Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Data Interfaces and Communication Interfaces →  ABAP and XML →  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

You can specify the following preconditions 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.

You can specify a precondition 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'))", you could also write "type-C(ROOT)".


Example

The element X is not ignored in serializations only if the ABAP data object bound to ROOT1 is of type int8 and the ABAP data object bound to ROOT2 is of type dtday.

<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-INT8(ROOT1), type-DTDAY(ROOT2)">
      <X>
        ...
      </X>
    </tt:s-cond>
  </tt:template>
</tt:transform>