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 - using, Preconditions

Other versions: 7.31 | 7.40 | 7.54

Syntax


... using="..." ...

Effect

The following preconditions can be specified for the content of the attribute using of an element tt:cond:

Precondition Meaning
exist(node) Met if an ABAP data object is bound to the node
type-...(node) Met if an ABAP data object of type ... is bound to the node

Each predefined ABAP type has a precondition type-... where the data type is specified in uppercase letters (see examples). The operand node can be a data node, which must be specified in a special form.

A single precondition can be specified as a list of several of the above preconditions, separated by commas. Such a precondition is met if all preconditions in the list are met. Within the list, every data node may appear only once.


Example

The element X is considered during serialization only if the ABAP data object bound to ROOT is of type c.

<tt:transform
  xmlns:tt="http://www.sap.com/transformation-templates">
  <tt:root name="ROOT"/>
  <tt:template>
    <tt:s-cond using="type-C(ref('ROOT'))">
      <X>
        ...
      </X>
    </tt:s-cond>
  </tt:template>
</tt:transform>

Instead of "type-C(ref('ROOT'))", "type-C(ROOT)" is of course also possible here.


Example

The element X is respected by serializations only if the ABAP data object bound to ROOT1 is of type i and the ABAP data object bound to ROOT2 is of type d.

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