Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
manish_gupta32
Product and Topic Expert
Product and Topic Expert
0 Kudos
936

Techniques for reading change documents in SAP MDG, and interpreting the change documents is the key. Below are few methods which can help to read the Change Documents:

1. Through API (CL_USMD_ADAPTER_PROVIDER): This API helps in reading the change documents which can be utilised as per your business scenario eg: Route the Workflow (BRF+ WF) to a different user if a specific field is updated by the requestor. Attached is the code snippet (Code for API Method.txt) that can be used to read the change documents.

  • manish_gupta32_1-1738734907654.png

2. Through SAP Change Documents Tables (CDPOS/CDHDR)

2.1. Get CR number 

manish_gupta32_2-1738735773863.png

2.2. Pass this to CDHDR table as shown below

manish_gupta32_3-1738735804282.png

2.3 You will see two entries as below, Change Numbers (CDHDR-CHANGENR) can be picked from here

manish_gupta32_4-1738735849099.png

2.4 Pass the change number from CDHDR (Step 2.3), into table CDPOS to get the details of the changed fields

manish_gupta32_6-1738736357264.png

You will see the old and new value for a field as below:

manish_gupta32_7-1738736419155.png

2.5 If MDG Change Pointers are active in your system, then actual material number (Object Key) will be available in the table MDGD_CP, and this can be read based on CR number and Object Type as shown below:

manish_gupta32_0-1738817638818.png

Feel free to share your thoughts, questions, or any experiences you may have had with SAP MDG Change Documents. 

I would like to thanks my colleague Bijal Parmar (Bijal.Parmar@sap.com) for sharing useful information.

Thank You, Keep Learning!!