Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Data Interfaces and Communication Interfaces →  ABAP and XML →  asXML - Canonical XML Representation →  asXML, Examples of Mappings 

asXML, Mapping of Elementary Data Types

The example demonstrates the mapping of elementary data types.

Other versions: 7.31 | 7.40 | 7.54

Source Code

    DATA: num    TYPE i VALUE 20,
          dat    TYPE d VALUE '20060627',
          xmlstr TYPE xstring.

    CALL TRANSFORMATION id
                        SOURCE number = num
                               date   = dat
                        RESULT XML xmlstr.

    cl_abap_browser=>show_xml( xml_xstring = xmlstr ).

Description

In the CALL TRANSFORMATION statement, the data objects num and dat are bound to the XML elements number and date. The values subelement contains these elements. The text content of these elements is determined by mapping the bound elementary ABAP data objects.