2010 Jan 15 9:01 AM
Dear All,
How to increase performance for the following query BSIS
select a~saknr as glcode
b~txt50 as gldesc
into corresponding fields of table it_final
from skb1 as a
inner join skat as b
on asaknr = bsaknr
where a~saknr in p_glcode
and a~bukrs eq company
and b~spras eq 'EN'
and b~ktopl eq 'ABIX'.
sort it_gl by saknr.
the above query get 220 G/L accounts.
if not it_final[] is initial.
select
bukrs
hkont
augdt
augbl
zuonr
gjahr
belnr
buzei
budat
werks
kostl
aufnr
shkzg
dmbtr
prctr
into corresponding fields of table it_bseg
from bsis
for all entries in it_final
where bukrs eq company
and prctr eq s_prctr
and gjahr eq s_year
and hkont eq it_final-glcode
and budat in s_budat "BETWEEN fromdt AND todt .
*above query taken above 30 minutes in production.
2010 Jan 15 9:05 AM
Hi john,
I also faced similar problem in BSIS.
Out of the where fields,
where bukrs eq company
and prctr eq s_prctr "<--------- problem
and gjahr eq s_year
and hkont eq it_final-glcode
and budat in s_budat . "<--------- problem
the two fields
PRCTR
and BUDAT
are creating the slowness. Create a secondary index on BSIS table, containing these two fields, (along with MANDT ofcourse), then the performance will be DRASTICALLY FAST. I have experienced it and it works fantastic.
regards,
amit m.
Hi,
Avoid to use into corresponding into...
If you are using select option then in wheere condition use IN
else use EQ for parameter.
Regards,
Pravin
2010 Jan 15 9:05 AM
Hi john,
I also faced similar problem in BSIS.
Out of the where fields,
where bukrs eq company
and prctr eq s_prctr "<--------- problem
and gjahr eq s_year
and hkont eq it_final-glcode
and budat in s_budat . "<--------- problem
the two fields
PRCTR
and BUDAT
are creating the slowness. Create a secondary index on BSIS table, containing these two fields, (along with MANDT ofcourse), then the performance will be DRASTICALLY FAST. I have experienced it and it works fantastic.
regards,
amit m.
2010 Jan 15 9:08 AM
2010 Jan 15 9:23 AM
Apologies Everyone...
I am the same user Gold Moon...I asked this question again in ABAP general as i thought members are more active
in that forum.
Thanks All.
J Melladi
2010 Jan 15 9:11 AM
Hello John,
Before proceeding further i would like to know which for the selection-screen fields are mandatory: company, s_prctr, s_year, s_budat.
Also are s_prctr, s_year SELECT-OPTIONS? If so why are you using EQ ?
BR,
Suhas
2010 Jan 15 9:17 AM
Use Indexing in BSIS table.
BSIS,BSEG they all are cluster tables. So using indexing we can have better performance.
Same post in Performance Tuning Forum*
Moderator please look into these
Manas
2010 Jan 15 9:24 AM
Hi,
Avoid to use into corresponding into...
If you are using select option then in wheere condition use IN
else use EQ for parameter.
Regards,
Pravin
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |