Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

I need info about CL_XML_DOCUMENT

Former Member
0 Kudos

Hi to all,

I need info about the class CL_XML_DOCUMENT and his methods.

I only have seen information of a few methods.

Where can I find more information and examples of use about this class?

3 REPLIES 3

uwe_schieferstein
Active Contributor
0 Kudos

Hello Kata

You may have a look at package SIXML and its sub-packages for sample reports using class CL_XML_DOCUMENT.

Regards

Uwe

Former Member

uwe_schieferstein
Active Contributor
0 Kudos

Hello Kata

Following is a sample coding to display an IDoc as XML:



DATA:
  ld_rc                 TYPE i,
  ld_xmldata        TYPE string,
  lo_idoc_xml1     TYPE REF TO cl_idoc_xml1,
  lo_doc              TYPE REF TO cl_xml_document.


  CREATE OBJECT lo_idoc_xml1
    EXPORTING
      docnum = <number of IDoc>.

      CALL METHOD lo_idoc_xml1->get_xmldata_as_string
        IMPORTING
          data_string = ld_xmldata.


      CREATE OBJECT lo_doc.

      " Parse XML string
      CALL METHOD lo_doc->parse_string
        EXPORTING
          stream  = ld_xmldata
        receiving
          retcode = ld_rc.

      lo_doc->display( ).  " Display IDoc-XML

Regards,

Uwe