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 / FM for Order Create with Reference

Former Member
0 Likes
2,174

Hi experts,

I looking for a BAPI or any FM that can be used to create sales orders with reference. I want to create ORders with reference to other orders.

I've tried BAPI_SALESORDER_CREATEFROMDAT1 and 2. These doesn;t work for referencing Order. Any ideas....

Thanks a LOT

Ron

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,208

It is possible using BAPI_SALESORDER_CREATEFROMDAT12

you need to pass ref order number to

ORDER_HEADER_IN-REF_DOC (BAPISDHD1-REF_DOC)

Thanks

Seshu

4 REPLIES 4
Read only

ferry_lianto
Active Contributor
0 Likes
1,208

Hi,

Please try FM SD_SALESDOCUMENT_CREATE ... in the header parameter there is parameter called REFDOCTYPE where you can specify the other sales document.

Also please check BAPI BAPI_SALESDOCUMENT_COPY as well.

Regards,

Ferry Lianto

Please reward points if helpful.

Read only

Former Member
0 Likes
1,209

It is possible using BAPI_SALESORDER_CREATEFROMDAT12

you need to pass ref order number to

ORDER_HEADER_IN-REF_DOC (BAPISDHD1-REF_DOC)

Thanks

Seshu

Read only

Former Member
0 Likes
1,208

Hi,

Here is list of all bapi for sales order.

BAPISDORDER_GETDETAILEDLIST Sales Order: List of All Order Data

BAPI_ORDER_CHANGE_STATUS_GET Change status for order

BAPI_SALESDOCU_CREATEFROMDATA Creating a Sales Document

BAPI_SALESORDER_CHANGE Sales Order: Change Sales Order

BAPI_SALESORDER_CREATEFROMDAT1 Sales Order: Create Sales Order

BAPI_SALESORDER_CREATEFROMDAT2 Sales Order: Create Sales Order

BAPI_SALESORDER_CREATEFROMDATA Create sales order, no more maintenance

BAPI_SALESORDER_GETLIST Sales order: List of all orders for customer

BAPI_SALESORDER_GETSTATUS Sales order: Display status

BAPI_SALESORDER_SIMULATE Sales Order: Simulate Sales Order

BAPI_XSI_GET_VTRK_G Tracking info

Pls reward helpful points.

Regards,

Ameet

Read only

Former Member
0 Likes
1,208

Hi,

First create the Sales Order via BAPI_SALESORDER_CREATEFROMDAT2 in the normal way. Then, get the relevant Contract Line Items' Condition Records and call BAPI_SALESORDER_CHANGE for the newly created ales Order (do not use BAPI_SALESORDER_GETDETAILEDLIST to get Condition Records as this populates some Function Group Structures and causes BAPI_SALESORDER_CHANGE to fail - rather hit KONV to get the Conditions and then T685A to get the Pricing Condition Master data, then pass this info into MAP_INT_TO_EXT_STRUCTURE which maps the data into the correct structure format for BAPI_SALESORDER_CHANGE).

Or use

FM SD_SALESDOCUMENT_CREATE

Regards