Validating file path on the Presentation Server
by Goutam
To validate a file path on the presentation server, use the method
directory_exist available in the class cl_gui_frontend_services.
Demo program to validate the file path on the presentation server:
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.
|