<?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 stmt in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-stmt/m-p/1457715#M216273</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mohan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE statement is used to read single record of a Internal Tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ cannot be used for reading data from Presentation server(PC). &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;READ DATASET&amp;lt;/b&amp;gt; is used for reading files on Application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA : msg(200). "For holding messages during OPEN DATASET
 
DATA : i_int LIKE tedata-data.
 
 
OPEN DATASET w_path FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE msg.
 
 
IF sy-subrc NE 0.
  MESSAGE w_osmsg TYPE 'S' DISPLAY LIKE 'E'.
  LEAVE LIST-PROCESSING.
ENDIF.
 
DO.
  READ DATASET w_path INTO i_int.
 
  IF sy-subrc EQ 0.
    
    APPEND i_int.
    CLEAR  i_int.
    
  ELSE.
 
    EXIT.
  ENDIF.
 
 
ENDDO.
 
  CLOSE DATASET w_path.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If READ DATASET is used before opening a file,  READ DATASET  tries to open a file (IN BINARY MODE FOR INPUT or with the options of the last OPEN DATASET statement for this file)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reading files on Presentation server use FM'S &amp;lt;b&amp;gt;GUI_UPLOAD&amp;lt;/b&amp;gt; for getting data from Presentation server to ABAP PRogram and &amp;lt;b&amp;gt;GUI_DOWNLOAD&amp;lt;/b&amp;gt; for putting data from ABAP PRogram to Presentation server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun Samabrgi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Jul 2006 11:31:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-17T11:31:43Z</dc:date>
    <item>
      <title>read stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-stmt/m-p/1457709#M216267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;using read stmt is it possible to open the file in presentation server then how?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jul 2006 11:25:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-stmt/m-p/1457709#M216267</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-17T11:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: read stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-stmt/m-p/1457710#M216268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mohan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reading the file in the presentation server u have to use GUI_UPLOAD Fm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If useful reward points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jul 2006 11:28:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-stmt/m-p/1457710#M216268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-17T11:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: read stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-stmt/m-p/1457711#M216269</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 can open the file from the presentation server using &lt;/P&gt;&lt;P&gt;gui_upload fm. why you want to use the read statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;kishore&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jul 2006 11:29:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-stmt/m-p/1457711#M216269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-17T11:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: read stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-stmt/m-p/1457712#M216270</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;  Yes, it is possible, refer the following,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Retrieve Data file from Application server(Upload from Unix)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: i_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    OPEN DATASET i_file FOR INPUT IN TEXT MODE.&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;      MESSAGE e999(za) WITH 'Error opening file' i_file.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    DO.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Reads each line of file individually&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      READ DATASET i_file INTO wa_datatab.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Perform processing here&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    .....   &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ENDDO.&lt;/P&gt;&lt;P&gt;You can also refer the following link to understand how it works, &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/file/file_updown.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/file/file_updown.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jul 2006 11:29:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-stmt/m-p/1457712#M216270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-17T11:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: read stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-stmt/m-p/1457713#M216271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  You can use the FM GUI_UPLOAD to fetch the file from the presentation server into an internal table.You can read the internal table to fetch the data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jul 2006 11:30:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-stmt/m-p/1457713#M216271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-17T11:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: read stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-stmt/m-p/1457714#M216272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;READ statement is used in case of DATASET. For file on presentation server, you should GUI_UPLOAD function or method GUI_UPLOAD of CL_GUI_FRONTEND_SERVICES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note : Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jul 2006 11:30:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-stmt/m-p/1457714#M216272</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-17T11:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: read stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-stmt/m-p/1457715#M216273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mohan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE statement is used to read single record of a Internal Tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ cannot be used for reading data from Presentation server(PC). &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;READ DATASET&amp;lt;/b&amp;gt; is used for reading files on Application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA : msg(200). "For holding messages during OPEN DATASET
 
DATA : i_int LIKE tedata-data.
 
 
OPEN DATASET w_path FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE msg.
 
 
IF sy-subrc NE 0.
  MESSAGE w_osmsg TYPE 'S' DISPLAY LIKE 'E'.
  LEAVE LIST-PROCESSING.
ENDIF.
 
DO.
  READ DATASET w_path INTO i_int.
 
  IF sy-subrc EQ 0.
    
    APPEND i_int.
    CLEAR  i_int.
    
  ELSE.
 
    EXIT.
  ENDIF.
 
 
ENDDO.
 
  CLOSE DATASET w_path.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If READ DATASET is used before opening a file,  READ DATASET  tries to open a file (IN BINARY MODE FOR INPUT or with the options of the last OPEN DATASET statement for this file)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reading files on Presentation server use FM'S &amp;lt;b&amp;gt;GUI_UPLOAD&amp;lt;/b&amp;gt; for getting data from Presentation server to ABAP PRogram and &amp;lt;b&amp;gt;GUI_DOWNLOAD&amp;lt;/b&amp;gt; for putting data from ABAP PRogram to Presentation server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun Samabrgi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jul 2006 11:31:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-stmt/m-p/1457715#M216273</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-17T11:31:43Z</dc:date>
    </item>
  </channel>
</rss>

