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.


 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image