<?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 Validation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-validation/m-p/1469115#M220615</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;If the file does not exist then the SY-SUBRC will fail, if you give the wrong file name which is not existed in AL11 Transaction code then also the the SY-SUBRC will fail. so until unless if you give the right path which is existed in the Application server the SY-SUBRC will fail , so do not worry aboout the wrong paths&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>Wed, 02 Aug 2006 19:58:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-02T19:58:30Z</dc:date>
    <item>
      <title>File path Validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-validation/m-p/1469114#M220614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;validation of file path &lt;/P&gt;&lt;P&gt;Posted: Aug 2, 2006 2:42 PM      Reply      E-mail this post  &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET g_filepath IN TEXT MODE FOR INPUT&lt;/P&gt;&lt;P&gt;MESSAGE g_msg.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;MESSAGE e001 WITH 'File Already Exist' g_msg .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE DATASET g_filepath.&lt;/P&gt;&lt;P&gt;leave Program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE .&lt;/P&gt;&lt;P&gt;CLOSE DATASET g_filepath.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here when control goes to ELSE. then may be file doesnot exist or Invalid File Path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if File doesnot exist then OK . (I have to write data into it)&lt;/P&gt;&lt;P&gt;what to do when Invalid File Path ( eg /temp/gtc\abc.txt). here \ wrongly given.&lt;/P&gt;&lt;P&gt;so how o handle such wrong inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz reply&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2006 19:52:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-validation/m-p/1469114#M220614</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-02T19:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: File path Validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-validation/m-p/1469115#M220615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;If the file does not exist then the SY-SUBRC will fail, if you give the wrong file name which is not existed in AL11 Transaction code then also the the SY-SUBRC will fail. so until unless if you give the right path which is existed in the Application server the SY-SUBRC will fail , so do not worry aboout the wrong paths&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>Wed, 02 Aug 2006 19:58:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-validation/m-p/1469115#M220615</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-02T19:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: File path Validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-validation/m-p/1469116#M220616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sharada,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check these FM's&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONV_UTIL_CHECK_FILE_EXISTENCE&lt;/P&gt;&lt;P&gt;CV120_DOC_FILE_EXISTENCE_CHECK&lt;/P&gt;&lt;P&gt;CV122_DOC_FILE_EXISTENCE_CHECK&lt;/P&gt;&lt;P&gt;DX_FILE_EXISTENCE_CHECK &lt;/P&gt;&lt;P&gt;PFL_CHECK_OS_FILE_EXISTENCE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have u another idea!&lt;/P&gt;&lt;P&gt;try this following code&lt;/P&gt;&lt;P&gt;selection-screen begin of block b1 with frame .&lt;/P&gt;&lt;P&gt;PARAMETER : FILE(100) lower case.&lt;/P&gt;&lt;P&gt;selection-screen end of block b1.&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WS_FILENAME_GET'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DEF_FILENAME = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DEF_PATH = '&lt;STRONG&gt;.&lt;/STRONG&gt;'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MASK = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MODE = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TITLE = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;FILENAME = FILE&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;RC =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2006 20:02:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-validation/m-p/1469116#M220616</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-02T20:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: File path Validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-validation/m-p/1469117#M220617</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;check this FM, if this FM returns sy-subrc not equal to zero , that means , given path is invalid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: ifile type table of  salfldir with header line.

parameters: p_path type salfile-longname
                    default '/temp/gtcabc.txt'


call function 'RZL_READ_DIR_LOCAL'
     exporting
          name           = p_path
     tables
          file_tbl       = ifile
     exceptions
          argument_error = 1
          not_found      = 2
          others         = 3.
       if sy-subrc ne 0.
         ----invalid path
       endif.

and also you can check like this :

read ifile index 1.
if ifile-name is initial.
   ----invalid path
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Appana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2006 20:04:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-validation/m-p/1469117#M220617</guid>
      <dc:creator>Laxmana_Appana_</dc:creator>
      <dc:date>2006-08-02T20:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: File path Validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-validation/m-p/1469118#M220618</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 cannot find out if the error is because of invalid path provided or because of the file not available.&lt;/P&gt;&lt;P&gt;For both the errors OPEN DATASET returns SY-SUBRC EQ 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sudhir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2006 20:27:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-validation/m-p/1469118#M220618</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-02T20:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: File path Validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-validation/m-p/1469119#M220619</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;Check the below post , Hope this may be helpful.&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="1024810"&gt;&lt;/A&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>Wed, 02 Aug 2006 21:04:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-path-validation/m-p/1469119#M220619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-02T21:04:50Z</dc:date>
    </item>
  </channel>
</rss>

