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.

More Function Module
Functions / SAP Script / ALV

Tables
Database Table

ABAP Books List
ABAP/4 Certification, Programming, Smartforms, Sapscripts and Object Oriented Programming Books

Smart Forms
SAP Smartforms

ABAP Menu:
ABAP Example Hints and Tips

Return to Index:-
SAP ABAP/4 Programming, Basis Administration, Configuration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.  The site www.gotothings.com is in no way affiliated with SAP AG.
Any unauthorised copying or mirroring is prohibited.