Ansicht
Dokumentation

ABENST_SYMMETRY - ST SYMMETRY

ABENST_SYMMETRY - ST SYMMETRY

PERFORM Short Reference   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.
SAP E-Book

- Symmetry of Serialization and Deserialization

The language constructs of Simple Transformations support the formulation of reversible transformations, that is, of programs that provide the original values in the execution order serialization - deserialization (or vice versa). However, it is also possible to write programs that cannot be reversed.

Example

This simple example illustrates a non-symmetrical transformation. Since the tt.value statements are not enclosed in separate elements, the serialized values of ROOT1 and ROOT2 are grouped in X.

tt:transform
  xmlns:tt="http://www.sap.com/transformation-templates">
  tt:root name="ROOT1"/>
  tt:root name="ROOT2"/>
  tt:template>
    X
      tt:value ref="ROOT1"/>
      tt:value ref="ROOT2"/>
    /X>
  /tt:template>
/tt:transform>

The following ABAP program can call the transformation:

DATA xml_string TYPE string.
DATA field1 TYPE string VALUE 'Hello'.
DATA field2 TYPE string VALUE ' World!'.

DATA result1 like field1.
DATA result2 like field2.

CALL TRANSFORMATION ...
  SOURCE root1 = field1
         root2 = field2
  RESULT XML xml_string.

CALL TRANSFORMATION ...
  SOURCE XML xml_string
  RESULT root1 = result1
         root2 = result2.

The result of the serialization is:

XHello World!/X>

Accordingly, the result of the deserialization to result1 is "Hello World!", while result2 retains its initial value, which is different from the original content of field1 and field2.

For a symmetrical transformation, the tt:value statements each have to appear in separate elements, or they must be separated by a unique text (which cannot appear in the first value).






Vendor Master (General Section)   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Length: 2919 Date: 20240328 Time: 150806     sap01-206 ( 37 ms )