Skip to Content
0
Former Member
Aug 27, 2010 at 01:39 PM

Optional attributes in XML to ABAP transformation

1479 Views

Hi,

I have to deserialize (transformation xml to abap) an xml input file.

I want to use SAP ST (Simple Transformations).

This xml format is using attributes

Such attributes can be transformed in ST with

<tt:attribute name="item_id" value-ref="MATNR"/>

I realized 2 problems:

1. If the xml file does not contain every attribute which is in the transformation.

This can be solved by tt:cond

Sample

<tt:cond>

<tt:attribute name="uom" value-ref="BASE_UOM"/>

</tt:cond>

Now attribute uom is optional. Without the tt:cond the ST prragrom would throw exception if it is not in the file.

2. If the xml file contains an attribute which is not used in the transformation.

I tried to use tt:skip but it is not working for "<tt:attribute name= ... value-ref=... name" but only for "<tt:value-ref=...".

I only want to get the values I need out of the parameter list.

How can I achieve this without defining a transformation for every parameter in the xml file?

Thanks and regards

Michael