‎2005 Dec 05 9:35 PM
Hi guyz,
I have an issue with the select statement.
the following code is existing in my program to select.
select objnr gjahr appending i_cost
from coss
for all entries in i_aufnr
where objnr = i_aufnr-objnr
and gjahr in s_gjahr
and kstar in (c_labor, c_overhead).
now i have to include some more values for the cost element (coss-kstar) viz (c_ele1,c_ele2,c_ele3).
can i write the code like :
kstar in (c_labor, c_overhead, c_ele1,c_ele2,c_ele3).
if not, how shd write the select statement?
plz suggest me.
thanks a lot in advance.
venu
‎2005 Dec 05 9:39 PM
‎2005 Dec 05 9:36 PM
Hi Venu,
You can write the code that way.You can specify any no. of values.
Phani.
‎2005 Dec 05 9:38 PM
you can write like that, are you facing any problem..
regards
vijay
‎2005 Dec 05 9:39 PM
‎2005 Dec 05 9:46 PM
If you want it to be more flexible, define a range for that field and fill it as follows.
ranges: r_kstart for coss-kstar.
r_kstar-low = c_ele1.
r_kstar-option = 'EQ'.
r_kstar-sign = 'I'.
append r_kstar.
You can fill all others using the same logic. Even better would be to make it as a select-option and prefill it just like above in the INITIALIZATION event. If the users want to add more cost elements in the future, they can simply add it to this select option, instead of you changing the program everytime.
Srinivas
‎2005 Dec 05 9:54 PM
‎2005 Dec 06 4:53 PM
Hi Venu,
You can specify values but there is a limitation on SQL statement generated by SAP at Kernal.. If you have too many values not only in this IN statement (Individual or Internal table ).. SAP created SQL statement at Runtime will give dump if it exceeds the limit..
You are ok with this one.. but just keep in mind.
-Bharat