Hola,
Utiliza el método a continuación.
CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG.
DATA: V_FILENAME TYPE STRING,
IT_FILETABLE TYPE FILETABLE,
V_RC TYPE I.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
WINDOW_TITLE = 'File Open'
INITIAL_DIRECTORY = 'C:'
CHANGING
FILE_TABLE = IT_FILETABLE
RC = V_RC
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
OTHERS = 4.
IF SY-SUBRC = 0.
READ TABLE IT_FILETABLE INDEX 1 INTO V_FILENAME.
ELSE.
MESSAGE E100 WITH TEXT-011. " Error while opening the file
ENDIF.
Espero que este código te ayude. No olvides recompensar si te resulta útil 😉
Gracias,
GSK