Skip to Content
author's profile photo
Former Member

Checking in Selection screen - Matchcode

Hi,

In the selection screen i'm putting all the key fields of the same table as select option with matchcode object created individually.

If i select some values in the first select option , i need to get the corresponding fields available in the second select option with respect to the value i selected in the first one. In what way i can get the matchcode to show the matching records depending on the previous selection.

I appreciate ur time.

Regards

Krithika

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • Best Answer
    author's profile photo
    Former Member
    Sep 28, 2005 at 03:11 PM

    You need to use the AT SELECTION-SCREEN ON HELP-REQUEST FOR <i>select-options2</i> event.

    There, you will select the data depending of the values in <i>select-options1</i>.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 30, 2005 at 08:47 AM

    Hi,

    In the function 'DYNP_VALUES_READ' - what is the parameter to be passed for : tables dynpfields.

    Though i tried with select option name it is showing error - 'length is incorrect'.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Sasikumar,

      I tried it , it is not showing any error but it is not showing any values when i press F4 in the select-option.

      How to fetch it.

      Thanx

      Krithi

  • author's profile photo
    Former Member
    Sep 28, 2005 at 03:04 PM

    Hi

    there are several ways to do that, but they depend on how your search help are.

    So you let us know more details.

    But I think it'll be not easy to do that because you're using select-options and not parameter.

    Max

    Message was edited by: max bianchi

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 29, 2005 at 02:37 PM

    Hi,

    Thanks.

    This is the codings:

    TABLES STXH.

    SELECT-OPTIONS :

    S-TDOBJ FOR STXH-TDOBJ MATCHCODE OBJECT ZSHLP1,

    S-TDNAME FOR STXH-TNAME,

    S-TDID FOR STXH-TDID,

    S-TDSPR FOR STXH-TDSPRAS.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S-TDNAME-LOW.

    SELECT TDNAME FROM STXH INTO S-TDNAME WHERE TDOBJ IN S-TDOBJ.

    -


    I'm not getting it.I created matchcode zshlp1 for the field tdobj.

    So when i click s-tdname i should get the corresponding records avalable with respect to the selection done in s-tdobj.

    Regards

    Krithika

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 29, 2005 at 03:23 PM

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S-TDNAME-LOW.

    In this event you will not have S_TDOBJ populated if you have not pressed "ENTR" once before pressing F4 on TDNAME.

    In F4 help Screen PAI is not triggerd so values are not transferred from screen to program. Just press enter before pressing F4 and you will get the values.

    That was for explanation.

    You can get the values of S_TDOBJ using function

    DYNP_VALUES_READ ( even if PAI is not triggered). Then use this value in your select statement and your F4 on TDNAME will work.

    Cheers

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 30, 2005 at 09:37 AM

    Hi you have two problems. First your screen data of other field should be available in POV ( Porcess on Value Req ) module . See the code below

    <i> tables stxh.

    DATA: BEGIN OF it_dynp_value_tab OCCURS 0.

    INCLUDE STRUCTURE dynpread.

    DATA: END OF it_dynp_value_tab.

    data pprog like sy-repid.

    data pdynnr like sy-dynnr.

    ranges RTDOBJ FOR STXH-TDOBJECT .

    MOVE: 'S_TDOBJ-LOW' TO it_dynp_value_tab-fieldname.

    APPEND it_dynp_value_tab.

    MOVE: 'S_TDOBJ-HIGH' TO it_dynp_value_tab-fieldname.

    APPEND it_dynp_value_tab.

    CALL FUNCTION 'DYNP_VALUES_READ'

    EXPORTING

    dyname = pprog

    dynumb = pdynnr

    TABLES

    dynpfields = it_dynp_value_tab

    EXCEPTIONS

    invalid_abapworkarea = 1

    invalid_dynprofield = 2

    invalid_dynproname = 3

    invalid_dynpronummer = 4

    invalid_request = 5

    no_fielddescription = 6

    invalid_parameter = 7

    undefind_error = 8

    double_conversion = 9

    stepl_not_found = 10

    OTHERS = 11.

    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 it_dynp_value_tab INDEX 1.

    move it_dynp_value_tab-fieldvalue to RTDOBJ-LOW.

    READ TABLE it_dynp_value_tab INDEX 2.

    move it_dynp_value_tab-fieldvalue to RTDOBJ.

    RTDOBJ-SIGN = 'I' .

    IF RTDOBJ-LOW NE SPACE AND RTDOBJ-HIGH EQ SPACE.

    RTDOBJ-OPTION 'EQ'.

    APPEND RTDOBJ.

    ELSEIF RTDOBJ-LOW NE SPACE AND RTDOBJ-HIGH NE SPACE . .

    RTDOBJ-OPTION 'BT'.

    APPEND RTDOBJ.

    ENDIF.</i>

    After this RTDOBJ will have values what you have put in seledct option 'S_TDOBJ' on selection screen. This will not mean that values will be dispalyed in F4 help in TDNAME . To display values you have to select all valid values in an internal table using RTDOBJ and then use FM F4IF_INT_TABLE_VALUE_REQUEST to display values .

    Cheers

    Add comment
    10|10000 characters needed characters exceeded