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: 

matchcode to search files

Former Member
0 Kudos

Hi,

In my dynpro I have a "text box" to enter a name of a file.

How can I add a matchcode to this "text box" so as to I can select a file ? (I want to see the typical window to select a file).

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

you could just call the function F4_Filename.

Regards Wolfgang

7 REPLIES 7

Former Member
0 Kudos

Hello,

you could just call the function F4_Filename.

Regards Wolfgang

0 Kudos

Can you give me more details?

In what place put I it?? In the "search help" property of the "text box" in the screen painter??

0 Kudos

Hello,

use cl_gui_front_end_services=>get_filename. F4_Filename only stores filenames in a 128 byte field, which is definitly to short in out tmes, a unc path can be easily much longer then that.

*******reward points,if found useful

For example, how also said other colleagues:

DATA: FILEBIN TYPE  FILETABLE,
      FILESTR TYPE FILE_TABLE,
      RC TYPE I.
PARAMETERS: FILE TYPE FILENAME.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE.
  CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    CHANGING FILE_TABLE = FILEBIN
             RC         = RC.
  IF SY-SUBRC IS INITIAL.
    READ TABLE FILEBIN INTO FILESTR INDEX 1.
    FILE = FILESTR-FILENAME.
  ENDIF.

Good luck.

Former Member
0 Kudos

Hi Oscar,

You can call function module F4_FILENAME to activate the search help under 'process on value-request' event.

Regards

Sujatha

0 Kudos

DATA: carrid TYPE spfli-carrid,

hlp TYPE string,

struc TYPE dfies-tabname,

comp TYPE dfies-fieldname.

DESCRIBE FIELD carrid HELP-ID hlp.

SPLIT hlp AT '-' INTO struc comp.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST' EXPORTING tabname = struc

fieldname = comp

EXCEPTIONS field_not_found = 1

no_help_for_field = 2

inconsistent_help = 3

no_values_found = 4

OTHERS = 5.

Reward if useful.

Anita

Former Member
0 Kudos

Hi

use the following method.

CALL METHOD cl_gui_frontend_services=>FILE_OPEN_DIALOG

Reward points if helpful