Application Development and Automation 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: 
Read only

Delete file from directory which

0 Likes
826

Hi ,

I want to delete files from a directory in Application server.

I have the file name as fn_13/07/2007.txt

Have a condition that files should be deleted which are less than 10 days.

Is there any function module to do this.

Thanks in Advance.

Regards,

Indhra

1 ACCEPTED SOLUTION
Read only

former_member189059
Active Contributor
0 Likes
777

Hello Indhra,

These methods may help ( from CL_GUI_FRONTEND_SERVICES )

<b>DIRECTORY_BROWSE</b> Static Method Public Shows a Directory Selection Window

<b>DIRECTORY_CREATE</b> Static Method Public Creates a Directory in the Client

<b>DIRECTORY_DELETE</b> Static Method Public Deletes a Directory in the Client

<b>DIRECTORY_EXIST</b> Static Method Public Checks if a directory exists

<b>DIRECTORY_GET_CURRENT</b> Static Method Public Returns the Current Directory

<b>DIRECTORY_LIST_FILES</b> Static Method Public Lists Files in a Given Directory

<b>DIRECTORY_SET_CURRENT</b> Static Method Public Sets the Current Directory (Do NOT Use)

<b>ENVIRONMENT_GET_VARIABLE</b> Static Method Public Gets an Environment Variable

<b>ENVIRONMENT_SET_VARIABLE</b> Static Method Public Sets an Environment Variable

<b>EXECUTE</b> Static Method Public Starts an Application or Opens a Document in the Client

<b>FILE_COPY</b> Static Method Public Copies a File

<b>FILE_DELETE</b> Static Method Public Deletes a File

Hi ,

I want to delete files from a directory in Application server.

I have the file name as fn_13/07/2007.txt

Have a condition that files should be deleted which are less than 10 days.

Is there any function module to do this.

Thanks in Advance.

Regards,

Indhra

3 REPLIES 3
Read only

former_member189059
Active Contributor
0 Likes
778

Hello Indhra,

These methods may help ( from CL_GUI_FRONTEND_SERVICES )

<b>DIRECTORY_BROWSE</b> Static Method Public Shows a Directory Selection Window

<b>DIRECTORY_CREATE</b> Static Method Public Creates a Directory in the Client

<b>DIRECTORY_DELETE</b> Static Method Public Deletes a Directory in the Client

<b>DIRECTORY_EXIST</b> Static Method Public Checks if a directory exists

<b>DIRECTORY_GET_CURRENT</b> Static Method Public Returns the Current Directory

<b>DIRECTORY_LIST_FILES</b> Static Method Public Lists Files in a Given Directory

<b>DIRECTORY_SET_CURRENT</b> Static Method Public Sets the Current Directory (Do NOT Use)

<b>ENVIRONMENT_GET_VARIABLE</b> Static Method Public Gets an Environment Variable

<b>ENVIRONMENT_SET_VARIABLE</b> Static Method Public Sets an Environment Variable

<b>EXECUTE</b> Static Method Public Starts an Application or Opens a Document in the Client

<b>FILE_COPY</b> Static Method Public Copies a File

<b>FILE_DELETE</b> Static Method Public Deletes a File

Read only

former_member189059
Active Contributor
0 Likes
777

Also, with the method <b>FILE_GET_ATTRIBUTES</b>, you may be able to get the date

Read only

Former Member
0 Likes
777

You can use function module EPS_DELETE_FILE to delete the file from the application server.

Use can even use the statement

delete dataset '\tmp\file.txt'.

Regards,

Pavan