<?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 Directory &amp; file from appilcation server in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-directory-file-from-appilcation-server/m-p/948234#M64691</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gaurav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in fm EPS_GET_DIRECTORY_LISTING there're bugs , if you're searching with wildcards- so best solution ist to use sm69 , as Deepak writes, with unix command &amp;lt;b&amp;gt;find&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:  find /home -name abc.txt -print&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Jul 2005 06:31:17 GMT</pubDate>
    <dc:creator>andreas_mann3</dc:creator>
    <dc:date>2005-07-08T06:31:17Z</dc:date>
    <item>
      <title>Read Directory &amp; file from appilcation server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-directory-file-from-appilcation-server/m-p/948230#M64687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing a problem,the rquirement is to First read an directory &amp;amp; then inside that directory ,I need to trad file.&lt;/P&gt;&lt;P&gt;there exist a fn module which reads from file from the directory.But if any sub directory also exist in that main directory ,then it raises an exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one provide a way out to read directory first &amp;amp; subsequently a file in that directory,assuming that sub directories too exist in main directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks  for all forthcoming responses.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2005 15:52:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-directory-file-from-appilcation-server/m-p/948230#M64687</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-07T15:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Read Directory &amp; file from appilcation server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-directory-file-from-appilcation-server/m-p/948231#M64688</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 inside your code, you can run a script as an OS level command (not an elegant option) that does some of the work for you. For example, you can create a directory listing (using commands like ls or dir &amp;lt;&amp;lt; in the script) into a text file and store this text file in a specified location where there is no subdirectory. You can then read this text file using standard commands(open dataset) to get all the file locations. Finally, you have the complete path and the filename in your program, so you can choose to read the required file (open dataset).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There must certainly be some FM that handles it, but this will also do.&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2005 16:51:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-directory-file-from-appilcation-server/m-p/948231#M64688</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-07T16:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Read Directory &amp; file from appilcation server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-directory-file-from-appilcation-server/m-p/948232#M64689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gaurav,&lt;/P&gt;&lt;P&gt;pls try function module 'EPS_GET_DIRECTORY_LISTING'.&lt;/P&gt;&lt;P&gt;I hope it helps. BR,&lt;/P&gt;&lt;P&gt;Alvaro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2005 16:52:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-directory-file-from-appilcation-server/m-p/948232#M64689</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-07T16:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Read Directory &amp; file from appilcation server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-directory-file-from-appilcation-server/m-p/948233#M64690</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;This FM 'EPS_GET_DIRECTORY_LISTING' requires Basis authorisations hence it maynot be a good option. I once had issues with this authorisations and later had to use the External OS command created in SM69. Use FM SXPG_COMMAND_EXECUTE to run the external OS commands&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Deepak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2005 20:08:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-directory-file-from-appilcation-server/m-p/948233#M64690</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-07T20:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: Read Directory &amp; file from appilcation server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-directory-file-from-appilcation-server/m-p/948234#M64691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gaurav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in fm EPS_GET_DIRECTORY_LISTING there're bugs , if you're searching with wildcards- so best solution ist to use sm69 , as Deepak writes, with unix command &amp;lt;b&amp;gt;find&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:  find /home -name abc.txt -print&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2005 06:31:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-directory-file-from-appilcation-server/m-p/948234#M64691</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2005-07-08T06:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Read Directory &amp; file from appilcation server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-directory-file-from-appilcation-server/m-p/948235#M64692</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 also call some internal functions to retrieve a dir listing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report  zdirlist                      .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of tfile,&lt;/P&gt;&lt;P&gt;        dirname(75) type c, " name of directory. (possibly truncated.)&lt;/P&gt;&lt;P&gt;        name(75)    type c, " name of entry. (possibly truncated.)&lt;/P&gt;&lt;P&gt;        type(10)    type c, " type of entry.&lt;/P&gt;&lt;P&gt;        len(8)      type p, " length in bytes.&lt;/P&gt;&lt;P&gt;        owner(8)    type c, " owner of the entry.&lt;/P&gt;&lt;P&gt;        mtime(6)    type p, " last modification date, seconds since 1970&lt;/P&gt;&lt;P&gt;        mode(9)     type c, " like "rwx-r-x--x": protection mode.&lt;/P&gt;&lt;P&gt;        errno(3)    type c,&lt;/P&gt;&lt;P&gt;        errmsg(40)  type c,&lt;/P&gt;&lt;P&gt;       end of tfile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lv_eps_subdir     like epsf-epssubdir.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: dir_list type table of tfile&lt;/P&gt;&lt;P&gt;                    with header line,&lt;/P&gt;&lt;P&gt;      file_counter  type i,&lt;/P&gt;&lt;P&gt;      error_counter type i,&lt;/P&gt;&lt;P&gt;      field_counter type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;f&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: dir_name  like epsf-epsdirnam,&lt;/P&gt;&lt;P&gt;            filemask like epsf-epsfilnam.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Start&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get directory listing&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;call 'C_DIR_READ_FINISH'                  " just to be sure&lt;/P&gt;&lt;P&gt;      id 'ERRNO'  field dir_list-errno&lt;/P&gt;&lt;P&gt;      id 'ERRMSG' field dir_list-errmsg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call 'C_DIR_READ_START'&lt;/P&gt;&lt;P&gt;      id 'DIR'    field dir_name&lt;/P&gt;&lt;P&gt;      id 'FILE'   field filemask&lt;/P&gt;&lt;P&gt;      id 'ERRNO'  field dir_list-errno&lt;/P&gt;&lt;P&gt;      id 'ERRMSG' field dir_list-errmsg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  raise read_directory_failed.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refresh dir_list.&lt;/P&gt;&lt;P&gt;clear file_counter.&lt;/P&gt;&lt;P&gt;clear error_counter.&lt;/P&gt;&lt;P&gt;do.&lt;/P&gt;&lt;P&gt;  clear dir_list.&lt;/P&gt;&lt;P&gt;  call 'C_DIR_READ_NEXT'&lt;/P&gt;&lt;P&gt;        id 'TYPE'   field dir_list-type&lt;/P&gt;&lt;P&gt;        id 'NAME'   field dir_list-name&lt;/P&gt;&lt;P&gt;        id 'LEN'    field dir_list-len&lt;/P&gt;&lt;P&gt;        id 'OWNER'  field dir_list-owner&lt;/P&gt;&lt;P&gt;        id 'MTIME'  field dir_list-mtime&lt;/P&gt;&lt;P&gt;        id 'MODE'   field dir_list-mode&lt;/P&gt;&lt;P&gt;        id 'ERRNO'  field dir_list-errno&lt;/P&gt;&lt;P&gt;        id 'ERRMSG' field dir_list-errmsg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    add 1 to file_counter.&lt;/P&gt;&lt;P&gt;    append dir_list.&lt;/P&gt;&lt;P&gt;  elseif sy-subrc = 1.&lt;/P&gt;&lt;P&gt;    exit.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    if error_counter &amp;gt; 100.&lt;/P&gt;&lt;P&gt;      call 'C_DIR_READ_FINISH'&lt;/P&gt;&lt;P&gt;            id 'ERRNO'  field dir_list-errno&lt;/P&gt;&lt;P&gt;            id 'ERRMSG' field dir_list-errmsg.&lt;/P&gt;&lt;P&gt;      write: / 'Too many read errors'.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    add 1 to error_counter.&lt;/P&gt;&lt;P&gt;    append dir_list.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call 'C_DIR_READ_FINISH'&lt;/P&gt;&lt;P&gt;      id 'ERRNO'  field dir_list-errno&lt;/P&gt;&lt;P&gt;      id 'ERRMSG' field dir_list-errmsg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if file_counter &amp;gt; 0.&lt;/P&gt;&lt;P&gt;  sort dir_list by name ascending.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;  write: / 'Empty directory'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at dir_list.&lt;/P&gt;&lt;P&gt;  clear field_counter.&lt;/P&gt;&lt;P&gt;  write: /.&lt;/P&gt;&lt;P&gt;  do.&lt;/P&gt;&lt;P&gt;    add 1 to field_counter.&lt;/P&gt;&lt;P&gt;    assign component field_counter&lt;/P&gt;&lt;P&gt;           of structure dir_list to &amp;lt;f&amp;gt;.&lt;/P&gt;&lt;P&gt;    if not sy-subrc is initial.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    write: &amp;lt;f&amp;gt;, ' '.&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I don't know if there are special user rights required and how portable this is...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps (please reward me if it does &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joerg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2005 06:43:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-directory-file-from-appilcation-server/m-p/948235#M64692</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-08T06:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: Read Directory &amp; file from appilcation server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-directory-file-from-appilcation-server/m-p/948236#M64693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi floks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thansk for all your help.&lt;/P&gt;&lt;P&gt;I am rewarding you your due.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to share fm 'RZL_READ_DIR_LOCAL' did the trick for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2005 06:09:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-directory-file-from-appilcation-server/m-p/948236#M64693</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-21T06:09:43Z</dc:date>
    </item>
  </channel>
</rss>

