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 - Flow Control with Variables 

ST - tt:cond-var, Condition for Variables

Other versions: 7.31 | 7.40 | 7.54


<tt:cond-var check="..."> 


The statement tt:cond-var allows conditional transformations for which, unlike tt:[s-|d-]cond, only data content can be specified and not conditions for the data flow. The content of tt:cond-var is processed in accordance with a check condition. cond is the same as general conditions, with the exception that variables and values can be specified as operands, but not data nodes.

Outside of tt:switch-var, a condition check must be specified.

Serialization and Deserialization

In serializations and deserializations, the condition is checked and the content of the element tt:cond-var is only processed if the condition is met.


Unlike general conditional transformations with tt:[s-|d-]cond, the content of the XML input stream for tt:cond-var is irrelevant.


The following transformation demonstrates a condition for a parameter:

  <tt:root name="ROOT"/>
    <tt:apply name="SUB">
      <tt:with-parameter name="PARA" ref="ROOT"/>
  <tt:template name="SUB">
      <tt:parameter name="PARA"/>
    <tt:cond-var check="PARA<100">
      <X val="small">...</X>
    <tt:cond-var check="PARA>=100">
      <X val="big">...</X>

In tt:apply, the value of the data root ROOT is passed to the parameter PARA of the subtemplate SUB and checked there. Depending on whether the ABAP data object bound to ROOT is smaller, greater than, or equal to 100, the serialization creates either of the following:

<X val="small">...</X>


<X val="big">...</X>

is created. var(PARA) could be written in the conditions check instead of PARA.