<?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: Uploading XML File in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-xml-file/m-p/2569523#M586607</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sudheer and Omkar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your quick response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But by using the code which u gave the data will not be fetched into an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is I want to upload the XML into an internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Haritha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Aug 2007 07:43:44 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-03T07:43:44Z</dc:date>
    <item>
      <title>Uploading XML File</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-xml-file/m-p/2569520#M586604</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 where I need to upload the XML file in one client(or system)&lt;/P&gt;&lt;P&gt;which has been downloaded using another client(or system)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using &lt;/P&gt;&lt;P&gt;call method cl_gui_frontend_services=&amp;gt;gui_upload&lt;/P&gt;&lt;P&gt;to upload the file but it is going for dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried with&lt;/P&gt;&lt;P&gt;call method w_xml-&amp;gt;import_from_file&lt;/P&gt;&lt;P&gt;but it is also going for dump as both methods are using the same FM GUI_UPLOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone please tell me how to resolve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Haritha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 07:35:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-xml-file/m-p/2569520#M586604</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T07:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading XML File</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-xml-file/m-p/2569521#M586605</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;Look at the below link for an example Program &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&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;*&amp;amp;----&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;&lt;/P&gt;&lt;P&gt;class cl_ixml definition load.&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;begin of tsfixml,&lt;/P&gt;&lt;P&gt;data(1024) type c,&lt;/P&gt;&lt;P&gt;end of tsfixml.&lt;/P&gt;&lt;P&gt;&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&lt;/P&gt;&lt;P&gt;'d:joaodesenvolvimentos i act	este.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;Regards,&lt;/P&gt;&lt;P&gt;Maria João Rocha&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 =&lt;/P&gt;&lt;P&gt;l_xml_table&lt;/P&gt;&lt;P&gt;size =&lt;/P&gt;&lt;P&gt;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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;l_parser-&amp;gt;set_validating( mode = if_ixml_parser=&amp;gt;co_validate ).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;*&amp;amp;----&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;*&amp;amp;----&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;c_conv TYPE REF TO cl_abap_conv_in_ce,&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;LI level="1" type="ul"&gt;&lt;P&gt;CLEAR l_str1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LOOP AT l_xml_table INTO l_xml_line.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;c_conv = cl_abap_conv_in_ce=&amp;gt;create( input = l_xml_line-data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*replacement = space ).&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;c_conv-&amp;gt;read( IMPORTING data = l_content len = l_len ).&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CONCATENATE l_str1 l_content INTO l_str1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;l_str1 = l_str1+0(l_xml_table_size).&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SPLIT l_str1 AT cl_abap_char_utilities=&amp;gt;cr_lf INTO TABLE l_itab.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WRITE: /.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WRITE: /' XML File'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WRITE: /.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LOOP AT l_itab INTO l_str1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=&amp;gt;horizontal_tab&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*IN&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;l_str1 WITH space.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WRITE: / l_str1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WRITE: /.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endform. "get_xml_table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&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;*&amp;amp;----&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;data: name2 type string,&lt;/P&gt;&lt;P&gt;name_root type string,&lt;/P&gt;&lt;P&gt;node_parent type ref to if_ixml_node,&lt;/P&gt;&lt;P&gt;node_root type ref to if_ixml_node,&lt;/P&gt;&lt;P&gt;num_children 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;num_children = node-&amp;gt;num_children( ).&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;node_root = node-&amp;gt;get_root( ).&lt;/P&gt;&lt;P&gt;name_root = node_root-&amp;gt;get_name( ).&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;write: 'NUM_CHILDREN:', num_children.&lt;/P&gt;&lt;P&gt;write: 'ROOT:', name_root.&lt;/P&gt;&lt;P&gt;node_parent = node-&amp;gt;get_parent( ).&lt;/P&gt;&lt;P&gt;name2 = node_parent-&amp;gt;get_name( ).&lt;/P&gt;&lt;P&gt;write: 'NAME2: ' , name2.&lt;/P&gt;&lt;P&gt;&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;prefix = attr-&amp;gt;get_namespace_prefix( ).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;mjprocha&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;node_parent = node-&amp;gt;get_parent( ).&lt;/P&gt;&lt;P&gt;write: at indent value color col_group inverse.&lt;/P&gt;&lt;P&gt;name2 = node_parent-&amp;gt;get_name( ).&lt;/P&gt;&lt;P&gt;write: 'NAME2: ' , name2.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 07:39:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-xml-file/m-p/2569521#M586605</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T07:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading XML File</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-xml-file/m-p/2569522#M586606</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;Check this link for uploading xml file..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://wiki.ittoolbox.com/index.php/Download_and_upload_OO_ABAP_class_in_XML_format" target="test_blank"&gt;http://wiki.ittoolbox.com/index.php/Download_and_upload_OO_ABAP_class_in_XML_format&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if it helps..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Omkar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 07:41:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-xml-file/m-p/2569522#M586606</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T07:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading XML File</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-xml-file/m-p/2569523#M586607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sudheer and Omkar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your quick response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But by using the code which u gave the data will not be fetched into an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is I want to upload the XML into an internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Haritha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 07:43:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-xml-file/m-p/2569523#M586607</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T07:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading XML File</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-xml-file/m-p/2569524#M586608</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;&amp;lt;b&amp;gt;Please refer to&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="96971"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/abap-object-oriented-spreadsheet-with-unlimited-power.htm" target="test_blank"&gt;http://www.sap-img.com/abap/abap-object-oriented-spreadsheet-with-unlimited-power.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Visit &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need some basic idea of range object in excel.&lt;/P&gt;&lt;P&gt;You need to create XLS with named ranges or create ranges dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This could be a neat way to upload XLS the OO way!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function Module zjnc_get_range reads 1 range into any Internal &lt;/P&gt;&lt;P&gt;table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF it_test OCCURS 0,
        vpd  LIKE mseg-menge,
        vas  LIKE mkpf-budat,
        vkm  LIKE mseg-matnr,
      END OF it_test.

  CALL FUNCTION 'ZJNC_GET_RANGE'
    EXPORTING
      rangename       = 'test'
      itabname        = 'IT_TEST[]'
      irecname        = 'it_test'
      spreadsheetintf = spreadsheetintf.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Work!$A$14:$C$16 is range "test"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Numbers &amp;amp; Character data are no problem BUT dates are.&lt;/P&gt;&lt;P&gt;In Excel default date is mm/dd/yyyy but is dependent on PC's &lt;/P&gt;&lt;P&gt;international setting which is normally default&lt;/P&gt;&lt;P&gt;To Avoid any 5-March 3-May type mix-up, I have designed the FM so that you need to&lt;/P&gt;&lt;P&gt;enter dates as 'dd.Mon.yyyy i.e. in Characters in "Internet Date Format"&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FUNCTION zjnc_get_range.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     REFERENCE(RANGENAME) TYPE  C
*"     REFERENCE(ITABNAME) TYPE  C
*"     REFERENCE(IRECNAME) TYPE  C
*"     REFERENCE(SPREADSHEETINTF) TYPE REF TO  I_OI_SPREADSHEET
*"----------------------------------------------------------------------
*
*"     REFERENCE(SPREADSHEETINTF) TYPE REF TO  I_OI_SPREADSHEET
*"----------------------------------------------------------------------
  DATA:
    stru_ref    TYPE REF TO cl_abap_structdescr,
    comp_tab    TYPE abap_compdescr_tab,
    one_comp    TYPE abap_compdescr,
    one_name    TYPE string,
    type_ref    TYPE REF TO cl_abap_typedescr,
    is_ddic     TYPE abap_bool,
    lt_ddic     TYPE dd_x031l_table,
    wa_ddic     TYPE x031l.

  DATA: zjncranges    TYPE soi_range_list,
        zjnccontents  TYPE soi_generic_table,
        zjnconerange  TYPE soi_range_item,
        zjnconeitem   TYPE soi_generic_item,
        prevrow(4)    TYPE n,
        nrow(4)       TYPE n,
        ncolumn(4)    TYPE n,
        mystring      TYPE string,
        mydate        LIKE sy-datum.

  FIELD-SYMBOLS: &amp;lt;fs_type&amp;gt;  TYPE ANY,
                 &amp;lt;fs_table&amp;gt; TYPE STANDARD TABLE,
                 &amp;lt;fs_line&amp;gt;  TYPE ANY.

  CONCATENATE '(' sy-cprog ')' itabname INTO mystring.
  ASSIGN (mystring) TO &amp;lt;fs_table&amp;gt;.

  CONCATENATE '(' sy-cprog ')' irecname INTO mystring.
  ASSIGN (mystring) TO &amp;lt;fs_line&amp;gt;.

  stru_ref ?= cl_abap_structdescr=&amp;gt;describe_by_data( &amp;lt;fs_line&amp;gt; ).

  comp_tab = stru_ref-&amp;gt;components.

  REFRESH zjncranges.

  MOVE rangename TO zjnconerange-name.
  APPEND zjnconerange TO zjncranges.

  CALL METHOD spreadsheetintf-&amp;gt;get_ranges_data
    IMPORTING
      contents = zjnccontents
      error    = zjncerror
      retcode  = zjncretcode
    CHANGING
      ranges   = zjncranges.

  MOVE 0 TO prevrow.
  LOOP AT zjnccontents INTO zjnconeitem.
    MOVE zjnconeitem-row TO nrow.
    IF nrow &amp;lt;&amp;gt; prevrow.
      IF prevrow &amp;lt;&amp;gt; 0.
        APPEND &amp;lt;fs_line&amp;gt; TO &amp;lt;fs_table&amp;gt;.
      ENDIF.
      CLEAR &amp;lt;fs_line&amp;gt;.
      MOVE nrow TO prevrow.
    ENDIF.

    MOVE zjnconeitem-column TO ncolumn.
    READ TABLE comp_tab INDEX ncolumn INTO one_comp.
    CONCATENATE '(' sy-cprog ')' irecname '-' one_comp-name INTO one_name.
    ASSIGN (one_name) TO &amp;lt;fs_type&amp;gt;.

    IF one_comp-type_kind &amp;lt;&amp;gt; 'D'.
      MOVE zjnconeitem-value TO &amp;lt;fs_type&amp;gt;.
    ELSE.
      TRANSLATE zjnconeitem-value TO UPPER CASE.
      CALL FUNCTION 'CONVERSION_EXIT_SDATE_INPUT'
        EXPORTING
          input  = zjnconeitem-value
        IMPORTING
          output = mydate.
      MOVE mydate TO &amp;lt;fs_type&amp;gt;.
    ENDIF.

  ENDLOOP.

  IF prevrow &amp;lt;&amp;gt; 0.
    APPEND &amp;lt;fs_line&amp;gt; TO &amp;lt;fs_table&amp;gt;.
  ENDIF.

ENDFUNCTION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------" /&gt;&lt;P&gt;SAP has a facility called BDS. &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Read&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.intelligententerprise.com/channels/applications/feature/archive/schulze.jhtml" target="test_blank"&gt;http://www.intelligententerprise.com/channels/applications/feature/archive/schulze.jhtml&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read &lt;A href="http://www.sappro.com/download03.cfm?session=" target="test_blank"&gt;http://www.sappro.com/download03.cfm?session=&lt;/A&gt;    &lt;/P&gt;&lt;P&gt;There is ready code of BDS+DOI -- uses CL_BDS_DOCUMENT_SET global class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you wish to store a Word/Excel/AutoCad or any other document in SAP, &lt;/P&gt;&lt;P&gt;then you can use the Business Document Service (BDS). I did not - as &lt;/P&gt;&lt;P&gt;Cluster Data Directory is a simple beginning ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;Uploading data directly from Excel file format &amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* 
* Upload data direct from excel.xls file to SAP 
* 
REPORT ZEXCELUPLOAD. 
PARAMETERS: filename LIKE rlgrap-filename MEMORY ID M01, 
            begcol TYPE i DEFAULT 1 NO-DISPLAY, 
            begrow TYPE i DEFAULT 1 NO-DISPLAY, 
            endcol TYPE i DEFAULT 100 NO-DISPLAY, 
            endrow TYPE i DEFAULT 32000 NO-DISPLAY. 
* Tick don't append header 
PARAMETERS: kzheader AS CHECKBOX. 

DATA: BEGIN OF intern OCCURS 0. 
        INCLUDE STRUCTURE  alsmex_tabline. 
DATA: END OF intern. 

DATA: BEGIN OF intern1 OCCURS 0. 
        INCLUDE STRUCTURE  alsmex_tabline. 
DATA: END OF intern1. 

DATA: BEGIN OF t_col OCCURS 0, 
       col LIKE alsmex_tabline-col, 
       size TYPE i. 
DATA: END OF t_col. 

DATA: zwlen TYPE i, 
      zwlines TYPE i. 

DATA: BEGIN OF fieldnames OCCURS 3, 
        title(60), 
        table(6), 
        field(10), 
        kz(1), 
      END OF fieldnames. 
* No of columns 
DATA: BEGIN OF data_tab OCCURS 0, 
       value_0001(50), 
       value_0002(50), 
       value_0003(50), 
       value_0004(50), 
       value_0005(50), 
       value_0006(50), 
       value_0007(50), 
       value_0008(50), 
       value_0009(50), 
       value_0010(50), 
       value_0011(50), 
       value_0012(50), 
       value_0013(50), 
       value_0014(50), 
       value_0015(50), 
       value_0016(50), 
       value_0017(50), 
       value_0018(50), 
       value_0019(50), 
       value_0020(50), 
       value_0021(50), 
       value_0022(50), 
       value_0023(50), 
       value_0024(50), 
       value_0025(50), 
       value_0026(50), 
       value_0027(50), 
       value_0028(50), 
       value_0029(50), 
       value_0030(50), 
       value_0031(50), 
       value_0032(50), 
       value_0033(50), 
       value_0034(50), 
       value_0035(50), 
       value_0036(50), 
       value_0037(50), 
       value_0038(50), 
       value_0039(50), 
       value_0040(50), 
       value_0041(50), 
       value_0042(50), 
       value_0043(50), 
       value_0044(50), 
       value_0045(50), 
       value_0046(50), 
       value_0047(50), 
       value_0048(50), 
       value_0049(50), 
       value_0050(50), 
       value_0051(50), 
       value_0052(50), 
       value_0053(50), 
       value_0054(50), 
       value_0055(50), 
       value_0056(50), 
       value_0057(50), 
       value_0058(50), 
       value_0059(50), 
       value_0060(50), 
       value_0061(50), 
       value_0062(50), 
       value_0063(50), 
       value_0064(50), 
       value_0065(50), 
       value_0066(50), 
       value_0067(50), 
       value_0068(50), 
       value_0069(50), 
       value_0070(50), 
       value_0071(50), 
       value_0072(50), 
       value_0073(50), 
       value_0074(50), 
       value_0075(50), 
       value_0076(50), 
       value_0077(50), 
       value_0078(50), 
       value_0079(50), 
       value_0080(50), 
       value_0081(50), 
       value_0082(50), 
       value_0083(50), 
       value_0084(50), 
       value_0085(50), 
       value_0086(50), 
       value_0087(50), 
       value_0088(50), 
       value_0089(50), 
       value_0090(50), 
       value_0091(50), 
       value_0092(50), 
       value_0093(50), 
       value_0094(50), 
       value_0095(50), 
       value_0096(50), 
       value_0097(50), 
       value_0098(50), 
       value_0099(50), 
       value_0100(50). 
DATA: END OF data_tab. 
DATA: tind(4) TYPE n. 
DATA: zwfeld(19). 
FIELD-SYMBOLS: &amp;lt;fs1&amp;gt;. 

AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename. 
  CALL FUNCTION 'KD_GET_FILENAME_ON_F4' 
       EXPORTING 
            mask      = '*.xls' 
            static    = 'X' 
       CHANGING 
            file_name = filename. 
  

START-OF-SELECTION. 

  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE' 
       EXPORTING 
            filename                = filename 
            i_begin_col             = begcol 
            i_begin_row             = begrow 
            i_end_col               = endcol 
            i_end_row               = endrow 
       TABLES 
            intern                  = intern 
       EXCEPTIONS 
            inconsistent_parameters = 1 
            upload_ole              = 2 
            OTHERS                  = 3. 

  IF sy-subrc &amp;lt;&amp;gt; 0. 
    WRITE:/ 'Upload Error ', SY-SUBRC. 
  ENDIF. 

END-OF-SELECTION. 

  LOOP AT intern. 
    intern1 = intern. 
    CLEAR intern1-row. 
    APPEND intern1. 
  ENDLOOP. 

  SORT intern1 BY col. 
  LOOP AT intern1. 
    AT NEW col. 
      t_col-col = intern1-col. 
      APPEND t_col. 
    ENDAT. 
    zwlen = strlen( intern1-value ). 
    READ TABLE t_col WITH KEY col = intern1-col. 
    IF sy-subrc EQ 0. 
      IF zwlen &amp;gt; t_col-size. 
        t_col-size = zwlen. 
*                          Internal Table, Current Row Index 
        MODIFY t_col INDEX sy-tabix. 
      ENDIF. 
    ENDIF. 
  ENDLOOP. 

  DESCRIBE TABLE t_col LINES zwlines. 

  SORT intern BY row col. 
  IF kzheader = 'X'. 
    LOOP AT intern. 
      fieldnames-title = intern-value. 
      APPEND fieldnames. 
      AT END OF row. 
        EXIT. 
      ENDAT. 
    ENDLOOP. 
  ELSE. 
    DO zwlines TIMES. 
      WRITE sy-index TO fieldnames-title. 
      APPEND fieldnames. 
    ENDDO. 
  ENDIF. 

  SORT intern BY row col. 
  LOOP AT intern. 
    IF kzheader = 'X' 
    AND intern-row = 1. 
      CONTINUE. 
    ENDIF. 
    tind = intern-col. 
    CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld. 
    ASSIGN (zwfeld) TO &amp;lt;fs1&amp;gt;. 
    &amp;lt;fs1&amp;gt; = intern-value. 
    AT END OF row. 
      APPEND data_tab. 
      CLEAR data_tab. 
    ENDAT. 
  ENDLOOP. 

  CALL FUNCTION 'DISPLAY_BASIC_LIST' 
       EXPORTING 
            file_name     = filename 
       TABLES 
            data_tab      = data_tab 
            fieldname_tab = fieldnames. 

*-- End of Program 

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all helpfull answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Pavan praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 07:44:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-xml-file/m-p/2569524#M586608</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T07:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading XML File</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-xml-file/m-p/2569525#M586609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok Haritha...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using the Function - SMUM_XML_PARSE. This will upload an XMl file into an internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Omkar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 08:13:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-xml-file/m-p/2569525#M586609</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T08:13:27Z</dc:date>
    </item>
  </channel>
</rss>

