SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Data Interfaces and Communication Interfaces → ABAP and XML → Transformations for XML → Simple Transformations → ST - Serialization and Deserialization → ST - Reading and Writing Variables →ST - tt:read-write, Read or Write Variables
Syntax
<tt:read-write var="variable" [type="type" [length="len"]
[decimals="dec"]]
[map="..."]
[minLength|maxLength="len"]
[xsd-type...] />
Effect
The command tt:read-write is a short form of the following two statements:
Specifying tt:read-write has the same effect as the statements tt:read and tt:read specified one directly after the other.
The attribute type and the attributes length and decimals specified using this attribute are used by tt:read only. As with tt:read, the attribute length can only be specified together with type.
Example
Serialization and Deserialization Using a Variable In serializations, the variable VARI is assigned the values of the data object bound to ROOT and is written to XML using read-write. In deserializations, the value of the variable is read from XML and assigned to the data object bound to ROOT.
The following ABAP program can call the transformation:
The result of the serialization is:
The transformation is not symmetrical, due to minLength. After deserialization, the string str has at least 10 positions.