Application Development and Automation 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: 
Read only

matchcode to search files

Former Member
0 Likes
3,208

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
Read only

Former Member
0 Likes
1,780

Hello,

you could just call the function F4_Filename.

Regards Wolfgang

7 REPLIES 7
Read only

Former Member
0 Likes
1,781

Hello,

you could just call the function F4_Filename.

Regards Wolfgang

Read only

0 Likes
1,780

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??

Read only

0 Likes
1,780

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

Read only

1,780

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.

Read only

Former Member
0 Likes
1,780

Hi Oscar,

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

Regards

Sujatha

Read only

0 Likes
1,780

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

Read only

Former Member
0 Likes
1,780

Hi

use the following method.

CALL METHOD cl_gui_frontend_services=>FILE_OPEN_DIALOG

Reward points if helpful