‎2007 Oct 26 2:49 PM
Hi,
I have a FM which will update the database table.The FM also does the commint.
After that when I try to do select query to the table,sy-subrc returns 0(succeeds) in debug mode but returns 2(fails) in real scenario i.e when i don't have breakpoints.
Any solution for the issue.
Thanks
Suganya
‎2007 Oct 26 3:05 PM
The V1 update process has probably not completed. When you do the COMMIT, do a COMMIT WORK AND WAIT.
Rob
‎2007 Oct 26 3:06 PM
Hi,
When u are in debug mode , commit work will be executed by system. so u can select the data immediately after update.
but when u execute normally commit will be executed when the transaction ends, so it cant fetch immediately after update.
after update try BAPI_TRANSACTION_COMMIT
exporting wait = 'X'.
this will work
‎2007 Oct 26 3:07 PM
Suganya,
Explicitly write a commit work statement after Function module.
<b> Reward for helpful answers</b>
Satish
‎2007 Oct 26 3:17 PM
As Rob suggested, add AND WAIT to the commit statement. Also check your table and see if it is buffered (technical settings). If it is buffered, you can add BYPASSING BUFFER to your SELECT statement.
‎2007 Oct 26 3:24 PM
please use commit work and wait.
actually you need to wait for the commit work to get completed and database updation.
you can put explicit wait also but not recommended.