cancel
Showing results for 
Search instead for 
Did you mean: 

CREATION OF OPPORTUNITY

Former Member
0 Kudos

Hi All,

I would like to create an opportunity with all the relavent fields using Function Modules. Can anyone provide me with a Report Program for the creation of an Opportunity.

Thanks in Advance,

Shwetha .

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi Swetha,

Would you be kind enough to discuss with us the scenario that would require you to create an oppty using FM. Is there any coding involved, are you enhancing the standard delivery model.

Would be rewared the maximum points.

cheers,

Muralidhar Prasad.C

Former Member
0 Kudos

Hello Shwetha,

The easiest way to create opportunities through FM is the BAPI_OPPORTUNITY_CREATEMULTI. Check where used list for more syntax details. Don't forget to call the BAPI_TRANSACTION_COMMIT after the createmulti.

Hope this helps,

Kind regards,

Joost

Former Member
0 Kudos

Good job Joost Stallaert.........

A simple program using BAPI_OPPORTUNITY_CREATEMULTI .

******************************************************************

DATA: ls_header LIKE bapibus20001_header_ins,

lt_header TYPE STANDARD TABLE OF

bapibus20001_header_ins,

ls_opp LIKE bapibus20001_opportunity,

lt_opp TYPE STANDARD TABLE OF

bapibus20001_opportunity,

lt_pricing TYPE STANDARD TABLE OF

bapibus20001_pricing,

ls_pricing TYPE bapibus20001_pricing,

ls_input_fields TYPE bapibus20001_input_fields,

lt_input_fields TYPE STANDARD TABLE OF

bapibus20001_input_fields,

lt_return TYPE STANDARD TABLE OF bapiret2 ,

ls_return TYPE bapiret2 .

DATA ls_saved_process TYPE bapibus20001_object_id.

DATA: lt_guid_16 TYPE crmt_object_guid_tab,

ls_guid_16 TYPE crmt_object_guid.

DATA: lv_langu TYPE sylangu,

lv_uname TYPE syuname,

lt_SAVED_PROCESS type BAPIBUS20001_OBJECT_ID occurs 0 .

CONSTANTS:

pricing TYPE crmt_object_name VALUE 'PRICING',

gc_handle_1 TYPE crmt_handle VALUE '0000000001',

BEGIN OF gc_fieldname,

startdate TYPE crmt_fieldname VALUE 'STARTDATE',

expect_end TYPE crmt_fieldname VALUE 'EXPECT_END',

END OF gc_fieldname,

BEGIN OF gc_object_kind,

orderadm_h TYPE crmt_object_kind VALUE 'A',

orderadm_i TYPE crmt_object_kind VALUE 'B',

END OF gc_object_kind,

BEGIN OF gc_object_name,

opport_h TYPE crmt_object_name VALUE 'OPPORT_H',

order TYPE crmt_object_name VALUE 'ORDER',

orderadm_h TYPE crmt_object_name VALUE 'ORDERADM_H',

orderadm_i TYPE crmt_object_name VALUE 'ORDERADM_I',

END OF gc_object_name.

  • ref kinds

CONSTANTS: BEGIN OF gc_object_ref_kind,

orderadm_h TYPE crmt_object_kind

VALUE gc_object_kind-orderadm_h,

orderadm_i TYPE crmt_object_kind

VALUE gc_object_kind-orderadm_i,

any TYPE crmt_object_kind

VALUE space,

END OF gc_object_ref_kind.

  • Admin Header

ls_header-description = 'GV REDDY PRASAD'.

ls_header-handle = '1'.

ls_header-process_type = 'OPPT'.

ls_header-descr_language = sy-langu.

ls_header-langu_iso = sy-langu.

APPEND ls_header TO lt_header.

CLEAR ls_input_fields.

ls_input_fields-ref_handle = '1'.

ls_input_fields-ref_kind = 'A'.

ls_input_fields-objectname = 'ORDERADM_H'.

ls_input_fields-fieldname = 'PROCESS_TYPE'.

APPEND ls_input_fields TO lt_input_fields.

ls_input_fields-fieldname = 'OBJECT_ID'.

APPEND ls_input_fields TO lt_input_fields.

ls_input_fields-fieldname = 'DESCRIPTION'.

APPEND ls_input_fields TO lt_input_fields.

  • Opportunity Header

ls_input_fields-objectname = 'OPPORT_H'.

ls_opp-ref_handle = '1'.

ls_input_fields-fieldname = 'EXP_REVENUE'.

ls_opp-exp_revenue = '0012'.

APPEND ls_input_fields TO lt_input_fields.

ls_input_fields-fieldname = 'CURRENCY'.

ls_opp-currency = 'INR'.

ls_opp-currency_iso = 'INR'.

APPEND ls_input_fields TO lt_input_fields.

ls_pricing-ref_handle = gc_handle_1.

ls_pricing-ref_kind = gc_object_ref_kind-orderadm_h.

ls_pricing-currency = 'INR'.

APPEND ls_pricing TO lt_pricing.

ls_input_fields-objectname = pricing.

APPEND ls_input_fields TO lt_input_fields.

ls_input_fields-objectname = gc_object_name-opport_h.

ls_input_fields-fieldname = gc_fieldname-startdate.

ls_opp-startdate = sy-datum.

APPEND ls_input_fields TO lt_input_fields.

ls_input_fields-fieldname = gc_fieldname-expect_end.

ls_opp-expect_end = sy-datum.

APPEND ls_input_fields TO lt_input_fields.

CALL FUNCTION 'BAPI_OPPORTUNITY_CREATEMULTI'

TABLES

HEADER = lt_header

OPPORTUNITY = lt_opp

INPUT_FIELDS = lt_input_fields

RETURN = lt_return

SAVED_PROCESS = lt_saved_process .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .

***************************************************************************

******To display the record or error

loop at lt_return into ls_return.

write ls_return-MESSAGE.

endloop.

loop at lt_saved_process into ls_saved_process.

write ls_saved_process-OBJECT_ID.

endloop.

Former Member
0 Kudos

Hi

Sorry ,Mr Prasad she has asked for how to create a opportunity, not for any configuration or customization steps, please review the question.

Former Member
0 Kudos

Fm : **********

CRM_ORDER_MAINTAIN - to create orders ,opportunity.

to see how it works goto se38 execute CRM_ORDER_MAINTAIN fill the selection screen and execute .

After using this fm commit work should be used.

Fm: ********

CRM_ORDER_MAINTAIN_MULTI_OW to create multi orders

Fm:****

CRM_ORDER_MAINTAIN_SINGLE_OW to create single

Former Member
0 Kudos

Hi

Swetha to create an opportunity open crmd- order and open business transactions

create an your opportunity type , later enter customer or sales prospect,,

products

partner, sales team , and org details like s org, sales office, division , distribution channel etc assesments , sales team then save assesments form and save the transaction on the top after saving you will find an opportunity number bottom of the application this is the procedure to create an opportunity

Former Member
0 Kudos

You can use the BAPI BAPI_SLSTRANSACT_CREATEMULTI to create opportunity. Please look at where used list of same to get detials.

Regards,

Kiran

Former Member
0 Kudos

Hi,

i would be interested in a function module i could call to create opportunities as well.

Best Regards

Rene