‎2005 Dec 15 7:41 AM
Hi frnds,
i have 2 parameters. plant and mat. no.. the plant has the std. search help. But for the matnr i want to create a search help such that only those values pertaining to the input plant is displayed. im using the fun. module F4IF_FIELD_VALUE_REQUEST in the event AT SELECTION SCREEN ON VALUE REQUESTR. but plz tell me wot values am i to pass to this?
points assured to all replies..
regrds,
Madan.
‎2005 Dec 15 7:56 AM
Hi,
Here is the sample code.Kindly reward points by clikcing the star on the left of reply,if it helps.
tables kna1.
data:
begin of t_values occurs 2,
value like kna1-begru,
end of t_values,
t_return like ddshretval occurs 0 with header line.
select-options s_begru for kna1-begru.
at selection-screen on value-request for s_begru-low.
refresh t_values.
t_values = 'PAR*'.
append t_values.
t_values = 'UGG'.
append t_values.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BEGRU'
value_org = 'S'
tables
value_tab = t_values
return_tab = t_return
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc = 0.
read table t_return index 1.
s_begru-low = t_return-fieldval.
endif.
‎2005 Dec 15 7:47 AM
populate the internal table .
and pass it.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = space
fieldname = space
searchhelp = shelp
dynprofield = 'X'
TABLES
return_tab = ittable
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5.
‎2005 Dec 15 7:49 AM
DATA: return_values LIKE ddshretval OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
value_org = 'S'
display = 'F'
TABLES
value_tab = t_1001
return_tab = return_values
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 return_values INDEX 1.
t_1001-matnr = return_values-fieldval.
MOVE t_1001 TO it_1001.
ENDIF.
Reward points if it is helpful.
Cheers
‎2005 Dec 15 7:52 AM
Hi,
Look at the sample code...........
*******************
data: begin of t_itab occurs 0,
pernr like zfdmr_records-pernr,
end of t_itab.
DATA: t_return like ddshretval occurs 0 with header line.
**----
*at selection-screen on value-request for s_pernr-low.
**----
perform get_values changing s_pernr-low.
*
**----
*at selection-screen on value-request for s_pernr-high.
**----
perform get_values changing s_pernr-high.
&----
*& Form get_values
&----
text
----
-->P_S_PERNR_LOW text
----
FORM get_values CHANGING P_S_PERNR.
refresh t_itab.
clear t_return.
select pernr from zfdmr_records into table t_itab.
delete adjacent duplicates from t_itab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'PERNR'
PVALKEY = ' '
DYNPPROG = sy-cprog
DYNPNR = sy-dynnr
DYNPROFIELD = 'ZFDMR_RECORDS-PERNR'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = 'F'
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
TABLES
VALUE_TAB = t_itab
FIELD_TAB =
RETURN_TAB = t_return
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.
READ TABLE t_return INDEX 1.
p_s_pernr = t_return-fieldval.
ENDFORM. " get_values
********************This is one way.
2. You can give some values in LIST OF POSSIBLE VALUES..
This we will give at domain level.
Double click on DATA ELEMENT again double click on DOMAIN.
There you will find VALUE RANGE TAB. Here you need to give possible values.
This values will store in DD07T Table.
Then for the above code you need to select from DD07T table and must pass that to FM.
Thanks.
If this helps you reward with points.
‎2005 Dec 15 7:56 AM
Hi,
Here is the sample code.Kindly reward points by clikcing the star on the left of reply,if it helps.
tables kna1.
data:
begin of t_values occurs 2,
value like kna1-begru,
end of t_values,
t_return like ddshretval occurs 0 with header line.
select-options s_begru for kna1-begru.
at selection-screen on value-request for s_begru-low.
refresh t_values.
t_values = 'PAR*'.
append t_values.
t_values = 'UGG'.
append t_values.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BEGRU'
value_org = 'S'
tables
value_tab = t_values
return_tab = t_return
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc = 0.
read table t_return index 1.
s_begru-low = t_return-fieldval.
endif.
‎2005 Dec 15 8:12 AM
Hi,
I hope your problem is solved.If so,kindly click the blue star on the left of reply,which solves your problem.
If not,get back.
‎2005 Dec 15 8:33 AM