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 file on PC from ABAP program

Former Member
0 Kudos

Hello guys

I want to know if there is any FM for deleting a file on PC.

thank you

vj

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You can use Function Module "GUI_DELETE_FILE". There is one issue with this function module, whether successful or not the function module raises the error condition.

Thanks

Jerrod

4 REPLIES 4

Former Member
0 Kudos

You can use Function Module "GUI_DELETE_FILE". There is one issue with this function module, whether successful or not the function module raises the error condition.

Thanks

Jerrod

0 Kudos

Hi,

You can also use the FILE_DELETE method of the class CL_GUI_FRONTEND_SERVICES.

Regards,

Suresh Datti

0 Kudos

Thank you guys

vj

ferry_lianto
Active Contributor
0 Kudos

Hi,

If you are in ECC 5.0, please try this FM <b>UBC_FILE_DELETE</b>.

or you can use


CALL METHOD cl_gui_frontend_services=>file_delete
    EXPORTING
      filename           = l_filename
    CHANGING
      rc                 = l_rc
    EXCEPTIONS
      file_delete_failed = 1
      cntl_error         = 2
      OTHERS             = 3.

Hope this will help.

Regards,

Ferry Lianto