Use method : cl_gui_frontend_services=>directory_browse.
Code example :
DATA : lv_directory TYPE string.
" Open the popup window to choose a diretory (without filename !)
cl_gui_frontend_services=>directory_browse( EXPORTING window_title = 'Your title'
CHANGING selected_folder = lv_directory
EXCEPTIONS cntl_error = 1
error_no_gui = 2 ).
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
" OR MESSAGE i001(00) WITH 'Your message'.
RETURN
ENDIF.
cl_gui_cfw=>flush( ).
About the author