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

Deleting files from application server

Former Member
0 Likes
4,107

Hi all,

I all i want to delete files(txt) from application server is there any abap statement by which i can delete it by specifying the path of that file

Regards

Amar

1 ACCEPTED SOLUTION
Read only

former_member223446
Active Participant
0 Likes
1,461

hi amar

we can delete the txt file by using

DELETE DATASET <data set name> (here u can give exact path of the file where it is stored)

if sy-subrc eq 0.

write : 'file is deleted'.

else.

write : 'it is not deleted'.

endif.

5 REPLIES 5
Read only

Former Member
0 Likes
1,461

try this

DELETE DATASET '/usr/trans/test.txt'.

Read only

Former Member
0 Likes
1,461

Hi!

Check this out:

DELETE DATASET '/tmp/test.txt'.

IF SY-SUBRC <> 0.

WRITE: / 'Error in deleting'.

ELSE.

WRITE; / 'File deleted'.

ENDIF.

Regards

Tamá

Read only

Former Member
0 Likes
1,461

write program in se38 using this syntax.

DELETE DATASET <dataset name> syntax.

or use FM <b>EPS_DELETE_FILE</b>

Read only

Former Member
0 Likes
1,461

Hi,

You can delete a folder in application server by using function module <b>WBMR_DELETE_APPL_FOLDER</b>

If you want to delete the txt files, get the list of txt files in the given folder and

open the file in write mode again and close it. Then, the content in txt file will be cleared and blank files will be stored.

Regards

Sailaja.

Read only

former_member223446
Active Participant
0 Likes
1,462

hi amar

we can delete the txt file by using

DELETE DATASET <data set name> (here u can give exact path of the file where it is stored)

if sy-subrc eq 0.

write : 'file is deleted'.

else.

write : 'it is not deleted'.

endif.