Application Development 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: 

Please Improve the performance of this code from BSIS table

Former Member
0 Kudos

Hi Gurus,

I am fetching records from BSIS table but it takes so much of time.my code is this.

SELECT bukrs

hkont

augdt

budat

bldat

xblnr

wrbtr

kostl

FROM bsis

INTO TABLE int_accrual

WHERE hkont IN s_hkont

AND budat IN s_pdate

AND XBLNR IN S_XBLNR

AND BLART IN S_BLART

AND kostl IN s_ccntr.

Please give me suggestions for getting data from it within less span of time.

my client do not interested to add another fields in selection screen and also to create INDEX in BSIS table but he want to get data from it within less span of time.

please give me solution what can i do now.

Thanks in advance.

Thanks & Regards,

Radhakrishna.Y

2 REPLIES 2

Former Member
0 Kudos

hi..

First select all primary key fields whether u use in the program or not. then, use the select stmt as:

select all primary key
           + ur required fields
from bsis
into table itab
where hkont in s_hkont
 and budat in s_budat.

delete itab where xblnr not in s_xblnr.
delete itab where blart not in s_blart.
delete itab where kostl not in s_kostl.

this might help u.

check the performance and trace and revert back.

regards,

padma.

Former Member
0 Kudos

Hello

Before your select statement try this code:


data: it001 like t001 occurs 0 with header line.
ranges: r_bukrs for t001-bukrs.
select * from t001 into table it001.
loop at it001.
  r_bukrs-sign = 'I'.
  r_bukrs-option = 'EQ'.
  r_bukrs-low = it001-bukrs.
  append r_bukrs.
endloop.

And in select statement:


...
INTO TABLE int_accrual
WHERE bukrs in r_bukrs
AND hkont IN s_hkont
AND budat IN s_pdate
AND XBLNR IN S_XBLNR
AND BLART IN S_BLART
AND kostl IN s_ccntr.