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

check select option.

Former Member
0 Likes
1,036

Hi,

I have taken a Multiple values in the selection screen with the 'select-options'.And

My code is like below.

select-options : KUNNR1 for KNA1-KUNNR.

select-options : KTOKD1 for KNA1-KTOKD.

Select single KTOKD from KNA1 into KTOKD2

where kunnr In KUNNR1.

Now what is the value we got for KTOKD2, we have to chek with all the values we are getting from KTOKD1 in the selection screen.

Please give me some Idea how can I do it.

Thanks & Regards

Venkat

Hi,

I have taken a Multiple values in the selection screen with the 'select-options'.And

My code is like below.

select-options : KUNNR1 for KNA1-KUNNR.

select-options : KTOKD1 for KNA1-KTOKD.

Select single KTOKD from KNA1 into KTOKD2

where kunnr In KUNNR1.

Now what is the value we got for KTOKD2, we have to chek with all the values we are getting from KTOKD1 in the selection screen.

Please give me some Idea how can I do it.

Thanks & Regards

Venkat

8 REPLIES 8
Read only

Former Member
0 Likes
990

Hi venkata,

can you explain it a bit more clearly?

Regards,

Ravi

Read only

Former Member
0 Likes
990

hi,



do this 

<b>loop at KTOKD2 where KTOKD in KTOKD1</b>.

-------ur logic
or append the value in new internal table

<b>Endloop.</b>


<b>

Reward Points & mark helpful Answers</b>

Read only

Former Member
0 Likes
990

Da a internal table

select-options : KUNNR1 for KNA1-KUNNR.

select-options : KTOKD1 for KNA1-KTOKD.

DATA: begin of it occurs 0,

KTOKD2 like kna1-ktokd,

end of it.

Select KTOKD from KNA1 into table it

where kunnr In KUNNR1

and ktokd in ktokd1.

But , ..could you explain us your problem a little more clearly ?? (i'm no sure i understand good your problem)

BR< Jacek

Message was edited by: Jacek Slowikowski

Message was edited by: Jacek Slowikowski

Message was edited by: Jacek Slowikowski

Read only

Former Member
0 Likes
990

hi,

at selection-screen.

if not KTOKD1 is initial.

select single KTOKD from KNA1 into KTOKD1

where kunnr in kunnr1

and KTOKD in KTOKD1.

endif.

hope this helps,

do reward if it helps,

priya.

Message was edited by: Priya

Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
990

Hi,

Use event <b> At selection screen</b>

then inside that loop ur internal table for the values to be checked..

Hope it helps..

cheers,

Simha.

Read only

0 Likes
990

Hi,

Please take a look at my code below:

types: begin of t_kna1,

kunnr type kna1-kunnr,

ktokd type kna1-ktokd,

end of t_kna1.

data: it_kna1 type standard table of t_kna1.

field-symbols: <fs_kna1> like line of it_kna1.

selection-screne begin of block b1 with frame.

select-options: s_kunnr for kna1-kunnr,

s_ktokd1 for kna1-ktokd.

selection-screen end of block b1.

start-of-selection.

select kunnr ktokd from kna1

into it_kna1

where kunnr in s_kunnr.

*or you can do select single if you only want a single *record.

remember that using IN is saying that you are checking against multiple values.

Hope this helps.

P.S> Please reward points for useful answers.

Read only

Former Member
0 Likes
990

As a sample note down some values which result from the selection based on

Select single KTOKD from KNA1 into KTOKD2

where kunnr In KUNNR1.

Now search for the equivalent in the standard database tables.

Read only

Former Member
0 Likes
990

Hi,

As much as I understand u want a validation for the data for field2 from the values in field1.

If So,Please go throuhg the code below.

REPORT ZSM_TEST.

TABLES : MARA.

SELECTION-SCREEN BEGIN OF BLOCK B1.

PARAMETERS : S_MTART LIKE MARA-MTART OBLIGATORY.

PARAMETERS : S_MATNR LIKE MARA-MATNR OBLIGATORY MODIF ID M1.

SELECTION-SCREEN END OF BLOCK B1.

<b>To Disable the field2(Material Code) in case the Material Type is not entered

-


</b>

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-GROUP1 EQ 'M1'.

IF S_MTART IS INITIAL.

SCREEN-INPUT = '0'.

ELSE.

SCREEN-INPUT = '1'.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

<b>Check the data for combibation of field1 and field2

-


</b>AT SELECTION-SCREEN.

CHECK S_MTART IS NOT INITIAL AND

S_MATNR IS NOT INITIAL.

SELECT SINGLE * FROM MARA

WHERE MTART EQ S_MTART

AND MATNR EQ S_MATNR.

IF SY-SUBRC NE 0.

MESSAGE E002(SY) WITH 'Invalid Material & Type Combination!!'.

ENDIF.

START-OF-SELECTION.

WRITE : 'BINGO'.