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: 

BKPF taking more more time, performace very slow. how to Increase ?

Former Member
0 Kudos

Hi Gurus/Expert.

my problem is i m gettind data in It_vbrk correctly now from it_vbrk i m going to fetch record from bkpf but its dispalying data very slow .

performance is very poor.

how to increas its performance . ? please help me in this case.

select bukrs belnr gjahr blart budat xblnr awkey into table it_bkpf from bkpf

for all entries in it_vbrk

where awkey = it_vbrk-awkey

and xblnr = it_vbrk-xblnr.

abouve code is taking more time.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Use the whole key and only the needed fields

- AWTYP should be used before AWKEY

- use XBLNR or AWKEY, not both (here AWKEY is better)

Try something like

SELECT bukrs belnr gjahr blart budat xblnr awkey 
  INTO TABLE it_bkpf 
  FROM bkpf
  FOR ALL ENTRIES IN it_vbrk
  WHERE  awtyp = 'VBRK'
    AND  awkey = it_vbrk-awkey

Regards

5 REPLIES 5

0 Kudos

Hi,

Try and have as FULL a primary key as possible in your where clause, if your where clause has the primary key fileds it will be fast.

When I mean full (All the fields that comprise the primary key of the table) You should provide as many fields of primary key as possible in the Where clause.

Regards,

Sesh

Former Member
0 Kudos

Hi Majid,

Table BKPF has got several secondary indexes already - 7 on our system. The trick is to give the read the correct fields.

select bukrs belnr gjahr blart budat xblnr awkey into table it_bkpf from bkpf

for all entries in it_vbrk

where <i>awtyp = 'VBRK'</i>

and awkey = it_vbrk-awkey.

This allows the select to pick the correct secondary index (number 4).

Former Member
0 Kudos

hi

good

use the move corresponding statement in your select statement to increase the performance of the program.

thanks

mrutyun^

raymond_giuseppi
Active Contributor
0 Kudos

Use the whole key and only the needed fields

- AWTYP should be used before AWKEY

- use XBLNR or AWKEY, not both (here AWKEY is better)

Try something like

SELECT bukrs belnr gjahr blart budat xblnr awkey 
  INTO TABLE it_bkpf 
  FROM bkpf
  FOR ALL ENTRIES IN it_vbrk
  WHERE  awtyp = 'VBRK'
    AND  awkey = it_vbrk-awkey

Regards

Former Member
0 Kudos

Dear All, Raymand, John,

Thanks for your help i have solved my problem,

again Thanks for your valuable code.

Point has given to all

Majed Khan.