Skip to Content
author's profile photo Former Member
Former Member

ABAP to XML

Hi All,

I went throught many of the threads n sdn... i have one doubt... i have to generate an Hierarchical XML from ABAP..

which has more than one node.

in this case., should i create more than one data type/structure????

XML will look something like this:

<! //First UN >

<! //3rd UN >

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 12, 2010 at 07:49 AM

    Hi,

    check the programs BCCIIXMLT1-BCCIIXMLT4. you will get some idea on the ABAP-XML and XML-ABAP conversion.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 12, 2010 at 01:26 PM

    Hi Poonam Naik,

    creation of XML from ABAP can be done through the call transformation method.

    types: begin of str,
      mystr type string,
      end of str.
      data: it_data type standard table of str,
            wa type str.
    
    "" write the 
    
    call transformation id
    source root =  wa_convert_data "having a single row of data.
    result xml   wa-mystr "output in the format .
    
    
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
    *   BIN_FILESIZE                    =
        filename                        = 'C:\test_xml'  "file location
      FILETYPE                        = 'ASC
         tables
        data_tab                        = it_data  " xml format data.

    KR,

    Lalitkumar.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi all,

      I am gettin an error while writing this transformation:

      The moment i called

      call transformation ztest

      source root = it_final

      xml sml_string.

      Nothing is happening at this point... its just coming out of the statment

      <?sap.transform simple?>

      http://www.sap.com/transformation-templates">

      <tt:root name="ROOT"/>

      <tt:template>

      <tt:loop ref=".ROOT" >

      <ORDERNR>

      <tt:value ref="ordernr"/>

      <CUSTOMER>

      <tt:value ref="customer"/>

      </CUSTOMER>

      <DESTINATION>

      <tt:value ref="destination"/>

      </DESTINATION>

      <SUPPLIER>

      <tt:value ref="supplier"/>

      </SUPPLIER>

      <BRUKARE>

      <tt:value ref="brukare"/>

      </BRUKARE>

      <SOURCE>

      <tt:value ref="source"/>

      </SOURCE>

      <ID>

      <tt:value ref="id"/>

      <TYPE>

      <tt:value ref="type"/>

      </TYPE>

      <SORTIMENT>

      <tt:value ref="sortiment"/>

      </SORTIMENT>

      <WEIGHT>

      <tt:value ref="weight"/>

      </WEIGHT>

      <VOLUME>

      <tt:value ref="volume"/>

      </VOLUME>

      <FLOORSPACE>

      <tt:value ref="floorspace"/>

      </FLOORSPACE>

      <STATUS>

      <tt:value ref="status"/>

      </STATUS>

      <WORKUNITID>

      <tt:value ref="workunitid"/>

      </WORKUNITID>

      </ID>

      <HAZMAT>

      <tt:value ref="hazmat"/>

      <UNNUM>

      <tt:value ref="unnum"/>

      </UNNUM>

      <PACKAGECODETYPE>

      <tt:value ref="packagecodetype"/>

      </PACKAGECODETYPE>

      <UNWEIGHT>

      <tt:value ref="unweight"/>

      </UNWEIGHT>

      <UNVOLUME>

      <tt:value ref="unvolue"/>

      </UNVOLUME>

      <UNQTY>

      <tt:value ref="unqty"/>

      </UNQTY>

      </HAZMAT>

      </ORDERNR>

      </tt:loop>

      </tt:template>

      </tt:transform>

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.