on 05-16-2006 7:24 PM
Can we have something like this in a select query.. ( see the WHERE clause)
select vbeln vstel
route kunnr
lstel bolnr
traty traid
wadat_ist
from likp
into gt_likp
where kunnr in s_kunnr
and kunnr in r_kunnr.
regards
Nishant
Message was edited by: Nishant Gupta
Sure, why not? I assume that R_KUNNR is a range.
Regards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It really depends on what logic you have built in the SELECT-OPTION and the RANGE. Logically, the only records that will be retrieved will be the ones that satisfy BOTH the SELECT-OPTION and the RANGE, hence the logic will need to be overlapping in some way. I don't know your purpose for doing it this way, but there must be a reason. If not, using one range would be better.
* Copy S_KUNNR to the R_KUNNR range
Loop at s_kunnr.
r_Kunnr = s_kunnr.
append r_kunnr.
endloop.
Regards,
Rich Heilman
lets take for example there are two customer numbers : 100 and 101. Assuming that both are populated in S_KUNNR and R_KUNNR.
your select statement will get converted to
select vbeln vstel
route kunnr
lstel bolnr
traty traid
wadat_ist
from likp
into gt_likp
where ( kunnr eq '100' or kunnr eq '101')
and ( kunnr eq '100' or kunnr eq '101').
i dont see a point in using R_KUNNR, even if you remove it the number of entries are not going to vary.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It might be more efficient to do something like this:
append lines of r_kunnr to s_kunnr.
select vbeln vstel
route kunnr
lstel bolnr
traty traid
wadat_ist
from likp
into gt_likp
where kunnr in s_kunnr.
Rob
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nishant,
Syntactically we can do that, I am not sure if it gives the right results.
So, why can't append all the values from s_kunnr into r_kunnr and use just r_kunnr in the WHERE clause.
By the way what happened to your IDOC thing?
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.