Make your own free website on Tripod.com
 

SAP ABAP Programming, Functional and Basis Components Books

Let user select the download file name in their PC local drive

Function F4_FILENAME

When the user click the button Save In, a pop-up windows will appear to allow them to choose their PC local drive and filename.

REPORT ZF4_FILENAME.

TABLES SSCRFIELDS.

PARAMETERS:  P-FILE LIKE RLGRAP-FILENAME DEFAULT 'C:\TEMP\SAP.XLS'.

* Double click on TEXT-001 and type Save In
SELECTION-SCREEN PUSHBUTTON /35(10) TEXT-001 USER-COMMAND F4CLICK.

AT SELECTION-SCREEN.

IF SSCRFIELDS-UCOMM = 'F4CLICK'.
 call function 'F4_FILENAME'
  EXPORTING
    PROGRAM_NAME        = SYST-CPROG
    DYNPRO_NUMBER       = SYST-DYNNR
    FIELD_NAME          = ' '
  IMPORTING
    FILE_NAME           = P-FILE.
ENDIF.

or

Function KD_GET_FILENAME_ON_F4

PARAMETERS: filename LIKE rlgrap-filename MEMORY ID M01.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.
  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
       EXPORTING
            mask      = '*.xls'
            static    = 'X'
       CHANGING
            file_name = filename.

Back to Previous

Return to SAP Hints and Tips on Configuration and ABAP/4 Programming