Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Parameters of FM:KD_GET_FILENAME_ON_F4

Former Member
0 Kudos

Hi , experts.

When I use FM: KD_GET_FILENAME_ON_F4 , I am puzzled by the parameters.

Can you explain FIELD_NAME, STATIC and MASK in Import?

Regards,

feng.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

File_name is the parameter that you declared to have the file name

mask is used for filter..In case if you want to browse xls..you will give *.xls

Static will be X ..not sure about it..

Ex...

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.

Thanks

Naren

7 REPLIES 7

Former Member
0 Kudos

Hi,

File_name is the parameter that you declared to have the file name

mask is used for filter..In case if you want to browse xls..you will give *.xls

Static will be X ..not sure about it..

Ex...

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.

Thanks

Naren

0 Kudos

Hi,Narendran.

Thanks for your answer.

Can you explain more ?

In your example, you didn't use FIELD_NAME, can you tell me why?And when we can use FIELD_NAME?

And why the value of STATIC is 'X' , can be another value?

Regards,

feng.

Former Member
0 Kudos

All are default declared so all will be type C with one char and default blank

VALUE(FIELD_NAME) DEFAULT SPACE

VALUE(STATIC) DEFAULT SPACE

VALUE(MASK) TYPE C DEFAULT SPACE

you can send the value 'X' or space in that all will work as a flag.

Rewards if useful.........

Minal Nampalliwar

Former Member
0 Kudos

Hi,

Take a look at this code

REPORT ZF4_FILENAME.

TABLES SSCRFIELDS.

PARAMETERS:  P-FILE LIKE RLGRAP-FILENAME DEFAULT 'C:TEMPSAP.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. 

Cheers

VJ

varma_narayana
Active Contributor
0 Kudos

Hi..

Mask is used to Limit the Files with some extension

Eg:

<b> mask = '*.XLS'</b>

FIELD_NAME is the Filed on Screen to which the File name has to be returned.

Eg:

<b>FIELD_NAME = 'P_FILE'</b>

regards.

harimanjesh_an
Active Participant
0 Kudos

hi feng,

<b>KD_GET_FILENAME_ON_F4</b> FM is a Filemanager support to locate file in a directory (on value request).

<b>FIELD_NAME</b> : Name of field where path is to be entered. This the the Dynopro field name where ur selected filename will be populated.

<b>MASK </b> : MASK is a normal printout which specifies the files which can be

selected.

Structure of MASK: ','<text>','<FILTERGROUP>+'.'

Structure of FILTERGROUP: <filter>';'<filter>*

Example: CALL FUNCTION .. EXPORTING .. MASK = ',.,..' .. generates

the file selector mask with the defaults File name: empty, Save as type:

.

<b>STATIC</b> : Static is used as some flag.

If Static is SPACE then ur filepath will be set to blank. And it calls the FM <b>WS_FILENAME_GET</b>.

ELSE.

It calls FM <b>SO_SPLIT_FILE_AND_PATH</b>. This FM is used to split filename and pathname.

PARAMETERS: p_file LIKE rlgrap-filename MEMORY ID M1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.

CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

EXPORTING

MASK = ',Textfiles,*.txt'

STATIC = 'X'

CHANGING

FILE_NAME = p_file.

Reward me if useful........

Harimanjesh AN

0 Kudos

Thanks , Harimanjesh AN.

Can you explain more about FIELD_NAME and STATIC?Or give me some examples which have these key worlds?

I wrote an example below:

REPORT ztest_li

MESSAGE-ID ZEIF01.

*SELECTION-SCREEN DEFINITION

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: P_CHK1 AS CHECKBOX DEFAULT 'X',

P_FILE LIKE RLGRAP-FILENAME.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK B1.

AT SELECTION-SCREEN.

IF P_CHK1 = 'X' AND P_FILE IS INITIAL.

MESSAGE E011 WITH 'FILE'.

ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

EXPORTING

mask = ',.,.'

static = ' '

CHANGING

file_name = P_FILE.

IF SY-SUBRC <> 0.

MESSAGE E011 WITH 'FILE'.

ENDIF.

I changed the value of STATIC, STATIC = 'X' ; STATIC = ' '.But the result is the same.

Regards,

feng.