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

Lock Error while posting document through bapi_acc_document_post

Former Member
0 Likes
922

Hi,

We are trying to Post documents in R/3 using Bapi_acc_document_post from BW system using ABAP report. The report groups data using certain criteria and makes a Bapi call for each group.

Problem : The program has 2 modes test mode and actual run.

When the program was run in a test mode 15 groups were created. Hence 15 documents should get created in R/3.

Now when the actual run was done the program gave an output saying doc1 created,doc2 created....doc11 created.. and suddenly Bapi error .. doc1 is locked by another user, doc1 is locked by another user, doc1 is locked by another user, doc1 is locked by another user.

Moreover Doc1 never got created in R/3. Doc 2 to Doc11 were created in R/3 and then the BApi error.

Can anyone please help me understand why this could have happened?

P.S : We use same Bapi for Check run as well as Actual run. Only difference is that in actual run a BApi_commit is done.

Do you think using BAP_ACC_DOCUMENT_CHECK during check run will help ?

PLease advice.

3 REPLIES 3
Read only

Former Member
0 Likes
631

Are you calling BAPI_TRANSACTION_COMMIT with WAIT = 'X' after a successful call to BAPI_ACC_DOCUMENT_POST?

Read only

0 Likes
631

Hi ,

No the wait parameter is not used.

Read only

0 Likes
631

Setting the WAIT parameter = 'X' will make your updates synchronous which might solve your problem.

Please try and let me know.