Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to rollback saved data from database (custom) table

vinayad
Participant
0 Likes
4,202

I want to rollback the record from the table which is modified or deleted.

Normally when we do undo, it works for unsaved data but here I need the record even it's changed in database level.

Let me know how to approach?

Any suggestions would be appreciated.

Thanks!!

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
2,725

In Abap SQL when database is updated and commited you have no tool to reverse the change, the commit is an end.

If no database commit was executed, explicitly or implicitly, use FM DB_ROLLBACK, else

  • You could either log data change and use the log to reverse changes, or use some Admin Database Tool to reverse journalized entries, but that's not Abap relevant.
  • Try to use standard SAP way to update database and commit only at end of transaction. Perform some search in online help with keywords such as Database Logical Unit of Work (LUW)
4 REPLIES 4
Read only

ankurch
Active Contributor
0 Likes
2,725

Hi There,

Normally we can maintain entries in custom table through SM30, try with same tcode whether you are able to delete entries from the table or not!

Thanks,

Ankur Chauhan
Read only

0 Likes
2,725

Hi Ankur,

I would appreciate for your response.

Yes I can delete, insert, modify even 'UNDO' in SM30. But I want to rollback which is last modified or deleted data, this when you try to undo it won't work. I have implemented same options in my program for the custom table operations.

Hope my question is cleared.

Thanks.

Read only

matt
Active Contributor
2,725

Once you've saved it, you've committed it. No chance of rollback. If the table has database logging you'll be able to find out what changed and manually change it back. Otherwise talk to your basis team about recovering from backup.

Read only

RaymondGiuseppi
Active Contributor
2,726

In Abap SQL when database is updated and commited you have no tool to reverse the change, the commit is an end.

If no database commit was executed, explicitly or implicitly, use FM DB_ROLLBACK, else

  • You could either log data change and use the log to reverse changes, or use some Admin Database Tool to reverse journalized entries, but that's not Abap relevant.
  • Try to use standard SAP way to update database and commit only at end of transaction. Perform some search in online help with keywords such as Database Logical Unit of Work (LUW)