How To Use Function 'F4_FILENAME' and 'KD_GET_FILENAME_ON_F4'
*-----------------------------------------------------------------------
*
* Company XXX Company Limited
*
* ProgrameName: ZZW_FUT_F4_FILENAME
*
* Author: Lilo.Zhu
*
* Date: 08/08/2007
*
* Description: Study SAP In Program How To Use Function 'F4_FILENAME'
* When User Click 'Save In' Button, A Pop-up Window will
* appear to allow you choice local PC Drive and Filename.
*
*-----------------------------------------------------------------------
REPORT ZZW_FUT_F4_FILENAME .
Tables: SSCRFIELDS.
*-----------------------------------------------------------------------
* Function 'F4_FILENAME'
*-----------------------------------------------------------------------
Selection-Screen Begin Of Block B1 With Frame Title Text-001.
Parameters: P_File Like RLGRAP-FileName
Modif ID M1 Default 'C:/Data/SAP.XLS'.
Selection-Screen PushButton /33(10) Text-002 User-Command F4CLICK.
Selection-Screen End Of Block B1.
*-----------------------------------------------------------------------
* Function 'KD_GET_FILENAME_ON_F4'
*-----------------------------------------------------------------------
Selection-Screen Begin Of Block B2 With Frame Title Text-003.
Parameters: P_File_1 Like RLGRAP-FileName Memory ID M2.
Selection-Screen End Of Block B2.
At Selection-Screen.
IF SSCRFIELDS-Ucomm EQ 'F4CLICK'.
Call Function 'F4_FILENAME'
Exporting
Program_Name = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ''
IMPORTING
FILE_NAME = P_File.
ENDIF.
At Selection-Screen On Value-Request For P_File_1.
Call Function 'KD_GET_FILENAME_ON_F4'
Exporting
Mask = '*.xls'
Static = 'X'
Changing
File_Name = P_File_1.