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 in AL11

nachiketapte
Explorer
0 Kudos

Hi,

We have some files in AL11 Directory, which i want to delete?

Can any one share some steps to delete these files.

Other Post on SCN could not solve my problem

7 REPLIES 7

Former Member
0 Kudos

Why not give a list of the files to Basis They can take care of it quickly without an ABAP solution.

Rob

Former Member
0 Kudos

Hello Nachiket,

A simple ABAP Code with the logic as below will help to delete files in AL11. (Sorry, I am not an ABAPer and my ABAP is not so good. You will have to tweak the code below a bit to make it work).

Create a Program in SE38 and define a screen to input the path where file in AL11 is stored.

Selection-screen begin of block b1 with frame title text -001.

(Define text element as "Enter File Path")

     parameters: p_del type rlgrap-filename

Selection-screen end of block b1.

at selection-screen output.

perform f_delete_file.

form f_delete_file.

      if (p_del is initial).

          message 'Enter File Path, It cannot be blank' type I.

          exit.

      endif.

     delete dataset p_del.

     if sy-subrc = 0.

          message 'File deleted Successfully' type I.

     elseif sy-subrc <> 0.

          message 'File not deleted' type I.

     endif.

endform.

Cheers

Shiva

0 Kudos

well you should at an absolute minimum use a logical path and add  an authority check to avoid unauthorised deletion of files

Former Member
0 Kudos

Use FM   SXPG_COMMAND_EXECUTE

0 Kudos

This message was moderated.

0 Kudos

CL_GUI_FRONTEND_SERVICES will probabyl not work here, as he wants to access files on the application server and not on the presentation server

Use Transaction N2UX

if not possible use SE93 and start the report for N2UX directly from SE38 or SA38.

Regards

felix