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/Pointers on merging multiple sales orders

Former Member
0 Likes
537

Hello Gurus,

I have a requirement to create a sales order with reference to multiple orders. I have used BAPI_SALESDOCUMENT_COPY to create the first order with reference to the original order, saved this order and then modify this order with the data from the remaining orders (by reading the data from the order using BAPI_SALESORDER_GETDETAILBOS). This is turning out to be very complicated as we are using BOM and I have to change the item number and the higher line item number of subsequent order data that I am including in the merged order.

Is there a better way of doing this? Is there a BAPI/Function Module available to create a sales order with reference to multiple orders?

Any help or pointers to achieve this requirement will be helpful to me.

Thanks in advance.

Thanks,

Sandeep

3 REPLIES 3
Read only

Former Member
0 Likes
493

Why not use BAPI_SALESORDER_CREATEFROMDAT1 or BAPI_SALESORDER_CREATEFROMDAT2. Also see note 93091.

Rob

Read only

0 Likes
493

Thanks Rob. We have the copy controls set so we will need the data to be transferred from the original document to the copied document.

In Createfromdat1 or createfromdat2, where do I specify multiple referenced orders?

As an example if I have the following orders in my system:

Order 1000 line 10

Line 20

Line 30

Order 2000 Line 10

Line 20

Now I need an order which has the line items from both these orders:

Order expected: Line 10

Line 20

Line 30

Line 40 which is Line 10 of order 2000

Line 50 which is Line 20 of order 2000

Read only

0 Likes
493

I don't think you do in this case. You are creating, not copying orders. If you must copy, then I guess you have to stick with what you've got. But I don't think the functionality is there to copy from multiple orders.

Rob