Application Development 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: 

Attaching a searchhelp to a parameter

Former Member

How can we attach a searchhelp to a parameter or select-option?

regards

cs

1 ACCEPTED SOLUTION

Former Member

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>

6 REPLIES 6

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member

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>

0 Kudos

"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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.