<?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 Read from a URL in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-from-a-url/m-p/7121008#M1511118</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;The need is to read a file from a URL and parse it. The class CL_HTTP_REQUEST and CL_IXML is supposed to be used for the same. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The URL is like &lt;A href="https://abc.com/def" target="test_blank"&gt;https://abc.com/def&lt;/A&gt; . when we access the URL a txt file is read in the browser. we wish to programatically read this file in ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will be very much appreciated if any of you can share with us in case you have done something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhura&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jul 2010 10:40:10 GMT</pubDate>
    <dc:creator>madhura_lobo</dc:creator>
    <dc:date>2010-07-16T10:40:10Z</dc:date>
    <item>
      <title>Read from a URL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-from-a-url/m-p/7121008#M1511118</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;The need is to read a file from a URL and parse it. The class CL_HTTP_REQUEST and CL_IXML is supposed to be used for the same. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The URL is like &lt;A href="https://abc.com/def" target="test_blank"&gt;https://abc.com/def&lt;/A&gt; . when we access the URL a txt file is read in the browser. we wish to programatically read this file in ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will be very much appreciated if any of you can share with us in case you have done something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhura&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jul 2010 10:40:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-from-a-url/m-p/7121008#M1511118</guid>
      <dc:creator>madhura_lobo</dc:creator>
      <dc:date>2010-07-16T10:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Read from a URL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-from-a-url/m-p/7121009#M1511119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Lobo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can refer to the code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INITIALIZATION.
  DATA : url_ TYPE string,
        http_client TYPE REF TO if_http_client,
        xbuffer TYPE xstring.

START-OF-SELECTION.
  url_ = 'http://bluepages.ibm.com'.
  CALL METHOD cl_http_client=&amp;gt;create_by_url
    EXPORTING
      url    = url_
    IMPORTING
      client = http_client
    EXCEPTIONS
      OTHERS = 1.
  CALL METHOD http_client-&amp;gt;request-&amp;gt;set_header_field
    EXPORTING
      name  = '~request_uri'
      value = '/BpHttpApis/slaphapi?ibmperson/((sn=Chow)(c=cn)).list/byxml'.
  CALL METHOD http_client-&amp;gt;send
    EXCEPTIONS
      http_communication_failure = 1
      http_invalid_state         = 2
      http_processing_failed     = 3.
  WRITE / sy-subrc.
  CALL METHOD http_client-&amp;gt;receive
    EXCEPTIONS
      http_communication_failure = 1
      http_invalid_state         = 2
      http_processing_failed     = 3.
  IF sy-subrc &amp;lt;&amp;gt; 0.
    WRITE / sy-subrc.
    EXIT.
  ENDIF.

END-OF-SELECTION.
  xbuffer = http_client-&amp;gt;response-&amp;gt;get_data( ).
  WRITE : / xbuffer.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards.&lt;/P&gt;&lt;P&gt;Jerry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jul 2010 13:29:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-from-a-url/m-p/7121009#M1511119</guid>
      <dc:creator>JerryWang</dc:creator>
      <dc:date>2010-07-16T13:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Read from a URL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-from-a-url/m-p/7121010#M1511120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jerry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the response. Was helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the url is https, and i am getting Native SSL error. Any idea how to get this solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added the following calls in addition to what you have specified above&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  http_client-&amp;gt;send_sap_logon_ticket( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  http_client-&amp;gt;request-&amp;gt;set_header_field( EXPORTING name  = '~request_method' "#EC NOTEXT&lt;/P&gt;&lt;P&gt;                                                   value = 'GET' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  cl_http_utility=&amp;gt;set_request_uri( request = http_client-&amp;gt;request&lt;/P&gt;&lt;P&gt;                                    uri     = url_ ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  http_client-&amp;gt;response-&amp;gt;get_status( IMPORTING code   = lv_status&lt;/P&gt;&lt;P&gt;                                           reason = lv_reason ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also specified the sap_username and sap_client in the create_by_url() method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the lv_status = 500 and lv_reason = Native SSL error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhura&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Jul 2010 05:26:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-from-a-url/m-p/7121010#M1511120</guid>
      <dc:creator>madhura_lobo</dc:creator>
      <dc:date>2010-07-17T05:26:58Z</dc:date>
    </item>
  </channel>
</rss>

