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 a .txt from usr/sap/tmp directory

Former Member
0 Kudos

Hello,

Does anyone knows how to delete a file from the following SAP directory?

/USR/SAP/TMP/file.txt

Thanks in advance,

CL

1 ACCEPTED SOLUTION

ferry_lianto
Active Contributor
0 Kudos

Hi,

You can use FM EPS_DELETE_FILE.

Regards,

Ferry Lianto

8 REPLIES 8

ferry_lianto
Active Contributor
0 Kudos

Hi,

You can use FM EPS_DELETE_FILE.

Regards,

Ferry Lianto

0 Kudos

Thanks for your quick reply. But I do get this error:

Exception NO_AUTHORIZATION

Message ID: TK Message number: 621

Message:

No authorization for transferring files in Change and Transport System

Any suggestion?

0 Kudos

I guess you are not authorized to delete the files on that Unix directory. Unless your security team gives you more authority, you can not delete that file.

0 Kudos

Krishna, that message error do not belong to your approach.

I'm running your code without any errors, but the file stills there.

Former Member
0 Kudos

Use the abap statement

delete dataset 'usr/sap/tmp/a.txt'.

0 Kudos

Thanks I like this approach better.

I tried the code but is not deleting the file. Do I need to Open a dataset first?

ferry_lianto
Active Contributor
0 Kudos

Hi,

You don't have authorization to delete the file.

Please ask BASIS/Unix admin to delete the fie or give enough authorization to delete the file.

Regards,

Ferry Lianto

0 Kudos

Ok Thanks guys!