10-14-2008 12:51 PM
DELETE FROM zvfnvrd.
* Check if delete ís OK
SELECT COUNT(*)
FROM zvfnvrd.
IF sy-subrc = 0.
WRITE:/ 'Try again'.
<<<<<<<HERE>>>>>>>>>>>
ENDIF.
Hi,
How to leave program without COMMIT WORK.
If I use LEAVE PROGRAM, commit work is stil done.
Adibo.
10-14-2008 1:07 PM
Use [ROLLBACK WORK|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=rollbackWORK&cat=sdn_all] before [LEAVE PROGRAM|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=leavePROGRAM&adv=false&sortby=cm_rnd_rankvalue].
Regards
10-14-2008 12:56 PM
commit work
Executes a database commit and thus closes a Logical Unit of Work
All database updates are made irrevocable and cannot be reversed with ROLLBACK WORK
10-14-2008 12:59 PM
Hi,
Once the records are deleted from database table they cannot be rolled back.
You can give appropriate error message for the same.
Regards,
Saba
10-14-2008 1:07 PM
Use [ROLLBACK WORK|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=rollbackWORK&cat=sdn_all] before [LEAVE PROGRAM|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=leavePROGRAM&adv=false&sortby=cm_rnd_rankvalue].
Regards
10-14-2008 1:18 PM
Hi,
ROLLBACK WORK before LEAVE PROGRAM is not working.
So if I have database table with lets say 20 records.
When calling DELETE FROM table, if 10 record have been deleted and 10 have NOT been deleted I can't ROLLBACK?
Its strange.
When I'am in DEBUGGING MODE and have called DELETE FROM table an then I execute program bij simply closing the window, I get all the records back. So nothing is deleted!!
Adibo
10-14-2008 1:33 PM
If ROLLBACK WORK does not work, you have perform a database commit (implicitly or explicitly) Some instructions close the current database LUW, so its then too late to undo the database changes.
Look at [Database Logical Unit of Work (LUW)|http://help.sap.com/erp2005_ehp_03/helpdata/EN/41/7af4bca79e11d1950f0000e82de14a/frameset.htm] where you will found information on implicit database commit triggering.
Regards