What is Change Log? – Change log/document are used to logs the changes to master records, tables, etc. And change documents are stored in two tables that is CDHDR and CDPOS. where CDHDR is the header table and CDPOS is the item table.
There is a field called object class -> which is nothing but the SAP object which is meant for the change document. (SAP object means material master, sales document, Vendor master, etc. this is more or else similar to SAP Business object like for sales document BUS2030)
Also, there is a column called change number i.e CHANGENR -> a unique number generated each time a change is logged.
Let’s take an example of sales order how these change document helps to identify changes made on the sales document.
For the Sales document, the object class is VERKBELEG. You can get the details about object class using Tcode SCDO
For the shake of example, I have changed the Customer Ref. Date in the sales order (using transaction VA02)
Now there are two ways to identify, one: the Technical way that is on table level and the other function way. Let’s check the Table level the what change logs are captured.
Steps:
-> Go to CDHDR table – Provide the necessary details like object class, user, Transaction, Date, etc.
Once you get the data then get the change number (CHANGENR) -> Then using that change number check on the item Table CDPOS for more details
In the CDPOS table – you will get all the information like changes are made in which table & it’s key(which is combination client + Primary key in the table), Table field changed & its old and new value, etc.
Similarly, the changes on the sales order can view from a functional perspective as below image
Note: Additionally the Table fields which are marked for “change document” are only captured in the change logs & this is on the data element level. In our case the Table is VBKD and the field is BSTDK
I Hope, this gives an overview of the change document & its Tables(CDHDR & CDPOS).😀
In upcoming blogs on this, we will check -> How to activate the change logs for the Custom table… Stay Tune.
Check out our ABAP Blogs ABAP – ABAP Skill
Check out our OData Series OData – ABAP Skill
0 Comments