‎2008 Nov 10 4:52 PM
Hi friends,
Can u give me soolution for the below select statement to increase the performance.
SELECT * FROM setleaf WHERE
setclass EQ '0106' AND
subclass IN i_subclass AND
setname LIKE l_setname.
MOVE: setleaf-valsign TO r_pgroup-sign,
setleaf-valoption TO r_pgroup-option,
setleaf-valfrom TO r_pgroup-low,
setleaf-valto TO r_pgroup-high.
APPEND r_pgroup.
CLEAR r_pgroup.
ENDSELECT.
‎2008 Nov 10 5:04 PM
data : it_setleaf type table of setleaf,
st_setleaf type setleaf.
select * from setleaf
into table it_setleaf
where setclass EQ '0106'
and subclass IN i_subclass
and setname LIKE l_setname.
loop at it_setleaf into st_setleaf.
r_pgroup-sign = setleaf-valsign.
r_pgroup-option = setleaf-valoption.
r_pgroup-low = setleaf-valfrom.
r_pgroup-high = setleaf-valto.
append r_pgroup.
endloop.
‎2008 Nov 10 5:06 PM
Select ... Endselect is kinda a select in a loop. so i think the above should be quite efficent.
‎2008 Nov 10 6:12 PM
Mahesh - this is the second time today I have moved your question to the correct forum. Performance questions go in the ABAP Performance and Tuning forum. And try to get a better subject than "performance issue".
matt
‎2008 Nov 11 8:42 AM
Hi,
Check the below code:
data : it_setleaf type standard table of setleaf,
wa_setleaf type setleaf.
data: it_pgroup type standard table of ussel,
wa_pgroup type ussel.
select * from setleaf
into table it_setleaf
where setclass EQ '0106'
and subclass IN i_subclass
and setname LIKE l_setname.
loop at it_setleaf into wa_setleaf.
wa_pgroup-sign = wa_setleaf-valsign.
wa_pgroup-option = wa_setleafvaloption.
wa_pgroup-low = wa_setleaf-valfrom.
wa_pgroup-high = wa_setleaf-valto.
append wa_pgroup to it_pgroup.
clear wa_pgroup.
endloop.Regards,
Saba
‎2008 Nov 11 8:54 AM
Try this one.
data :
it_pgroup type standard table of ussel.
select valsign as sign
valoption as option
valfrom as low
valto as high
from setleaf
INTO CORRESPONDING FIELDS OF TABLE it_pgroup
where setclass EQ '0106'
and subclass IN i_subclass
and setname LIKE l_setname.
But actually your original solution was also o.k.
Please check the performance of the WHERE condition which indexes are available, is this
i_subclass filled?
Siegfried
‎2008 Nov 22 7:39 AM
Hi,
please try this one...
data : it_setleaf type standard table of setleaf .
select valsign valoption valfrom valto
from setleaf
into corresponding fields of table it_setleaf
where setclass = '0106'
and subclass = i_subclass
and setname = l_setname.
Use 'EQ' in where clause for first time to get account group / reporting group from setleaf .then pass the same from it_setleaf to other tables .