cancel
Showing results for 
Search instead for 
Did you mean: 

About BAPI in SO mass creation

Former Member
0 Kudos

Dear specialist,

Here is the background for this customer requirement:

We have EDI interface configured in our SAP system, we will create blanket sales order for big dealers such as MACY's and Wal-mart automactically through the interface, which consists of large amount of items with different ship-to parties.

We need to split the blanket sales orders relevant to the customer PO into a couple of normal sales orders through the ship-to party, that is to say, we will group the items with the same ship-to party into one sales order, just coping the items with the same ship-to party unchanged into a new sales order which can be processed subsequently. Now I use the BAPI 'BAPI_SALESORDER_CREATEFROMDAT2' as the backbone of my program, but I can not copy all the elements of the blanket sales order using the reference function of the BAPI, just like creating a new sales order. I try to debug the program, but it neglects the copy control rountines when creating the normal sales order and creates a new sales order incompletely.

What should I do?

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Clement,

Before calling the BAPI, can you not sequence/sort your order details in a way that you send all line items with common ship-to(example: A) as one order in the first call to BAPI and then, all line items with a differnt ship-to (example : B) as a second order in the second call to BAPI & go on in a loop. You can definitly keep and copy the header details and bill-to or pay-to details the same if they are. Hope I understood you right here.

Thanks,

Shiv

Former Member
0 Kudos

My question is that the BAPI can not copy the necessary elements like pricing elements, onetime customer ship-to address and so on.

The BAPI just writes a reference in the document flow, but works like creating a new sales order.

ian_kehoe
Active Participant
0 Kudos

Hello Clement,

It is not possible to create with reference using a BAPI.

There is in general no copy functionality available in the Sales BAPI's.

The reference document fields can be used to update the document flow.

But not to receive any transaction data like items, conditions etc.

The reason for this behaviour is that the Create-BAPI's themselves are

explicitly only for creation of an order by the given input data. Which

ones these are have to be extracted before according to individual

requirements. This is a functional separation that is absolutely

reasonable in order to keep the functional complexness of our BAPIs

under control.

You could create a program that calls BAPISDORDER_GETDETAILEDLIST

then uses the code from the copy control routines and then calls

BAPI_SALESORDER_CREATEFROMDAT2.

I hope this information helps.

Best regards,

Ian Kehoe

Former Member
0 Kudos

Hi, lan Kehoe,

I have searched the notes 370988 on sap service market, and made sure that it cannot use the copy control rules for this BAPI.

So I use the 1:1 fully copy BAPI BAPI_SALESDOCUMENT_COPY to copy the blanket sales order into a normal sales order and split it into different deliveries.

Anyway, thanks and appreciate your reply.