Skip to Content
Author's profile photo Robert Eijpe

XML DOM Processing in ABAP part I – Convert an ABAP table into XML file using SAP DOM Approach.

h4. Introduction    With NetWeaver 04 SAP introduced simple transformations, a new way of converting XML directly into ABAP tables, structures and fields. Tobias Trapp (/people/tobias.trapp/blog) wrote 5 weblogs about this topic with the title XML processing in ABAP. However the success of these great weblogs, you must have at least a SAP WAS 6.40 environment and you have to learn the Simple Transformation Language. At first another solution was introduced by SAP into the SAP kernel of version 4.6D. This implementation is called the iXML package and could be accessed using and ABAP Object class CL_IXML and about 40 ABAP Object interfaces IF_IXML*. In this weblog I will focus on the possibilities of SAP XML Document Object Model (DOM) processing at the ABAP stack. My objective is to explain how you can use it in abap mapping. For this I split this weblog into three parts. This first part will focus on the conversion of an abap table into an xml file. The second part  (/pub/wlg/2702) will deal with the use of SAP DOM within XI abap mapping, introduced with SAP XI 3.0.      h4. The XML    In this weblog part we will create an xml file on the user’s computer based on data from an SAP system. First we will fill an internal table with SAP data.      image  Next we will create a document object using an iXML factory. This document can be filled with the data of the internal table. The document object can be represented as a tree structure, the so called Document Object Model or SAP DOM..     image     After filling the document object, we will transfer it into a XML stream. This stream is the binary version of the XML file and can be represented as a string, an xstring or a table with binary fields.     image

Assigned Tags

      9 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Hi Robert,

      Very nice blog. The content in your blog would be very useful. Can you pls give me a scenario where this method would be useful.

      Thanks & Regards,
      Ravikiran.

      Author's profile photo Former Member
      Former Member
      Hi All,

      I good scenario could be WAS 6.20 accesing a web service that needs to be feed with xml.

      hope it helps,

      David R.

      Author's profile photo Arshad Ismail
      Arshad Ismail
      A good blog. It clearly explains the transformation of ABAP data into a XML stream using the iXML factory.
      Author's profile photo Former Member
      Former Member
      Hello, very good blog.
      Can you explain the error "no DTD specified, can't validate"
      Thanks a lot.
      Author's profile photo Sreekanth Gollamudi
      Sreekanth Gollamudi
      When i am trying to download the file into Application server, values are truncated.. specially last value is truncated.

      Ex: sreekanth

      Here last characters 'e>' is truncated...

      If i increase the size of DATA(256) TYPE X in XML_LINE types... it is not changing.

      Please let me know if you have any solution for the same.

      Thanks in advance.

      Best Regards,
      Sreekanth

      Author's profile photo Former Member
      Former Member
      It is a wonderful blog . Explaination is fantastic.

      It would be helpful in lot of integration scenarios.

      Thanks & Regards,
      Kavan Shah

      Author's profile photo Former Member
      Former Member

      Hi,

      Author's profile photo Anand Patil
      Anand Patil
      Thanks for the details. It was a good exercise for me.
      Author's profile photo Vinod Mathew Thomas
      Vinod Mathew Thomas
      Awesome blog and wonderful illustration with examples. Thanks for sharing.