<?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: read xml filr from application server in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-xml-filr-from-application-server/m-p/2912304#M685303</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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="404880"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Alvaro Tejada Galindo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Oct 2007 18:48:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-15T18:48:03Z</dc:date>
    <item>
      <title>read xml filr from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-xml-filr-from-application-server/m-p/2912303#M685302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I want to read an XML file from application server. can anyone please give me the sample code?&lt;/P&gt;&lt;P&gt;Please its very urgent,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 18:39:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-xml-filr-from-application-server/m-p/2912303#M685302</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-15T18:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: read xml filr from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-xml-filr-from-application-server/m-p/2912304#M685303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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="404880"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Alvaro Tejada Galindo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 18:48:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-xml-filr-from-application-server/m-p/2912304#M685303</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-15T18:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: read xml filr from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-xml-filr-from-application-server/m-p/2912305#M685304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey, thanks a lot for ur immediate response.&lt;/P&gt;&lt;P&gt;I too have that code, jus wanted to know what value am I supposed to pass in the last part of the code 'CALL TRANSFORMATION ('ID')'.&lt;/P&gt;&lt;P&gt;what value am i suppsoed to pass in this ID??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me in this&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 19:03:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-xml-filr-from-application-server/m-p/2912305#M685304</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-15T19:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: read xml filr from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-xml-filr-from-application-server/m-p/2912306#M685305</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;You need to pass XSLT transformation definition you have created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 19:10:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-xml-filr-from-application-server/m-p/2912306#M685305</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-10-15T19:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: read xml filr from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-xml-filr-from-application-server/m-p/2912307#M685306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you please xplain abt it in details. How do i have to create tht?&lt;/P&gt;&lt;P&gt;Am new to this and would like to know in detail.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 19:21:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-xml-filr-from-application-server/m-p/2912307#M685306</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-15T19:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: read xml filr from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-xml-filr-from-application-server/m-p/2912308#M685307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following sample report &amp;lt;b&amp;gt;ZUS_SDN_BCCIIXMLT2&amp;lt;/b&amp;gt; (modified from BCCIIXMLT2) shows how to upload an XML file from the application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the structure of the XML is according to the structure of a DDIC structure then you can directly convert the XML into the DDIC record using the transformation ID (= identical) which is used to convert ABAP to XML and vice versa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*
*  BCCIIXMLT2 - sample program
*
*  This sample program shows how to read an XML document from a file
*  in the appserver's file system, parse the document into a DOM
*  representation and display the content as a list.
*  Additionally the DOM representation is rendered back into an XML
*  stream and stored as an output XML file on the appserver machine.
*
*  This sample program uses ABAP strings to represent the XML input
*  and output streams. See BCCIIXMLT1 for using internal tables.
*


REPORT zus_sdn_bcciixmlt2 MESSAGE-ID bcciixmlt3_msg LINE-SIZE 1000.


DATA:
  gd_rc     TYPE sysubrc,
  go_doc    TYPE REF TO cl_xml_document.


START-OF-SELECTION.

  PARAMETERS: filename(80) TYPE c
          DEFAULT 'tempIDoc_430040.xml'.  "#EC NOTEXT

*-- read the XML document from a dataset into a string
  DATA: inputstring TYPE xstring.
  OPEN DATASET filename FOR INPUT IN BINARY MODE.
  IF sy-subrc NE 0.
    MESSAGE e000.
  ENDIF.
  READ DATASET filename INTO inputstring.
  CLOSE DATASET filename.



  CREATE OBJECT go_doc.
  CALL METHOD go_doc-&amp;gt;parse_xstring
    EXPORTING
      stream  = inputstring
    RECEIVING
      retcode = gd_rc.
  CALL METHOD go_doc-&amp;gt;display
*    EXPORTING
*      WITH_BDN = SPACE
      .



*-- create the main factory
  DATA: pixml TYPE REF TO if_ixml.
  pixml = cl_ixml=&amp;gt;create( ).

*-- create the initial document
  DATA: pdocument TYPE REF TO if_ixml_document.
  pdocument = pixml-&amp;gt;create_document( ).

*-- create the stream factory
  DATA: pstreamfactory TYPE REF TO if_ixml_stream_factory.
  pstreamfactory = pixml-&amp;gt;create_stream_factory( ).

*-- create a stream for the input (string)
  DATA: pistream TYPE REF TO if_ixml_istream.
  pistream = pstreamfactory-&amp;gt;create_istream_xstring( inputstring ).


*-- create the parser
  DATA: pparser TYPE REF TO if_ixml_parser.
  pparser = pixml-&amp;gt;create_parser( stream_factory  = pstreamfactory
                                    istream       = pistream
                                    document      = pdocument ).

*-- parse the stream
  IF pparser-&amp;gt;parse( ) NE 0.
    IF pparser-&amp;gt;num_errors( ) NE 0.
      DATA: count TYPE i.
      count = pparser-&amp;gt;num_errors( ).
      WRITE: count, ' parse errors have occured:'.          "#EC NOTEXT
      DATA: pparseerror TYPE REF TO if_ixml_parse_error,
            i TYPE i.
      DATA: index TYPE i VALUE 0.
      WHILE index &amp;lt; count.
        pparseerror = pparser-&amp;gt;get_error( index = index ).
        i = pparseerror-&amp;gt;get_line( ).
        WRITE: 'line: ', i.                                 "#EC NOTEXT
        i = pparseerror-&amp;gt;get_column( ).
        WRITE: 'column: ', i.                               "#EC NOTEXT
        DATA: string TYPE string.
        string = pparseerror-&amp;gt;get_reason( ).
        WRITE: string.
        index = index + 1.
      ENDWHILE.
    ENDIF.
  ENDIF.

*-- we don't need the stream any more, so let's close it...
  CLEAR pistream.



*-- just for fun: render the DOM back into an output stream/xstring
  DATA: postream TYPE REF TO if_ixml_ostream,
        outputstring TYPE xstring.
  postream = pstreamfactory-&amp;gt;create_ostream_xstring( outputstring ).
  CALL METHOD pdocument-&amp;gt;render( ostream = postream ).

*-- write the XML document as a dataset
  DATA: dsn(80) TYPE c.
  CONCATENATE filename '.out' INTO dsn.                     "#EC NOTEXT
  OPEN DATASET dsn FOR OUTPUT IN BINARY MODE.
  TRANSFER outputstring TO dsn.
  CLOSE DATASET dsn.


*-- print the whole DOM tree as a list...
  DATA: pnode TYPE REF TO if_ixml_node.
  pnode = pdocument.
  PERFORM print_node USING pnode.





*---------------------------------------------------------------------*
*       FORM print_node                                               *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM print_node USING value(pnode) TYPE REF TO if_ixml_node.
  DATA: indent      TYPE i.
  DATA: ptext       TYPE REF TO if_ixml_text.
  DATA: string      TYPE string.

  indent  = pnode-&amp;gt;get_height( ) * 2.

  CASE pnode-&amp;gt;get_type( ).
    WHEN if_ixml_node=&amp;gt;co_node_element.
      string  = pnode-&amp;gt;get_name( ).
      WRITE: AT /indent '&amp;lt;', string, '&amp;gt; '.                  "#EC NOTEXT
    WHEN if_ixml_node=&amp;gt;co_node_text.
      ptext ?= pnode.
      IF ptext-&amp;gt;ws_only( ) IS INITIAL.
        string = pnode-&amp;gt;get_value( ).
        WRITE: AT /indent string.
      ENDIF.
  ENDCASE.

  pnode = pnode-&amp;gt;get_first_child( ).
  WHILE NOT pnode IS INITIAL.

    PERFORM print_node USING pnode.
    pnode = pnode-&amp;gt;get_next( ).

  ENDWHILE.

ENDFORM.                    "print_node&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 19:24:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-xml-filr-from-application-server/m-p/2912308#M685307</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-10-15T19:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: read xml filr from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-xml-filr-from-application-server/m-p/2912309#M685308</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;Please check this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/tobias.trapp/blog/2005/05/04/xml-processing-in-abap-part-1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't have prior XML exposure then use as suggested by Uwe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 19:38:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-xml-filr-from-application-server/m-p/2912309#M685308</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-10-15T19:38:14Z</dc:date>
    </item>
  </channel>
</rss>

