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 local files

Former Member
0 Kudos

Hi All,

I searched all the SDN , yet I couldn't find the answer to this question. I need a way to delete local files. Can something like this be achieved in version 4.6C ?

Thanks in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You mean Unix server file then you can use DELETE Dataset filename.

Thanks

Seshu

6 REPLIES 6

Former Member
0 Kudos

You mean Unix server file then you can use DELETE Dataset filename.

Thanks

Seshu

0 Kudos

No, I mean the files on the presentation server, local files.

0 Kudos

George,

you can also use FM GUI_DELETE_FILE.

Regards,

Satish

0 Kudos

Hi,

I am not in front of system..but check in SE37 using GUIdelete* you may find something.

Regards,

Atish

Message was edited by:

Atish Sarda

0 Kudos

Then you can use FM WS_FILE_DELETE or Satish mentioned logic

Thanks

Seshu

Former Member

Hi,

Use below code to delete the local file.

CALL METHOD cl_gui_frontend_services=>file_delete
  EXPORTING
    filename           = 'C:TEST.TXT'
  CHANGING
    rc                 = rc
  EXCEPTIONS
    file_delete_failed = 1
    cntl_error         = 2
    error_no_gui       = 3
    file_not_found     = 4
    access_denied      = 5
    unknown_error      = 6
    OTHERS             = 7.
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

Reward if this helps,

Satish