Show TOC

Syntax documentationInitialization Locate this document in the navigation structure

You can use the statement tt:clear to initialize a data root, a variable, or a parameter:

<tt:clear [ref="node"|var="variable"] />

You use ref or var to specify the field that you want to initialize. If no field is specified, the current node is used implicitly. The following fields are possible:

Serialization

During serialization, only variables (or parameters) are initialized. If a node is specified with ref or if the current node is specified implicitly, tt:clear has no effect during serialization.

Deserialization

During deserialization, the specified nodes or variables (or parameters) are initialized.

Example

The transformation below shows an initialization:

Syntax Syntax

  1. <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
  2.   <tt:root name="ROOT"/>
  3.   <tt:template>
  4.     <tt:ref name="ROOT">
  5.       <X>
  6.         <tt:value/>
  7.       </X>
  8.       <tt:clear/>
  9.     </tt:ref>
  10.   </tt:template>
  11. </tt:transform>
End of the code.

During deserialization, the initial value is assigned to the ABAP data object bound to the data root ROOT.