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

Sales order Bapi - Delivery Bapi

Former Member
0 Likes
1,514

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 ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,279

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

9 REPLIES 9
Read only

Former Member
0 Likes
1,279

Try BAPI_TRANSACTION_COMMIT after creating the SO

Cheers

carsten

Read only

0 Likes
1,279

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

Read only

Former Member
0 Likes
1,279

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

Read only

Former Member
0 Likes
1,279

Hi,

Try using following FM's for delivery creation

RV_DELIVERY_CREATE
RV_DELIVERY_CREATE_SINGLE
RV_DELIVERY_CREATE_SINGLE_POST

Also check tcode VTLA for copying controls for sales order to delivery with your functional person.

Regards,

Amit

Read only

0 Likes
1,279

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 ?

Read only

Former Member
0 Likes
1,280

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

Read only

0 Likes
1,279

Thanks Ragvender for your suggestion.

How to do this? can u please explain in details

Read only

0 Likes
1,279

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.

Read only

0 Likes
1,279

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