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.
![Change Log in SAP](https://abapskill.com/wp-content/uploads/2021/07/Screenshot_1-1.jpg.webp)
![Change Log in SAP](https://abapskill.com/wp-content/uploads/2021/07/Screenshot_2-1.jpg.webp)
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
![SCDO Transaction](https://abapskill.com/wp-content/uploads/2021/07/Screenshot_3-1.jpg.webp)
For the shake of example, I have changed the Customer Ref. Date in the sales order (using transaction VA02)
![VA03 Transaction](https://abapskill.com/wp-content/uploads/2021/07/Screenshot_4-1.jpg.webp)
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.
![SE16N Transaction for CDHDR](https://abapskill.com/wp-content/uploads/2021/07/Screenshot_5-1.jpg.webp)
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
![CDHDR table structure](https://abapskill.com/wp-content/uploads/2021/07/Screenshot_7-1.jpg.webp)
![CDPOS Table structure](https://abapskill.com/wp-content/uploads/2021/07/Screenshot_9-1-1024x219.jpg.webp)
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
![Change log in sales order](https://abapskill.com/wp-content/uploads/2021/07/Screenshot_10.jpg.webp)
![change log selection screen](https://abapskill.com/wp-content/uploads/2021/07/Screenshot_11.jpg.webp)
![changes in sales order](https://abapskill.com/wp-content/uploads/2021/07/Screenshot_12.jpg.webp)
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
![change document in data element](https://abapskill.com/wp-content/uploads/2021/07/Screenshot_13.jpg.webp)
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