SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Data Interfaces and Communication Interfaces → ABAP and XML → Transformations for XML → Simple Transformations → ST - Serialization and Deserialization → ST - Transformation of ABAP Values → ST - tt:value, Elementary Data Objects →Simple Transformation, tt:value
Serializes and deserializes elementary data objects
Source Code
REPORT demo_st_value.
CLASS demo DEFINITION.
PUBLIC SECTION.
CLASS-METHODS main.
ENDCLASS.
CLASS demo IMPLEMENTATION.
METHOD main.
DATA: dat TYPE d,
tim TYPE t,
time_stamp TYPE xsddatetime_z.
dat = sy-datlo.
tim = sy-timlo.
CONVERT DATE dat TIME tim INTO TIME STAMP time_stamp TIME ZONE ``.
CALL TRANSFORMATION demo_st_value
SOURCE date = dat
time = tim
datetime = time_stamp
RESULT XML data(xml).
cl_demo_output=>display_xml( xml ).
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
demo=>main( ).
Description
Note that time_stamp is defined with the special type XSDDATETIME_Z from ABAP Dictionary. This type ensures that a special mapping is used for the time stamp. The transformation in question, DEMO_ST_VALUE, shows the mapping of elementary ABAP data types for date, time, and classic time stamp to XML and back.
The transformation is symmetrical.