Select directories and files using Object Methods
The following code uses SAP Objects to select directories and files.
The following code uses SAP Objects to select directories and files.
Version- 4.6c************************************** *" For Selecting a File *" *" code also demonstrates *" how to specify the file extension tables rlgrap. data: i_tab type filetable, vg_subrc type i. selection-screen begin of block m with frame. select-options so_fpath for rlgrap-filename. selection-screen end of block m. at selection-screen on value-request for so_fpath-low. CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG EXPORTING WINDOW_TITLE = 'Select File' DEFAULT_FILENAME = '*.txt' MULTISELECTION = 'X' CHANGING FILE_TABLE = i_tab RC = vg_subrc. loop at i_tab into so_fpath-low. so_fpath-sign = 'I'. so_fpath-option = 'EQ'. append so_fpath. endloop. *" **************************************** ************************************** *" For Selecting a Directory data: v_path type string. parameters: v_path2 like rlgrap-filename. at selection-screen on value-request for v_path2. CALL METHOD cl_gui_frontend_services=>directory_browse EXPORTING window_title = 'Windows Title' initial_folder = 'C:' CHANGING selected_folder = v_path. CALL METHOD cl_gui_cfw=>flush. concatenate v_path '' into v_path2. *" ****************************************