sapdev logo background
sapdev logo sapdev logo
Comments

Popup window to select a File using function module WS_FILENAME_GET




The below abap code demonstrates how to implement a file selection popup onto your ABAP report selection screen field.


*Selecting a File, plus inserting default file extension
parameters: p_file like rlgrap-filename default 'c:\hesa.txt' LOWER CASE.

************************************************************************
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_file.
  CALL FUNCTION 'WS_FILENAME_GET'
       EXPORTING
            def_filename     = p_file
            mask             = ',*.xls.'
            mode             = 'O'
            title            = 'Upload File'(078)
       IMPORTING
            filename         = p_file
       EXCEPTIONS
            inv_winsys       = 1
            no_batch         = 2
            selection_cancel = 3
            selection_error  = 4
            OTHERS           = 5.




comments powered by Disqus