SAP Database change logs - A simple solution for recording database change history
There is a very simple way to activate change history for database tables in SAP, including your own
custom z tables. All you have to do is check the 'Log data changes' checkbox within technical settings.
Once you have done this and activated it you simply use transaction SCU3 to view any changes made to data within this table. There is obviously a very slight performace hit involved with doing this as logs need to be created each time a change is made so you probably only want to turn this on for tables you are interested in recording history for.
These logs are stored in table 'DBTABLOG' and can be access via function module 'DBLOG_READ'. Rather than me repeating what is already available on the web check out the following link for ABAP code on using this FM Using DBLOG_READ
SAP profile parameter rec/client
Also note you need to make sure the global parameter for for data logging 'rec/client' is set in-order to activate data logging to work. This can be set to be on for all clients, specific ones or set to off all together. See here for how to set the rec/client parameter.
Turning the change logs on for a table
Within transaction SE11 technical settings simply check the 'Log data changes' checkbox
View change log entries
Simply execute transaction SCU3 and press the 'Evaluate Logs' button.
Now enter your table name and display option you require and press execute
The chnage logs should then be displayed
Change Document history menu -->
Activate change document history for a specific field
Creating Change Document History for a new table so chnages are stored into CDHDR & CDPOS
Adding entries to Change Document History CDHDR & CDPOS tables using associated function module manually
SAP change document history tables