Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete files from Unix Directory/Subdirectory

Former Member
0 Kudos
931

Hi

I need to develop a pgm which deletes files from Unix directory and subdirectories

Given below is the flow chart but i am not aware of any function module or any standard sub program which does the below.

Can some send me inputs on below.

1.selection screen:

a) directory to check

b) flag to include sub-directories

2. logic:

a) select all files from UNIX into internal table

b) go through file-name table and check whether file is listed in table

c) if not - propose for deletion

3) display list with proposal of files for deletion including check box to select single file. Functions which should be available: select all, deselect all, DELETE

1 ACCEPTED SOLUTION

Former Member
0 Kudos
258

use FM <b>EPS_DELETE_FILE</b>


      call function 'EPS_DELETE_FILE'
           destination                 rfc_destination
           exporting
               file_name               = remote_file
               dir_name                = remote_directory
           exceptions
               others                  = 99.

Regards,

Santosh

6 REPLIES 6

Former Member
0 Kudos
258

Hi Bhavana,

For deleting application server files, use the function module <b>EPS_DELETE_FILE</b>

Former Member
0 Kudos
258

get all files into internal table...

loop at internal table.

try using <b>EPS_DELETE_FILE</b> FM.

endloop.

Former Member
0 Kudos
259

use FM <b>EPS_DELETE_FILE</b>


      call function 'EPS_DELETE_FILE'
           destination                 rfc_destination
           exporting
               file_name               = remote_file
               dir_name                = remote_directory
           exceptions
               others                  = 99.

Regards,

Santosh

Former Member
0 Kudos
258

Hi All

I am looking for a code snippet which doesnt delete the file directly but does the below

1) FM to read all files from directory or subdirectory

2) Check if files are to be deleted , after checking with table , and only then make an itab with to be deleted files.

3) ALV user option to be available to either select all, deselect all, DELETE the files.

Please dont send me single FM's. Thanks in advance,

Former Member
0 Kudos
258

Ok i have got the reply..

The FM is check_exist

Former Member
0 Kudos
258

That was for a different query..