This post will explain how to Create Sap Change Documents for Custom Table or Field step by step.
Table of Contents
Let’s first have a look on the result, we expect for this change tracking
For example, change in FI Document ( tcode FB03 to display a document and SAP Table BKPF )
To Display Changes on Document, Environment > Document Changes
All the changes are displayed as following with old value and new value for each modified field.
( Change Document tracking manage change on field level )
In order to compare new value and old value, go to All Changes
Change Documents?Objects and Tables
Technically, the changes on Document are saved in these both tables
CDHDR : Change document header
CDPOS : Change document items
The object class assigned to Business Objects can be customized in tcode SCDO (Display Change Document Objects)
Sap Change Documents for Custom Fields
The Update function module for FI document is BELEG_WRITE_DOCUMENT
Let take for example for zzField on BKPF, object class assigned to FI document should be BELEG
Sample code following can be modified to adjust your requirement.
Or you can call directly the FM BELEG_WRITE_DOCUMENT, don’t forget to run commit work because this function module must run in UPDATE MODE in order to not disturb the main business process.
INCLUDE FF05LCDT. SELECT SINGLE * FROM BKPF WHERE BUKRS = p_companycode AND BELNR = p_invoicedocnumber AND GJAHR = p_fiscalyear. CHECK SY-SUBRC = 0. " Old data *BKPF = BKPF. " New data BKPF-zzfield = p_link. MODIFY BKPF. UPD_BKDF = 'X'. INCLUDE FF05LCDC.
In order to manage change document ( history ) on customize table, a change document object have to be create.
For me information, check the sap help documentation on Create a Change Document Object.
SAP ISU Tables for Technical master data, for Billing Master Data, Billing and invoicing Tables?…
SAP Fiori 3 UX and Design of SAP Fiori Apps for SAP S/4HANA, SAP TechEd…
Dunning is the business practice of informing a customer of past due payment. Dunning letters…
SAP AP Tcodes & SAP AR Tcodes: House Banks Tcodes, Advance Payments or Down Payments,…
What are the main SAP Payment Terms Tables ? What are the related Tables in…
Work center consists of master data related to routing of products. It contains data related…