The file extract below shows the SD_C table configuration for extracting data from an SAP SD system:
...
<xmlextractor_tableconfiguration>
<configuration name="SD_C">
<docspec>
<docreftable name="VBAK">
<booleancondition>
<condition fieldname="ERDAT#-#ERZET"
logicaloperator="creationtimestamp">
<value>yyyyMMdd</value>
<value>HHmmss</value>
</condition>
<condition fieldname="VBTYP"
logicaloperator="eq">
<value>C</value>
</condition>
</booleancondition>
<pkfield name="VBELN" />
</docreftable>
<doctable name="Orders" tablename="VBAP">
<pkfield name="VBELN" fktablename="VBAK"
fkfieldname="VBELN"/>
<pkfield name="POSNR" />
<fieldtoread name="ERDAT"/>
<fieldtoread name="ERZET"/>
<fieldtoread name="MATNR">
<textref tablename="MAKT" reffieldname="MATNR"
textfieldname="MAKTX" langfieldname="SPRAS"/>
</fieldtoread>
<fieldtoread name="KONDM">
<textref tablename="T178T" reffieldname="KONDM"
textfieldname="VTEXT" langfieldname="SPRAS"/>
</fieldtoread>
<fieldtoread name="SPART">
<textref tablename="TSPAT" reffieldname="SPART"
textfieldname="VTEXT" langfieldname="SPRAS"/>
</fieldtoread>
<fieldtoread name="WERKS">
<textref tablename="T001W" reffieldname="WERKS"
textfieldname="NAME1"/>
</fieldtoread>
<fieldtoread name="CHARG"/>
<fieldtoread name="PSTYV"/>
<fieldtoread name="ERNAM"/>
<fieldtoread name="NETWR"/>
</doctable>
</docspec>
<table name="VBAK">
<pkfield name="VBELN" fktablename="Orders"
fkfieldname="VBELN"/>
<fieldtoread name="VTWEG">
<textref tablename="TVTWT" reffieldname="VTWEG"
textfieldname="VTEXT" langfieldname="SPRAS"/>
</fieldtoread>
<fieldtoread name="VKORG">
<textref tablename="TVKOT" reffieldname="VKORG"
textfieldname="VTEXT" langfieldname="SPRAS"/>
</fieldtoread>
<fieldtoread name="VDATU"/>
<fieldtoread name="VKBUR">
<textref tablename="TVKBT" reffieldname="VKBUR"
textfieldname="BEZEI" langfieldname="SPRAS"/>
</fieldtoread>
<fieldtoread name="VKGRP">
<textref tablename="TVGRT" reffieldname="VKGRP"
textfieldname="BEZEI" langfieldname="SPRAS"/>
</fieldtoread>
<fieldtoread name="VBTYP"/>
<fieldtoread name="AUART"/>
</table>
<table name="MARA">
<pkfield name="MATNR" fktablename="Orders"
fkfieldname="MATNR"/>
<fieldtoread name="MATNR"/>
<fieldtoread name="MTART">
<textref tablename="T134T" reffieldname="MTART"
textfieldname="MTBEZ" langfieldname="SPRAS"/>
</fieldtoread>
</table>
</configuration>
</xmlextractor_tableconfiguration>
The SD_C table configuration contains the following tables:
Document header table
...
<docreftable name="VBAK">
<booleancondition>
<condition fieldname="ERDAT#-#ERZET"
logicaloperator="creationtimestamp">
<value>yyyyMMdd</value>
<value>HHmmss</value>
</condition>
<condition fieldname="VBTYP"
logicaloperator="eq">
<value>C</value>
</condition>
</booleancondition>
<pkfield name="VBELN" />
</docreftable>
...
The identifier and name of the document header table from the R/3 system is VBAK. All order document headers (VBTYP=C) for the period specified in the command line are read. The value elements of the creationtimestamp condition operator specify the format of the specified time stamp.
The name of the primary key table column is VBELN. For each different VBELN field value, data records are extracted from the linked document table for which VBELN has the same value as in the document header table.
Document table
...
<doctable name="Orders" tablename="VBAP">
<pkfield name="VBELN" fktablename="VBAK"
fkfieldname="VBELN"/>
<pkfield name="POSNR" />
<fieldtoread name="ERDAT"/>
<fieldtoread name="ERZET"/>
<fieldtoread name="MATNR">
<textref tablename="MAKT" reffieldname="MATNR"
textfieldname="MAKTX" langfieldname="SPRAS"/>
</fieldtoread>
<fieldtoread name="KONDM">
<textref tablename="T178T" reffieldname="KONDM"
textfieldname="VTEXT" langfieldname="SPRAS"/>
</fieldtoread>
<fieldtoread name="SPART">
<textref tablename="TSPAT" reffieldname="SPART"
textfieldname="VTEXT" langfieldname="SPRAS"/>
</fieldtoread>
<fieldtoread name="WERKS">
<textref tablename="T001W" reffieldname="WERKS"
textfieldname="NAME1"/>
</fieldtoread>
<fieldtoread name="CHARG"/>
<fieldtoread name="PSTYV"/>
<fieldtoread name="ERNAM"/>
<fieldtoread name="NETWR"/>
</doctable>
...
The document table VBAP is assigned the identifier Orders. The foreign key relation specified in the line
<pkfield name="VBELN" fktablename="VBAK" fkfieldname="VBELN"/>
links the table to the document header table. Unless otherwise specified, foreign key relations are created based on equal field values (see chapter Comparison of foreign key relations). In this example, only those table rows for which the comparison of the VBAP-VBELN and VBAK-VBELN field values returns equal values will be extracted. The primary key consists of the VBELN and POSNR columns.
For each table row extracted, a system event (event XML element) is created in the XML output file. For each fieldtoread XML element, a line of the form
<attribute type="...">...</attribute>
is written to the output file.
The primary key fields (pkfield) specified in the doctable definition are extracted automatically. You do not have to specify fieldtoread elements for them.
For some fieldtoread elements, the value extracted from the referenced table (textref XML element) is written in addition to the extracted data field value. The optional langfieldname extracts the language-specific text of the data field.
The complete source system attribute type is made up of the identifier of the document header table (doctable name), the field name (fieldtoread name) and the name of the referenced text field (textref ... textfieldname). The source system attribute type for the first extracted fieldtoread element with a referenced table looks like this:
<attribute type="Orders-MATNR-MAKTX">...</attribute>
Data tables
...
<table name="VBAK">
<pkfield name="VBELN" fktablename="Orders"
fkfieldname="VBELN"/>
<fieldtoread name="VTWEG">
<textref tablename="TVTWT" reffieldname="VTWEG"
textfieldname="VTEXT" langfieldname="SPRAS"/>
</fieldtoread>
<fieldtoread name="VKORG">
<textref tablename="TVKOT" reffieldname="VKORG"
textfieldname="VTEXT" langfieldname="SPRAS"/>
</fieldtoread>
<fieldtoread name="VDATU"/>
<fieldtoread name="VKBUR">
<textref tablename="TVKBT" reffieldname="VKBUR"
textfieldname="BEZEI" langfieldname="SPRAS"/>
</fieldtoread>
<fieldtoread name="VKGRP">
<textref tablename="TVGRT" reffieldname="VKGRP"
textfieldname="BEZEI" langfieldname="SPRAS"/>
</fieldtoread>
<fieldtoread name="VBTYP"/>
<fieldtoread name="AUART"/>
</table>
<table name="MARA">
<pkfield name="MATNR" fktablename="Orders"
fkfieldname="MATNR"/>
<fieldtoread name="MATNR"/>
<fieldtoread name="MTART">
<textref tablename="T134T" reffieldname="MTART"
textfieldname="MTBEZ" langfieldname="SPRAS"/>
</fieldtoread>
</table>
...
The foreign key relations to the VBELN and MATNR primary key fields in the Orders table are used to extract supplementary information from the VBAK and MARA data tables.