ABAP Keyword Documentation → ABAP - Reference → Data Interfaces and Communication Interfaces → ABAP and XML → Transformations for XML → ST - Simple Transformations → ST - Serialization and Deserialization → ST - Transformation of ABAP Values
ST - tt:copy, asXML Format
<tt:copy [ref="node"] />
Command tt:copy is used to serialize in and deserialize from the asXML format. It can be used on all data objects with the exception of reference variables or objects containing reference variables as components.
The optional attribute ref can be used to define the current node for the command. If ref is not specified, the current node of the surrounding element is used.
In serializations, the entire ABAP data object that is bound to the current node, along with all its components, is recursively transformed to asXML format and used in the XML data in place of the command.
In deserializations, the XML data stream is interpreted as asXML format and its values are passed to the ABAP data object that is bound to the current node.
In serializations of data objects using tt:copy, it is important to note that a node will not be automatically inserted for the asXML format created. To get valid XML data, the node must be explicitly specified in the template. If not, the XML data cannot be deserialized. The only exceptions are structures with a single component or internal tables with a single row. However, these do not generally have any practical use.
The following simple transformation serializes the ABAP data object that is bound to data root ROOT under the node <node> into the asXML format. If the node <node> is not specified, the transformation would not produce valid XML data and deserialization would raise an exception.
<tt:copy ref="ROOT" />
When the ABAP program from the example in section Internal Tables calls this transformation, the serialization process has the following result:
The simple transformation is symmetrical.