<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: problem converting data in XML file to internal table data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232859#M1209491</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope the below link help you out....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&amp;amp;query=xml" target="test_blank"&gt;https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&amp;amp;query=xml&lt;/A&gt;&lt;EM&gt;file&lt;/EM&gt;into&lt;EM&gt;internal&lt;/EM&gt;table+++++&amp;amp;adv=false&amp;amp;sortby=cm_rnd_rankvalue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="6852740"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pooja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Feb 2009 07:55:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-13T07:55:05Z</dc:date>
    <item>
      <title>problem converting data in XML file to internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232858#M1209490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement. I need to convert an XML file to internal table data and based on that data do Goods Receipt in SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the help of this blog /people/r.eijpe/blog/2005/11/10/xml-dom-processing-in-abap-part-i--convert-an-abap-table-into-xml-file-using-sap-dom-approach&lt;/P&gt;&lt;P&gt;I am able to convert the XML file to data in SAP. But this blog will display the output on screen as ELELEMNT = nodename VALUE= value of that node.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I donu2019t want in that way, I want to store all the data in XML file in an internal table so that I can make use of those values and do Goods Recipt in SAP.&lt;/P&gt;&lt;P&gt;Can some one suggest how should I read the data in an internal table.&lt;/P&gt;&lt;P&gt; Here is my code..what changes should I make?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  z_xit_xml_check&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  REPORT  z_xit_xml_check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  TYPE-POOLS: ixml.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  TYPES: BEGIN OF t_xml_line,&lt;/P&gt;&lt;P&gt;          data(256) TYPE x,&lt;/P&gt;&lt;P&gt;        END OF t_xml_line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: l_ixml            TYPE REF TO if_ixml,&lt;/P&gt;&lt;P&gt;        l_streamfactory   TYPE REF TO if_ixml_stream_factory,&lt;/P&gt;&lt;P&gt;        l_parser          TYPE REF TO if_ixml_parser,&lt;/P&gt;&lt;P&gt;        l_istream         TYPE REF TO if_ixml_istream,&lt;/P&gt;&lt;P&gt;        l_document        TYPE REF TO if_ixml_document,&lt;/P&gt;&lt;P&gt;        l_node            TYPE REF TO if_ixml_node,&lt;/P&gt;&lt;P&gt;        l_xmldata         TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: l_elem            TYPE REF TO if_ixml_element,&lt;/P&gt;&lt;P&gt;        l_root_node       TYPE REF TO if_ixml_node,&lt;/P&gt;&lt;P&gt;        l_next_node       TYPE REF TO if_ixml_node,&lt;/P&gt;&lt;P&gt;        l_name            TYPE string,&lt;/P&gt;&lt;P&gt;        l_iterator        TYPE REF TO if_ixml_node_iterator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: l_xml_table       TYPE TABLE OF t_xml_line,&lt;/P&gt;&lt;P&gt;        l_xml_line        TYPE t_xml_line,&lt;/P&gt;&lt;P&gt;        l_xml_table_size  TYPE i.&lt;/P&gt;&lt;P&gt;  DATA: l_filename        TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PARAMETERS: pa_file TYPE char1024 DEFAULT 'c:\temp\orders_dtd.xml'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Validation of XML file: Only DTD included in xml document is supported&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  PARAMETERS: pa_val  TYPE char1 AS CHECKBOX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Creating the main iXML factory&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    l_ixml = cl_ixml=&amp;gt;create( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Creating a stream factory&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    l_streamfactory = l_ixml-&amp;gt;create_stream_factory( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM get_xml_table CHANGING l_xml_table_size l_xml_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  wrap the table containing the file into a stream&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    l_istream = l_streamfactory-&amp;gt;create_istream_itable( table = l_xml_table&lt;/P&gt;&lt;P&gt;                                                    size  = l_xml_table_size ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Creating a document&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    l_document = l_ixml-&amp;gt;create_document( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create a Parser&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    l_parser = l_ixml-&amp;gt;create_parser( stream_factory = l_streamfactory&lt;/P&gt;&lt;P&gt;                                      istream        = l_istream&lt;/P&gt;&lt;P&gt;                                      document       = l_document ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Validate a document&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF pa_val EQ 'X'.&lt;/P&gt;&lt;P&gt;      l_parser-&amp;gt;set_validating( mode = if_ixml_parser=&amp;gt;co_validate ).&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Parse the stream&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF l_parser-&amp;gt;parse( ) NE 0.&lt;/P&gt;&lt;P&gt;      IF l_parser-&amp;gt;num_errors( ) NE 0.&lt;/P&gt;&lt;P&gt;        DATA: parseerror TYPE REF TO if_ixml_parse_error,&lt;/P&gt;&lt;P&gt;              str        TYPE string,&lt;/P&gt;&lt;P&gt;              i          TYPE i,&lt;/P&gt;&lt;P&gt;              count      TYPE i,&lt;/P&gt;&lt;P&gt;              index      TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        count = l_parser-&amp;gt;num_errors( ).&lt;/P&gt;&lt;P&gt;        WRITE: count, ' parse errors have occured:'.&lt;/P&gt;&lt;P&gt;        index = 0.&lt;/P&gt;&lt;P&gt;        WHILE index &amp;lt; count.&lt;/P&gt;&lt;P&gt;          parseerror = l_parser-&amp;gt;get_error( index = index ).&lt;/P&gt;&lt;P&gt;          i = parseerror-&amp;gt;get_line( ).&lt;/P&gt;&lt;P&gt;          WRITE: 'line: ', i.&lt;/P&gt;&lt;P&gt;          i = parseerror-&amp;gt;get_column( ).&lt;/P&gt;&lt;P&gt;          WRITE: 'column: ', i.&lt;/P&gt;&lt;P&gt;          str = parseerror-&amp;gt;get_reason( ).&lt;/P&gt;&lt;P&gt;          WRITE: str.&lt;/P&gt;&lt;P&gt;          index = index + 1.&lt;/P&gt;&lt;P&gt;        ENDWHILE.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Process the document&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF l_parser-&amp;gt;is_dom_generating( ) EQ 'X'.&lt;/P&gt;&lt;P&gt;      PERFORM process_dom USING l_document.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  get_xml_table&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  FORM get_xml_table CHANGING l_xml_table_size TYPE i&lt;/P&gt;&lt;P&gt;                              l_xml_table      TYPE STANDARD TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Local variable declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_len      TYPE i,&lt;/P&gt;&lt;P&gt;          l_len2     TYPE i,&lt;/P&gt;&lt;P&gt;          l_tab      TYPE tsfixml,&lt;/P&gt;&lt;P&gt;          l_content  TYPE string,&lt;/P&gt;&lt;P&gt;          l_str1     TYPE string,&lt;/P&gt;&lt;P&gt;          c_conv     TYPE REF TO cl_abap_conv_in_ce,&lt;/P&gt;&lt;P&gt;          l_itab     TYPE TABLE OF string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_filename = pa_file.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  upload a file from the client's workstation&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD cl_gui_frontend_services=&amp;gt;gui_upload&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        filename   = l_filename&lt;/P&gt;&lt;P&gt;        filetype   = 'BIN'&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        filelength = l_xml_table_size&lt;/P&gt;&lt;P&gt;      CHANGING&lt;/P&gt;&lt;P&gt;        data_tab   = l_xml_table&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        OTHERS     = 19.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Writing the XML document to the screen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLEAR l_str1.&lt;/P&gt;&lt;P&gt;    LOOP AT l_xml_table INTO l_xml_line.&lt;/P&gt;&lt;P&gt;      c_conv = cl_abap_conv_in_ce=&amp;gt;create( input = l_xml_line-data replacement = space  ).&lt;/P&gt;&lt;P&gt;      c_conv-&amp;gt;read( IMPORTING data = l_content len = l_len ).&lt;/P&gt;&lt;P&gt;      CONCATENATE l_str1 l_content INTO l_str1.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;    l_str1 = l_str1+0(l_xml_table_size).&lt;/P&gt;&lt;P&gt;    SPLIT l_str1 AT cl_abap_char_utilities=&amp;gt;cr_lf INTO TABLE l_itab.&lt;/P&gt;&lt;P&gt;    WRITE: /.&lt;/P&gt;&lt;P&gt;    WRITE: /' XML File'.&lt;/P&gt;&lt;P&gt;    WRITE: /.&lt;/P&gt;&lt;P&gt;    LOOP AT l_itab INTO l_str1.&lt;/P&gt;&lt;P&gt;      REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=&amp;gt;horizontal_tab IN&lt;/P&gt;&lt;P&gt;        l_str1 WITH space.&lt;/P&gt;&lt;P&gt;      WRITE: / l_str1.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;    WRITE: /.&lt;/P&gt;&lt;P&gt;  ENDFORM.                    "get_xml_table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  process_dom&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  FORM process_dom USING document TYPE REF TO if_ixml_document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DATA: node      TYPE REF TO if_ixml_node,&lt;/P&gt;&lt;P&gt;          iterator  TYPE REF TO if_ixml_node_iterator,&lt;/P&gt;&lt;P&gt;          nodemap   TYPE REF TO if_ixml_named_node_map,&lt;/P&gt;&lt;P&gt;          attr      TYPE REF TO if_ixml_node,&lt;/P&gt;&lt;P&gt;          name      TYPE string,&lt;/P&gt;&lt;P&gt;          prefix    TYPE string,&lt;/P&gt;&lt;P&gt;          value     TYPE string,&lt;/P&gt;&lt;P&gt;          indent    TYPE i,&lt;/P&gt;&lt;P&gt;          count     TYPE i,&lt;/P&gt;&lt;P&gt;          index     TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    node ?= document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CHECK NOT node IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ULINE.&lt;/P&gt;&lt;P&gt;    WRITE: /.&lt;/P&gt;&lt;P&gt;    WRITE: /' DOM-TREE'.&lt;/P&gt;&lt;P&gt;    WRITE: /.&lt;/P&gt;&lt;P&gt;    IF node IS INITIAL. EXIT. ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  create a node iterator&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    iterator  = node-&amp;gt;create_iterator( ).&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  get current node&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    node = iterator-&amp;gt;get_next( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  loop over all nodes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    WHILE NOT node IS INITIAL.&lt;/P&gt;&lt;P&gt;      indent = node-&amp;gt;get_height( ) * 2.&lt;/P&gt;&lt;P&gt;      indent = indent + 20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CASE node-&amp;gt;get_type( ).&lt;/P&gt;&lt;P&gt;        WHEN if_ixml_node=&amp;gt;co_node_element.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        element node&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          name    = node-&amp;gt;get_name( ).&lt;/P&gt;&lt;P&gt;          nodemap = node-&amp;gt;get_attributes( ).&lt;/P&gt;&lt;P&gt;          WRITE: / 'ELEMENT  :'.&lt;/P&gt;&lt;P&gt;          WRITE: AT indent name COLOR COL_POSITIVE INVERSE.&lt;/P&gt;&lt;P&gt;          IF NOT nodemap IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          attributes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            count = nodemap-&amp;gt;get_length( ).&lt;/P&gt;&lt;P&gt;            DO count TIMES.&lt;/P&gt;&lt;P&gt;              index  = sy-index - 1.&lt;/P&gt;&lt;P&gt;              attr   = nodemap-&amp;gt;get_item( index ).&lt;/P&gt;&lt;P&gt;              name   = attr-&amp;gt;get_name( ).&lt;/P&gt;&lt;P&gt;              prefix = attr-&amp;gt;get_namespace_prefix( ).&lt;/P&gt;&lt;P&gt;              value  = attr-&amp;gt;get_value( ).&lt;/P&gt;&lt;P&gt;              WRITE: / 'ATTRIBUTE:'.&lt;/P&gt;&lt;P&gt;              WRITE: AT indent name  COLOR COL_HEADING INVERSE, '=',&lt;/P&gt;&lt;P&gt;                               value COLOR COL_TOTAL   INVERSE.&lt;/P&gt;&lt;P&gt;            ENDDO.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;        WHEN if_ixml_node=&amp;gt;co_node_text OR&lt;/P&gt;&lt;P&gt;             if_ixml_node=&amp;gt;co_node_cdata_section.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        text node&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          value  = node-&amp;gt;get_value( ).&lt;/P&gt;&lt;P&gt;          WRITE: / 'VALUE     :'.&lt;/P&gt;&lt;P&gt;          WRITE: AT indent value COLOR COL_GROUP INVERSE.&lt;/P&gt;&lt;P&gt;      ENDCASE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    advance to next node&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      node = iterator-&amp;gt;get_next( ).&lt;/P&gt;&lt;P&gt;    ENDWHILE.&lt;/P&gt;&lt;P&gt;  ENDFORM.                    "process_dom&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be highly apperciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Jessica Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2009 17:22:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232858#M1209490</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-12T17:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: problem converting data in XML file to internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232859#M1209491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope the below link help you out....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&amp;amp;query=xml" target="test_blank"&gt;https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&amp;amp;query=xml&lt;/A&gt;&lt;EM&gt;file&lt;/EM&gt;into&lt;EM&gt;internal&lt;/EM&gt;table+++++&amp;amp;adv=false&amp;amp;sortby=cm_rnd_rankvalue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="6852740"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pooja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2009 07:55:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232859#M1209491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-13T07:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: problem converting data in XML file to internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232860#M1209492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey pooja,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In all the links that you provided..they all are similar to thomas blog and suggest the code to convert XML data and write it on screen as "Element" and "Value".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is not to write these values to screen..i need to collect them in an internal table and make use of those values to do Goods reciept in SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anybody has any clues on converting XML to internal table please suggest.&lt;/P&gt;&lt;P&gt;My XML file is very complex with many parent and child nodes and the child nodes keep occuring more than once and vary from file to file. i need to write a generic code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jessica Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 14:33:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232860#M1209492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T14:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: problem converting data in XML file to internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232861#M1209493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jessica,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Though with my minimal knowledge on XML conversion, I would suggest a to use once the below code.&lt;/P&gt;&lt;P&gt;No harm in trying as this is a small piece of code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; TRY.&lt;/P&gt;&lt;P&gt;      CALL TRANSFORMATION ('ID')&lt;/P&gt;&lt;P&gt;      SOURCE XML v_xmlupl&lt;/P&gt;&lt;P&gt;      RESULT tab = i_xml[].&lt;/P&gt;&lt;P&gt;      CONDENSE v_xmlupl.&lt;/P&gt;&lt;P&gt;    CATCH cx_transformation_error.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   Write your error message.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Here v_xmlupl is your XML string and I_XML is the internal table of the type of data you are expecting in the XML string.&lt;/P&gt;&lt;P&gt;If this does not work then you might have to create your own transformation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 16:10:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232861#M1209493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T16:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: problem converting data in XML file to internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232862#M1209494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You want me to inlcude this code in addition to my code?&lt;/P&gt;&lt;P&gt;i am unable to understand, can you please be more clear?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 18:24:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232862#M1209494</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T18:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: problem converting data in XML file to internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232863#M1209495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jessica,&lt;/P&gt;&lt;P&gt;  I had similar problem with too complex XML file. I do not know if_ixml etc so I cannot help you with your code, but I can write anything about my solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1) I have to write XSLT transformation program - describing structure of XML data, see to my example and you can adjust it to your XML definition. Let's create XSLT program with name ZFI_AVIZA_XXX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;xsl:transform version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&amp;gt;

&amp;lt;!-- used by progs: Y1T_PV_XMLTEST, ZFI_AVIZA --&amp;gt;

&amp;lt;!-- &amp;lt;xsl:template match="/"&amp;gt;
    &amp;lt;xsl:apply-templates /&amp;gt;
&amp;lt;/xsl:template&amp;gt;
--&amp;gt;

&amp;lt;xsl:template match="statement"&amp;gt;
    &amp;lt;xsl:apply-templates select="merchants/merchant"/&amp;gt;
&amp;lt;/xsl:template&amp;gt;

&amp;lt;xsl:template match="merchant"&amp;gt;
  &amp;lt;asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0"&amp;gt;&amp;lt;asx:values&amp;gt;
    &amp;lt;AVIZA&amp;gt;
    &amp;lt;xsl:apply-templates select="branches/branch"/&amp;gt;
    &amp;lt;/AVIZA&amp;gt;
  &amp;lt;/asx:values&amp;gt;&amp;lt;/asx:abap&amp;gt;
&amp;lt;/xsl:template&amp;gt;

&amp;lt;!-- add/del 12.5.2008 --&amp;gt;
&amp;lt;!--
&amp;lt;xsl:template match="branches"&amp;gt;
  &amp;lt;xsl:apply-templates select="branch"/&amp;gt;
&amp;lt;/xsl:template&amp;gt;
--&amp;gt;
&amp;lt;!-- add 12.5.2008 end --&amp;gt;

&amp;lt;xsl:template match="branch"&amp;gt;
  &amp;lt;xsl:apply-templates select="terminals/terminal"/&amp;gt;
&amp;lt;/xsl:template&amp;gt;

&amp;lt;xsl:template match="terminal"&amp;gt;
  &amp;lt;xsl:variable name="xwaers"&amp;gt;
    &amp;lt;xsl:value-of select="currency" /&amp;gt;
  &amp;lt;/xsl:variable&amp;gt;
  &amp;lt;xsl:variable name="termid"&amp;gt;
    &amp;lt;xsl:value-of select="IDs/primaryID" /&amp;gt;
  &amp;lt;/xsl:variable&amp;gt;

  &amp;lt;xsl:apply-templates select="transactions"&amp;gt;
    &amp;lt;xsl:with-param name="xwaers" select="$xwaers" /&amp;gt;
    &amp;lt;xsl:with-param name="termid" select="$termid" /&amp;gt;
  &amp;lt;/xsl:apply-templates&amp;gt;
&amp;lt;/xsl:template&amp;gt;

&amp;lt;xsl:template match="transactions"&amp;gt;
  &amp;lt;xsl:param name="xwaers"/&amp;gt;
  &amp;lt;xsl:param name="termid"/&amp;gt;
  &amp;lt;xsl:apply-templates select="reportingDay"&amp;gt;
    &amp;lt;xsl:with-param name="xwaers" select="$xwaers" /&amp;gt;
    &amp;lt;xsl:with-param name="termid" select="$termid" /&amp;gt;
  &amp;lt;/xsl:apply-templates&amp;gt;
&amp;lt;/xsl:template&amp;gt;

&amp;lt;xsl:template match="reportingDay"&amp;gt;
    &amp;lt;xsl:param name="xwaers" /&amp;gt;
    &amp;lt;xsl:param name="termid" /&amp;gt;
    &amp;lt;xsl:variable name="reported"&amp;gt;
  &amp;lt;xsl:value-of select="@day" /&amp;gt;
    &amp;lt;/xsl:variable&amp;gt;
    &amp;lt;xsl:apply-templates select="transaction"&amp;gt;
      &amp;lt;xsl:with-param name="xwaers" select="$xwaers" /&amp;gt;
      &amp;lt;xsl:with-param name="termid" select="$termid" /&amp;gt;
      &amp;lt;xsl:with-param name="xrep" select="$reported" /&amp;gt;
    &amp;lt;/xsl:apply-templates&amp;gt;
&amp;lt;/xsl:template&amp;gt;


&amp;lt;xsl:template match="transaction"&amp;gt;
    &amp;lt;xsl:param name="xwaers" /&amp;gt;
    &amp;lt;xsl:param name="termid" /&amp;gt;
    &amp;lt;xsl:param name="xrep" /&amp;gt;
    &amp;lt;item&amp;gt;
      &amp;lt;TERMINAL&amp;gt;&amp;lt;xsl:value-of select="$termid" /&amp;gt;&amp;lt;/TERMINAL&amp;gt;
      &amp;lt;REPORTED&amp;gt;&amp;lt;xsl:value-of select="$xrep" /&amp;gt;&amp;lt;/REPORTED&amp;gt;
      &amp;lt;WAERS&amp;gt;&amp;lt;xsl:value-of select="$xwaers" /&amp;gt;&amp;lt;/WAERS&amp;gt;
      &amp;lt;DTOPEA&amp;gt;&amp;lt;xsl:value-of select="DTOPEA" /&amp;gt;&amp;lt;/DTOPEA&amp;gt;
      &amp;lt;MTTDVO&amp;gt;&amp;lt;xsl:value-of select="MTTDVO" /&amp;gt;&amp;lt;/MTTDVO&amp;gt;
      &amp;lt;MTDVCO&amp;gt;&amp;lt;xsl:value-of select="MTDVCO" /&amp;gt;&amp;lt;/MTDVCO&amp;gt;
      &amp;lt;FEEACC&amp;gt;&amp;lt;xsl:value-of select="FEEACC" /&amp;gt;&amp;lt;/FEEACC&amp;gt;
    &amp;lt;/item&amp;gt;
&amp;lt;/xsl:template&amp;gt;


&amp;lt;/xsl:transform&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now look to acording ABAP code parts:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At first some declarations:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF tt_avizapkuc,
         terminal(20) TYPE c,
         reported(10) TYPE c, " yyyy-mm-dd
         waers TYPE waers,
         dtopea(21) TYPE c,   " yyyy-mm-ddThh:mm:ss
         mttdvo(15) TYPE c,   " brutto value
         mtdvco(15) TYPE c,   " netto value
         feeacc(15) TYPE c,   " fee
       END OF tt_avizapkuc.

DATA: gt_uc_data TYPE STANDARD TABLE OF tt_avizapkuc.
FIELD-SYMBOLS: &amp;lt;fs_ucr&amp;gt; TYPE tt_avizapkuc.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code extracts required fields from XML data into ABAP internal table. Internal table gt_file contains XML data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM xmltoabap.

  DATA: lt_result_xml TYPE abap_trans_resbind_tab.

  FIELD-SYMBOLS: &amp;lt;lfs_xml&amp;gt; TYPE abap_trans_resbind.

  APPEND INITIAL LINE TO lt_result_xml ASSIGNING &amp;lt;lfs_xml&amp;gt;.
  GET REFERENCE OF gt_uc_data INTO &amp;lt;lfs_xml&amp;gt;-value.
  &amp;lt;lfs_xml&amp;gt;-name = 'AVIZA'.

  CALL TRANSFORMATION zfi_aviza_xxx
     SOURCE XML gt_file
     RESULT (lt_result_xml).

ENDFORM.                    " xmltoabap&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, it is simple, isn't it? &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Prerequisitions:&lt;/P&gt;&lt;P&gt;  To know XSLT and ABAP languages&lt;/P&gt;&lt;P&gt;  Check your system if last support packages and kernel are applied - it works with packages from 03/2008 and newer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;  Pavel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 21:49:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232863#M1209495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T21:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: problem converting data in XML file to internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232864#M1209496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pavel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot. Can you show me your XML file so that i can correlate better. my XML file is very complex and will not be constant as the child nodes with in a parent node might be occuring more than once or might occur only once and i need to write a very very generic code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can  you post your XML file so that i can correlate  the XSLT and ABAP pgm and write my pgm for my XML file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for ur help.. will be waiting for ur reply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;JEsssica SAm&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 22:54:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232864#M1209496</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T22:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: problem converting data in XML file to internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232865#M1209497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jessica,&lt;/P&gt;&lt;P&gt;  sorry, I cannot show you XML file, it contains private data. But I think I can create similar one, but please wait ... it's midnight now and I am going to refresh (myself, not internal table). But the base of XML file is DTD description, I'll find it and send it with data file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pavel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 23:44:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232865#M1209497</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T23:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: problem converting data in XML file to internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232866#M1209498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry about that..i respect your privacy...i will try to understand the XML file based on ur prgm...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jessica Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2009 00:04:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232866#M1209498</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-17T00:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: problem converting data in XML file to internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232867#M1209499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try FM BAPI_ALV_XML_LOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also try the Function Modules in the Function Group CRM_BSP_DESIGNER_XML.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anki Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2009 05:18:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232867#M1209499</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-17T05:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: problem converting data in XML file to internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232868#M1209500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also Check  the below Thread&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/r.eijpe/blog/2005/11/21/xml-dom-processing-in-abap-part-ii--convert-an-xml-file-into-an-abap-table-using-sap-dom-approach&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anki Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2009 05:19:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232868#M1209500</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-17T05:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: problem converting data in XML file to internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232869#M1209501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jessica,&lt;/P&gt;&lt;P&gt;  look to data file. This file has been edited by hand so I hope it will not be crippled. Note that XSLT can work with XML data with missing subtrees, when a subtree with required value is misssing, transformation simply do not put affected line to abap internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;  Pavel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;statement dist-email="email-at-domain.sk"
           fname-prefix="20080124_100035_1775_"
           generated-on="2008-01-25T05:37:26" institution-id="UNB"
           period-end="2008-01-24" period-start="2008-01-24"
           xmlns:zzz="http://firstdata.sk/tol/posman/statement/1.0"
           xmlns:ns="http://firstdata.sk/tol/posman/statement/1.0"&amp;gt;
  &amp;lt;merchants&amp;gt;
    &amp;lt;merchant&amp;gt;
      &amp;lt;IDs&amp;gt;
        &amp;lt;primaryID&amp;gt;100035&amp;lt;/primaryID&amp;gt;
      &amp;lt;/IDs&amp;gt;
      &amp;lt;name&amp;gt;Customer, GMBH&amp;lt;/name&amp;gt;
      &amp;lt;merchantNationalID&amp;gt;36621427&amp;lt;/merchantNationalID&amp;gt;
      &amp;lt;address type="residence"&amp;gt;
        &amp;lt;line1&amp;gt;Customer, GMBH&amp;lt;/line1&amp;gt;
        &amp;lt;street&amp;gt;Street 19&amp;lt;/street&amp;gt;
        &amp;lt;city&amp;gt;Big City&amp;lt;/city&amp;gt;
        &amp;lt;zip&amp;gt;11111&amp;lt;/zip&amp;gt;
        &amp;lt;country&amp;gt;SK&amp;lt;/country&amp;gt;
      &amp;lt;/address&amp;gt;
      &amp;lt;branches&amp;gt;
        &amp;lt;branch&amp;gt;
          &amp;lt;IDs&amp;gt;
            &amp;lt;primaryID&amp;gt;1000351&amp;lt;/primaryID&amp;gt;
          &amp;lt;/IDs&amp;gt;
          &amp;lt;name&amp;gt;Customer&amp;lt;/name&amp;gt;
          &amp;lt;addresses&amp;gt;
            &amp;lt;address type="residence"&amp;gt;
              &amp;lt;line1&amp;gt;Customer&amp;lt;/line1&amp;gt;
              &amp;lt;street&amp;gt;Another street&amp;lt;/street&amp;gt;
              &amp;lt;line3&amp;gt;OC Max&amp;lt;/line3&amp;gt;
              &amp;lt;city&amp;gt;Small City&amp;lt;/city&amp;gt;
              &amp;lt;zip&amp;gt;01010&amp;lt;/zip&amp;gt;
              &amp;lt;country&amp;gt;SK&amp;lt;/country&amp;gt;
            &amp;lt;/address&amp;gt;
            &amp;lt;address type="statements"&amp;gt;
              &amp;lt;line1&amp;gt;Customer&amp;lt;/line1&amp;gt;
              &amp;lt;street&amp;gt;Street 007&amp;lt;/street&amp;gt;
              &amp;lt;line3&amp;gt;OC Max&amp;lt;/line3&amp;gt;
              &amp;lt;city&amp;gt;Small City&amp;lt;/city&amp;gt;
              &amp;lt;zip&amp;gt;01010&amp;lt;/zip&amp;gt;
              &amp;lt;country&amp;gt;SK&amp;lt;/country&amp;gt;
            &amp;lt;/address&amp;gt;
          &amp;lt;/addresses&amp;gt;
          &amp;lt;terminals&amp;gt;
            &amp;lt;terminal&amp;gt;
              &amp;lt;IDs&amp;gt;
                &amp;lt;primaryID&amp;gt;SN100035101&amp;lt;/primaryID&amp;gt;
              &amp;lt;/IDs&amp;gt;
              &amp;lt;timMerchantId&amp;gt;21000000517251&amp;lt;/timMerchantId&amp;gt;
              &amp;lt;name&amp;gt;Customer&amp;lt;/name&amp;gt;
              &amp;lt;account&amp;gt;
                &amp;lt;accountID&amp;gt;0000006618072123&amp;lt;/accountID&amp;gt;
                &amp;lt;bankID&amp;gt;1100&amp;lt;/bankID&amp;gt;
              &amp;lt;/account&amp;gt;
              &amp;lt;currency&amp;gt;EUR&amp;lt;/currency&amp;gt;
              &amp;lt;transactions&amp;gt;
                &amp;lt;reportingDay day="2008-01-24"&amp;gt;
                  &amp;lt;transaction&amp;gt;
                    &amp;lt;CDRES&amp;gt;1&amp;lt;/CDRES&amp;gt;
                    &amp;lt;CETYK&amp;gt;120&amp;lt;/CETYK&amp;gt;
                    &amp;lt;DTOPEA&amp;gt;2008-01-24T10:05:10&amp;lt;/DTOPEA&amp;gt;
                    &amp;lt;NUISOM&amp;gt;676191******5709&amp;lt;/NUISOM&amp;gt;
                    &amp;lt;MTTDVO&amp;gt;473.00&amp;lt;/MTTDVO&amp;gt;
                    &amp;lt;MTDVCO&amp;gt;466.85&amp;lt;/MTDVCO&amp;gt;
                    &amp;lt;CESMT&amp;gt;1&amp;lt;/CESMT&amp;gt;
                    &amp;lt;FEEACC&amp;gt;6.15&amp;lt;/FEEACC&amp;gt;
                    &amp;lt;DETYP&amp;gt;1&amp;lt;/DETYP&amp;gt;
                    &amp;lt;TXCIP&amp;gt;1.30&amp;lt;/TXCIP&amp;gt;
                    &amp;lt;NUAUTO&amp;gt;890963&amp;lt;/NUAUTO&amp;gt;
                  &amp;lt;/transaction&amp;gt;
                  &amp;lt;transaction&amp;gt;
                    &amp;lt;CDRES&amp;gt;1&amp;lt;/CDRES&amp;gt;
                    &amp;lt;CETYK&amp;gt;125&amp;lt;/CETYK&amp;gt;
                    &amp;lt;DTOPEA&amp;gt;2008-01-24T10:41:32&amp;lt;/DTOPEA&amp;gt;
                    &amp;lt;NUISOM&amp;gt;541597******2975&amp;lt;/NUISOM&amp;gt;
                    &amp;lt;MTTDVO&amp;gt;697.00&amp;lt;/MTTDVO&amp;gt;
                    &amp;lt;MTDVCO&amp;gt;687.94&amp;lt;/MTDVCO&amp;gt;
                    &amp;lt;CESMT&amp;gt;1&amp;lt;/CESMT&amp;gt;
                    &amp;lt;FEEACC&amp;gt;9.06&amp;lt;/FEEACC&amp;gt;
                    &amp;lt;DETYP&amp;gt;1&amp;lt;/DETYP&amp;gt;
                    &amp;lt;TXCIP&amp;gt;1.30&amp;lt;/TXCIP&amp;gt;
                    &amp;lt;NUAUTO&amp;gt;509847&amp;lt;/NUAUTO&amp;gt;
                  &amp;lt;/transaction&amp;gt;
                  &amp;lt;transaction&amp;gt;
                    &amp;lt;CDRES&amp;gt;1&amp;lt;/CDRES&amp;gt;
                    &amp;lt;CETYK&amp;gt;120&amp;lt;/CETYK&amp;gt;
                    &amp;lt;DTOPEA&amp;gt;2008-01-24T20:57:46&amp;lt;/DTOPEA&amp;gt;
                    &amp;lt;NUISOM&amp;gt;676115******2018&amp;lt;/NUISOM&amp;gt;
                    &amp;lt;MTTDVO&amp;gt;599.00&amp;lt;/MTTDVO&amp;gt;
                    &amp;lt;MTDVCO&amp;gt;591.21&amp;lt;/MTDVCO&amp;gt;
                    &amp;lt;CESMT&amp;gt;1&amp;lt;/CESMT&amp;gt;
                    &amp;lt;FEEACC&amp;gt;7.79&amp;lt;/FEEACC&amp;gt;
                    &amp;lt;DETYP&amp;gt;1&amp;lt;/DETYP&amp;gt;
                    &amp;lt;TXCIP&amp;gt;1.30&amp;lt;/TXCIP&amp;gt;
                    &amp;lt;NUAUTO&amp;gt;423635&amp;lt;/NUAUTO&amp;gt;
                  &amp;lt;/transaction&amp;gt;
                &amp;lt;/reportingDay&amp;gt;
              &amp;lt;/transactions&amp;gt;
            &amp;lt;/terminal&amp;gt;
          &amp;lt;/terminals&amp;gt;
        &amp;lt;/branch&amp;gt;
      &amp;lt;/branches&amp;gt;
    &amp;lt;/merchant&amp;gt;
  &amp;lt;/merchants&amp;gt;
&amp;lt;/statement&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2009 17:31:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232869#M1209501</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-17T17:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: problem converting data in XML file to internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232870#M1209502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pavel Vera,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With your example i tries doing the following .....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I tried  to convert the data of XML file to internal table data. I am collecting the data in internal table to do goos recipt with that data.&lt;/P&gt;&lt;P&gt;Please find my XML file, ABAP pgm and XSLT pgm . I donu2019t know what I am missing I am not getting any output. I donu2019t know what is wrong please help me with this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my XML file, My code and XSLT Program. In the below XML file I need to collect Vendor Number, Order Number, and Date tags which occur only once for one XML file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also need to collect the following tags from &amp;lt;Shipmentdetail&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Shipmentdetail&amp;gt; has following child nodes and I need to collect them &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TrackingNumber&lt;/P&gt;&lt;P&gt;Freight&lt;/P&gt;&lt;P&gt;Weight&lt;/P&gt;&lt;P&gt;ShipmentDate&lt;/P&gt;&lt;P&gt;ShipmentMethod &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Need to collect to collect the following tags from &amp;lt;ProductInformation&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;ProductInformation&amp;gt; has following child nodes and I need to collect them&lt;/P&gt;&lt;P&gt;    LineNumber&lt;/P&gt;&lt;P&gt;    SKUNumber&lt;/P&gt;&lt;P&gt;    OrderedQuantity&lt;/P&gt;&lt;P&gt;    ShippedQuantity&lt;/P&gt;&lt;P&gt;    UOM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &amp;lt;Shipmentdetail&amp;gt; and &amp;lt;ProductInformation&amp;gt; are child nodes of &amp;lt;OrderShipment&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &amp;lt;Shipmentdetail&amp;gt; occurs only ones but the &amp;lt;ProductInformation&amp;gt; can occur once or many times and will be dynamic and differs depening on the input file.&lt;/P&gt;&lt;P&gt;My XML file is as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
 &amp;lt;?xml version="1.0" encoding="iso-8859-1" ?&amp;gt; 
- &amp;lt;ShipmentHeader&amp;gt;
  &amp;lt;AccountID /&amp;gt; 
- &amp;lt;OrderShipment&amp;gt;
      &amp;lt;VendorNumber&amp;gt;1000&amp;lt;/VendorNumber&amp;gt; 
      &amp;lt;OrderNumber&amp;gt;P00009238&amp;lt;/OrderNumber&amp;gt; 
      &amp;lt;OrderType&amp;gt;Stock&amp;lt;/OrderType&amp;gt; 
      &amp;lt;Company /&amp;gt; 
      &amp;lt;Division /&amp;gt; 
     &amp;lt;Department /&amp;gt; 
     &amp;lt;Date&amp;gt;20061120&amp;lt;/Date&amp;gt; 
     &amp;lt;CartonCount&amp;gt;2&amp;lt;/CartonCount&amp;gt; 
     &amp;lt;ShipAllProducts&amp;gt;No&amp;lt;/ShipAllProducts&amp;gt; 
-             &amp;lt;ShipmentDetail&amp;gt;
                  &amp;lt;TrackingNumber&amp;gt;1ZR3W891PG47477811&amp;lt;/TrackingNumber&amp;gt; 
                  &amp;lt;Freight&amp;gt;000000010000&amp;lt;/Freight&amp;gt; 
                  &amp;lt;ShipmentDate&amp;gt;20061120&amp;lt;/ShipmentDate&amp;gt; 
                  &amp;lt;ShipmentMethod&amp;gt;UPS1PS&amp;lt;/ShipmentMethod&amp;gt; 
             &amp;lt;/ShipmentDetail&amp;gt;
-            &amp;lt;ProductInformation&amp;gt;
                 &amp;lt;LineNumber&amp;gt;000000001&amp;lt;/LineNumber&amp;gt; 
                 &amp;lt;SKUNumber&amp;gt;110FR&amp;lt;/SKUNumber&amp;gt; 
                 &amp;lt;AdvSKUNumber&amp;gt;003 4518&amp;lt;/AdvSKUNumber&amp;gt; 
                 &amp;lt;SKUID /&amp;gt; 
                 &amp;lt;OrderedQuantity&amp;gt;00000001000000&amp;lt;/OrderedQuantity&amp;gt; 
                 &amp;lt;ShippedQuantity&amp;gt;00000001000000&amp;lt;/ShippedQuantity&amp;gt; 
                 &amp;lt;UOM&amp;gt;EA&amp;lt;/UOM&amp;gt; 
                 &amp;lt;Factor&amp;gt;1&amp;lt;/Factor&amp;gt; 
            &amp;lt;/ProductInformation&amp;gt;
-           &amp;lt;ProductInformation&amp;gt;
                &amp;lt;LineNumber&amp;gt;000000002&amp;lt;/LineNumber&amp;gt; 
                &amp;lt;SKUNumber&amp;gt;938EN&amp;lt;/SKUNumber&amp;gt; 
                &amp;lt;AdvSKUNumber&amp;gt;001 7294&amp;lt;/AdvSKUNumber&amp;gt; 
                &amp;lt;SKUID /&amp;gt; 
                &amp;lt;OrderedQuantity&amp;gt;00000000450000&amp;lt;/OrderedQuantity&amp;gt; 
                &amp;lt;ShippedQuantity&amp;gt;00000000450000&amp;lt;/ShippedQuantity&amp;gt; 
                &amp;lt;UOM&amp;gt;EA&amp;lt;/UOM&amp;gt; 
                &amp;lt;Factor&amp;gt;1&amp;lt;/Factor&amp;gt; 
            &amp;lt;/ProductInformation&amp;gt;
-           &amp;lt;CaseInformation&amp;gt;
               &amp;lt;LineNumber&amp;gt;000000001&amp;lt;/LineNumber&amp;gt; 
               &amp;lt;SKUNumber&amp;gt;110FR&amp;lt;/SKUNumber&amp;gt; 
               &amp;lt;AdvSKUNumber&amp;gt;003 4518&amp;lt;/AdvSKUNumber&amp;gt; 
               &amp;lt;SKUID /&amp;gt; 
               &amp;lt;SSCCNumber&amp;gt;00000001668000002487&amp;lt;/SSCCNumber&amp;gt; 
               &amp;lt;CaseQuantity&amp;gt;00000001000000&amp;lt;/CaseQuantity&amp;gt; 
               &amp;lt;UOM&amp;gt;EA&amp;lt;/UOM&amp;gt; 
               &amp;lt;Factor&amp;gt;1&amp;lt;/Factor&amp;gt; 
             &amp;lt;/CaseInformation&amp;gt;
             &amp;lt;CaseInformation&amp;gt;
               &amp;lt;LineNumber&amp;gt;000000001&amp;lt;/LineNumber&amp;gt; 
               &amp;lt;SKUNumber&amp;gt;110FR&amp;lt;/SKUNumber&amp;gt; 
               &amp;lt;AdvSKUNumber&amp;gt;003 4518&amp;lt;/AdvSKUNumber&amp;gt; 
               &amp;lt;SKUID /&amp;gt; 
               &amp;lt;SSCCNumber&amp;gt;00000001668000002487&amp;lt;/SSCCNumber&amp;gt; 
               &amp;lt;CaseQuantity&amp;gt;00000001000000&amp;lt;/CaseQuantity&amp;gt; 
               &amp;lt;UOM&amp;gt;EA&amp;lt;/UOM&amp;gt; 
               &amp;lt;Factor&amp;gt;1&amp;lt;/Factor&amp;gt; 
             &amp;lt;/CaseInformation&amp;gt;
-  &amp;lt;/OrderShipment&amp;gt;
  &amp;lt;/ShipmentHeader&amp;gt; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Program&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPE-POOLS abap.

CONSTANTS gs_file TYPE string VALUE 'C:\temp\test.xml'.

* This is the structure for the data from the XML file

TYPES: BEGIN OF ts_shipment,
         VendorNumber(10)     TYPE n,
         OrderNumber(20)      TYPE n,
         OrderType(8)         TYPE c,
         Date(8)              TYPE c,

       END OF ts_shipment.

TYPES: BEGIN OF ts_shipmentdetail,
         TrackingNumber(30)     TYPE n,
         Freight(12)            TYPE n,
         Weight(14)             TYPE n,
         ShipmentDate(8)        TYPE c,
         ShipmentMethod(8)      TYPE c,

         END OF ts_shipmentdetail.

TYPES: BEGIN OF ts_productinformation,
         LineNumber(9)          TYPE n,
         SKUNumber(20)          TYPE c,
         OrderedQuantity(14)    TYPE n,
         ShippedQuantity(14)    TYPE n,
         UOM(4)                 TYPE c,

         END OF ts_productinformation.

* Table for the XML content

DATA: gt_itab       TYPE STANDARD TABLE OF char2048.

* Table and work ares for the data from the XML file

DATA: gt_shipment               TYPE STANDARD TABLE OF ts_shipment,
      gs_shipment               TYPE ts_shipment.

DATA: gt_shipmentdetail         TYPE STANDARD TABLE OF ts_shipmentdetail,
      gs_shipmentdetail         TYPE ts_shipmentdetail.

DATA: gt_productinformation     TYPE STANDARD TABLE OF ts_productinformation,
      gs_productinformation     TYPE ts_productinformation.


* Result table that contains references
* of the internal tables to be filled

DATA: gt_result_xml TYPE abap_trans_resbind_tab,
      gs_result_xml TYPE abap_trans_resbind.

* For error handling

DATA: gs_rif_ex     TYPE REF TO cx_root,
      gs_var_text   TYPE string.

* Get the XML file from your client

CALL METHOD cl_gui_frontend_services=&amp;gt;gui_upload
  EXPORTING
    filename                = gs_file
  CHANGING
    data_tab                = gt_itab
  EXCEPTIONS
    file_open_error         = 1
    file_read_error         = 2
    no_batch                = 3
    gui_refuse_filetransfer = 4
    invalid_type            = 5
    no_authority            = 6
    unknown_error           = 7
    bad_data_format         = 8
    header_not_allowed      = 9
    separator_not_allowed   = 10
    header_too_long         = 11
    unknown_dp_error        = 12
    access_denied           = 13
    dp_out_of_memory        = 14
    disk_full               = 15
    dp_timeout              = 16
    not_supported_by_gui    = 17
    error_no_gui            = 18
    OTHERS                  = 19.

IF sy-subrc &amp;lt;&amp;gt; 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "ISHIPMENT".

GET REFERENCE OF gt_shipment INTO gs_result_xml-value.
gs_result_xml-name = 'ISHIPMENT'.
APPEND gs_result_xml TO gt_result_xml.

* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "ISHIPDET".

GET REFERENCE OF gt_shipmentdetail INTO gs_result_xml-value.
gs_result_xml-name = 'ISHIPDET'.
APPEND gs_result_xml TO gt_result_xml.

* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "IPRODDET".

GET REFERENCE OF gt_productinformation  INTO gs_result_xml-value.
gs_result_xml-name = 'IPRODDET'.
APPEND gs_result_xml TO gt_result_xml.

* Perform the XSLT stylesheet

TRY.

    CALL TRANSFORMATION z_xml_to_abap3
    SOURCE XML gt_itab
    RESULT (gt_result_xml).

  CATCH cx_root INTO gs_rif_ex.

    gs_var_text = gs_rif_ex-&amp;gt;get_text( ).
    MESSAGE gs_var_text TYPE 'E'.

ENDTRY.

* Writing the data from file for gt_shipment
*Collecting the Shipping Data from the XML file to internal table gt_shipment
*and writing the data to the screen

LOOP AT gt_shipment INTO gs_shipment.
  WRITE: / 'VendorNumber:', gs_shipment-VendorNumber.
  WRITE: / 'OrderNumber :', gs_shipment-OrderNumber.
  WRITE: / 'OrderType  :', gs_shipment-OrderType.
  WRITE: / 'Date  :',      gs_shipment-Date.

  WRITE : /.
ENDLOOP. "gt_shipment.



LOOP AT gt_shipmentdetail INTO gs_shipmentdetail.
  WRITE: / 'TrackingNumber:',     gs_shipmentdetail-TrackingNumber.
  WRITE: / 'Freight :',           gs_shipmentdetail-Freight.
  WRITE: / 'Weight  :',           gs_shipmentdetail-Weight.
  WRITE: / 'ShipmentDate  :',     gs_shipmentdetail-ShipmentDate.
* WRITE: / 'ShipmentMethod  :'    gs_shipmentdetail-ShipmentMethod

  WRITE : /.
ENDLOOP. "gt_shipmentdetail.



LOOP AT gt_productinformation INTO gs_productinformation.
  WRITE: / 'LineNumber:',         gs_productinformation-LineNumber.
  WRITE: / 'SKUNumber :',         gs_productinformation-SKUNumber.
  WRITE: / 'OrderedQuantity  :',  gs_productinformation-OrderedQuantity.
  WRITE: / 'ShippedQuantity  :',  gs_productinformation-ShippedQuantity.
  WRITE: / 'UOM  :',              gs_productinformation-UOM.
  WRITE : /.
ENDLOOP. "gt_productinformation.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XSLT Program&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

 
 &amp;lt;xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&amp;gt;
  &amp;lt;xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/&amp;gt;
  &amp;lt;xsl:strip-space elements="*"/&amp;gt;

  &amp;lt;xsl:template match="/"&amp;gt;
    &amp;lt;asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0"&amp;gt;
      &amp;lt;asx:values&amp;gt;
        &amp;lt;ISHIPMENT&amp;gt;
          &amp;lt;xsl:apply-templates select="//OrderShipment"/&amp;gt;
        &amp;lt;/ISHIPMENT&amp;gt;
      &amp;lt;/asx:values&amp;gt;
    &amp;lt;/asx:abap&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;xsl:template match="OrderShipment"&amp;gt;
    &amp;lt;item&amp;gt;
      &amp;lt;VENDORNUMBER&amp;gt;
        &amp;lt;xsl:value-of select="VendorNumber"/&amp;gt;
      &amp;lt;/VENDORNUMBER&amp;gt;
      &amp;lt;ORDERNUMBER&amp;gt;
        &amp;lt;xsl:value-of select="OrderNumber"/&amp;gt;
      &amp;lt;/ORDERNUMBER&amp;gt;
      &amp;lt;ORDERTYPE&amp;gt;
        &amp;lt;xsl:value-of select="OrderType"/&amp;gt;
      &amp;lt;/ORDERTYPE&amp;gt;
      &amp;lt;DATE&amp;gt;
        &amp;lt;xsl:value-of select="Date"/&amp;gt;
      &amp;lt;/DATE&amp;gt;

    &amp;lt;/item&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;xsl:template match="/"&amp;gt;
    &amp;lt;asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0"&amp;gt;
      &amp;lt;asx:values&amp;gt;
        &amp;lt;ISHIPDET&amp;gt;
          &amp;lt;xsl:apply-templates select="//OrderShipment/ShipmentDetail"/&amp;gt;
        &amp;lt;/ISHIPDET&amp;gt;
      &amp;lt;/asx:values&amp;gt;
    &amp;lt;/asx:abap&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;xsl:template match="ShipmentDetail"&amp;gt;
    &amp;lt;item&amp;gt;
      &amp;lt;TRACKINGNUMBER&amp;gt;
        &amp;lt;xsl:value-of select="TrackingNumber"/&amp;gt;
      &amp;lt;/TRACKINGNUMBER&amp;gt;
      &amp;lt;FREIGHT&amp;gt;
        &amp;lt;xsl:value-of select="Freight"/&amp;gt;
      &amp;lt;/FREIGHT&amp;gt;
      &amp;lt;SHIPMENTDATE&amp;gt;
        &amp;lt;xsl:value-of select="ShipmentDate"/&amp;gt;
      &amp;lt;/SHIPMENTDATE&amp;gt;
      &amp;lt;SHIPMENTMETHOD&amp;gt;
        &amp;lt;xsl:value-of select="ShipmentMethod"/&amp;gt;
      &amp;lt;/SHIPMENTMETHOD&amp;gt;

    &amp;lt;/item&amp;gt;
  &amp;lt;/xsl:template&amp;gt;



&amp;lt;/xsl:transform&amp;gt; .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is highly appreciated. If anyone encountered this situation before please let me know where i am going wrong in my XSLT transformation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Help will be highly apppreciated. Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jessica   Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Feb 2009 17:38:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-converting-data-in-xml-file-to-internal-table-data/m-p/5232870#M1209502</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-22T17:38:43Z</dc:date>
    </item>
  </channel>
</rss>

