Writing the fields in the program

Complete the change document-relevant fields and tables as follows.

General data

These are the fields which are defined in the INCLUDE program part F<K4>CDF.

  • OBJECTID
    Object value (key) of the object
  • TCODE
    Transaction, with which the change was made
  • UTIME
    Change time
  • UDATE
    Change date
  • USERNAME
    Changed by

Object-specific data

These are the fields which are defined in the INCLUDE program part F<K4>CDV .

Single case tables:

  • Table * <table name > or record fields <old record fields name > (with the table structure)
    The table header record or the record fields must contain the original data.
  • Table <table name >
    The table header record must contain the new data.
  • Table *<ref. table name >
    (only if ref. tab. name was specified when the change document object was defined)
    The table header record must contain the original currencies and units.
  • UPD_<table name >
    With this flag, you specify the processing logic.
    The following values are possible:
    • "D" (DELETE)
      A change document item is to be created for the record in *<table name > or <old record fields name > which is to be flagged as deleted. <table name > is not processed.
    • "I" (INSERT)
      A change document item is to be created for the record in <table name > which is to be flagged as created. *<table name > or <old record fields name > is not processed.
    • "U" (UPDATE)
      *<table name > or <old record fields name > and <table name > are compared and a change document item is created for each changed field. The keys of *<table name > or <old record fields name > and <table name > must be identical.
    • " " (space, no processing)
      *<table name > or <old record fields name > and <table name > are not processed by the update program. (If no changes have been made, the processing can be skipped to save time.)

Multiple case tables:

These tables must be passed sorted by key.

  • Y<table name >
    The table must contain the original version of the changed or deleted records. The structure consists of the table, as specified in the change document object definition under table name, a processing flag (TYPE C, length 1) and possibly the structure of the associated currency and units table, as specified in the definition of the change document object under Ref. table name. It is created during the change document object INCLUDE generation and saved under the name V<table name > in the Dictionary.

The processing flag can be switched from space to "D", if it is to be processed in the application. Otherwise it has no effect.

  • X<table name >
    The table must contain the current version of the changed or created records. The structure is the same as Y<table name > (see above).
    The following values are possible for the processing flag:
    • "I" (INSERT)
      Records were created, or table records were deleted, then a record with the same key was created in the same transaction, and this is to be documented as "Delete" and "Create" (special case), not as "Change".
    • "U" or " " (space) (UPDATE)

The parameter UPD_<table name > (see below) initially determines whether the record is new or changed. The processing flag is only checked when, with the parameter value "U", the following key comparison between the two tables TABLE_OLD and TABLE_NEW finds two records with the same key.

Multiple case internal table processing flags can always contain space, with the exception of the special case (in X<table name >). The possibility of setting the processing flag to "D", "I" or "U" as well was created so that the tables could also be used for other purposes in which such processing flags are useful, in application programs.

  • UPD_<table name >
    With this flag you determine the processing logic.
    The following values are possible:
    • " D " (DELETE)
      A change document item is to be created for each record in Y<table name > which is to be flagged as deleted. X<table name> is not processed.
    • "I" (INSERT)
      A change document item is to be created for each record in X<table name> which is to be flagged as created. Y<table name> is not processed.
    • "U" (UPDATE)
      The keys of TABLE_OLD and TABLE_NEW are compared. The following cases are distinguished:
    • 1. Record exists in TABLE_OLD but not in TABLE_NEW: Change document items are to be created for the record in TABLE_OLD which is to be deleted.
    • 2. Record exists in TABLE_NEW but not in TABLE_OLD: A change document item is to be created for the records in TABLE_NEW which are to be flagged as created.
    • 3. Record exists in both TABLE_OLD and TABLE_NEW: A change document item is created for each changed field which is defined as change document-relevant in the Dictionary.
    • " " (space, no processing)
      Y<table name> and X<table name > are not processed by the update program. (If no changes have been made, the processing can be skipped to save time.)

Text changes:

If text changes are to be logged (according to the change document object definition), the following fields are to be completed:

  • ICDTXT_<Object>
    This structure contains the change document-relevant texts with corresponding details:
    • TEILOBJID
      Key of the changed table record
    • TEXTART
      Text type of the changed texts
    • TEXTSPR
      Language key
    • UPDKZ
      Change flag for the table record: D(elete), I(nsert) or U(pdate)
  • UPD_ICDTXT_<Object>
    Change flag for the text table:
    • " " (space)
      Table is ignored by the update program
    • "U"
      Table is taken into account by the update program

Optional parameters

You can also use the following INCLUDE program part F<K4>CDF parameters:

  • CDOC_PLANNED_OR_REAL
    With this parameter you control whether the changes to be logged are actual or planned changes.
    Possible values
    • "R" actual (real) changes
    • "P" planned changes
    • " "(space) if no plan number exists: actual change
      if a plan number exists: planned change
  • CDOC_UPD_OBJECT
    If the change document is relevant for determining which change action was performed for the object, you can pass the action performed here.
    Possible values:
    • "I" the object was inserted.
    • "U" the object was changed.
    • "D" the object was deleted.