01-08-2007 1:54 PM
Dear All,
Can anyone help in mass sales order creation using Bapi BAPI_SALESORDER_CREATEFROMDAT2.
For example if i want to create 3 sales order with three item per order . i am populating
HEADER = 3 Records
Item = 9 records
schedule = 9 records
partner = 1 record.
Then after populating the records I am calling Bapi BAPI_SALESORDER_CREATEFROMDAT2
to create order. It should have created three order but unfortunately it creates
only one sales order. I debugged and found that records are correct both in header,
item, scheudle and partners.
Could you please guide me what I am missing for creation of mass orders.
I appreciate your time and many thanks in advance.
cheers
chandra
01-08-2007 1:59 PM
01-08-2007 2:06 PM
Hi Martin,
Thanks for your quick response. Yes I am calling FM call
function 'BAPI_TRANSACTION_COMMIT'
importing
return = p_return.
after calling BAPI. Please note that I am calling bapi BAPI_SALESORDER_CREATEFROMDAT2 only after population of data.
That means not in a LOOP.
Could you please thow me light again on this.
cheers
chandra
01-08-2007 2:10 PM
Hi,
It should create three orders, pls check all the parameters u have passing and check the bapi return table for more idea.
01-08-2007 2:17 PM
Hi Chandra,
Do like this.
Loop at Header table into wa_header.
*-- Move BAPI Header data
Loop at item table into wa_item where condition.
*-- in this move all Item and Schedule line item to the BAPI.
At end of item .
Use the below function modules.
BAPI_SALESORDER_CREATEFROMDAT2
BAPI_TRANSACTION_COMMIT.
Endloop.
Endloop.
Regards,
Balavardhan.K
01-08-2007 2:28 PM
Hi Bhavana,
Thanks for your quick suggestion. Can we get around LOOP process. The reason being if you are uploading 3000 orders for each record it calls BAPI and comit this will reduce the system perfomrance time and uncessary kill the processor.
Could you please suggest me doing without a LOOP. I think SAP has faciliated internal table for Header, Item and schedule to populate then why need to have
LOOP again that my question.
I appreciate your early reply.
cheers
chandra
01-08-2007 3:07 PM
Performance will be a serious concern if u r going to use loop. So check your BAPI calling parameters.
01-08-2007 3:50 PM
Hi Alexander,
Can you please what parameters I need to check. If possilbe forward an example to look at. Once again I appreciate your help.
Many thanks and looking forward your more advise.
cheers
chandra
01-08-2007 2:14 PM
Hello Chandra,
Use Loop. Populate one header with the corresponding items at a time, call BAPI and then COMMIT. hope this will work.
Regards,
Bhavana
01-09-2007 7:02 AM
Hi Chandra,
SAP has provided the option for internal table so that we can populate one header at a time not to populate all headers together.
You will get the clarification of this by doing the below steps.
1. Go to SE37. Give the BAPI Name-> API_SALESORDER_CREATEFROMDAT2.
2. Prerss F8. Now fill the values in header table ORDER_HEADER_IN. Once you double click the icon to fill the data, you will get we can populate only one header line at a time. There is no tab available to insert second line to populate the header data. Means you can't populate more than 1 header.
3. Now try to populate data in Iitem table. You will find there is an option to insert second line, third line.....
I just observe BAPI structure and replied. Hope it's clear now.
Regards,
Bhavana
01-10-2007 9:53 AM
Hi Bhavana,
Thanks for your right response. That means SAP does not provide the mass creation of
Sales orders at one shot.
Have a nice day.
cheers
01-12-2007 9:43 AM
Hello Chandra,
Please reward the points if my answers were helpful
Regards,
Bhavana