Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Data Interfaces and Communication Interfaces →  ABAP and XML →  Transformations for XML →  ST - Simple Transformations →  ST - Serialization and Deserialization →  ST - Flow Control →  ST - tt:cond, Conditional Transformations 

ST - data, Assertions

Other versions: 7.31 | 7.40 | 7.54

Syntax


... data="..." ...

Effect

The following assertions can be specified for the content of the attribute data of an element tt:cond:

Assertion Meaning
initial(node) Met if the bound ABAP data object is initial
initial(var(variable)) Met if the variable is initial.
dnode var(variable) = value, value = dnode

The operands of the assertions can be data nodes, variables, or values.

  • Variables are specified in the form var(variable), where variable is a variable or a parameter.

An assertion can be specified as a list of more than one of the above assertions, separated by commas. An assertion of this type is met if all assertions in the list are met. Within the list, every data node may appear only once.


Example

The element X is respected in serializations only if the ABAP data object bound to ROOT is 11.

<tt:transform
  xmlns:tt="http://www.sap.com/transformation-templates">
  <tt:root name="ROOT"/>
  <tt:template>
    <tt:s-cond data="ROOT=11">
      <X>
        <tt:value ref="ROOT" />
      </X>
    </tt:s-cond>
  </tt:template>
</tt:transform>

The element X is respected in serializations only if the value of the ABAP data object bound to ROOT1 is initial and the value of the ABAP data object bound to ROOT2 is 22.

<tt:transform
  xmlns:tt="http://www.sap.com/transformation-templates">
  <tt:root name="ROOT1"/>
  <tt:root name="ROOT2"/>
  <tt:template>
    <tt:s-cond data="initial(ROOT1),ROOT2=22">
      <X>
        ...
      </X>
    </tt:s-cond>
  </tt:template>
</tt:transform>