SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_file TYPE RLGRAP-FILENAME OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
DATA: l_v_file_filter TYPE STRING.
DATA: l_v_filetable TYPE FILE_TABLE,
l_t_filetable TYPE FILETABLE.
DATA: l_v_rc TYPE I.
DATA: l_v_user_action TYPE I.
l_v_file_filter = '(*.txt)|*.txt|(*.xls)|*.xls'.
cl_gui_frontend_services=>file_open_dialog( EXPORTING window_title = 'Select file'
file_filter = l_v_file_filter
CHANGING file_table = l_t_filetable
rc = l_v_rc
user_action = l_v_user_action ).
CHECK l_v_user_action EQ 0.
CHECK l_t_filetable[] IS NOT INITIAL.
READ TABLE l_t_filetable INTO l_v_filetable INDEX 1.
p_file = l_v_filetable-filename.