Skip to Content
author's profile photo Former Member
Former Member

Delete files from Unix Directory/Subdirectory

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2006 at 11:25 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2006 at 11:09 AM

    Hi Bhavana,

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2006 at 11:24 AM

    get all files into internal table...

    loop at internal table.

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

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2006 at 11:32 AM

    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,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 03:12 PM

    Ok i have got the reply..

    The FM is check_exist

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 03:12 PM

    That was for a different query..

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.