Start of Content Area

Syntax documentation Data Objects and All Their Components  Locate the document in its SAP Library structure

The following ST command can be used to serialize and de-serialize any data objects, aside from reference variables or objects that have reference variables as components:

 

<tt:copy [ref="node"] />

 

The optional attribute ref can be used to define the current node for the command. If refis not specified, the current node of the surrounding element is used.

This command uses the asXML format, which is the canonical XML representation of ABAP data that is generated as an interim step during serialization through XSL transformations. This format is described in the ABAP keyword documentation under command CALL TRANSFORMATION.

 

Serialization

During the serialization process, 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 document in place of the command.

Deserialization

During the deserialization process, the XML data stream is interpreted as asXML format and its values are passed on to the ABAP data object that is bound to the current node.

 

Example

The following simple transformation serializes the ABAP data object that is bound to data root ROOT into asXML format.

 

<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">

  <tt:root name="ROOT"/>

  <tt:template>
    <tt:copy  ref="ROOT" />
  </tt:template>

</tt:transform>

 

When the ABAP program from the example in section Internal Tables calls this transformation, the serialization process has the following result:

 

<item>
  <KEY>2</KEY>
  <VALUES>
    <item>4</item>
    <item>8</item>
    <item>16</item>
  </VALUES>
</item>
<item>
  <KEY>3</KEY>
  <VALUES>
    <item>9</item>
    <item>27</item>
    <item>81</item>
  </VALUES>
</item>
<item>
  <KEY>4</KEY>
  <VALUES>
    <item>16</item>
    <item>64</item>
    <item>256</item>
  </VALUES>
</item>

 

The simple transformation is symmetrical.

 

 

End of Content Area