‎2009 Dec 04 10:17 AM
Hi all,
Im bit confused with transactional concepts commit work/rollback work.
In below program after the insert statement the data is written into db, and after rollback the data is taken back from db
wa-Z_DEPT = 'IWW'.
wa-Z_DEPTNO = '1TT'.
ZAA_EMP = wa.
insert ZAA_EMP.
ROLLBACK WORK.
in the below program the data is not taken back from db after roll back when i give a commit after insert.
insert ZAA_EMP.
COMMIT WORK.
ROLLBACK WORK.
Is it mandatory to commit after a insert statement.
Is it possible to rollback after a commit.
Is there no implicit commit happening after the insert statement.
Anybody there please clear my doubts.
Regards,
Keshu
‎2009 Dec 04 10:22 AM
hI,
After commiting the work u cannot roll back the work unless the commit is not successful.
‎2009 Dec 04 10:22 AM
hI,
After commiting the work u cannot roll back the work unless the commit is not successful.
‎2009 Dec 04 10:25 AM
Hello,
FYI, once you do a COMMIT WORK the database LUW is complete & if yes the COMMIT is successful you can no longer ROLLBACK.
I think you must read [Database LUW concept |http://help.sap.com/saphelp_nw70/helpdata/EN/41/7af4bca79e11d1950f0000e82de14a/content.htm] in SAP.
BR,
Suhas
‎2009 Dec 04 10:26 AM
Hi Suhas,
So after a insert statement is it mandatory to do a commit work ?
‎2009 Dec 04 10:30 AM
>
> So after a insert statement is it mandatory to do a commit work ?
Hello KSD,
It is not "mandatory" to do a COMMIT after any DB operation.
There are some cases of implicit commits which you can get from the SAP help documentation . And you can always do an explicit COMMIT
BR,
Suhas
PS: Please go through the SAP documentation link, very well documented
‎2009 Dec 04 10:32 AM
As far as i kknow, its notmandatory to use COMMIT after INSERT.
We use COMMIT stmt to update our record in that very micro-second by crossing all other LUW queue.
Even though u dont use commit, your records will be inserted as per the LUW queue but few micro seconds later.
thanks,
Padma
‎2009 Dec 04 10:37 AM
As far as i kknow, its notmandatory to use COMMIT after INSERT.
what if it triggers a roll back of some other statements after an insert withou commit.
@Suhas:Let me read the doc :).
Thanks,
Keshu
‎2009 Dec 04 10:26 AM
Hello
You may use only COMMIT or only ROLLBACK.
COMMIT is not work after ROLLBACK and vice versa.
‎2009 Dec 04 10:27 AM
Hi,
Can you please try this
insert ZAA_EMP.
COMMIT WORK AND WAIT. "Note
ROLLBACK WORK.
Probably, the work is <edited>not<edited> rolled back because the COMMIT statement is taking a long time to execute.
The F1 says
If you do not specify the addition AND WAIT, the program does not wait until the update work process has executed it (asynchronous updating), but instead is resumed immediately after COMMIT WORK.
Edited by: Nitwick on Dec 4, 2009 3:59 PM