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

BKPF Performence Issue

Former Member
0 Likes
1,993

Hello,

I am using BKPF table to fetch FI documents but it is taking so much time.

How to reduce time. Please guide me.

Here is my code:

SELECT xblnr bldat FROM bkpf

   INTO  TABLE it_bkpf1

   FOR ALL ENTRIES IN it_bkpf

   WHERE   awkey = it_bkpf-awkey

    belnr = it_bkpf-belnr

   and gjahr = it_bkpf-gjahr.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,651

Hi,

I think you can use secondary index to improve the performance

pls check out this link

http://www.saphub.com/abap-dictionary/sap-secondary-index/

Secondry Index : A key which is created other than primary key, to speed up processing.

Additional indexes can place a load on the system since they must be adjusted each time the table contents change. Each additional index therefore slows down the insertion of records in the table.

It is used frequently in select query then for improving performance related to data fetch,

Additional indexes will change the order to select the fields from the table as you specify in your select query. Plz do not create one unless it is very much required to fetch the data.

9 REPLIES 9
Read only

Former Member
0 Likes
1,651

Hi,

sort it_bkpf by awkey belnr gjahr.

delete adjacent duplicates from it_bkpf comparing awkey belnr gjahr..

if it_bkpf[] is not initial.

SELECT xblnr bldat FROM bkpf

   INTO  TABLE it_bkpf1

   FOR ALL ENTRIES IN it_bkpf

   WHERE   awkey = it_bkpf-awkey and

    belnr = it_bkpf-belnr

   and gjahr = it_bkpf-gjahr.

endif.

Regards

Shaik

Read only

Former Member
0 Likes
1,651
Read only

Former Member
0 Likes
1,651

Hi,

if it_bkpf[] is not initial.

SELECT xblnr bldat FROM bkpf

   INTO  TABLE it_bkpf1

   FOR ALL ENTRIES IN it_bkpf

   WHERE   awkey = it_bkpf-awkey and

    belnr = it_bkpf-belnr

   and gjahr = it_bkpf-gjahr

   %_HINTS ORACLE 'INDEX("BKPF" "ZIN")'.      "u can create ZIN index

endif.

for index go to se11 table bkpf  and

Read only

0 Likes
1,651

Hello,

I never used Indexes,Can u explain me the power of index?

Regards

Neeraj

Read only

0 Likes
1,651

Hi Neeraj,

Be careful with generic statements, more indexes can improve or degrade performance, less indexes as well, all depending on circumstances. Too complex to describe in a few lines, there are articles and books about these topics. Whenever I will get a chance I will try to resurrect the FAQs and sticky threads of the "old SCN" ABAP performance forum.

SAP standard often uses date fields in indexes, e.g. look at table BKPF where quick access by posting date or CPU date is required.

In any case, before introducing new indexes (which take additional DB space and time per update operation, and might make matters more complex for the CBO), always try finding additional WHERE-conditions (e.g. LEDNR = "00" for CO tables or BSTAT = space for FI document tables) or alternative access paths to the desired data using existing tables that sort the data differently, as suggested by Yuri above.

Your query must be constructed so that the CBO can make optimal use of existing primary or secondary indexes.

Regards,

Rajesh

Read only

0 Likes
1,651

Hi Rajesh,

Thanks for your suggestion.

I am thinking about projection view on bkpf.May be it can solve the problem?

Regards

Neeraj

Read only

0 Likes
1,651

You can try to add bukrs (company code) field to your where condition which makes the primary key condition complete and reduces the processing time significantly.

If it is not possible to add bukrs in where condition then try to use secondary index.

Regards,

Gautham.

Read only

Former Member
0 Likes
1,652

Hi,

I think you can use secondary index to improve the performance

pls check out this link

http://www.saphub.com/abap-dictionary/sap-secondary-index/

Secondry Index : A key which is created other than primary key, to speed up processing.

Additional indexes can place a load on the system since they must be adjusted each time the table contents change. Each additional index therefore slows down the insertion of records in the table.

It is used frequently in select query then for improving performance related to data fetch,

Additional indexes will change the order to select the fields from the table as you specify in your select query. Plz do not create one unless it is very much required to fetch the data.

Read only

0 Likes
1,651

Thanks to all .

Problem is solved.

Regards

Neeraj