Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Need to create SO with reference to existing SO using bapi

Former Member
0 Likes
1,739

Hi All,

i need to create a new sales order with reference to an existing sales order using the bapi: 'BAPI_SALESORDER_CREATEFROMDAT2'

or 'BAPI_SALESORDER_CREATEFROMDAT1'.

I am able to generate the new SO using 'BAPI_SALESORDER_CREATEFROMDAT1'. but the reference doc no is not updated.

Could you plz help me to do so.

Thanks in advance !

Hi All,

i need to create a new sales order with reference to an existing sales order using the bapi: 'BAPI_SALESORDER_CREATEFROMDAT2'

or 'BAPI_SALESORDER_CREATEFROMDAT1'.

I am able to generate the new SO using 'BAPI_SALESORDER_CREATEFROMDAT1'. but the reference doc no is not updated.

Could you plz help me to do so.

Thanks in advance !

11 REPLIES 11
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,597

First read [Note 370988 - BAPIs in SD: Creation with reference|https://service.sap.com/sap/support/notes/370988]

Regards,

Raymond

Read only

0 Likes
1,597

Hi Raymond,

Thanks for your help. Its helping a lot.

But when i m trying to create SO using BAPI_SALESORDER_CREATEFROMDAT2, it shows that a new SO number is generated but when i go to VA03 to check tht SO, it says there that this SO number does not exist.

I even checked in the tables also. The new SO is not created there.

Any help plz..

Read only

0 Likes
1,597

You did not forget the BAPI commit ?

Read only

0 Likes
1,597

Hi Raymond,

I did that in the code so tht will work fine.

But when i m trying to extract the data for the reference document using 'BAPISDORDER_GETDETAILEDLIST', its not giving any output in the program.

When i m going through SE37, its showing me the output there.

I tried to execute the same code that was attached in the SAP note.

Any help plz..

Read only

0 Likes
1,597

The only difference between the program and the SE37 test is the conversion-exit of the order number, check that the value is correct.

Read only

0 Likes
1,597

Could you please explain it more..since i am doing this for the first time.

Thanks

Read only

0 Likes
1,597

- check if the order number is filled with leading zeroes

- check if there is an error message in the RETURN parameter of the BAPI

Regards,

Raymond

Read only

0 Likes
1,597

Hi Priya,

What are the return messages.

Regards,

Madhu.

Read only

0 Likes
1,597

Hi,

I am getting th following return message:

Unpermitted combination of business object BUS2032 and sales doc. category L

When i m checking my ref doc category, it shoes 'C'.

Any help plz

Read only

0 Likes
1,597

As the BAPI always use 'BUS2032' (Type "C") when calling SD_SALESDOCUMENT_CREATE, the type "L" is not allowed, you could try to call the FM with 'BUS2096'.

(To check type use SD_OBJECT_TYPE_DETERMINE)

Regards,

Raymond

Read only

0 Likes
1,597

Hi Priya,

Change the Business object and Check.

Regards,

Prakash.

Prakash J