‎2009 Sep 10 8:19 AM
I want to create Sales order, i am using Bapi 'BAPI_SALESORDER_CREATEFROMDAT2' to create multiple sales order in a loop.
After creating Sales order, i want to create delivery for the same order. I am using Bapi 'BAPI_OUTB_DELIVERY_CREATE_SLS' to create Delivery for the sales order. I create a Sales order , then i create delivery in a loop, one by one.
But when i try to create the delivery through bapi, it gives error like 'Copying control is not possible'. I tried to debug the error, but did'nt understand.
Now when i create the sales order through bapi and then in the same loop if i call other program through 'SUBMIT', in that program, i have used delivery bapi, in that case it creates delivery.
Can any body help on this ?
‎2009 Sep 10 12:46 PM
Hi
After creating the sales order through bapi, after commit statement check that sales orrder is lock is released.
If not released keep the timer until th elock release. Then use the delivery bapi.
regrads,
raghu
‎2009 Sep 10 8:51 AM
Try BAPI_TRANSACTION_COMMIT after creating the SO
Cheers
carsten
‎2009 Sep 10 8:54 AM
I have already written 'BAPI_TRANSACTION_COMMIT' after sales order bapi. I am also passing wait parameter as 'X'.
But still the problem exists.
Edited by: philips123 on Sep 10, 2009 9:55 AM
‎2009 Sep 10 12:10 PM
then, somtething must be different dealing with sales_order_items-ref_doc.
Are you sure that it's properly filled with the new VBELN returned from SO-Bapi ???
Cheers
carsten
‎2009 Sep 10 12:41 PM
Hi,
Try using following FM's for delivery creation
RV_DELIVERY_CREATE
RV_DELIVERY_CREATE_SINGLE
RV_DELIVERY_CREATE_SINGLE_POSTAlso check tcode VTLA for copying controls for sales order to delivery with your functional person.
Regards,
Amit
‎2009 Sep 10 12:48 PM
Thanks Carsten and Amit for your reply.
When i use 'Submit' and in that i call the delivery bapi, i pass the same parameters as i was passing in the original pgm .
But after submit it creates delivery , but if i call in same loop after sales order bapi, with same parameter, it gives error.
In table we have checked entries is there, that's why it creates delivery in submit pgm.
Is it related any where to LUW concept ?
‎2009 Sep 10 12:46 PM
Hi
After creating the sales order through bapi, after commit statement check that sales orrder is lock is released.
If not released keep the timer until th elock release. Then use the delivery bapi.
regrads,
raghu
‎2009 Sep 10 12:54 PM
Thanks Ragvender for your suggestion.
How to do this? can u please explain in details
‎2009 Dec 08 9:50 PM
are you sure you are not still locking the delivery. As long as it is not being called via BDC you can do a commit work and wait which will flush the DB buffer and write changes to the disk. Remember that when you are calling some of the SAP standard commands they will sometimes do things in update tasks.
I have used these bapi's but always required to put in a commit work and wait otherwise they have issues in production systems where the load is higher.
Best of luck.
‎2009 Dec 21 5:45 AM
Hi,
Some times in loop 'BAPI_TRANSACTION_COMMIT' not perform as expected and create problem in updation.
Try command SET UPDATE TASK LOCAL in the loop before calling the BAPI.
Hope it will work.
Thanks,
Shailendra