sapdev logo background
sapdev logo sapdev logo
Comments

SAP ST TT SERIALIZE DESERIALIZE documentation, setup help and example usage



Return to SAP documentation index


ARTICLE

ST - tt:serialize , tt:deserialize , Transformation Direction

Syntax
<(><<)>tt:serialize>
...
<(><<)>/tt:serialize>

<(><<)>tt:deserialize>
...
/tt:deserialize

Effect
You can use these ST commands to limit parts of templates for execution during serialization or deserialization:
All the template elements listed within the tt:serialize element are only considered during serialization. All the template elements listed within the tt:deserialize element are only considered during deserialization.

Example
The following Simple Transformation serializes a structure and deserializes to an internal table:
<(><<)>tt:transform
xmlns:tt="http://www.sap.com/transformation-templates">
tt:root name="ROOT1"/
tt:root name="ROOT2"/
<(><<)>tt:template>
<(><<)>X>
<(><<)>tt:serialize>
<(><<)>Y>
tt:value ref=".ROOT1.COL1" /
<(><<)>/Y>
<(><<)>Y>
tt:value ref=".ROOT1.COL2" /
<(><<)>/Y>
<(><<)>Y>
tt:value ref=".ROOT1.COL3" /
<(><<)>/Y>
<(><<)>/tt:serialize>
<(><<)>tt:deserialize>
<(><<)>tt:loop ref=".ROOT2">
<(><<)>Y>
tt:value/
<(><<)>/Y>
<(><<)>/tt:loop>
<(><<)>/tt:deserialize>
<(><<)>/X>
<(><<)>/tt:template>
/tt:transform
The following ABAP program can call the transformation:
DATA xml_string TYPE string.

DATA: BEGIN OF struc,
col1 TYPE i VALUE 1,
col2 TYPE i VALUE 2,
col3 TYPE i VALUE 3,
END OF struc.

DATA itab TYPE TABLE OF i.

CALL TRANSFORMATION ...
SOURCE root1 = struc
RESULT XML xml_string.

CALL TRANSFORMATION ...
SOURCE XML xml_string
RESULT root2 = itab.
After deserialization, the internal table contains three rows with the values of the structure components.
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




ST_TT_ROOT
ST_TT_SKIP




comments powered by Disqus