11-24-2009 5:34 PM
Dear Friends,
As per the requirement i have to give F4 help on a particular field . and i have used the function module
'F4IF_INT_TABLE_VALUE_REQUEST'.
Now my Functional says after testing in UAT , that the user should not be allowed to enter value ( key in value in the input field) only he should pick the values fromt he F4 help . As per my functional i have changed the input field only output field only.
Now when i press F4 on the field i am able to see the F4 values and able to select the required but that selected value is
not getting replaced with the existing value on the screen field ........because it is a disabled field . I was able to replace the value when it was a input field , but after i made a disabled field it is not holiding the value which i selected from the F4 list .
I would like to know is there a way where i can select the F4 values even the field is made only output field or input field where the user should not be allowed enter value but only select from F4 help values.
regards
divya
Edited by: Rob Burbank on Nov 24, 2009 12:52 PM
11-24-2009 5:37 PM
11-24-2009 5:37 PM
11-25-2009 2:31 AM
It is possible - there is an little used option in the F4IF_INT_TABLE_VALUE_REQUEST function that allows it - the "Force" option for the "display" parameter ... try the example below.
Jonathan
report zsdn_jc_pf_picklist_force.
parameters:
p_field(30) type c.
at selection-screen output.
loop at screen.
screen-input = '0'.
modify screen.
endloop.
set cursor field 'P_FIELD'.
at selection-screen on value-request for p_field.
perform my_f4.
*&---------------------------------------------------------------------*
*& Form my_f4
*&---------------------------------------------------------------------*
form my_f4.
data:
ls_field type dfies,
lt_field type table of dfies,
ls_return type ddshretval,
lt_return type table of ddshretval.
data:
l_title(28) type c,
l_repid type syrepid,
lt_value(100) type c occurs 10.
append 'HELLO1' to lt_value.
append 'World1' to lt_value.
append 'HELLO2' to lt_value.
append 'World2' to lt_value.
append 'HELLO3' to lt_value.
append 'World3' to lt_value.
*
* Build table of columns based on DDIC objects
*
ls_field-tabname = 'BKPF'.
ls_field-fieldname = 'BELNR'.
append ls_field to lt_field.
ls_field-tabname = 'BSEG'.
ls_field-fieldname = 'SGTXT'.
append ls_field to lt_field.
l_title = 'Pick a value, any value...'.
l_repid = sy-repid.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BELNR'
dynpprog = l_repid
dynpnr = '1000'
dynprofield = 'P_FIELD'
stepl = 0
window_title = l_title
value = ' '
value_org = 'C' "Column or Structure
multiple_choice = ' '
display = 'F' "F = Force
callback_program = ' '
callback_form = ' '
tables
value_tab = lt_value
field_tab = lt_field
return_tab = lt_return
exceptions
others = 0.
endform. "my_f4
11-25-2009 7:26 AM
Hi Jonathan,
Thanks a ton ....your code helped me allot.
regards
divya
11-24-2009 5:44 PM
Hi,
try this way-->create drop down so user will select from drop down it will not allow manual
input...
PARAMETERS: p_tname TYPE dd03l-tabname AS LISTBOX VISIBLE LENGTH 30
MODIF ID r1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_tname.
DATA: w_dynprofld TYPE help_info-dynprofld.
DATA : BEGIN OF t_table OCCURS 0,
tabname TYPE dd03l-tabname,
END OF t_table.
CLEAR t_table.
REFRESH t_table.
t_table-tabname = 'ZCB_COMMTEAM_GRP'.
APPEND t_table.
t_table-tabname = 'ZCB_CCODE2GPGRP'.
APPEND t_table.
t_table-tabname = 'ZCB_VEND2PURGRP'.
APPEND t_table.
w_dynprofld = 'P_TNAME'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'TABNAME'
dynpprog = sy-repid
dynpnr = '1000'
dynprofield = w_dynprofld
value_org = 'S'
TABLES
value_tab = t_table.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Regards,
Prabhudas
11-24-2009 6:49 PM
11-25-2009 2:47 AM
LOOK AT THIS PARAMETER DISPLAY, IT SET 'F', may be help you.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
display = 'F'
TABLES
value_tab =
field_tab =
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
11-25-2009 3:00 AM
Hi,
This is very much possible and for this you need to user the FM 'DYNP_VALUES_UPDATE'.
Here is how it goes.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'PKGNAME'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = ' '
value_org = 'S'
TABLES
value_tab = table_value
field_tab = field_tab1
return_tab = return_tab_pkg
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
The 'Return_tab' gives u the value of the F4 selected.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-repid
dynumb = screen_number
TABLES
dynpfields = dynpfields.
This table 'dynpfields' should contain the Screen field name on which u have to display the value and the value that is selected from the F4 help.
Regards,
Pramod
Edited by: Pramod M on Nov 25, 2009 8:30 AM
11-25-2009 5:58 AM
Hi Divya,
<li>Jonathan code works perfectly.
<li>Here is the simplified code for the same.
Thanks
Venkat.OREPORT ztest_notepad.
DATA: BEGIN OF it_bukrs OCCURS 0,
bukrs TYPE t001-bukrs,
butxt TYPE t001-butxt,
END OF it_bukrs.
PARAMETERS:bukrs TYPE t001-bukrs.
*"AT SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
screen-input = '0'.
MODIFY SCREEN.
ENDLOOP.
*"F4 help
AT SELECTION-SCREEN ON VALUE-REQUEST FOR bukrs.
SELECT bukrs butxt FROM t001 INTO TABLE it_bukrs.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'BUKRS'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'BUKRS'
value_org = 'S'
display = 'F' "F = Force
TABLES
value_tab = it_bukrs.