<?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: Directory existence check (Application server) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/directory-existence-check-application-server/m-p/816276#M42229</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although it uses kernel function call, you can use it if otherwise is not stated in official documentation. Because the call is wrapped by a usual function module, its availability is somehow guaranteed I think.&lt;/P&gt;&lt;P&gt;Moreover, I guess there are lots of ABAP developers who directly use kernel function calls although it is not so recommended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Serdar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Oct 2004 16:47:47 GMT</pubDate>
    <dc:creator>ssimsekler</dc:creator>
    <dc:date>2004-10-04T16:47:47Z</dc:date>
    <item>
      <title>Directory existence check (Application server)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/directory-existence-check-application-server/m-p/816275#M42228</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;What is the best way to check directory existence in the application server?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'OPEN DATASET gv_dir.' seems to work in HP-UNIX, however as far as I know OPEN DATASET is for files.&lt;/P&gt;&lt;P&gt;I checked FM 'EPS_GET_DIRECTORY_LISTING' it calls kernel to check dir existence, which is not s good idea to use it in customer programs:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  CALL 'C_DIR_READ_START'
        ID 'DIR'    FIELD DIR_NAME
        ID 'FILE'   FIELD FILE_MASK
        ID 'ERRNO'  FIELD FILE-ERRNO
        ID 'ERRMSG' FIELD FILE-ERRMSG.
  IF SY-SUBRC &amp;lt;&amp;gt; 0.
    RAISE READ_DIRECTORY_FAILED.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2004 16:24:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/directory-existence-check-application-server/m-p/816275#M42228</guid>
      <dc:creator>Peter_Inotai</dc:creator>
      <dc:date>2004-10-04T16:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Directory existence check (Application server)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/directory-existence-check-application-server/m-p/816276#M42229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although it uses kernel function call, you can use it if otherwise is not stated in official documentation. Because the call is wrapped by a usual function module, its availability is somehow guaranteed I think.&lt;/P&gt;&lt;P&gt;Moreover, I guess there are lots of ABAP developers who directly use kernel function calls although it is not so recommended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Serdar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2004 16:47:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/directory-existence-check-application-server/m-p/816276#M42229</guid>
      <dc:creator>ssimsekler</dc:creator>
      <dc:date>2004-10-04T16:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Directory existence check (Application server)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/directory-existence-check-application-server/m-p/816277#M42230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OPEN DATASET FOR OUTPUT should work since it will give an error if the file you tried to create in a server directory can't be created because of invalid directory/path. You can use dummy filename.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2004 19:54:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/directory-existence-check-application-server/m-p/816277#M42230</guid>
      <dc:creator>nablan_umar</dc:creator>
      <dc:date>2004-10-04T19:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Directory existence check (Application server)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/directory-existence-check-application-server/m-p/816278#M42231</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 check the directory in the application server using the transaction AL11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also as said by one of the friend it gives a short dump 'DATASET_CANT_OPEN' if there is no such directory in the application server (while using OPEN DATASET).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2007 02:22:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/directory-existence-check-application-server/m-p/816278#M42231</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-18T02:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Directory existence check (Application server)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/directory-existence-check-application-server/m-p/816279#M42232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use OPen dataset,but if you want to validate at At selection-screen then we need to use diffrent logic,i have written the code as below for one of my program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the code to get all the files falling in the directory...... .&lt;/P&gt;&lt;P&gt;data: begin of t_tabl occurs 0,&lt;/P&gt;&lt;P&gt;          line(132),&lt;/P&gt;&lt;P&gt;      end of t_tabl,&lt;/P&gt;&lt;P&gt;data: lc_command(100) type c.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get all the file name falling under specified directory...&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  lc_command(3)    = 'ls '.&lt;/P&gt;&lt;P&gt;  lc_command+3(45) = p_dir. " Directory of file path&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call 'SYSTEM' id 'COMMAND' field lc_command&lt;/P&gt;&lt;P&gt;                id 'TAB'     field t_tabl-&lt;STRONG&gt;sys&lt;/STRONG&gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check any files exits in the directory.......................&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  if t_tabl[] is initial.&lt;/P&gt;&lt;P&gt;    message e006 with 'No files exist in the specified directory ' p_dir.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Above step will give you the all the fiels falling under the directory specified. But you have to loop through the internal table t_tabl to find the required files  for eg: if you know the start few letters of the file name which are going to be constant always....like CWD_CNF*..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To delete the files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_tabl.&lt;/P&gt;&lt;P&gt;   lc_command(3) = 'rm'.&lt;/P&gt;&lt;P&gt;   lc_command+3(45) = t_tabl-line.&lt;/P&gt;&lt;P&gt;   call 'SYSTEM' id 'COMMAND' field lc_command&lt;/P&gt;&lt;P&gt;                        id 'TAB'     field t_tabl-&lt;STRONG&gt;sys&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;endloop.&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;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2007 02:44:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/directory-existence-check-application-server/m-p/816279#M42232</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-18T02:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Directory existence check (Application server)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/directory-existence-check-application-server/m-p/816280#M42233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Peter,&lt;/P&gt;&lt;P&gt;This function module is the best !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PFL_CHECK_DIRECTORY&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2007 03:00:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/directory-existence-check-application-server/m-p/816280#M42233</guid>
      <dc:creator>former_member189059</dc:creator>
      <dc:date>2007-07-18T03:00:21Z</dc:date>
    </item>
  </channel>
</rss>

