Skip to Content
avatar image
Former Member

Attaching a searchhelp to a parameter

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

regards

cs

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 17, 2007 at 01: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>

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      "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

  • avatar image
    Former Member
    Aug 17, 2007 at 01: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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 01: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 01: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 21, 2007 at 12: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.

    Add comment
    10|10000 characters needed characters exceeded