<?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: Application Server file Validity in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-validity/m-p/5973478#M1339620</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Neha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To access the files on Application server we use DATASET operationsd like open, read, close etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in your case use opendataset as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  open dataset   ds_name for output in text mode encoding default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;     //write your message here.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLOSE DATASET ds_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where ds_name = logical path name of your file, or if you want to check for just one file, hard code the path.&lt;/P&gt;&lt;P&gt;Better practice is to use logical path name.&lt;/P&gt;&lt;P&gt;Also declare ds_name as&lt;/P&gt;&lt;P&gt;DATA: ds_name          LIKE rfpdo-rfbifile.    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Close dataset is used in case file exists you need to close it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Revert back if you wantto know abt logical file name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sana.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Aug 2009 14:34:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-19T14:34:47Z</dc:date>
    <item>
      <title>Application Server file Validity</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-validity/m-p/5973475#M1339617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one query. I wanted to check the validity of file in application server. The scenerio is like in my selection screen I will provide application server file name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to validate whether that file is existing or not. If file is not existing then I need to display an error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody will suggest me how I can achieve this requirement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Neha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2009 12:42:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-validity/m-p/5973475#M1339617</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-19T12:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Application Server file Validity</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-validity/m-p/5973476#M1339618</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 these FMs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CONV_UTIL_CHECK_FILE_EXISTENCE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CV120_DOC_FILE_EXISTENCE_CHECK&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CV122_DOC_FILE_EXISTENCE_CHECK&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DX_FILE_EXISTENCE_CHECK&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PFL_CHECK_OS_FILE_EXISTENCE&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: vikred on Aug 19, 2009 6:21 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2009 12:50:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-validity/m-p/5973476#M1339618</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-19T12:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Application Server file Validity</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-validity/m-p/5973477#M1339619</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;Simply use the statement: OPEN DATASET. If the sy-subrc after the statement is NE 0 , then the file is not existing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to pass the filename and filepath for the above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg: FNAME = '/tmp/myfile'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET FNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more information on OPEN DATASET, check sap help.&lt;/P&gt;&lt;P&gt;To open a file in binary mode, use the IN BINARY MODE addition to the OPEN DATASET statement&lt;/P&gt;&lt;P&gt;To open a file for reading, use the FOR INPUT addition to the OPEN DATASET statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Shiva Kumar Tirumalasetty on Aug 19, 2009 7:57 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2009 14:26:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-validity/m-p/5973477#M1339619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-19T14:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: Application Server file Validity</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-validity/m-p/5973478#M1339620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Neha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To access the files on Application server we use DATASET operationsd like open, read, close etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in your case use opendataset as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  open dataset   ds_name for output in text mode encoding default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;     //write your message here.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLOSE DATASET ds_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where ds_name = logical path name of your file, or if you want to check for just one file, hard code the path.&lt;/P&gt;&lt;P&gt;Better practice is to use logical path name.&lt;/P&gt;&lt;P&gt;Also declare ds_name as&lt;/P&gt;&lt;P&gt;DATA: ds_name          LIKE rfpdo-rfbifile.    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Close dataset is used in case file exists you need to close it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Revert back if you wantto know abt logical file name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sana.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2009 14:34:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-validity/m-p/5973478#M1339620</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-19T14:34:47Z</dc:date>
    </item>
  </channel>
</rss>

