Downtime Announcement: Please note the SAP Community Wiki will be unavailable due to a system upgrade on Thursday, September 24th between 6 and 7 AM CEST
Skip to end of metadata
Go to start of metadata

CL_GUI_FRONTEND_SERVICES=>FILE_DELETE

Give the path of the file to be deleted as the value of FILE_PATH. The file path can also be obtained using the file browser using the function module 'KD_GET_FILENAME_ON_F4 '.

  DATA: FILE_PATH TYPE STRING VALUE 'C:\test.txt',

       RET_VAR TYPE I.

  CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_DELETE
    EXPORTING
      FILENAME             = FILE_PATH
    CHANGING
      RC                   = RET_VAR
  EXCEPTIONS
    FILE_DELETE_FAILED   = 1
    CNTL_ERROR           = 2
    ERROR_NO_GUI         = 3
    FILE_NOT_FOUND       = 4
    ACCESS_DENIED        = 5
    UNKNOWN_ERROR        = 6
    NOT_SUPPORTED_BY_GUI = 7
    WRONG_PARAMETER      = 8
    OTHERS               = 9
  .

  • No labels

1 Comment

  1. Couple of most important methods of CL_GUI_FRONTEND_SERVICES are demonstrated in blog: Printing DMS documents.