08-17-2007 2:10 PM
How can we attach a searchhelp to a parameter or select-option?
regards
cs
08-17-2007 2:29 PM
u can declare the parameters or select-options like this
parameters: p like mara-matnar mathcode object <give your search help name>
same way as select-options also
<b>Reward Points If Useful</b>
08-17-2007 2:20 PM
Hi,
If there is match code object for that paritucalr field you can directly assign while creating select options.
other wise you have to fetch all possible values for that field in an internal table in initialization event.
then on at selection screen on value request for that field u will have to call function module..
F4IF_INT_TABLE_VALUE_REQUEST
Reward if helpful.
Regards
Azad.
08-17-2007 2:25 PM
Hi,
Check my code below:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_WERK-LOW.
REFRESH ITEMP.
CLEAR ITEMP.
SELECT WERKS
NAME1
FROM T001W
INTO TABLE ITEMP
WHERE IWERK = 'M011'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'WERKS'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
TABLES
VALUE_TAB = ITEMP
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.
S_WERK-LOW = T_RETURN-FIELDVAL.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_WERK-HIGH.
REFRESH ITEMP.
CLEAR ITEMP.
SELECT WERKS
NAME1
FROM T001W
INTO TABLE ITEMP
WHERE IWERK = 'M011'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'WERKS'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
TABLES
VALUE_TAB = ITEMP
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.
S_WERK-HIGH = T_RETURN-FIELDVAL.
Hope this helps.
Reward if helpful.
Regards,
Sipra
08-17-2007 2:29 PM
u can declare the parameters or select-options like this
parameters: p like mara-matnar mathcode object <give your search help name>
same way as select-options also
<b>Reward Points If Useful</b>
02-03-2015 7:08 AM
"Example
PARAMETERS p_sm_id type ZZA_06_TMAST-SALESMAN MATCHCODE OBJECT zza_06_shp_1.
"ZZA_06_TMAST-SALESMAN is a field of transparent table
"zza_06_shp_1 is a search help
08-17-2007 2:31 PM
Hi,
i fu have search help say S_help, then u can simply do as :
parameters: mat type matnr matchcode object S_help.
or u can use the FM " f4if_field_value_request"
Rvert back if any issues,
Reward with poinst if helpful.
Regards,
Naveen.
Message was edited by:
Naveen Deva
08-21-2007 1:53 PM
Thank you all for the replies. they are really helpful.
came to know that we can attach search help to parameters/select-options through matchcode syntax.