Change documents — who changed what, and when¶
Level: 201 · working knowledge
Status: stub — the mechanism is here; the worked example is not yet.
One line: A change document records the old and new value of every logged field of a business object, with user and timestamp, in CDHDR/CDPOS — written by the standard transactions automatically and by your own code only if you generate the change document object (SCDO) and call its function modules, which a direct database UPDATE never does.
The mechanism¶
- Mark the field's data element as change document relevant.
- Create a change document object in
SCDOfor the table(s); it generates function modulesZOBJECT_WRITE_DOCUMENTand friends. - In your code, after the change and before the commit, call the generated module with the before and after images.
- Read them back with
CHANGEDOCUMENT_READ, or in the transaction's Environment → Changes menu, or straight fromCDHDRandCDPOS.
Why it earns a page¶
Because auditors ask, and because the answer to "who set this credit limit" is only there if something wrote it. A BAPI writes change documents; a standard transaction writes them; a direct database write to the same table does not, and neither does a BAdI that quietly adjusts a field after the standard has already logged it. CDPOS is also one of the largest tables in most systems, which is a fact about archiving as much as about logging.
What this page still needs¶
- [ ] a change document object generated for a demo table, and the call that writes it
- [ ]
CDHDR/CDPOSrows for one change, recorded - [ ] how a RAP business object gets change documents
See also¶
- Database writes — what skips them
- BAPIs and RFC — what writes them
- Application log — the other trail
- DDIC, domains and data elements — the flag on the data element