<?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: 'File path is invalid' in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319595#M164896</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a good sample puttin the two together, the program will give a list of the file in the directory and then allow you to write the file contents to the list display by clicking on the filename.&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/comm/recv/in/MMSC07/'.


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;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>Thu, 08 Jun 2006 20:15:34 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-06-08T20:15:34Z</dc:date>
    <item>
      <title>'File path is invalid'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319587#M164888</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;I have a file name in the server:&lt;/P&gt;&lt;P&gt;/usr/sap/comm/recv/in/MMSC07/PIR1.txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'RZL_READ_DIR_LOCAL'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      name           = v_afile&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      file_tbl       = gt_files&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      argument_error = 1&lt;/P&gt;&lt;P&gt;      not_found      = 2&lt;/P&gt;&lt;P&gt;      OTHERS         = 3.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE e101 WITH v_afile.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_afile =/usr/sap/comm/recv/in/MMSC07/PIR1.txt&lt;/P&gt;&lt;P&gt;sy-subrc ='2' as result&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------" /&gt;&lt;P&gt;in function: 'RZL_READ_DIR_LOCAL'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FULL_NAME = NAME. =/usr/sap/comm/recv/in/MMSC07/PIR1.txt&lt;/P&gt;&lt;P&gt;CALL 'ALERTS'  ID 'ADMODE'       FIELD AD_RZL&lt;/P&gt;&lt;P&gt;               ID 'OPCODE'       FIELD RZL_OP_RD_DIR&lt;/P&gt;&lt;P&gt;               ID 'FILE_NAME'    FIELD FULL_NAME&lt;/P&gt;&lt;P&gt;               ID 'DIR_TBL'      FIELD LINE_TBL-&lt;STRONG&gt;SYS&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE SY-SUBRC.&lt;/P&gt;&lt;P&gt;    WHEN 0.   LOOP AT LINE_TBL.&lt;/P&gt;&lt;P&gt;                FILE_TBL-SIZE = LINE_TBL(10).&lt;/P&gt;&lt;P&gt;                FILE_TBL-NAME = LINE_TBL+12.&lt;/P&gt;&lt;P&gt;                APPEND FILE_TBL.&lt;/P&gt;&lt;P&gt;              ENDLOOP.&lt;/P&gt;&lt;P&gt;    WHEN OTHERS.  RAISE NOT_FOUND.&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got '1' for SY_SUBRC. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The message is &amp;lt;b&amp;gt;'File path is invalid'&amp;lt;/b&amp;gt;. &lt;/P&gt;&lt;P&gt;I double check the path and the file is there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my questions:&lt;/P&gt;&lt;P&gt;1. is 'RZL_READ_DIR_LOCAL' SAP deliveried function?&lt;/P&gt;&lt;P&gt;2. What the CALL 'ALERTS' do?  &lt;/P&gt;&lt;P&gt;   why I got '1' as result?  &lt;/P&gt;&lt;P&gt;   where I can see the source code?&lt;/P&gt;&lt;P&gt;3. How to let the ABAP pgm locate my file and do the process?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jun 2006 19:39:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319587#M164888</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-08T19:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: 'File path is invalid'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319588#M164889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Helen&lt;/P&gt;&lt;P&gt;  Put that file name in this way i.e, within a colon..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;v_afile = '/usr/sap/comm/recv/in/MMSC07/PIR1.txt'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;REWARD IF IT HELPS&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jun 2006 19:43:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319588#M164889</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-08T19:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: 'File path is invalid'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319589#M164890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi helen use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_afile = '/usr/sap/comm/recv/in/MMSC07/PIR1.txt'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Abdul Hakim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark all useful answers..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jun 2006 19:46:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319589#M164890</guid>
      <dc:creator>abdul_hakim</dc:creator>
      <dc:date>2006-06-08T19:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: 'File path is invalid'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319590#M164891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the method describe in this thread !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1472215"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;SK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jun 2006 19:47:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319590#M164891</guid>
      <dc:creator>former_member181966</dc:creator>
      <dc:date>2006-06-08T19:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: 'File path is invalid'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319591#M164892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a standard SAP FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try cutting and pasting the name of the file (from wherever you check that it exists) into the variable v_afile. Check that it's the same when the FM is entered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jun 2006 19:52:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319591#M164892</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-08T19:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: 'File path is invalid'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319592#M164893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Helen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope u better try this way...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: v_afile like  SALFILE-LONGNAME .&lt;/P&gt;&lt;P&gt;v_afile = '/usr/sap/comm/recv/in/MMSC07/PIR1.txt'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then pass v_afile to FM 'RZL_READ_DIR_LOCAL'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jun 2006 19:54:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319592#M164893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-08T19:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: 'File path is invalid'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319593#M164894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think that this function module is designed to read your file, only the directory.  So if you where to do something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001 .

data: ifile type table of  salfldir with header line.

parameters: p_file type salfile-longname
                    default '/usr/sap/comm/recv/in/MMSC07/'.


call function 'RZL_READ_DIR_LOCAL'
     exporting
          name           = p_file
     tables
          file_tbl       = ifile
     exceptions
          argument_error = 1
          not_found      = 2
          others         = 3.


loop at ifile.
  write:/ ifile.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then this program would show your PIR.txt file in the output list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to read the file itself, please use OPEN DATASET.&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>Thu, 08 Jun 2006 19:59:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319593#M164894</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-08T19:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: 'File path is invalid'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319594#M164895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the sample application for OPEN DATASET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

Parameters: d1 type localfile default '/usr/sap/TST/SYS/Data1.txt'.
         

data: begin of itab occurs 0,
      rec(1000) type c,
      end of itab.
data: wa(1000) type c.


start-of-selection.

  open dataset d1 for input in text mode.
  if sy-subrc = 0.
    do.
      read dataset d1 into wa.
      if sy-subrc &amp;lt;&amp;gt; 0.
        exit.
      endif.
      itab-rec = wa.
      append itab.
    enddo.
  endif.
  close dataset d1.





&lt;/CODE&gt;&lt;/PRE&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>Thu, 08 Jun 2006 20:00:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319594#M164895</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-08T20:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: 'File path is invalid'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319595#M164896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a good sample puttin the two together, the program will give a list of the file in the directory and then allow you to write the file contents to the list display by clicking on the filename.&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/comm/recv/in/MMSC07/'.


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;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>Thu, 08 Jun 2006 20:15:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319595#M164896</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-08T20:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: 'File path is invalid'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319596#M164897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Write the file name in the single codes.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;v_afile = '/usr/sap/comm/recv/in/MMSC07/PIR1.txt'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) RZL_READ_DIR_LOCAL --&amp;gt; Get list of files within specific directory(Application Server)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) If you want to Locate the file .. then use the DATASET functionmodules&lt;/P&gt;&lt;P&gt;OPEN_DATASET &amp;lt;Dataset name&amp;gt; &amp;lt;Text mode&amp;gt;&lt;/P&gt;&lt;P&gt;CLOSE_DATASET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jun 2006 20:21:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-is-invalid/m-p/1319596#M164897</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-08T20:21:22Z</dc:date>
    </item>
  </channel>
</rss>

