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 problem with query on bkpf table

Former Member
0 Likes
1,647

hi good morning all ,

i ahave a performance problem with a below query on bkpf table .

SELECT bukrs

belnr

gjahr

FROM bkpf

INTO TABLE ist_bkpf_temp

WHERE budat IN s_budat.

is ther any possibility to improve the performanece by using index .

plz help me ,

thanks in advance ,

regards ,

srinivas

9 REPLIES 9
Read only

Former Member
0 Likes
1,177

Hi,

can u add any other primary or sec key fields into the WHERE clause..like bukrs, gjahr?? BUDAT forms part of index~2, so if u can add bukrs, if possible, it might help.

regards,

madhu

Read only

0 Likes
1,177

hi vasu ,

yes , but not sure , we can add company code ( Bukrs ) , if so how to do that ,

can u give me the code ,

thanks in advance ,

regards ,

srinivas

Read only

0 Likes
1,177

hi,

if u can add bukrs as input field or if u have bukrs as part of any other internal table to filter out the data u can use:

for ex:

SELECT bukrs
belnr
gjahr
FROM bkpf
INTO TABLE ist_bkpf_temp 
WHERE budat IN s_budat
    and    bukrs in s_bukrs.

or

SELECT bukrs
belnr
gjahr
FROM bkpf
INTO TABLE ist_bkpf_temp
for all entries in itab 
WHERE budat IN s_budat
    and bukrs = itab-bukrs.

Just see , if it is possible to do any one of the above?? It has to be verified with ur requirement.

Read only

Former Member
0 Likes
1,177

The bad performance is because you're not specifying the primary keys of the table BKPF in your WHERE condition; BKPF usually is a big table.

What you really need is to create a new index on database for table BKPF via the ABAP Dictionary on fields BUKRS, AWKEY, GJAHR & BSTAT. You'll find the performace of the program will significantly increase after the new index is activated. But I would talk to the Basis first to confirm they have no issues if you create a new index for BKPF on the database system.

Reward Points..

Read only

Former Member
0 Likes
1,177

1.Try creating an index and use those fields in the where clause while fetching the data.Seems you are working on purchase register sort of report.

2.Make sure the selecting fields are in same order of the database table, and the Where condtion values also should be the same order,

3.use corresponding fields of statement with you select staement and check the performance .

Reward Points..

Read only

Former Member
0 Likes
1,177

Reward Points..

Read only

Former Member
0 Likes
1,177

add extra conditions to the where clause in your select statement

Read only

Former Member
0 Likes
1,177

Hi

BKPF always causing performance issue.Use BSIS table Instead of BKPF

Regards

Anbulakshmi

Read only

Former Member
0 Likes
1,177

Hi,

Try adding key fields in your select query mate like say BELNR BUKRS or GJAHR.

Thanks

Nayan