Ansicht
Dokumentation

ABENST_TT_SERIALIZE_DESERIALIZE - ST TT SERIALIZE DESERIALIZE

ABENST_TT_SERIALIZE_DESERIALIZE - ST TT SERIALIZE DESERIALIZE

TXBHW - Original Tax Base Amount in Local Currency   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.
SAP E-Book

- tt:serialize, tt:deserialize, Transformation Direction

tt:serialize>
  ...
/tt:serialize>

tt:deserialize>
  ...
/tt:deserialize>


Effect

These ST statements can be used to limit parts of templates for execution in serializations or deserializations:

All template elements specified within the tt:serialize element are only respected in serializations. All the template elements specified within the tt:deserialize element are only respected in deserializations.

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 lines with the values of the structure components.






RFUMSV00 - Advance Return for Tax on Sales/Purchases   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 3583 Date: 20240426 Time: 182226     sap01-206 ( 29 ms )