cancel
Showing results for 
Search instead for 
Did you mean: 

Report program to Create Opportunity

Former Member
0 Kudos
127

Hi Experts,

I have a requirement that, to write a report program to "create or update opportunity".

I am new in CRM, Can anybody help me to do this?

Thanks in advance,

Saju.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

To create an opportunity, you can use the FM CRM_ORDER_MAINTAIN. You can place a breakpoint in that FM and create an opportunity through transaction crmd_order. In this process you can see all the tables that are getting filled and pass it in the same way to your program. You also will need to call CRM_ORDER_SAVE and BAPI_TRANSACTION_COMMIT to make the changes to the database.

For updating an already existing opportunity, you need to use CRM_ORDER_READ to read the opportunity, then make the changes that you need to do using CRM_ORDER_MAINTAIN and then use CRM_ORDER_SAVE and BAPI_TRANSACTION_COMMIT to save the changes to the database. In case you want to display any details of the modified opportunity through your report program, you'll need to call CRM_ORDER_READ again.

Hope this helps you.

Thanks and regards

Preeti Viswanath

joaquin_fornas
Employee
Employee
0 Kudos

Hello

You can write a report that calls:

- To create opportunity, BAPI_OPPORTUNITY_CREATEMULTI

- To modify the oportunity, BAPI_OPPORTUNITY_CHANGEMULTI

Another option is calling function module CRM_ORDER_MAINTAIN, which also contains opportunity parameter.s

Regards

Joaquin

Former Member
0 Kudos

Hi Joaquin,

I wrote the report program using the FM crm_order_maintain.

But the opportunity is not getting created.

I dont know what are the mandatory parameters have to pass to the FM.

could you please help me with one sample report?

Thanks in advance,

Saju.

Former Member
0 Kudos

Hi ,

Place a break point in CRM_ORDER_MAINTAIN and then try to create a new opportunity. Check the changing parameter CT_INPUT_FIELDS and check the objects filled in that parameter and pass the corresponding internal tables( CT_ORDERADM_H, IT_PARTNER etc.) and pass the exact values which are filled in all those internal tables.

Then use CRM_ORDER_SAVE followed by BAPI_TRANSACTION_COMMIT.

Regards,

Nithish

0 Kudos

Hi Saju,

You can refer the report CRM_REPORT_CREATE_MASS_OPPT.

Regards

Leon