SAP ST TT VALUE STRUCTURE
Get Example source ABAP code based on a different SAP table
ABAP_ST -
ABAP_SYNTAX
$[length$|minLength$|maxLength='len'$]
$[xsd-type...$] />>
What does it do?
The serialization and deserialization of structures results directly from the
ABAP_EXAMPLES
The three ST programs from the sections
can transform a nested ABAP structure
col1(10) TYPE c VALUE 'ABCDEFGHIJ',
col2 TYPE i VALUE 111,
BEGIN OF struc2,
col1 TYPE d VALUE '20040126',
col2 TYPE t VALUE '084000',
END OF struc2,
END OF struc1.
DATA: xml_string TYPE string,
result LIKE struc1.
TRY.
CALL TRANSFORMATION ...
SOURCE root = struc1
RESULT XML xml_string.
cl_abap_browser=>show_xml( EXPORTING xml_string = xml_string ).
CALL TRANSFORMATION ...
SOURCE XML xml_string
RESULT root = result.
IF struc1 <> result.
MESSAGE 'Deserialization <> Serialization' TYPE 'I'.
ENDIF.
CATCH cx_st_error.
...
ENDTRY.>
The result of the serialization is the same XML data for all three Simple Transformations:
< X1>ABCDEFGHIJ < /X1>
< X2>111 < /X2>
< X3>
< X1>2004-01-26 < /X1>
< X2>08:40:00 < /X2>
< /X3>
< /X>>
ABAP_EXAMPLE_END