Ansicht
Dokumentation
ABENST_TT_COPY - ST TT COPY
CL_GUI_FRONTEND_SERVICES - Frontend Services RFUMSV00 - Advance Return for Tax on Sales/PurchasesThis documentation is copyright by SAP AG.
- tt:copy, asXML Format
tt:copy $[ref="node"$] />
Effect
Statement tt:copy is used to serialize in and deserialize from the asXML format. It can be used on all data objects with the exception of reference variables or objects containing reference variables as components.
The optional attribute ref can be used to define the current node for the statement. If ref is not specified, the current node of the surrounding element is used implicitly.
Serialization
In serializations, the entire ABAP data object that is bound to the current node is recursively transformed with all its components to asXML format and inserted into the XML data in place of the statement.
Deserialization
In deserializations, the XML data stream is interpreted as asXML format and its values are passed to the ABAP data object that is bound to the current node.
Note
In serializations of data objects using tt:copy, it is important to note that a node will not be automatically inserted for the asXML format created. To get valid XML data, the node must be explicitly specified in the template. If not, the XML data cannot be deserialized. The only exceptions are structures with a single component or internal tables with a single line. However, these do not generally have any practical use.
Example
The following Simple Transformation serializes the ABAP data object that is bound to data root ROOT under the node node> into the asXML format. If the node node> is not specified, the transformation would not produce valid XML data and deserialization would raise an exception.
tt:transform
xmlns:tt="http://www.sap.com/transformation-templates">
tt:root name="ROOT"/>
tt:template>
node>
tt:copy ref="ROOT" />
/node>
/tt:template>
/tt:transform>
When the ABAP program from the example in section Internal Tables calls this transformation, the serialization process has the following result:
node>
item>
KEY>2/KEY>
VALUES>
item>4/item>
item>8/item>
item>16/item>
/VALUES>
/item>
item>
KEY>3/KEY>
VALUES>
item>9/item>
item>27/item>
item>81/item>
/VALUES>
/item>
item>
KEY>4/KEY>
VALUES>
item>16/item>
item>64/item>
item>256/item>
/VALUES>
/item>
/node>
The Simple Transformation is symmetrical.
Fill RESBD Structure from EBP Component Structure SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up
This documentation is copyright by SAP AG.
Length: 4455 Date: 20240418 Time: 175348 sap01-206 ( 59 ms )