Ansicht
Dokumentation

ABENST_TT_COND-VAR - ST TT COND-VAR

ABENST_TT_COND-VAR - ST TT COND-VAR

TXBHW - Original Tax Base Amount in Local Currency   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

- tt:cond-var, Condition for Variables

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


Effect

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 depending on 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.

Note

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

Example

The following transformation demonstrates a condition for a parameter:

tt:transform
  xmlns:tt="http://www.sap.com/transformation-templates">
  tt:root name="ROOT"/>
  tt:template>
    tt:apply name="SUB">
      tt:with-parameter name="PARA" ref="ROOT"/>
    /tt:apply>
  /tt:template>
  tt:template name="SUB">
    tt:context>
      tt:parameter name="PARA"/>
    /tt:context>
    tt:cond-var check="PARA100">
      X val="small">.../X>
    /tt:cond-var>
    tt:cond-var check="PARA>=100">
      X val="big">.../X>
    /tt:cond-var>
  /tt:template>
/tt:transform>

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>

or

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

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






CL_GUI_FRONTEND_SERVICES - Frontend Services   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

Length: 4506 Date: 20240420 Time: 050604     sap01-206 ( 41 ms )