For changes to a commercial object to be able to be logged in a change document, the object must have been defined in the system as a change document object. A change document object definition contains the tables which represent a commercial object in the system. The definition can also specify whether the deletion of individual fields is to be documented. If a table contains fields whose values refer to units and currency fields, the associated table, containing the units and currencies, can also be specified.
It must be specified for each table, whether a commercial object contains only one (single case) or several (multiple case) records. For example, an order contains an order header and several order items. Normally one record for the order header and several records for the order items are passed to the change document creation when an order is changed.
The name under which a change document object is created is an object class.
The object class BANF was defined for the change document object "Purchase requisition", which consists of the tables EBAN (purchase requisition) and EBKN (purchase requisition account assignment).
Changes to this commercial object can then be saved in the system under the object values of this change document object, i.e. the object ID and a change document number. The object ID is the key to the object value, i.e. all records which are defined as belonging to a given change document object.
All changes to a commercial object constitute an object value under this key. This is for example the order number for orders or the number range object name for number range objects. All changes to a given order or to a given number range object can be accessed in this way.
The object value BANF with the object ID "3000000000" consists of the records of the tables EBAN and EBKN with the order number "3000000000".
If changes are not yet to be made, but are planned, they can be logged as planned changes. A planned date for the changes can be specified. The planned changes can be analyzed and copied into the tables. You must program the copy yourself.
All logging functions are supported by SAP function modules. The application development must contain certain INCLUDE programs. Old and new status are passed to the change document creation. The included function modules determine the changes for all table fields which are flagged as being change-relevant in the Dictionary.
A change document logs changes to a commercial object. The document is created independently of the actual database change. The change document structure is as follows:
The change number is not the same as the change document number. The change document number is issued automatically by the function group SCD0 function modules when a change document is created for a change document object. The change number is issued by the user when changes are planned. The same change number can be used for various change document objects.
When the object-specific update is called, the object-specific change document creation is called. The object-specific change document header is written with a change document number. The Dictionary is searched for which fields are to be logged for each table in the object definition. The log records for these fields are then created as change document items according to the object definition.