ABAP Keyword Documentation → ABAP - Reference → Data Interfaces and Communication Interfaces → ABAP and XML → Transformations for XML → ST - Simple Transformations → ST - Addressing ABAP Data → ST - Addressing Data Nodes
ST - Addressing Subnodes
When addressing subnodes, you must distinguish between a defined and an undefined current node.
Other versions: 7.31 | 7.40 | 7.54
Subnodes When the Current Node is Undefined
If the current node is undefined, you can address the subnodes of the data root of the template as follows:
Here, name is the symbolic name of a data root and node1, node2, ... are the actual names of components of the hierarchy levels 1, 2, ... When the transformation is executed, the ABAP data object bound to the data root must have a structured type with these components.
Note
If the current node is undefined, the first name of a chain is always interpreted as the name of a data root. In particular, name is used for the data root itself.
Subnodes When the Current Node is Defined
- The subnodes of the current node can be addressed in the following way:
- The subnodes of the data root of the template can be addressed in the following way:
When the transformation is executed, the ABAP data object bound to the current node or to the data root must have a structured type with these components.
Note
If the current node is defined, the first name of a chain is always interpreted as the name of a subcomponent of the current node. In particular, node does not stand for a data root, but for a direct subcomponent of the current node.
Example
The following ST program can be used to serialize a nested ABAP structure:
xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root name="ROOT"/>
<tt:template>
<X>
<X1>
<tt:value ref="ROOT.COL1" />
</X1>
<X2>
<tt:value ref="ROOT.COL2" />
</X2>
<X3>
<X1>
<tt:value ref="ROOT.STRUC2.COL1" />
</X1>
<X2>
<tt:value ref="ROOT.STRUC2.COL2" />
</X2>
</X3>
</X>
</tt:template>
</tt:transform>
For each tt:value command, the current node is set individually to a subnode of the data root. Otherwise the current node is undefined and you can address the data root ROOT using its name. Also see the example for calling a transformation in the tt:value, Structures section.