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: 

Select-option

Former Member
0 Kudos

hi ,

select-option : s_bukrs for bukrs.

so the data for s_bukrs is AU00 TO AU99

nz00 TO NZ99.

initaily i had for 1 coutnry code only

so

SELECT cod

FROM zcod

INTO table tscod

WHERE land1 = s_bukrs-low(02).

working fine..

now the problem is when i have 2 entires..

SELECT cod

FROM zcod

INTO table tscod

WHERE land1 IN s_bukrs-low.

BUT GETTING ERROR MESSAGE AS no IN for LOW option...

is there any other way I can handle multiple LOW entires????? in the select query

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Can u explain for what purpose you want two low entries in select options?

17 REPLIES 17

Former Member
0 Kudos

SELECT cod

FROM zcod

INTO table tscod

WHERE land1 IN s_bukrs.

Mentors,

I am just answering the questions which the users are asking. Questions might be simple, but the mistake was not mine.

Edited by: subas Bose on Feb 18, 2010 2:01 AM

Edited by: subas Bose on Feb 18, 2010 2:04 AM

Edited by: subas Bose on Feb 18, 2010 3:53 AM

Former Member
0 Kudos

Can u explain for what purpose you want two low entries in select options?

0 Kudos

the user want to select 1 or 2 company code...so the selection screen has s_bukrs value are AU00 TO AU99 , NZ00 TO NZ99.

Now the table has land field value is AU & NZ only...

so i need to select from table where land1 = AU & NZ ..

is there any way???

0 Kudos

So as per my understanding you need to select data where land1 = AU and land1 = NZ.

You can enter multiple values in the low portion and can use " WHERE LAND1 IN S_BUKRS".

In this case it will select all the records where land1 is AU and NZ.

0 Kudos

yes perfect....

is there anu way ..

thanks for ur help

0 Kudos

Sorry i dont get u exactly....r u looking for other ways to do this..May i know why u want other ways?

The solution i told u is the straight forward way and the best way to do this.

0 Kudos

the explanation is the same ,,is there any code for this??

0 Kudos

I think u need to study select otions first,bcoz this is a very starigh forward concept.

Use this code

SELECT cod
FROM zcod
INTO table tscod
WHERE land1 IN s_bukrs.

When u enter AU and NZ in the select options and use the above code,it will select all

the records from tscod where land1 is AU and land1 is NZ.

0 Kudos

types : begin of ty_bukrs,

land1 type land1,

end of ty_bukrs.

data : ts_bukrs type standard table of ty_bukrs,

wa_bukrs type ty_bukrs.

loop at s_bukrs into wa_bukrs.

wa_bukrs-land1 = s_bukrs-low(02).

append wa_bukrs to ts_bukrs.

clear: wa_bukrs, s_bukrs.

endloop.

SELECT zchepctycod

FROM z2rlchepctycod

INTO table ts_chepctycod

for all entries in ts_bukrs

WHERE land1 = ts_bukrs-land1.

i tired this code but the problem is that "loop at s_bukrs..doesnt move to 2nd entires..

0 Kudos

What u are trying to acheive,r u using select options?

Karthik,this is a very straight concept.

Just declare the select option s_bukrs.

SELECT-OPTIONS: S_BUKRS FOR BKPF-BUKRS.

and use the query that i posted.

Why u want to loop and move the record...?

0 Kudos

the issue I am comparing land with companycode.....

say land1 = s_bukrs-low(02) was my initial query for single value....

but now s_bukrs has multiple values..

how to handle it...if i give the previous one which u had mention , no entries as output....

thanks for ur support

0 Kudos

Now ur concern is previously if the user entered AU009 in selection screen, you are taking the first two characters that is 'AU'

and using in the query ie;WHERE LAND1 = s_bukrs-low(02). But now when ur using" WHERE LAND1 IN s_bukrs" ,ur using the

whole'AU009' and it is not selectiing any data..This is ur prblem right?

0 Kudos

yes u r correct.

land1 IN s_bukrs -> no entires as it is comparing land1 with IBTAU00AU99

but I need to compare only s_bukrs-low , i gave land1 = s_bukrs-low(02) --> in this case it is taking the first entries say AU and forgetting abt the next record IBTNZ00NZ99..........

.this is the problem....I need to take AU & NZ while comparing land1 IN .?????

thanks

0 Kudos

and if I give LAND1 IN S_BUKRS-LOW(02) -


is giving error....

0 Kudos

This is an very simple concept.

Do this way

DATA:V_BUKRS(2).

LOOP AT S_BUKRS.

CLEAR V_BUKRS.

V_BUKRS =  S_BUKRS-LOW+0(2).
S_BUKRS-LOW = V_BUKRS.
MODIFY  S_BUKRS.

ENDLOOP.

SELECT cod
FROM zcod
INTO table tscod
WHERE land1 IN s_bukrs.

This will sove ur prb.

0 Kudos

Thanks a lot ..it was really excellent....thanks for ur time....thanks for ur support

0 Kudos

Thanks JaiKarthik...a gentle suggestion just do sme research on smething first before posting in the forum bcoz here nobody

encourages basic questions.