Ansicht
Dokumentation

ABENST_TT_ASSIGN - ST TT ASSIGN

ABENST_TT_ASSIGN - ST TT ASSIGN

CL_GUI_FRONTEND_SERVICES - Frontend Services   Vendor Master (General Section)  
This documentation is copyright by SAP AG.
SAP E-Book

- tt:assign, Value Assignment

tt:assign $[to-ref="node"$|to-var="variable"$]
           $[ref="node"$|val="value"$|var="variable"$] />


Effect

The statement tt:assign is used to assign a value to a data root, a variable, or a parameter.

to-ref or to-var is used to specify the target field, and ref, val, or var to specify the source field. If no target field or no source field is specified, the current node is used implicitly. Target and source fields can be:

An assignment between reference variables with tt:assign is possible only if the static type of the source variables is more specific or the same as the static type of the target variables (upcast). In all other cases, the tt:cast statement can be used to perform a downcast.

Serialization

In serializations, only variables (or parameters) are given the current value of the source field. If a data node is specified as the target field using to-ref or if the current node is specified implicitly, tt:assign is ignored in serializations.

Deserialization

In deserializations, only variables (or parameters) or directly specified values are evaluated as source fields. If a node is specified as the source field (using ref) or if the current node is specified implicitly, tt:assign is ignored in deserializations.

The following syntax can be used if the current node, or the node specified after to-ref, is an internal table:

tt:assign $[to-ref="itab"$]>
  tt:assign $[to-ref="comp"$]
             $[val="value"$|var="variable"$] />
  ...
/tt:assign>

A line is then inserted into the internal table specified. The values of the components are set using the inner statements tt:assign. This statement is ignored in serializations.

Example

The transformation below shows value assignments:

tt:transform
  xmlns:tt="http://www.sap.com/transformation-templates">
  tt:root name="ROOT"/>
  tt:variable name="VARI" val="11"/>
  tt:parameter name="PARA" val="22"/>
  tt:template>
    tt:assign to-var="VARI" var="PARA"/>
    tt:assign to-ref="ROOT" var="VARI"/>
  /tt:template>
/tt:transform>

During a deserialization, the value 22 is assigned to the ABAP data object bound to the data root ROOT.






CL_GUI_FRONTEND_SERVICES - Frontend Services   PERFORM Short Reference  
This documentation is copyright by SAP AG.

Length: 4992 Date: 20240419 Time: 180225     sap01-206 ( 27 ms )