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

F4 Button in FM

Former Member
0 Likes
813

Hi,

I have created a Z-Function module..where 1 pop-up will come and while pressing F4 it will go to

process on value-request..and it is working fine in SE37

But when i am using in my program..same FM with same parameter ...the F4 button is not working ...control is not going to processon value-request

6 REPLIES 6
Read only

Former Member
0 Likes
738

use

FORM get_filename CHANGING p_filename.

DATA : lv_filename TYPE string,

lv_rc TYPE i,

li_filetable TYPE filetable.

CONSTANTS : lc_fname TYPE string VALUE 'ZRPP4000.XLS',

lc_fpath TYPE string VALUE 'C:\',

lc_extn TYPE string VALUE 'XLS'.

CALL METHOD cl_gui_frontend_services=>file_open_dialog

EXPORTING

default_filename = lc_fname

initial_directory = lc_fpath

default_extension = lc_extn

CHANGING

file_table = li_filetable

rc = lv_rc

EXCEPTIONS

file_open_dialog_failed = 1

cntl_error = 2

error_no_gui = 3

not_supported_by_gui = 4

OTHERS = 5.

IF sy-subrc = 0 .

READ TABLE li_filetable INTO lv_filename INDEX 1.

IF sy-subrc = 0.

p_filename = lv_filename.

ENDIF.

ENDIF.

REFRESH li_filetable.

CLEAR:lv_filename.

ENDFORM. "get_filename

Edited by: AD on Nov 27, 2008 7:13 AM

Edited by: AD on Nov 27, 2008 7:14 AM

Read only

Former Member
0 Likes
738

Hi Priya,

How you are getting the POPUP

are you using standard function module or Z- screens

to best of my knowledge it works with the zscreens only

please let us know

Regards

Ramchander Rao.K

Read only

0 Likes
738

Hi,,

i am calling the screen inside the FM.it is a z-screen.

Read only

Former Member
0 Likes
738

Hi,

You cannot get the F4 Pop-Up for FM in the Program, beacuse for this F4 need's to be handled in the Program.

Read only

agnihotro_sinha2
Active Contributor
0 Likes
738

hi priya,

call the FM under event AT selection-screen on value request for <fname>;

i think then it will trigger.

Read only

Former Member
0 Likes
738

Hi Priya,

As you says there is no problem with your function module,so it should work if you r using that

customize function module.

There is standard function module for F4 help ,you can use that one,is there any reason for creating

cust FM.

Use in this way

FORM sub_f4_help .

  • Selecting plant for f4 help for palnt in selection screen

SELECT werks "Plant

name1 "Name

FROM t001w

INTO TABLE it_werks

WHERE werks IN (g_w1,g_w2,g_w3).

IF sy-subrc = 0.

SORT it_werks.

ENDIF.

  • FM used to populate plant(2000,5000,6000) in f4 help

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'WERKS'

pvalkey = ' '

dynprofield = 'S_WERKS-LOW'

value_org = g_kind

TABLES

value_tab = it_werks "Fields of the hit list

return_tab = it_return "Return selected value

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc = 0.

READ TABLE it_return INTO wa_return INDEX 1.

IF sy-subrc = 0.

s_werks-low = wa_return-fieldval.

ENDIF.

CLEAR : it_return[],

wa_return.

ENDIF.

ENDFORM. " SUB_F4_HELP