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
Change Log in SAP

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

For the shake of example, I have changed the Customer Ref. Date in the sales order (using transaction VA02)

VA03 Transaction

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
Tcode SE16N

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
CDPOS Table structure

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
change log selection screen
Provide the item details as Input parameter
changes in sales order

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

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

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *