Pode usar a classe com.idsscheer.ppm.xmlextractortools.extractor. sap2ppm.ZTableInvertDates_sap2ppm para criar novos atributos de evento do sistema, com datas invertidas, quando extrair dados de um sistema SAP. Os valores de atributos de data já extraídos serão invertidos. Uma data invertida é calculada extraindo o valor da data no formato SAP, por exemplo, 20110529 para 29 de julho de 2011, a partir de 99999999. Os novos eventos de sistema criados podem ser referenciados em outras configurações da tabela de dados (elemento XML table).
Exemplo
<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>
Se estiver a usar a classe ZTableInvertDates_sap2ppm, não precisa de especificar um elemento fieldtoread. Qualquer elemento fieldtoread especificado será ignorado. Os novos atributos de evento do sistema consistem no valor do atributo name do elemento table e no valor do atributo name do elemento pkfield. No exemplo, são criados dois novos atributos de evento do sistema, VBAP_DATES_INVERTED-ERDAT e VBAP_DATES_INVERTED-AEDAT.
Pode usar as operações normais fkpart, prefix e postfix para os elementos pkfield.
Exemplo
Um evento de sistema criado com a configuração acima poderia ter a seguinte aparência:
...
<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>
...
Pode usar a classe ZTableInvertDates_sap2ppm para converter uma data invertida para uma data normal em formato SAP.
Exemplo
<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>
Retorna o resultado seguinte:
...
<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>
...