Skip to content

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

asXML, Mapping of Structures

This example demonstrates the mapping of structures.

Other versions: 7.31 | 7.40 | 7.54

Source Code

    DATA: BEGIN OF struct,
            num  TYPE i VALUE 20,
            dat  TYPE d VALUE '20060627',
          END OF struct,
          xmlstr TYPE xstring.

    CALL TRANSFORMATION id
                        SOURCE structure = struct
                        RESULT XML xmlstr.

    cl_demo_output=>display_xml( xmlstr ).

Description

The structure struct is mapped as a superordinate XML element for its components.