Example of attribute transformation

Importing source system data has generated the following entry in the XML output file:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE eventlist SYSTEM "event.dtd">

<eventlist>

<event>

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

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

<attribute type="VBAP-ERNAM">SCHMIDT</attribute>

<attribute type="VBAP-MATNR-MAKTX">100038</attribute>

<attribute type="VBAP-KWMENG">3</attribute>

</event>

</eventlist>

You want to link the value of the VBAP-ERNAMattribute type with a constant string and write it to the new Order item recorded by attribute type. In addition, you want to create the Note on order recording attribute type, which extracts the first name and last name from the VBAP-ERNAM attribute type and creates the following string:


<First name>< ><Last name>< has recorded the item ><VBAP-POSNR>< of the order ><VBAP-VBELN>< .>


The information in angle brackets represents attribute values that are extracted or transformed from existing attribute types or constants. You can specify the necessary information in the XML attribute transformation file:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE attributecalculation SYSTEM

"attributetransformation.dtd">

<attributecalculation>

<calculateattribute type="Order item recorded by">

<operation name="concat">

<constant>Walter, "A" </constant>

<valueof>VBAP-ERNAM</valueof>

</operation>

</calculateattribute>

<calculateattribute type="Note on order recording">

<operation name="concat">

<operation name="substring">

<valueof>Order item recorded by</valueof>

<constant>1</constant>

<constant>6</constant>

</operation>

<constant> </constant>

<operation name="substring">

<valueof>Order item recorded by</valueof>

<constant>-1</constant>

<constant>7</constant>

</operation>

<constant> recorded item</constant>

<valueof>VBAP-POSNR</valueof>

<constant> in order </constant>

<valueof>VBAP-VBELN</valueof>

<constant>.</constant>

</operation>

</calculateattribute>

</attributecalculation>

When you call up the relevant command line program again, this time with the -calcconfig <XML attribute transformation file> parameter, the following XML output file is generated:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE eventlist SYSTEM "event.dtd">

<eventlist>

<event>

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

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

<attribute type="VBAP-ERNAM">SCHMIDT</attribute>

<attribute type="Order item recorded by">

Walter, "A" SCHMIDT

</attribute>

<attribute type="VBAP-MATNR-MAKTX">100038</attribute>

<attribute type="VBAP-KWMENG">3</attribute>

<attribute type="Note on order recording">

Walter SCHMIDT recorded item 20 in order 3866.

</attribute>

</event>

</eventlist>