‎2008 Aug 19 12:21 PM
Hi,
I am using function modules GUI_DOWNLOAD and GUI_UPLOAD.
Is there any function module to check if a given file/folder path is valid or not?
Thanks.
‎2008 Aug 19 12:23 PM
Hello.
Yes, you can use class cl_gui_frontend_services, method DIRECTORY_EXIST.
Regards,
Valter Oliveira.
‎2008 Aug 19 12:24 PM
Hi Kumar ,
REPORT zdir_test.
TYPE-POOLS: abap.
DATA: v_dir TYPE string.
DATA: v_bol TYPE abap_bool.
v_dir = 'c:\sap\'.
CALL METHOD cl_gui_frontend_services=>directory_exist
EXPORTING
directory = v_dir
RECEIVING
result = v_bol
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
wrong_parameter = 3
not_supported_by_gui = 4
OTHERS = 5.IF NOT v_bol IS INITIAL.
WRITE:/ 'Directory exists.'.
ELSE.
WRITE:/ 'Directory does not exist.'.
ENDIF.
Regards,
Sachin M M
‎2008 Aug 19 12:25 PM
hi,
if u r hardcoding the path directly ,then there is no issue becse u dont get any error.
if u r using f4_filename function module to get file then u can check in the bottom.
if sy-subrc NE 0.
message 'file not found' type 'E'.
endif.
‎2008 Aug 19 12:35 PM