<?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 Text file from application server into internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548601#M1074190</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;Use OPEN DATASET and READ DATASET keywords.&lt;/P&gt;&lt;P&gt;Go through the F1 Help available for these key words.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Sep 2008 10:40:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-30T10:40:08Z</dc:date>
    <item>
      <title>Read Text file from application server into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548596#M1074185</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 want to read a text file stored on application server into my internal table.&lt;/P&gt;&lt;P&gt;Eg. my text file contains 10 userids  i want to read those into my Itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can i do this...................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please provide me sample code for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vinod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2008 09:58:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548596#M1074185</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-30T09:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Read Text file from application server into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548597#M1074186</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;Use the FM GUI_UPLOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Search SDN for sample code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2008 10:00:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548597#M1074186</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-30T10:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Read Text file from application server into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548598#M1074187</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;Use &lt;STRONG&gt;OPEN DATASET, READ DATASET&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

Data : p_file type rlgrap-filename,   " Application Server file path
          lt_input type table of typ_input " Internal table

open dataset p_file for input in text mode encoding default.
      if sy-subrc = 0.
        do.
          read dataset p_file into ls_input-wa_string.
          if sy-subrc eq 0.
            append ls_input to lt_input.
          else.
            exit.
          endif.
        enddo.
      endif.
      close dataset p_file.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope it will helps&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2008 10:00:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548598#M1074187</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-30T10:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Read Text file from application server into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548599#M1074188</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;These are so many threads on this .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GUI_DOWNLOAD  use this FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rhea.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2008 10:05:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548599#M1074188</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-30T10:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Read Text file from application server into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548600#M1074189</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;For reading a file from Appl server you have to use the statement: Read dataset command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For writing a file to Appl server, use : Open dataset command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for eg:in case of reading data from application server:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET f_name FOR &lt;STRONG&gt;INPUT&lt;/STRONG&gt; IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;READ DATASET f_name INTO w_data1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  SPLIT w_data1 AT w_char INTO fs_bkpf-bukrs&lt;/P&gt;&lt;P&gt;                               fs_bkpf-gjahr&lt;/P&gt;&lt;P&gt;                               fs_bkpf-blart&lt;/P&gt;&lt;P&gt;                               fs_bkpf-bldat&lt;/P&gt;&lt;P&gt;                               fs_bkpf-budat&lt;/P&gt;&lt;P&gt;                               fs_bkpf-monat&lt;/P&gt;&lt;P&gt;                               fs_bkpf-cpudt.&lt;/P&gt;&lt;P&gt;  APPEND fs_bkpf TO t_bkpf.  -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;&amp;gt; this will be your internal table.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CLOSE DATASET f_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnaks,&lt;/P&gt;&lt;P&gt;Rashmi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2008 10:18:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548600#M1074189</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-30T10:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Read Text file from application server into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548601#M1074190</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;Use OPEN DATASET and READ DATASET keywords.&lt;/P&gt;&lt;P&gt;Go through the F1 Help available for these key words.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2008 10:40:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548601#M1074190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-30T10:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Read Text file from application server into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548602#M1074191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;check this thread, &lt;/P&gt;&lt;P&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="994822"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2008 10:42:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548602#M1074191</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-30T10:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Read Text file from application server into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548603#M1074192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just one correction to the presented code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
open dataset p_file for input in text mode encoding default.
if sy-subrc = 0.
  do.
    read dataset p_file into ls_input-wa_string.
    if sy-subrc eq 0.
      append ls_input to lt_input.
    else.
      exit.
    endif.
  enddo.
  close dataset p_file. "NEW LOCATION TO CLOSE  
endif.
"PREVIOUS LOCATION TO CLOSE
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;If you try to close the file without success in open file, you'll get a short dump. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Valter Oliveira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2008 10:56:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548603#M1074192</guid>
      <dc:creator>valter_oliveira</dc:creator>
      <dc:date>2008-09-30T10:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Read Text file from application server into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548604#M1074193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Venu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             now i am able to read the terx file into internal table my internal table has only one field userid.  &lt;/P&gt;&lt;P&gt;             now i have one problem regarding formating of that data. while reading the data from applaction server # sign is coming after every record how can i eliminate that sign. i have also applied  that shifting code but still it is not working &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you give me the solution &lt;/P&gt;&lt;P&gt;following is my code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:  BEGIN OF unlk_tab OCCURS 0, " with header line,&lt;/P&gt;&lt;P&gt;       username LIKE xu200-xuser,&lt;/P&gt;&lt;P&gt;       END OF unlk_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  OPEN DATASET dsn FOR INPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*loop at dsn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ DATASET dsn INTO unlk_tab-username.&lt;/P&gt;&lt;P&gt;    IF sy-subrc EQ '0'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    shift unlk_tab-username right deleting trailing l_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      APPEND unlk_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2008 11:00:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548604#M1074193</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-30T11:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Read Text file from application server into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548605#M1074194</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;from the same thread try this code using field symbols concept &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it will work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: l_tab(1) type c value cl_abap_char_utilities=&amp;gt;horizontal_tab.&lt;/P&gt;&lt;P&gt;data: T_FIELD(1000) TYPE C OCCURS 0.&lt;/P&gt;&lt;P&gt;data: &amp;lt;fs&amp;gt; type any.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;open dataset wk_filepath for input in text mode encoding default.&lt;/P&gt;&lt;P&gt;do .&lt;/P&gt;&lt;P&gt;  read dataset wk_filepath into wk_file.&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;*split wk_file at l_tab into l_h_tbl_upload-fld1 l_h_tbl_upload-fld2....&lt;/P&gt;&lt;P&gt;   SPLIT wk_file at l_tab INTO TABLE T_FIELD.&lt;/P&gt;&lt;P&gt;   LOOP AT T_FIELD.&lt;/P&gt;&lt;P&gt;     ASSIGN COMPONENT SY-TABIX OF STRUCTURE l_h_tbl_upload to &amp;lt;FS&amp;gt;.&lt;/P&gt;&lt;P&gt;    &amp;lt;FS&amp;gt; = T_FIELD.&lt;/P&gt;&lt;P&gt;   ENDLOOP.&lt;/P&gt;&lt;P&gt;   append l_h_tbl_upload to fc_tbl_upload.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;close dataset l_wk_filepath.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2008 11:40:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-text-file-from-application-server-into-internal-table/m-p/4548605#M1074194</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-30T11:40:52Z</dc:date>
    </item>
  </channel>
</rss>

