Application Development and Automation 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: 
Read only

Checking in Selection screen - Matchcode

Former Member
0 Likes
4,741

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

1 ACCEPTED SOLUTION
Read only

guillaume-hrc
Active Contributor
0 Likes
2,391

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>.

8 REPLIES 8
Read only

Former Member
0 Likes
2,391

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

Read only

guillaume-hrc
Active Contributor
0 Likes
2,392

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>.

Read only

Former Member
0 Likes
2,391

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

Read only

Former Member
0 Likes
2,391

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

Read only

Former Member
0 Likes
2,391

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'.

Read only

0 Likes
2,391

hi,

DYNAME LIKE D020S-PROG ALUE 'Z2222', program

DYNUMB LIKE D020S-DNUM VALUE '1000', scr no.

DATA: DYNPFIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = DYNAME

DYNUMB = DYNUMB

TABLES

DYNPFIELDS = DYNPFIELDS.

cheers,

sasi

Read only

0 Likes
2,391

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

Read only

Former Member
0 Likes
2,391

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