SAP ST TT READ



Get Example source ABAP code based on a different SAP table
  


• read ABAP_ST_ELEMENT

ABAP_ST - tt:read, Read Variables

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

What does it do?
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.

ABAP_EXAMPLE_VX5
Deserialization of a value into a variable is shown in the following transformation DEMO_ST_READ.
TRNS DEMO_ST_READ
If the read XML fragment is < X > 333 < /X>, the data object bound to the data root ROOT has the value 333 after deserialization due to the assignment using tt:assign.
ABAP_EXAMPLE_END