Audit wants a field-level history of changes to your custom managed RAP business object: who changed which field, when, and from what to what. What does RAP give you for that today, what must be in place, and where does it not work?
Say your answer out loud first.
Practise another way
I would use RAP change documents. In the BDEF I add changedocuments master with a change document object on the root, changedocuments dependent on the children, and logging options per operation.
The data elements of the logged fields need the change document flag. It needs strict mode, a persistent table and a managed BO. On premise it works only with the Standard ABAP language version; otherwise I call the generated class myself.
The built-in way: RAP change documents. A RAP reuse service logs changes of persisted BO data into a change document object, with no code in the behavior pool:
managed implementation in class zbp_r_order unique;
strict ( 2 );
define behavior for ZR_Order alias Order
persistent table zorder
lock master
authorization master ( instance )
changedocuments master ( ZORDER_CD )
{
changedocuments ( create : key, update : data, delete : key );
...
}
define behavior for ZR_OrderItem alias Item
persistent table zorder_item
lock dependent by _Order
authorization dependent by _Order
changedocuments dependent by _Order
{ ... }
What must be in place
- BDEF strict mode and a
persistent table. The feature is available for managed RAP BOs. - A change document object. ADT generates it by a quick fix. In RAP only its name matters; its classic generation options are ignored.
- Field flags. Only fields whose data element has Change Document Logging set are logged. For simple types the annotation
@AbapCatalog.typeSpec.changeDocumentRelevant: truedoes the same. - One change documents master per BO. Dependent entities must form a tree below it. Fields in the ON condition of the association to the master should be read-only.
What gets logged. Changes are logged for the active persistence, not for each draft step. Create and update in one LUW appear as one create with the final values.
By default, logging follows the CDS entity's field metadata. An option switches it to the persistent table's fields. Changes made through a projection or a BO interface are logged in the base BO's object.
Where it stops
- In on-premise systems, the integration works only with the Standard ABAP language version. A BO written in ABAP for Cloud Development on SAP S/4HANA on-premise cannot use it, per the keyword documentation.
- A BDEF extension cannot define a master; it can add dependents if the tree stays intact.
- Unmanaged BOs are not supported.
The fallback for these cases is SAP's documented alternative: call the change document API in an additional save. The change document object generates a write class in your namespace with a WRITE method.
In SAP's reuse-services sample it is ZCL_ZREUSE_SO_002_CHDO, called in save_modified. Read the history with CL_CHDO_READ_TOOLS. Show it in Fiori through a custom entity.
Release note. Standard ABAP lists RAP change documents with release 7.58 (ABAP Platform 2023). For SAP BTP ABAP environment (now SAP Business AI Platform, ABAP environment), SAP announced them with release 2508.
Writes changedocuments master and dependent with options, names strict mode, data element flags and the managed-only limit, and knows the on-premise language-version limit and the WRITE-class fallback.
Builds a Z history table filled in a determination, or says change documents need SCDO and function modules that ABAP Cloud does not release.
Assuming RAP change documents work in every system. On premise, they need the Standard ABAP language version, and they never work for unmanaged BOs.
- Why are draft edits not in the change documents, and is that a problem for audit?
- How would you show the change history on the object page?
- When would you still write change documents yourself in save_modified?
6 official pages and 2 prep guides. Confidence: high. Checked 3 Dec 2026.
- Prep guide Gives the question.
- Prep guide Gives the question.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.