‎2008 Apr 15 7:09 PM
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.
‎2008 Apr 15 7:19 PM
Are you calling BAPI_TRANSACTION_COMMIT with WAIT = 'X' after a successful call to BAPI_ACC_DOCUMENT_POST?
‎2008 Apr 15 7:58 PM
‎2008 Apr 15 8:00 PM
Setting the WAIT parameter = 'X' will make your updates synchronous which might solve your problem.
Please try and let me know.