<?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 file from application server in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-file-from-application-server/m-p/2753962#M640665</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OPEN DATASET LV_FILENAME FOR INPUT IN TEXT MODE MESSAGE MSG.&lt;/P&gt;&lt;P&gt;         DO.&lt;/P&gt;&lt;P&gt;*-- Read Dataset and Populate Input file data to Internal Table&lt;/P&gt;&lt;P&gt;          READ DATASET LV_FILENAME INTO IT_DATA2.&lt;/P&gt;&lt;P&gt;          IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;*-- Append and Initialize table&lt;/P&gt;&lt;P&gt;            APPEND IT_DATA2.&lt;/P&gt;&lt;P&gt;            CLEAR  IT_DATA2.&lt;/P&gt;&lt;P&gt;          ELSE.&lt;/P&gt;&lt;P&gt;*-- Exit Out of DO loop if READ is unsuccess&lt;/P&gt;&lt;P&gt;            EXIT.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;        ENDDO.&lt;/P&gt;&lt;P&gt;*-- Close Dataset&lt;/P&gt;&lt;P&gt; close datset lv_filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_data2.&lt;/P&gt;&lt;P&gt;split it_data2-line at ';' into it_data-field1 it_data-field2....&lt;/P&gt;&lt;P&gt;append it_data.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Sep 2007 19:49:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-12T19:49:00Z</dc:date>
    <item>
      <title>read file from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-file-from-application-server/m-p/2753960#M640663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guru,&lt;/P&gt;&lt;P&gt;  i am reading file from application server which is seprated by semicolumn.&lt;/P&gt;&lt;P&gt; How can i read this file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnaks&lt;/P&gt;&lt;P&gt;Neo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2007 19:45:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-file-from-application-server/m-p/2753960#M640663</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-12T19:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: read file from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-file-from-application-server/m-p/2753961#M640664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Declare an itab with one field of type string. Read the file into this itab using OPEN DATASET statement.. then loop at this itab &amp;amp; SPLIT the &amp;lt;fld&amp;gt; at ';' into diff fields of a work area.. append that work area to another itab of the desired  structure.. get it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2007 19:48:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-file-from-application-server/m-p/2753961#M640664</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-12T19:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: read file from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-file-from-application-server/m-p/2753962#M640665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OPEN DATASET LV_FILENAME FOR INPUT IN TEXT MODE MESSAGE MSG.&lt;/P&gt;&lt;P&gt;         DO.&lt;/P&gt;&lt;P&gt;*-- Read Dataset and Populate Input file data to Internal Table&lt;/P&gt;&lt;P&gt;          READ DATASET LV_FILENAME INTO IT_DATA2.&lt;/P&gt;&lt;P&gt;          IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;*-- Append and Initialize table&lt;/P&gt;&lt;P&gt;            APPEND IT_DATA2.&lt;/P&gt;&lt;P&gt;            CLEAR  IT_DATA2.&lt;/P&gt;&lt;P&gt;          ELSE.&lt;/P&gt;&lt;P&gt;*-- Exit Out of DO loop if READ is unsuccess&lt;/P&gt;&lt;P&gt;            EXIT.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;        ENDDO.&lt;/P&gt;&lt;P&gt;*-- Close Dataset&lt;/P&gt;&lt;P&gt; close datset lv_filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_data2.&lt;/P&gt;&lt;P&gt;split it_data2-line at ';' into it_data-field1 it_data-field2....&lt;/P&gt;&lt;P&gt;append it_data.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2007 19:49:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-file-from-application-server/m-p/2753962#M640665</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-12T19:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: read file from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-file-from-application-server/m-p/2753963#M640666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are going to want to do something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

data: str type string.

data: begin of itab occurs 0,
      fld1(10) type c,
      fld2(10) type c,
      fld3(10) type c,
      end   of itab.

data:
      dsn(500) value '/usr/sap/TST/sys/test.txt'.

clear itab.  refresh itab.

* Read the data.
open dataset dsn for input in binary mode.
do.
  read dataset dsn into str.
  if sy-subrc = 0.
   split str at ';' into itab-fld1 itab-fld2 itab-fld3.
    append itab.
  else.
    exit.
  endif.
enddo.
close dataset dsn.


Loop at itab.
  write:/ itab-fld1, itab-fld2, itab-fld3.
endloop.

&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2007 19:49:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-file-from-application-server/m-p/2753963#M640666</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-09-12T19:49:40Z</dc:date>
    </item>
  </channel>
</rss>

