‎2010 Jul 27 10:03 AM
Hi experts,
I have a requirement from my client that consists on posting 2 documents and then clearing them.
Right now Iu2019m posting the first 2 documents using BAPI_ACC_DOCUMENT_POST and for clearing both documents Iu2019m using Tcode F-51 but sometimes it's giving me an error clearing the documents because after the second bapi run, posting the second document, apparently all went right and a document number it's returned but the database doesnu2019t updated the doc number.
Iu2019m using commit work and wait, and already tried BAPI_TRANSACTION_COMMIT, but it doesnu2019t work sometimes, and the only solution that i found was the Wait up 1 second command , which it's slowing the program execution.
i think the problem it's on the bapi posting execution, due to a lag on the database side, but Iu2019m not sure...
Did anyone already had this problem? Has anyone has a solution for this?
Thanks in advance
Best Regards
João Martins
‎2010 Jul 27 11:34 AM
Hi , use this statement
set update task local
The above statement will ensure that the it will commit to data base.
Ram.
‎2010 Jul 27 10:23 AM
Hello,
yes, I already had that problem but a BAPI_TRANSACTION_COMMIT with the WAIT parameter solved the problem.
‎2010 Jul 27 10:59 AM
Thanks for your reply but i allready tried the BAPI_TRANSACTION_COMMIT with the wait parameter but it didn't work...
This is a program of mass posting and let's say the in a 1 second period 2 documents are posted by the bapi, what it's happening it's the the second document isn't update on the database when i call the F-51 tcode to clear the items of both documents...
Any sugestion?
thank in advance
Regards
João Martins
‎2010 Jul 27 11:14 AM
Hi,
Normally every BAPI will work on Update task so that the data will be updated once the commit work is done. For the commit work, we will normally call the bapi function module - BAPI_TRANSACTION_COMMIT. It should work.
In your case, just try the below option:
Please call the bapi - BAPI_ACC_DOCUMENT_POST & BAPI_TRANSACTION_COMMIT in a seperate function module and call this function module in your program (just pass the import / export / table parameters accordingly).
For the information, I had once a similar type of issue and it got solved once I did like the above.
Regards,
Selva K.
‎2010 Jul 27 11:34 AM
Hi , use this statement
set update task local
The above statement will ensure that the it will commit to data base.
Ram.
‎2010 Jul 27 12:16 PM
Thanks!!
The SET UPDATE TASK LOCAL work out
Regards to all
Thanks
João Martins