Create attributes with inverted date

You can use the Java class com.idsscheer.ppm.xmlextractortools.extractor. sap2ppm.ZTableInvertDates_sap2ppm to create new system event attributes with inverted dates when extracting data from an SAP system. Values of already extracted date attributes will be inverted. An inverted date is calculated by extracting the value of the date in SAP format, e.g., 20110529 for July 29, 2011 from 99999999. The new system events created can be referenced in other data table configurations (table XML element).

Example

<docspec>

<doctable name="VBAP">

<pkfield name="VBELN" />

<pkfield name="POSNR" />

<pkfield name="ERDAT"/>

<pkfield name="AEDAT"/>

<pkfield name="ABDAT"/>

</doctable>

</docspec>

<table name="VBAP_DATES_INVERTED" tablename="VBAP_DATES_INVERTED" classtouse="com.idsscheer.ppm.xmlextractortools.extractor.sap2ppm.ZTableInvertDates_sap2ppm">

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

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

</table>

If you are using the ZTableInvertDates_sap2ppm class, you do not need to specify a fieldtoread element. Any specified fieldtoread elements will be ignored. The new system event attributes consist of the value of the name attribute of the table element and the value of the name attribute of the pkfield element. In the example, two new system event attributes are created, VBAP_DATES_INVERTED-ERDAT and VBAP_DATES_INVERTED-AEDAT.

You can use the regular fkpart, prefix, and postfix operations for the pkfield elements.

Example

A system event created with the above configuration could look like this:

...

<event>

<attribute type="VBAP-ABDAT">00000000</attribute>

<attribute type="VBAP-AEDAT">19970127</attribute>

<attribute type="VBAP-ERDAT">19970121</attribute>

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

<attribute type="VBAP-VBELN">0000004974</attribute>

<attribute type="VBAP_DATES_INVERTED-AEDAT">80029872</attribute>

<attribute type="VBAP_DATES_INVERTED-ERDAT">80029878</attribute>

</event>

...

You can use the class ZTableInvertDates_sap2ppm to convert an inverted date back to a normal date in SAP format.

Example

<docspec>

<doctable name="VBAP">

<pkfield name="VBELN" />

<pkfield name="POSNR" />

<pkfield name="ERDAT"/>

<pkfield name="AEDAT"/>

<pkfield name="ABDAT"/>

</doctable>

</docspec>

<table name="VBAP_DATES_INVERTED" tablename="VBAP_DATES_INVERTED" classtouse="com.idsscheer.ppm.xmlextractortools.extractor.sap2ppm.ZTableInvertDates_sap2ppm">

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

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

</table>

<table name="VBAP_DATES_INVERT_AGAIN" tablename="VBAP_DATES_INVERTED" classtouse="com.idsscheer.ppm.xmlextractortools.extractor.sap2ppm.ZTableInvertDates_sap2ppm">

<pkfield name="ERDAT" fktablename="VBAP_DATES_INVERTED" fkfieldname="ERDAT" />

<pkfield name="AEDAT" fktablename="VBAP_DATES_INVERTED" fkfieldname="AEDAT" />

<pkfield name="ABDAT" fktablename="VBAP_DATES_INVERTED" fkfieldname="ABDAT" />

</table>

Returns the following result:

...

<event>

<attribute type="VBAP-ABDAT">00000000</attribute>

<attribute type="VBAP-AEDAT">19970127</attribute>

<attribute type="VBAP-ERDAT">19970121</attribute>

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

<attribute type="VBAP-VBELN">0000004974</attribute>

<attribute type="VBAP_DATES_INVERTED-AEDAT">80029872</attribute>

<attribute type="VBAP_DATES_INVERTED-ERDAT">80029878</attribute>

<attribute type="VBAP_DATES_INVERT_AGAIN-AEDAT">19970127</attribute>

<attribute type="VBAP_DATES_INVERT_AGAIN-ERDAT">19970121</attribute>

</event>

...