‎2008 Mar 19 8:25 AM
hi
how to get the user required values as f4 help for a user defined parammeter in parameters
‎2008 Mar 19 8:28 AM
At selection-screen on value-request for p_mat.
Select MBLNR from mkpf into table it_mblnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'MBLNR'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT_MBLNR
FIELD_TAB =
RETURN_TAB = IT_RET
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF SY-SUBRC = 0.
read table it_ret index 1.
move it_ret-fieldval to p_mat.
ENDIF.
‎2008 Mar 19 8:31 AM
You can either attach a search help attached to the parameter.
OR
On the VALUE REQUEST of the parameter field call the FM
F4IF_INT_TABLE_VALUE_REQUEST with the required data.
For more information on the above FM, check the below link.
[http://sap.niraj.tripod.com/id27.html|http://sap.niraj.tripod.com/id27.html]
Hope this helps.
Thanks,
Balaji
‎2008 Mar 19 8:32 AM
see the example below:
here p_senkey is a parameter
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_senkey.
PERFORM f0012_sh_on_s_session CHANGING p_senkey.
&----
*& Form f0013_sh_on_s_session
&----
text
----
<--P_P_SENKEY text
----
FORM f0012_sh_on_s_session CHANGING p_senkey TYPE any.
REFRESH : i_seskey, i_ddshretval.
CLEAR:wa_seskey.
SELECT template_id " #CCE No deletion Flag
version
session_key
lock_date
success
unlock_date
FROM zfact_maint_jlog INTO wa_seskey.
APPEND wa_seskey TO i_seskey.
ENDSELECT.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'SESSION_KEY'
PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_SENKEY'
STEPL = 0
window_title = 'SESSION KEY'
VALUE = ' '
value_org = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = i_seskey
FIELD_TAB =
return_tab = i_ddshretval.
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
IF sy-subrc <> 0. "#EC *
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
CLEAR wa_ddshretval.
READ TABLE i_ddshretval INTO wa_ddshretval INDEX 1.
IF sy-subrc EQ 0.
p_senkey = wa_ddshretval-fieldval.
ENDIF.
ENDIF.
ENDFORM. " f0013_sh_on_s_session
‎2008 Mar 19 8:33 AM
Hi,
SELECT-OPTIONS : s_plant FOR zaw_pol_plan-plant DEFAULT '1000'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_plant1-low .
CLEAR i_t001w.
REFRESH i_t001w.
SELECT werks INTO TABLE i_t001w
FROM t001w.
IF sy-subrc EQ 0.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'WERKS'
dynpprog = ws_repid
dynpnr = sy-dynnr
value_org = 'S'
TABLES
value_tab = i_t001w
return_tab = v_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER
SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
IF p1_plant EQ 'ADD'.
s_plant1-low = v_return-fieldval.
ENDIF.
‎2008 Mar 19 8:34 AM
Hi,
for user defines value to display as F4.
DATA : BEGIN OF it_waers occurs 0,
waers TYPE ekko-waers,
END OF it_waers.
DATA : lt_return_tab TYPE STANDARD TABLE OF DDSHRETVAL WITH HEADER LINE.
REFRESH it_waers.
it_waers-waers = 'KG'.
APPEND it_waers.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'WAERS'
PVALKEY = ' '
DYNPPROG = 'ZTEST'
DYNPNR = '0100'
DYNPROFIELD = 'IT_EKKO-WAERS' "field name
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
tables
value_tab = it_waers
FIELD_TAB =
RETURN_TAB = lt_return_tab
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
READ TABLE lt_return_tab INDEX 1.
IT_EKKO-WAERS = lt_return_tab-fieldval.
ENDIF.
Fill the data it it_waers. Then from lt_return_tab u can get the selected value.
Please reward if useful.
Regards,
Ramesh
‎2008 Mar 19 8:41 AM
Hi Jyothsna,
If it (Parameter type) doesn't has search help or value table or value range in data dictionary u will not get F4 help automatically.
So declare an itab and populate it with ur required values.
E.G: For Customer number F4 help is like Cus.Number and name.
Call function module "F4int*" (check for it in se37) in the event,
at selection-screen on value request for p_kunnr.
Pass prog name and itab, u ll get F4 help.
Regards,
Subbu
‎2008 Mar 19 8:41 AM
u can achieve this in 2 ways.
1) fetch the user required data from database into an internal table then pass that internal table to the below function module.
F4IF_INT_TABLE_VALUE_REQUEST
2) maintain those values at domain level. that means if the required user values are fixed then maintain then in value range of domain..................
reward if useful............