Show TOC

Background documentationConcept Locate this document in the navigation structure

 

To be able to log changes to a business object in a change document, this object must be defined as a change document object, in the system. The definition of a change document object comprises tables which represent a business object in the system. The definition can also specify whether the individual fields are to be documented in deletions. If a table contains fields whose values refer to unit and currency fields, the table of unit and currencies can also be specified.

For each table, one (Single) or more (Multiple) rows belong to a business object. For example, an order header and several order items belong to an order. If the order changes, one row for the order header and several rows for the order items are usually passed to the change document creation.

The name under which a change document object is saved, is an object class.

The object class can use the "Namespace" concept.

Example Example

The object class BANF, which comprises the tables EBAN (purchase requisition) und EBKN (purchase requisition account assignment), has been defined for the change document object "purchase requisition".

End of the example.

Changes to this business object can then be saved under the object values of this change document object, i.e. the Object ID and a change document number, in the system. The object ID is the key to all records which belong to a change document object.

All changes to a business object are collected under this key. For example, for purchase orders, the purchase order number, or for number range objects, the number range object name. So all changes to a purchase order or number range object can be accessed.

Example Example

The BANF object with the object ID "3000000000" comprises the records in tables EBAN and EBKN with the purchase order number "3000000000".

End of the example.

If changes are to be planned but not yet made, they can be logged as planned changes. You can specify the planned change date. The planned changes can be analyzed and put in the tables. You must program this yourself.

All logging tasks are performed by SAP function modules. You must put certain INCLUDE programs in the application development. The change document is created when you specify the old and new status. The function modules determine the changes for all table fields which are flagged as change document-relevant, in the dictionary.

Note Note

Change documents are unicode-compatible.

End of the note.
Change Document

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

  • Change document header (CDHDR)

    The change document header contains the header data of the change to an object ID in an object class. A change document number is automatically assigned.

  • Change document item (CDPOS)

    The change document item contains the old and new value of a field in a change, and a change flag. The change flag can take the following values:

    • U(pdate)

      Data changed (log entry for each changed field which was flagged as "change document-relevant", in the dictionary)

    • I(nsert)

      Data inserted (log entry for the entire table entry)

    • J (Field documentation at Insert)

      Insert a table entry with field documentation. 1 log entry per field of the table entry inserted. The field contents inserted are retained

    • D(elete)

      Data deleted (log entry for the entire table entry)

    • E (Field documentation)

      Delete a table entry with field documentation. 1 log entry per field of the table entry deleted. The field contents deleted are retained

  • Change document item supplements

    • additional change document table for TABKEY > 70 characters

      If the key of a table is longer than 70 characters, this long table key is saved in the CDPOS_UID supplementary table. There are the following connections between the tables CDPOS and CDPOS_UID:

      The long table key for CDPOS is in character 254 in the field TABKEY of table CDPOS_UID.

      The GUID for CDPOS_UID is in the field TABKEY of table CDPOS.

      If there is a record in CDPOS_UID, field CDHDR-VERSION = 1 or 3.

    • Additional change document table for STRINGS

      If STRING fields are to be logged for a table, they are saved in the CDPOS_STR table.

      The fields VALUE_OLD and VALUE_NEW in table CDPOS_STR contain old and new change document values for a STRING variable.

      The fields VALUE_RAWSTR_OLD and VALUE_RAWSTR_NEW in table CDPOS_STR contain old and new change document values for a RAWSTRING variable gespeichert. The fields VALUE_SHSTR_OLD and VALUE_SHSTR_NEW in table CDPOS_STR contain old and new change document values for a SHORTSTRING variable.

      If there is a record in CDPOS_STR, field CDHDR-VERSION = 2 or 3.

  • Change document number

    The change document number is assigned when logging a change, i.e. when the change document creation function modules (function group SCD0) create the change document header.

    Caution Caution

    The change number is not the same as the change document number. The change document number is automatically assigned by the function modules of the function group SCD0 when a change document is created for a change document object. It uses the NUMBER_RANGE object "CHANGEDOCU".

    The change number is assigned when changes are planned by the user. The same change number can be used for different change document objects.

    End of the caution.
Internal Processing

If the object-specific update is called, object-specific change document creation is called. An object-specific change document header is written with a change document number. The dictionary is checked for which fields in each table in the object definition are to be logged. The log records for these fields are then captured as change document items, according to the object definition.