Application Development and Automation 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: 
Read only

performance issue

Former Member
0 Likes
790

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.

6 REPLIES 6
Read only

Former Member
0 Likes
687

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.

Read only

Former Member
0 Likes
687

Select ... Endselect is kinda a select in a loop. so i think the above should be quite efficent.

Read only

matt
Active Contributor
0 Likes
687

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

Read only

Former Member
0 Likes
687

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

Read only

Former Member
0 Likes
687

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

Read only

Former Member
0 Likes
687

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 .