10-15-2007 10:10 AM
How to delete a file from the presentation server (desktop) using the following method?? explain in detail with sample code.
CL_GUI_FRONTEND_SERVICES->FILE_DELETE
Regards,
Kalai
10-15-2007 10:17 AM
pass u r file path name in the presentation server thats it.......
DATA V_RC TYPE I.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_DELETE
EXPORTING
FILENAME = 'C:\LAK1.XLS'
CHANGING
RC = V_RC
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.
IF SY-SUBRC <> 0.
ENDIF
10-15-2007 10:13 AM
Hi,
You just need to pass the file name to this method.
regards,
Atish
10-15-2007 10:17 AM
pass u r file path name in the presentation server thats it.......
DATA V_RC TYPE I.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_DELETE
EXPORTING
FILENAME = 'C:\LAK1.XLS'
CHANGING
RC = V_RC
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.
IF SY-SUBRC <> 0.
ENDIF
10-15-2007 10:20 AM
Hi , just copy and paste the below code for deleteing the File ...
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.
Reward points if it is usefull .....
Girish
10-15-2007 4:28 PM
Hi,
Just give the path of the required file name which you want to delete to the exporting parameter 'File name = '
Regards,
Ramana