12-02-2014 3:28 PM
Guys,
I am facing a problem while using BAPI_SALESORDER_CREATEFROMDAT2 BAPI in a program.
I am filling up header data order_header_in = lwa_header_in. For lwa_header_in-purch_no_c = lwa_success-tracking_num from flat file,
we have to pass different purchase order no. So we are using loop.
The requirement is, we have to avoid the loop to fill up header data. How to do that?
Regards,
Shyamal.
12-02-2014 3:43 PM
Hi.
You can't use the bapi at once time for several headers orders.
You can figure out this limit by launching BAPI from SE37. The ORDER_HEADER_IN structure parameter in input, accept only 1 row.
In your situtation you should adopt SERIALIZATION, by calling n times the function module in the same session. That's a little more complicated but makes a difference in performance.
Hope to help
Bye
12-02-2014 4:46 PM
Hi Roberto,
Can you please share a small program which explain me better.
Regards,
Shyamal.
12-02-2014 5:01 PM
Hi.
BAPI_SALESORDER_CREATEFROMDAT2 comes with option remote function module activated so you can do this.
CALL FUNCTION ‘BAPI_SALESORDER_CREATEFROMDAT2’
STARTING NEW TASK ‘SALESORDER’
( DESTINATION NONE. <- is not mandatory).
In this way every order is processed in a single separated way and it doesn't need a linear execution of each ones.
In details:
When you call a remote function with the optional suffix STARTING NEW TASK, the system starts
the function in a new session. Rather than waiting for the remote call to be completed, the user
can resume processing as soon as the function module has been started in the target system.
Hope to help with this.
12-03-2014 8:26 AM
Thanks Roberto.
I can not able to understand your suggestion. Can you please how the BAPI_SALESORDER_CREATEFROMDAT2 can be used.
1) Now the BAPI_SALESORDER_CREATEFROMDAT2 is used inside the loop. Can we use it outside for each Purchase order number while creating each sales order?
2) Please share a small piece of code - how to use the BAPI.
Is it like this?
Loop at it... into wa...
CALL FUNCTION ‘BAPI_SALESORDER_CREATEFROMDAT2’
STARTING NEW TASK ‘SALESORDER’
( DESTINATION NONE. <- is not mandatory)
endloop.
If we code this way, then how performance will be tuned?
Regards,
Shyamal.
12-11-2014 3:46 PM
HI. Sorry for the delay.
1) You cannot use BAPI_SALESORDER_CREATEFROMDAT2 for a massive update at once. You have to create each order.
2) If you use SET UPDATE TASK LOCAL, before BAPI call, you'll reduce task (probably you'll have an higher LOAD memory level). Sorry but, before proceed, we have to understand what kind of limit you reach in order creation. I mean: How much time does it take to create 100 orders? Think that sales orders created by IDOCS in 5 second and with a parallel processing, should be ok.
Hope to help.
12-11-2014 4:45 PM
Hi Roberto,
Thanks for your reply. It will be great if kindly share a small program since I am unable to understand your solution properly.
Regards,
Shyamal.
12-11-2014 7:17 PM