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 in Select statement

Former Member
0 Likes
729

Hi ,

I have a select statement in my program as below:

select bukrs belnr gjahr blart bldat budat monat

cpudt tcode waers bstat psobt

into table t_bkpf

from bkpf

where bukrs in s_bukrs and

budat in s_budat and

monat = p_monat and

blart = p_blart.

This takes long time to fetch data. Could someone help me improving the performance of the statement.

1 ACCEPTED SOLUTION
Read only

abdul_hakim
Active Contributor
0 Likes
708

Hi

Your SELECT statement looks ok for me.

Well if possible add the following also in the WHERE condition,

belnr,

gjahr

Abdul

5 REPLIES 5
Read only

abdul_hakim
Active Contributor
0 Likes
709

Hi

Your SELECT statement looks ok for me.

Well if possible add the following also in the WHERE condition,

belnr,

gjahr

Abdul

Read only

0 Likes
708

Adding to what Abdul said , Also check if the parameters or select options which you are passing is blank or not.

Ankur Bhandari

Read only

FredericGirod
Active Contributor
0 Likes
708

Hi Sumi,

maybe start to had the GJAHR in your selection criteria.

and check your index, that must feet the selection criteria.

Rgd

Frédéric

Read only

Former Member
0 Likes
708

Hi Sumi,

1. The sql is perfectly ok.

2. With some constraints, (if possible)

we can do this :

a) take bukrs as parameter (instead of select-option)

so that sql is bukrs = s_bukrs

b)arrange the sequencde of where conditions as

bukrs

blart

bldat

monat

e) Still, want more perfroamnce, then

final optino is :

SECONDARY INDEX

(using se11)

on fields

budat, monat , blart

(this will imporove the performance DRASTICALLY)

regards,

amit m.

Read only

0 Likes
708

And sometimes, when you know the size of the data you will have, you could specify the good size of the internal table. But that could be dangerous.

Fred