Start of Content Area

Background documentation Concept   Locate the document in its SAP Library structure

To be able to log changes to a business object in a change document, this object as change document object must be defined in the system. In its definition, a change document object has tables, which represent a business object in the system. In the definition you can define whether the individual fields are to be documented for deletions. If a table contains fields where the values refer to units or currency fields, then the related table where the units and currencies are stored can also be specified.

It has to be decided for every table if only one row (single case) or multiple rows (multiple case) belong to a business object. For example, a request header and multiple request items belong to a request. Therefore for a change request a row for the request header and multiple rows for the request items are usually transferred to the change document creation.

The name under which a change document object is created represents an object class.

Example

Object class BANF was defined for the change document object “Purchase Requisition” and consists of the tables EBAN (purchase requisition) and EBKN (purchase requisition assignment).

Changes to this business object can then be stored under the individual object values of this change document object, that is, the object ID and a change document number. The object ID is the key of the object attributes, for example, all records that belong to a change document object according to the definition.

All changes to a business object are summarized as an object attribute under this key. This is, for example, the purchase requisition number for purchase requisitions or the name of the number range object for number range objects. This means you can access all changes to a specific purchase requisitions or a specific number range object.

Example

Object attribute BANF with object ID "3000000000" consists of the rows of the tables EBAN and EBKN with the purchase requisition number "3000000000".

If changes have not been made but are to be retained as a change project then you can log this change project as planned changes. It is possible here to also specify a planned deadline. The planned changes can be evaluated and accepted to the actual tables. This acceptance needs to be programmed by you yourself.

All logging tasks are taken over by SAP function modules. Prerequisite for this is the inclusion of specific INCLUDE programs in the application development. The transfer to the change document creation takes place after specifying the old/new status. The included function modules determine the changes for all table fields that are identified in the dictionary as change-document-relevant.

Note

Change documents are Unicode-capable.

 

Change Documents

A change document represents the logging of changes to a business object. The document creation takes place in a step that is independent from the actual change to the database. The change document is structured as followed:

      Change Document Header (CDHDR)

The header data of the change project for an object ID in a specific object class is stored in the change document header. A change document number is provided automatically.

      Change Document Item (CDPOS)

The change document item contains the older and new value for a field of a specific change project, as well as a change flag.
The following values are possible for the change flag:

       U(pdate)

Data changed (log entries for every changed field flagged in the dictionary as “change-document-relevant”).

       I(nsert)

Data added.

       J (Individual field documentation for insert)

Add a table entry with individual field documentation 1 log entry for each field of the added table entry, the added field content is retained.

       D(elete)

Data deleted (log entry for the whole table entry).

       I(ndividual Field Documentation)

Delete a table entry with individual field documentation 1 log entry for each field of the deleted table entry, the deleted table is retained.

      Additions to Change Document Items

       Additional Change Document Table for TABKEY > 70 Characters

If the table key for a table has 70 characters then this long table key is saved in the CDPOS_UID additional table. The following connection exists between the tables CDPOS and CDPOS_UID:

In the field TABKEY of table CDPOS_UID, the long table key is stored for CDPOS in character 254.

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

If there is a record in the CDPOS_UID then this is also flagged in the CDHDR-VERSION = 1 or 3 field.

       Additional Change Document Table for STRINGS

If STRING fields are to be logged for a tables then these are saved in the CDPOS_STR table.

Old and new change document values for a STRING variable are stored in the fields VALUE_OLD and VALUE_NEW of table CDPOS_STR.

Old and new change document values for a RAWSTRING variable are stored in the fields VALUE_RAWSTR_OLD and VALUE_RAWSTR_NEW of table CDPOS_STR.

If there is a record in the CDPOS_STR then this is also flagged in the CDHDR-VERSION = 2 or 3 field.

      Change Document Number

The change document number is given when logging a change project, that is, when creating the change document header using the function modules of the change document creation (function group SCDO).

Caution

The change number must not be confused with 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. The NUMBER_RANGE object "CHANGEDOCU" is used for this.

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

Internal Processing

The object-specific change document creation is called when calling the object-specific update process. The object-specific change document header is written with a change document number. It is checked  in the dictionary which fields are to be logged for every table that belongs to the object definition. The log records are then compiled as change document items for these fields according to the object definition.

 

 

End of Content Area