Code: Alles auswählen.
*----------------------------------------------------------------------*
* PARAMETERS *
*----------------------------------------------------------------------*
PARAMETER: p_fname TYPE rlgrap-filename DEFAULT 'C:\Kundenstamm.xls'.
*----------------------------------------------------------------------*
* AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME *
*----------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
PERFORM get_filename CHANGING p_fname.
*&---------------------------------------------------------------------*
*& Form GET_FILENAME
*&---------------------------------------------------------------------*
* Dateiauswahldialog anzeigen *
* Ergebnis wird ins zugehörige Datenelement gestellt *
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
* -->
* <-- P_P_FNAME Selections-Parameter, in den der Filename
* zurückgestellt wird
*----------------------------------------------------------------------*
FORM get_filename CHANGING value(p_p_fname).
DATA: file_filter TYPE string,
it_file_table TYPE filetable,
wa_file_table TYPE LINE OF filetable,
l_return TYPE i.
* Filter befüllen
file_filter = 'Microsoft Excel-Arbeitsmappe (*.xls)|*.xls|'.
* Dialog anzeigen
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
file_filter = file_filter
CHANGING
file_table = it_file_table
rc = l_return
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
OTHERS = 4.
IF sy-subrc = 0.
READ TABLE it_file_table INTO wa_file_table INDEX 1.
MOVE wa_file_table TO p_p_fname.
ENDIF.
ENDFORM. " GET_FILENAME