<?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 EXISTING VALIDATION in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-existing-validation/m-p/2559204#M583530</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;Open the file using the OPEN DATASET syntax..If the return code is not successful..then the file does not exits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

OPEN DATASET '/tmp/test.txt' FOR INPUT.

IF SY-SUBRC &amp;lt;&amp;gt; 0.
  MESSAGE 'Error in opening file or file does not exists'.
ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Jul 2007 20:20:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-12T20:20:16Z</dc:date>
    <item>
      <title>FILE EXISTING VALIDATION</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-existing-validation/m-p/2559202#M583528</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 am uploading the data for open AR line items through a file in the applicaiton server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can any one give me some idea how to validate whether that file is existing or not...?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please its bit urgent &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone can give me some code, that would be really helpful for me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SRI&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2007 20:15:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-existing-validation/m-p/2559202#M583528</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-12T20:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: FILE EXISTING VALIDATION</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-existing-validation/m-p/2559203#M583529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All you need to do is evaluate SY-SUBRC after the OPEN statement, if it is not 0, then it either does not exist or you don't have permission to open it,  I think 4 is that it does not exist, and 8, means that you don't have permission.  Anyway, simply check the value of SY-SUBRC after the OPEN DATASET statement.&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, 12 Jul 2007 20:18:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-existing-validation/m-p/2559203#M583529</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-07-12T20:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: FILE EXISTING VALIDATION</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-existing-validation/m-p/2559204#M583530</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;Open the file using the OPEN DATASET syntax..If the return code is not successful..then the file does not exits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

OPEN DATASET '/tmp/test.txt' FOR INPUT.

IF SY-SUBRC &amp;lt;&amp;gt; 0.
  MESSAGE 'Error in opening file or file does not exists'.
ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2007 20:20:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-existing-validation/m-p/2559204#M583530</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-12T20:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: FILE EXISTING VALIDATION</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-existing-validation/m-p/2559205#M583531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just i want to do the validation in at selection screen output even so that the mentioned file is existing or not&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does it make any sense... then how to do that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2007 20:42:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-existing-validation/m-p/2559205#M583531</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-12T20:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: FILE EXISTING VALIDATION</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-existing-validation/m-p/2559206#M583532</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 something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_apath.
 
* Open the Browse Dialog Box on the Application Server
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
  IMPORTING
    serverfile = p_apath
  EXCEPTIONS
    canceled_by_user = 1
    others = 2.
 
IF sy-subrc &amp;lt;&amp;gt; 0.
  ...                                   " Error Message
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>Thu, 12 Jul 2007 20:49:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-existing-validation/m-p/2559206#M583532</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-12T20:49:18Z</dc:date>
    </item>
  </channel>
</rss>

