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

BAPI_SALESORDER_CREATE - How do I create with a reference?

Former Member
0 Likes
1,344

Hello,

I am trying to figure out if I can use the standard BAPI to create a SO with a reference to a Contract. I don't see any mention of this in the documentation and wanted to know if anyone uses this BAPI this way or if there is another method to accomplish this?

Scenario we are trying to implement:

Old open contracts and sales orders that need to be re-created.

Copy old contract to new contract using the contract BAPI.

Copy the old open sales orders to new ones with reference to the new contract.

Close the old contracts/SOs.

Thanks,

John

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
866

Hi,

You create read the old contract/sales order and recreate using BAPI_SALESORDER_CREATEFROMDAT2. Another options is that using BAPI_SALESORDER_COPY to copy the old sales order and then change the reference using BAPI_SALESORDER_CHANGE.

I use BAPI_SALESORDER_CREATEFROMDAT2. If you want create with reference, please take care below fields as well as the corresponding flag fields.:

header level:

BAPISDHD1-REF_DOC

item level:

BAPIITEMIN-REF_DOC

BAPIITEMIN-REF_DOC_IT

Regards,

Andy

[www.sapgeek.net]

Edited by: Andy Zhao on Sep 16, 2009 4:00 AM

3 REPLIES 3
Read only

Former Member
0 Likes
866

Hi Checkout

BAPI_SALESDOCUMENT_COPY

Regards,

Himanshu

Read only

0 Likes
866

Unfortunatly this would copy the existing reference to the old contract instead of linking to the new one.

Read only

Former Member
0 Likes
867

Hi,

You create read the old contract/sales order and recreate using BAPI_SALESORDER_CREATEFROMDAT2. Another options is that using BAPI_SALESORDER_COPY to copy the old sales order and then change the reference using BAPI_SALESORDER_CHANGE.

I use BAPI_SALESORDER_CREATEFROMDAT2. If you want create with reference, please take care below fields as well as the corresponding flag fields.:

header level:

BAPISDHD1-REF_DOC

item level:

BAPIITEMIN-REF_DOC

BAPIITEMIN-REF_DOC_IT

Regards,

Andy

[www.sapgeek.net]

Edited by: Andy Zhao on Sep 16, 2009 4:00 AM