Vervielfältigung von System Events in Tabellen

Beim Auslesen aus einem SAP-System gibt es die Möglichkeit, basierend auf einer System-Event-Tabelle weitere System-Events zu erzeugen.

Auf Quellsystemebene kann es vorkommen, dass es zwischen zwei Tabellen eine 1:n-Beziehung gibt, die beim Ermitteln der System-Events nicht aufgelöst werden kann. Mit Hilfe der Klasse com.idsscheer.ppm.xmlextractortools.extractor.sap2ppm.ZTableMultiplyEvents_sap2ppm können aus einem System Event mehrere System Events erzeugt und somit die 1:n-Beziehung aufgelöst werden.

Beispiel

<configuration name="MultiplyEvents">

<docspec>

<doctable name="VBAK" tablename="VBAK">

<condition fieldname="VBELN" logicaloperator="in">

<value>0000006662</value>

<value>0000006741</value>

</condition>

<pkfield name="VBELN" />

</doctable>

</docspec>

<table name="VBAP" classtouse="com.idsscheer.ppm.xmlextractortools.extractor.sap2ppm.ZTableMultiplyEvents_sap2ppm">

<pkfield name="VBELN" fktablename="VBAK" fkfieldname="VBELN"/>

<fieldtoread name="POSNR"/>

<fieldtoread name="MATNR"/>

</table>

<table name="MAKT">

<condition fieldname="SPRAS" logicaloperator="eq">

<value>de</value>

</condition>

<pkfield name="MATNR" fktablename="VBAP" fkfieldname="MATNR"/>

<fieldtoread name="MAKTX"/>

</table>

</configuration>

Folgend die zugehörige System-Event-Ausgabedatei.

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE eventlist SYSTEM "event.dtd">

<eventlist>

<event>

<attribute type="VBAK-VBELN">0000006662</attribute>

</event>

<event>

<attribute type="MAKT-MAKTX">Flatscreen MS 1460 P</attribute>

<attribute type="VBAK-VBELN">0000006741</attribute>

<attribute type="VBAP-MATNR">M-06</attribute>

<attribute type="VBAP-POSNR">000010</attribute>

</event>

<event>

<attribute type="MAKT-MAKTX">Flatscreen MS 1775P</attribute>

<attribute type="VBAK-VBELN">0000006741</attribute>

<attribute type="VBAP-MATNR">M-10</attribute>

<attribute type="VBAP-POSNR">000020</attribute>

</event>

<event>

<attribute type="MAKT-MAKTX">MAG PA/DX 175</attribute>

<attribute type="VBAK-VBELN">0000006741</attribute>

<attribute type="VBAP-MATNR">M-14</attribute>

<attribute type="VBAP-POSNR">000030</attribute>

</event>

<event>

<attribute type="MAKT-MAKTX">Jotachi SN4500</attribute>

<attribute type="VBAK-VBELN">0000006741</attribute>

<attribute type="VBAP-MATNR">M-18</attribute>

<attribute type="VBAP-POSNR">000040</attribute>

</event>

</eventlist>

Folgendes Beispiel, ohne die beschriebene Klasse, verdeutlicht den Vorgang bei der Extraktion.

<configuration name="MultiplyEvents_Doctable_Only">

<docspec>

<doctable name="VBAK" tablename="VBAK">

<condition fieldname="VBELN" logicaloperator="in">

<value>0000006662</value>

<value>0000006741</value>

</condition>

<pkfield name="VBELN" />

</doctable>

</docspec>

<table name="VBAP">

<pkfield name="VBELN" fktablename="VBAK" fkfieldname="VBELN"/>

<fieldtoread name="POSNR"/>

<fieldtoread name="MATNR"/>

</table>

<table name="MAKT">

<condition fieldname="SPRAS" logicaloperator="eq">

<value>de</value>

</condition>

<pkfield name="MATNR" fktablename="VBAP" fkfieldname="MATNR"/>

<fieldtoread name="MAKTX"/>

</table>

</configuration>

Da einem Eintrag in der Tabelle VBAK mehrere Einträge in der Tabelle VBAP zugeordnet sind, wird aus der Tabelle VBAP nur eine einzige, zufällige Zeile gelesen.

Folgend die zugehörige System-Event-Ausgabedatei.

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE eventlist SYSTEM "event.dtd">

<eventlist>

<event>

<attribute type="VBAK-VBELN">0000006662</attribute>

</event>

<event>

<attribute type="MAKT-MAKTX">Flatscreen MS 1775P</attribute>

<attribute type="VBAK-VBELN">0000006741</attribute>

<attribute type="VBAP-MATNR">M-10</attribute>

<attribute type="VBAP-POSNR">000020</attribute>

</event>

</eventlist>