02-18-2010 12:52 AM
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
02-18-2010 1:03 AM
Can u explain for what purpose you want two low entries in select options?
02-18-2010 1:01 AM
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
02-18-2010 1:03 AM
Can u explain for what purpose you want two low entries in select options?
02-18-2010 1:27 AM
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???
02-18-2010 1:43 AM
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.
02-18-2010 1:47 AM
02-18-2010 1:57 AM
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.
02-18-2010 1:58 AM
02-18-2010 2:02 AM
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.
02-18-2010 2:03 AM
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..
02-18-2010 2:09 AM
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...?
02-18-2010 2:26 AM
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
02-18-2010 2:34 AM
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?
02-18-2010 2:38 AM
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
02-18-2010 2:40 AM
02-18-2010 2:45 AM
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.
02-18-2010 2:55 AM
Thanks a lot ..it was really excellent....thanks for ur time....thanks for ur support
02-18-2010 2:59 AM
Thanks JaiKarthik...a gentle suggestion just do sme research on smething first before posting in the forum bcoz here nobody
encourages basic questions.