Cdpos and Cdhdr table in SAP | Change Documents in SAP

Hi to everyone!!! If you having trouble with these two tables CDPOS and CDHDR and you really don´t know how to solve the issue. So in this article we will check Cdpos and Cdhdr table in SAP to see the change history of transaction and master tables of SAP using ABAP. we will cover Cdpos table in sap & Cdhdr table in SAP, Change Documents in SAP,How To Use of cdhdr and cdpos tables in SAP and Cdhdr object class list

As far as we know, using below mention parameters we would be getting the information which we need.

Table: CDHDR

Object class (OBJECTCLAS)

Change ID (CHANGE_IND)

Cdpos and Cdhdr table in SAP

Cdpos table in SAP

CDPOS is an item table which stores the log of changes. In ABAP it is use to retrieve the Item data of changes log which we created.

FIELDDATA ELEMENTDATA TYPELENGTHSHORT DESCRIPTION
MANDANTMANDTCLNT3Client
OBJECTCLASCDOBJECTCLCHAR15Object class
OBJECTIDCDOBJECTVCHAR90Object value
CHANGENRCDCHANGENRCHAR10Document change number
TABNAMETABNAMECHAR30Table Name
TABKEYCDTABKEYCHAR70Changed table record key
FNAMEFIELDNAMECHAR30Field Name
CHNGINDCDCHNGINDCHAR1Change Type (U, I, S, D)
TEXT_CASECDXFELDCHAR1Flag: X=Text change
UNIT_OLDCDUNITUNIT3Change documents, unit referenced
UNIT_NEWCDUNITUNIT3Change documents, unit referenced
CUKY_OLDCDCUKYCUKY5Change documents, referenced currency
CUKY_NEWCDCUKYCUKY5Change documents, referenced currency
VALUE_NEWCDFLDVALNCHAR254New contents of changed field
VALUE_OLDCDFLDVALOCHAR254Old contents of changed field
_DATAAGINGDATA_TEMPERATUREDATS8Data Filter Value for Data Aging
CDPOS TABLE IN SAP
CDPOS TABLE IN SAP
CDPOS TABLE IN SAP

Cdhdr table in SAP

CDHDR is header table which stores the log of changes. In ABAP it is use to retrieve the header data of changes log which we created.

FIELDDATA ELEMENTDATA TYPELENGTHSHORT DESCRIPTION
MANDANTMANDTCLNT3Client
OBJECTCLASCDOBJECTCLCHAR15Object class
OBJECTIDCDOBJECTVCHAR90Object value
CHANGENRCDCHANGENRCHAR10Document change number
USERNAMECDUSERNAMECHAR12User name of the person responsible in change document
UDATECDDATUMDATS8Creation date of the change document
UTIMECDUZEITTIMS6Time changed
TCODECDTCODECHAR20Transaction in which a change was made
PLANCHNGNRPLANCHNGNRCHAR12Planned change number
ACT_CHNGNOCD_CHNGNOCHAR10Change number of the document created by this change
WAS_PLANNDCD_PLANNEDCHAR1Flag that changes were generated from planned changes
CHANGE_INDCDCHNGINDHCHAR1Application object change type (U, I, E, D)
LANGULANGULANG1Language Key
VERSIONCHAR3CHAR33-Byte field
_DATAAGINGDATA_TEMPERATUREDATS8Data Filter Value for Data Aging
CDHDR TABLE IN SAP
CDHDR TABLE IN SAP
CDHDR TABLE IN SAP

How To Use of cdhdr and cdpos table in SAP

Suppose we have requirement to find the changes in delivery header through any custom program created by an ABAPer for that we need to check change log of delivery header. The changes logs are stored in CDPOS and CDHDR table, to create a program we will read the CDHDR and CDPOS tables by its objectclasss.

Cdhdr object class list

Sometime we are trying to find changes in our document or changes log or our document which was stored in tables CDHDR and CDPOS. We will use the Foncution Module “CHANGEDOCUMENT_READ_HEADERS” to get the header information which requires the objectclass of type CDHDR-OBJECTCLAS.

We have a field called object class -> which is nothing but the SAP object which is used for the change document. SAP object are material master, sales document, Vendor master, purchasing document, delivery document customer master etc.

And here another column which is change number i.e CHANGENR -> a unique number generated each time a change is done. 

For example of purchase order how these change document helps to identify changes made on the purchase document.

For the Purchase document, the object class is EINKBELEG. You can get details about object class using Tcode SCDO and from table TCDOB.

To find the object class you can check the table TCDOB.

FIELDDATA ELEMENTDATA TYPELENGTHSHORT DESCRIPTION
OBJECTCDOBJECTCLCHAR15Object class
TABNAMECDTABNAMECHAR30Change document creation: Table name
MULTCASECDMULTCASECHAR1Create change documents: ‘X’=Multiple case, ‘ ‘=Single case
DOCUDELCDDOCUDELCHAR1Change document creation: ‘X’=Field doc.when deleting
DOCUINSCDDOCUINSCHAR1Create Change Document: “X” = Field Documentation for Insert
REFNAMECDTABNAMECHAR30Change document creation: Table name
OLDTABNAMECDTABNAMECHAR30Change document creation: Table name
ARCHMULTCDARCHMULTCHAR1Multi-Record Processing in Archiving
DOCUD_NOIFCDDOCUDEL_NOIFCHAR1CDs: ‘X’=Single Field Documentation (No Initial Delete)
DOCUI_IFCDDOCUINS_IFCHAR1Change Document: ‘X’=Single Field Docu./Insert w./Initial
CDHDR OBJECT CLASS LIST
CDHDR OBJECT CLASS LIST
CDHDR OBJECT CLASS LIST

FAQ : Cdpos and Cdhdr table in SAP

1.What is Cdpos and Cdhdr

CDPOS is the item table which store the change log of item data.
CDHDR is the header table which store the change log header data.

2.How to use CDHDR and CDPOS SAP Tables?

Go to transaction SE16N enter table name CDHDR and fill the change document object and document number details well open in CDHDR and pass the same into CDPOS table you will get the all items details for the same.

3.What is the table of object list.

TCDOB is the table where all object list stores.

4.What is Change Log?

Change log or document are used to store the changes of master records, tables, and changes in any document. These changes are stored in two tables that is CDHDR and CDPOS. here CDHDR is the header table and CDPOS is the item table.

You May Also Like:

For the next blog please connect with us and follow us on twitter.com/einfonett

3 thoughts on “Cdpos and Cdhdr table in SAP | Change Documents in SAP”

Leave a Comment

%d bloggers like this: