<?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 a file from folder in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352877#M519569</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;why don't try in SXDB Transaction ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GOTO SXDB -&amp;gt; object 0010 -&amp;gt; enter -&amp;gt; click on copy -&amp;gt;here copy from and copy to&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jun 2007 15:12:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-11T15:12:43Z</dc:date>
    <item>
      <title>Read a file from folder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352869#M519561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i need to get a file from application server folder with date validation.&lt;/P&gt;&lt;P&gt;how do i get the file from foder with fname, size and date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 14:49:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352869#M519561</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T14:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Read a file from folder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352870#M519562</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 CG3Y or CG3Z transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 14:51:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352870#M519562</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T14:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Read a file from folder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352871#M519563</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;Plz elaborate on your requirment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 14:52:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352871#M519563</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T14:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Read a file from folder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352872#M519564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i need to develop the interface based on input file, it will be placed on application server foder with different file names, so i need to  read that folder and look for specific file  *.txt copy into my ITAB.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 14:57:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352872#M519564</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T14:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Read a file from folder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352873#M519565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is Rich example ..... try this......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;report zrich_0001 .
 
data: begin of itab occurs 0,
      rec(1000) type c,
      end of itab.
data: wa(1000) type c.
 
data: p_file type localfile.
data: ifile type table of  salfldir with header line.
 
parameters: p_path type salfile-longname
                    default '/usr/sap/TST/DVEBMGS01/data/'.
 
 
call function 'RZL_READ_DIR_LOCAL'
     exporting
          name           = p_path
     tables
          file_tbl       = ifile
     exceptions
          argument_error = 1
          not_found      = 2
          others         = 3.
 
loop at ifile.
  format hotspot on.
  write:/ ifile-name.
  hide ifile-name.
  format hotspot off.
endloop.
 
 
at line-selection.
 
  concatenate p_path ifile-name into p_file.
 
  clear itab.  refresh itab.
  open dataset p_file for input in text mode.
  if sy-subrc = 0.
    do.
      read dataset p_file into wa.
      if sy-subrc &amp;lt;&amp;gt; 0.
        exit.
      endif.
      itab-rec = wa.
      append itab.
    enddo.
  endif.
  close dataset p_file.
 
  loop at itab.
    write:/ itab.
  endloop.
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 15:01:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352873#M519565</guid>
      <dc:creator>former_member187255</dc:creator>
      <dc:date>2007-06-11T15:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Read a file from folder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352874#M519566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks, it doesn't  have the date stamp.&lt;/P&gt;&lt;P&gt;how can i get one with fname, size &amp;amp; date&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 15:03:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352874#M519566</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T15:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Read a file from folder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352875#M519567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the file is given as input in the selection screen u can use Dataset. (Open dataset). If there is no selection screen then the filename will be the same with te date and time stamp. &lt;/P&gt;&lt;P&gt;EX : Prgram name  : ztest&lt;/P&gt;&lt;P&gt;       file name     :   ztest_11062007_050311 (Program name _ date _time)&lt;/P&gt;&lt;P&gt;This will be the format so u can use dataset and u can build the filename in your program and use it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Umasankar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 15:04:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352875#M519567</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T15:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Read a file from folder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352876#M519568</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 try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    DATA: FILETAB TYPE TABLE OF FILE_INFO,
          FILEREC TYPE FILE_INFO,
          COUNT TYPE i,
          FZISE TYPE i.

    CALL METHOD CL_GUI_FRONTEND_SERVICES=&amp;gt;DIRECTORY_LIST_FILES
      EXPORTING
        DIRECTORY                   = '&amp;lt;Yourfilename&amp;gt;'
        FILTER                      = ''
        FILES_ONLY                  = 'X'
      CHANGING
        FILE_TABLE                  = FILETAB
        COUNT                       = COUNT
      EXCEPTIONS
        CNTL_ERROR                  = 1
        DIRECTORY_LIST_FILES_FAILED = 2
        WRONG_PARAMETER             = 3
        ERROR_NO_GUI                = 4
        others                      = 5.
 
    IF SY-SUBRC &amp;lt;&amp;gt; 0.
      RAISE CNTL_ERROR.
    ENDIF.
 
    IF COUNT = 0.
*     Does not exist
      RESULT = ABAP_FALSE.
      FSIZE  = 0.
    ELSE.
*     Does exist
      RESULT = ABAP_TRUE.
      READ FILETAB INDEX 1 INTO FILEREC.
      FSIZE = FILEREC-FILELENGTH.
    ENDIF.
&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;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 15:09:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352876#M519568</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2007-06-11T15:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Read a file from folder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352877#M519569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;why don't try in SXDB Transaction ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GOTO SXDB -&amp;gt; object 0010 -&amp;gt; enter -&amp;gt; click on copy -&amp;gt;here copy from and copy to&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 15:12:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-a-file-from-folder/m-p/2352877#M519569</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T15:12:43Z</dc:date>
    </item>
  </channel>
</rss>

