Preconditions 
For the content precond of attribute using of an element tt:cond, you can specify the following preconditions. The operand of the precondition can be a data node specified in the form dnode.
Precondition |
Meaning |
|---|---|
exist(dnode) |
Met if an ABAP data object is bound to the node |
type-C(dnode) |
Met if an ABAP data object of type c is bound to the node |
type-D(dnode) |
Met if an ABAP data object of type d is bound to the node |
type-F(dnode) |
Met if an ABAP data object of type f is bound to the node |
type-I(dnode) |
Met if an ABAP data object of type i is bound to the node |
type-N(dnode) |
Met if an ABAP data object of type n is bound to the node |
type-P(dnode) |
Met if an ABAP data object of type p is bound to the node |
type-T(dnode) |
Met if an ABAP data object of type t is bound to the node |
type-X(dnode) |
Met if an ABAP data object of type x is bound to the node |
The element X is considered during serialization only if the ABAP data object bound to ROOT is of type c.
Syntax
<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)".
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.
The element X is considered during serialization only if the ABAP data object bound to ROOT1 is of type i and the ABAP data object bound to ROOT2 is of type f.
Syntax
<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-F(ROOT2)">
<X>
...
</X>
</tt:s-cond>
</tt:template>
</tt:transform>