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: 

Select Stmt problem

Former Member
0 Kudos
117

hi all,

i am using following code to get FI accounting doc and year. but it is taking around 5 min to execute this select stmt can any one suggest me to improve the performance.

if not i_rseg[] is initial.

select belnr

gjahr

budat

awkey

from bkpf

into table i_bkpf

for all entries in i_rseg

where bukrs = i_rseg-bukrs

and awkey = i_rseg-awkey.

endif.

there are around 15000 entries exist in the table which are related to select query.

thanking you ,

srujan.p

8 REPLIES 8

Former Member
0 Kudos
89

hi,

1) Create a view for that table , or

2) Check for any existence of duplicate key valued entries in the internal table

delete them, because you are using

for all entries in itab

, or

3) If you don't need all the 15000 entries and you can get your work done with

a minimal number of values then use the statement

up to N rows

with your select query this way, you can improve the performance

and also hit the database only once in the entire operation

Thanks

Sharath

Former Member
0 Kudos
89

You have to add AWTYP to the WHERE.

Rob

Former Member
0 Kudos
89

hi,

comming to performance better to use views ,it gives better performance.

Regards,

jaya

0 Kudos
89

hi is there any standard view for that, i did'nt used that concept, can you explain me how to do that.

0 Kudos
89

>

> comming to performance better to use views ,it gives better performance.

Why do you say that? The problem here is with the index.

Rob

0 Kudos
89

hi ,

Over here I am trying to concatenate Rseg-Belnr, Rseg-Gjahr and pass this value to Bkpf-Awkey.

I require the entries of FI Doc data. And this is the place where my performance is affected badly!

Any inputs on this?

0 Kudos
89

>

> hi ,

>

> Over here I am trying to concatenate Rseg-Belnr, Rseg-Gjahr and pass this value to Bkpf-Awkey.

I understand that. You are trying to use index BKPF~4 (Index by application type and key). But here AWTYP is the first non-client field of the index, so you have to include it in the WHERE.

Rob

Former Member
0 Kudos
89

BKPF have the index 8 by the field AWKEY, try this index ... without using the field BUKRS