‎2012 Jan 16 6:31 PM
Hi,
I try to do the command DELETE FROM TABLE for delete all regist that exist on database table from my internal table.
The command delete all the regist but i need to do a rollback work doesn't work. All the that are removed.
Anyone can help me to go back with delete data if i wan't to recovery data ?
Thank you in advance.
Miguel Silva
‎2012 Jan 17 7:32 AM
You must execute the ROLLBACK WORK before any DATABASE COMMIT.
Database Commit is triggered by COMMIT WORK, a call to DB_COMMIT or a native sql commit statement.
But it is also triggered Implicitly by end of dialog step, Call of a function module in a synchronous or asynchronous Remote Function Call or end of such a call, receive. Remember that sending a message, warning, error or information will trigger the end of a dialog step, so also trigger a db commit. (Read some documentation on [Database Commit|http://help.sap.com/abapdocu_70/en/ABENDB_COMMIT.htm])
Regards,
Raymond
‎2012 Jan 16 6:33 PM
You have to do the rollback before the COMMIT or before the program ends. Did you do that?
Rob
‎2012 Jan 16 6:40 PM
if you are using commit inside loop then take it out...
and use ROLLBACK WORK before the commit(based on your condition). here is the SAP help link. read to know more..
‎2012 Jan 17 3:26 AM
try this code..
IF itab IS NOT INITIAL.
DELETE <db> FROM TABLE itab.
IF sy-subrc NE 0 .
ROLLBACK WORK.
MESSAGE e0398(00)."Error while Saving data
RETURN.
ENDIF.
ENDIF.
‎2012 Jan 17 7:32 AM
You must execute the ROLLBACK WORK before any DATABASE COMMIT.
Database Commit is triggered by COMMIT WORK, a call to DB_COMMIT or a native sql commit statement.
But it is also triggered Implicitly by end of dialog step, Call of a function module in a synchronous or asynchronous Remote Function Call or end of such a call, receive. Remember that sending a message, warning, error or information will trigger the end of a dialog step, so also trigger a db commit. (Read some documentation on [Database Commit|http://help.sap.com/abapdocu_70/en/ABENDB_COMMIT.htm])
Regards,
Raymond