CDS Views for Change Document Tables – CDHDR & CDPOS
2023-10-26 18:20:8 Author: blogs.sap.com(查看原文) 阅读量:23 收藏

Hi All,

This blog post provides information on how to read or view Change documents information or changes logs details of SAP objects like Purchase order, Purchase Requisition, Material, Plant, Internal order etc., in S4 Hana using standard CDS views.

Introduction:

Change Document:

A change document logs changes to a business object. The document is created independently of the database changes.

In SAP, any change log information of an SAP documents or objects captured in tables CDHDR and CDPOS

  • CDHDR: It contains the header data of the change to an object ID in an object class and change document number is automatically assigned.
  • CDPOS: It contains the old and new value of a field in a change and a change flag.

Both header and item tables capture changes such as change data in Material Master, changes to Purchase orders/ Purchase Req (PR), Purch Orders, Contracts, Sales Orders, Internal orders etc.,

More info about Change Doc:

https://help.sap.com/saphelp_ewm900/helpdata/en/48/dfd498ab14280de10000000a42189c/frameset.htm#:~:text=A%20change%20document%20logs%20changes,ID%20in%20an%20object%20class

In ECC or R/3 systems we will read change documents or change log information using tables CDHDR & CDPOS and we have to create custom views and custom reports as per business needs.

Example –

In CDHDR table for Object class we will pass below information to get Materials and PO documents changes history.

  • MATERIAL for Material master changes
  • EINKBELEG for Purchasing document changes.

The OBJECTID from CDHDR is usually the object’s number i.e., Material number, PO number etc., Get the CHANGENR from CDHDR and pass it to CDPOS table to see change details with new and old values.

Coming to this blog post, In S4Hana we have some standard CDS views which was delivered by SAP using them we can retrieve the change document history information easily as listed below. These views contain additional attributes or details which will be helpful.

This blog post has covered most of the standard CDS views which are available for Change document tables using these views we can track change document history of SAP objects like Purchase order, Material, Internal order, Notification change etc., with old and new values.

All these CDS views can be accessed in Eclipse and sql views in SE16n or SE11.

Hope this blog post helps.

Any suggestions or comments welcome.

Thank you!


文章来源: https://blogs.sap.com/2023/10/26/cds-views-for-change-document-tables-cdhdr-cdpos/
如有侵权请联系:admin#unsafe.sh