Ansicht
Dokumentation

ABENST_TT_READ - ST TT READ

ABENST_TT_READ - ST TT READ

ABAP Short Reference   General Material Data  
This documentation is copyright by SAP AG.
SAP E-Book

- tt:read, Read Variables

tt:read var="variable" $[type="type" $[length="len"$]
                                     $[decimals="dec"$]$]
                        $[map="..."$]
                        $[minLength$|maxLength="len"$]
                        $[xsd-type...$] />


Effect

The statement tt:read makes it possible to read a value of the inbound XML stream into a variable or a parameter:

variable is used to specify the variable or a parameter into which the value is read. The same applies to the attributes map, minLength, and maxLength plus xsd-type as to the statement tt:value (however tt:read always ignores minLength).

The other attributes are used to specify the expected type. In the statement tt:read, only elementary ABAP types can be specified, which can partly be generic. The syntax of this is the same as for the statement tt:type. The value read must match the specified type and the value must be in the corresponding ABAP value range. Otherwise an exception is raised

Serialization

The statement tt:read is ignored in serializations.

Deserialization

If no type conflict occurs, the variable or parameter is set to the value of the current position in the input stream, optionally according to the mapping list behind map. Depending on the type of the variable or parameter, a mapping takes place in accordance with the asXML format.

Example

Deserialization of a value into a variable.

tt:transform
  xmlns:tt="http://www.sap.com/transformation-templates">
  tt:root name="ROOT"/>
  tt:variable name="VARI"/>
  tt:template>
    X
      tt:read var="VARI" type="I" />
    /X>
    tt:assign to-ref="ROOT" var="VARI"/>
  /tt:template>
/tt:transform>

If the read XML fragment is X333/X>, the data object bound to the data root ROOT has the value 333 after deserialization due to the assignment using tt:assign.






Vendor Master (General Section)   PERFORM Short Reference  
This documentation is copyright by SAP AG.

Length: 4454 Date: 20240508 Time: 222758     sap01-206 ( 53 ms )