sapdev logo background
sapdev logo sapdev logo
Comments

File Selection for ABAP report using SAP object method FILE_OPEN_DIALOG




Provides a abap report election screen popup to allow the user to select a desired file from their PC. Also defaults to file extension of type .txt

*Selecting a File, plus inserting default file extension
tables rlgrap.

data: it_tab type filetable,
      gd_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.

REFRESH: it_tab.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    EXPORTING
        WINDOW_TITLE = 'Select File'
        DEFAULT_FILENAME = '*.txt'
        MULTISELECTION = 'X'
    CHANGING
        FILE_TABLE = it_tab
        RC = gd_subrc.

loop at it_tab into so_fpath-low.
    so_fpath-sign = 'I'.
    so_fpath-option = 'EQ'.
    append so_fpath.
endloop.




comments powered by Disqus