Information on change documents from the SAP tables CDPOS and CDHDR is stored in special source system attributes of system events using a particular class.
Change documents are extracted using a suitable configuration of a data table. The com.idsscheer.ppm.xmlextractortools.extractor.
sap2ppm.ZChangeDocTable_sap2ppm class is used to extract the change documents.
If there are no change documents for an extracted system events, only the configured table fields are transferred as source system attributes.
In the configuration of the data table from which the change documents are to be extracted, the following conditions must be specified:
<table name="..." classtouse="com.idsscheer.ppm.
xmlextractortools.extractor.sap2ppm.
ZChangeDocTable_sap2ppm">
<booleancondition>
<condition fieldname="OBJECTCLAS" ...>
...
</condition>
<condition fieldname="OBJECTID" ...>
...
</condition>
<condition fieldname="TABNAME" ...>
...
</condition>
<booleancondition logicaloperator="OR">
<condition fieldname="TABKEY" ...>
...
</condition>
<condition fieldname="TABKEY" ...>
...
</condition>
...
</booleancondition>
</booleancondition>
...
</table>
Please do not specify any other conditions.
The following table displays the source system attributes that are created from the extracted change document information. CH_DOCS has been specified as the identifier of the data table in the configuration.
Source system attribute |
Description |
---|---|
CH_DOCS-SUM_OF_CHANGES |
Total number of changes in the extracted document (number of saving operations). |
CH_DOCS-FIRST_CHANGE_DATE |
Date of the first change |
CH_DOCS-LAST_CHANGE_DATE |
Date of the last change |
CH_DOCS-CHANGE_USER_<x> |
Name of the processor that has created change documents. The attribute is created for every processor.<x> is the consecutive number of the processor. |
CH_DOCS-NUM_OF_CHANGES_USER_<x> |
Total number of changes made by the processor.<x> is the consecutive number of the processor. |
Example
The file extract below illustrates the configuration for extracting the changes in the VBAK and VBAP tables:
<configuration name="SD_CHANGE_DOC_SUM">
<docspec>
<docreftable name="VBAK">
<condition fieldname="ERDAT#-#ERZET"
logicaloperator="creationtimestamp">
<value>yyyyMMdd</value>
<value>HHmmss</value>
</condition>
<pkfield name="VBELN" />
</docreftable>
<doctable name="VBAP">
<pkfield name="VBELN" fktablename="VBAK"
fkfieldname="VBELN"/>
<pkfield name="POSNR" />
<fieldtoread name="VBELN"/>
<fieldtoread name="POSNR"/>
<fieldtoread name="ERDAT"/>
<fieldtoread name="ERZET"/>
<fieldtoread name="ERNAM"/>
</doctable>
</docspec>
<table name="CH_DOCS" classtouse="com.idsscheer.ppm.
xmlextractortools.extractor.
sap2ppm.ZChangeDocTable_sap2ppm">
<booleancondition>
<condition fieldname="OBJECTCLAS">
<value>VERKBELEG</value>
</condition>
<condition fieldname="OBJECTID"
logicaloperator="eq_concatEventAttrValues">
<value>VBAP-VBELN</value>
</condition>
<condition fieldname="TABNAME" logicaloperator="in">
<value>VBAK</value>
<value>VBAP</value>
</condition>
<booleancondition logicaloperator="OR">
<condition fieldname="TABKEY"
logicaloperator="eq_concatEventAttrValues">
<value>CLIENT#-#</value>
<value>VBAP-VBELN#-#</value>
<value>VBAP-POSNR</value>
</condition>
<condition fieldname="TABKEY"
logicaloperator="eq_concatEventAttrValues">
<value>CLIENT#-#</value>
<value>VBAP-VBELN</value>
</condition>
</booleancondition>
</booleancondition>
<pkfield name="VBELN" fktablename="VBAP"
fkfieldname="VBELN"/>
<pkfield name="POSNR" fktablename="VBAP"
fkfieldname="POSNR"/>
</table>
</configuration>
The eq_concatEventAttrValues operator compares the content of the specified field with combined attribute values from the specified fields. The values specified in the value XML elements are interpreted as the identifiers of source system attributes already extracted.
Note on the values of the OBJECTID and TABKEY fields
The individual field values (<value>...</value>) are concatenated using the specified separator string #-# between the individual field values. In the example, the values of the fields OBJECTID and TABKEY contain the following:
OBJECTID
Value |
Description |
Example value |
---|---|---|
VBAP-VBELN |
The value already extracted from the field VBELN in the table VBAP must match as a condition for the field OBJECTID. |
0000004972 |
TABKEY
Value |
Description |
Example value |
---|---|---|
CLIENT |
Parameter that is replaced by the number of the SAP client from which you extract. |
800 |
VBAP-VBELN |
Value of the extracted field VBELN of the table VBAP. |
0000004972 |
VBAP-POSNR |
Value of the extracted field POSNR of the table VBAP. |
000020 |
Based on the example values in the above configuration, the concatenated values 800#-#0000004972#-#000020 and 800#-#0000004972 are the result for the field TABKEY (key of the changed table row).
The output file extract below illustrates a possible system event:
<event>
<attribute type="CH_DOCS-CHANGE_USER_1">
sapuser
</attribute>
<attribute type="CH_DOCS-CHANGE_USER_2">
ANFEL
</attribute>
<attribute type="CH_DOCS-FIRST_CHANGE_DATE">
20030919
</attribute>
<attribute type="CH_DOCS-FIRST_CHANGE_TIME">
181020
</attribute>
<attribute type="CH_DOCS-LAST_CHANGE_DATE">
20030930
</attribute>
<attribute type="CH_DOCS-NUM_OF_CHANGES_USER_1">
1
</attribute>
<attribute type="CH_DOCS-NUM_OF_CHANGES_USER_2">
3
</attribute>
<attribute type="CH_DOCS-SUM_OF_CHANGES">
4
</attribute>
<attribute type="VBAP-ERDAT">20030919</attribute>
<attribute type="VBAP-ERNAM">ANFEL</attribute>
<attribute type="VBAP-ERZET">174938</attribute>
<attribute type="VBAP-POSNR">000010</attribute>
<attribute type="VBAP-VBELN">0000007500</attribute>
</event>