‎2005 Jun 02 4:21 PM
Hi,
after procesing a file i want to delete it.
i use the following code:
call function 'GUI_DELETE_FILE'
exporting
file_name = d_file
EXCEPTIONS
FAILED = 1
OTHERS = 2.
*if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*endif.
although the file is correctly deleted i always get sy-subrc = 1. Why is this happening?
(i´ve commented if sy-subrc <> 0 because i got this message: MESSAGE_TYPE_UNKNOWN).
Best regards.
‎2005 Jun 02 4:29 PM
Not sure why you are getting that, but maybe try the following code instead.
call method cl_gui_frontend_services=>file_delete
exporting
filename = filepatch
changing
rc = sysubrc
* 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.
Regards,
Rich Heilman
‎2005 Jun 02 4:29 PM
Not sure why you are getting that, but maybe try the following code instead.
call method cl_gui_frontend_services=>file_delete
exporting
filename = filepatch
changing
rc = sysubrc
* 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.
Regards,
Rich Heilman
‎2005 Jun 02 4:31 PM
Hello,
wouldn't trust in that function.
German documentation says:
OBSOLET: bitte Klasse CL_GUI_FRONTEND_SERVICES verwenden
means : not anymore supported, use Class .
The reason could be:
CASE ORBTYP.
WHEN ORB_COM_DEF.
CALL METHOD OF H_COM1 'DeleteFile' = RET
EXPORTING #1 = FILE_NAME.
IF ( RET = 0 ) .
RAISE FAILED.
ENDIF.
IF SY-SUBRC NE 0.
RAISE FAILED.
ENDIF.
ENDCASE.
Best regards
‎2005 Jun 02 4:49 PM
Hi,
are GUI_DOWNLOAD and GUI_UPLOAD obsolte as well?
Best regards.
‎2005 Jul 11 7:23 AM