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

Former Member
0 Likes
597

Hi friends,

Suggest me code to increase perfromance of below code.

select single * from bkpf where xblnr = it_ekbe-xblnr

and gjahr = it_ekbe-bldat+0(4)

and awkey = awkey.

Regards

Mahesh Kumar

3 REPLIES 3
Read only

GauthamV
Active Contributor
0 Likes
529

You have to make use of primary keys BUKRS BELNR

in order to improve the performance of this select query.

Performance related queries are to be posted here.

Read only

Former Member
0 Likes
529

There are two steps to be taken to improve the performance.

First :

in select query give the field names instead of * . Only fetch the field which you need or if you want all the fields then also mention all the field names in Exact SEQUENE as in Table.

Second :

Create secondary index on the table which you querying with all WHERE CLAUSE Fields.

Means GO TO SE11 and GO TO Table and then into Indexex. Create the secondary index with the fields in your query.

Read only

Clemenss
Active Contributor
0 Likes
529

Hi mahesh,

in order to gain performance never use select * because this is translated into

select MANDT BUKRS BELNR GJAHR BLART BLDAT BUDAT MONAT CPUDT CPUTM AEDAT UPDDT WWERT USNAM TCODE BVORG XBLNR DBBLG STBLG STJAH BKTXT WAERS KURSF KZWRS KZKRS BSTAT XNETB FRATH XRUEB GLVOR GRPID DOKID ARCID IBLAR AWTYP AWKEY FIKRS HWAER HWAE2 HWAE3 KURS2 KURS3 BASW2 BASW3 UMRD2 UMRD3 XSTOV STODT XMWST CURT2 CURT3 KUTY2 KUTY3 XSNET AUSBK XUSVR DUEFL AWSYS TXKRS LOTKZ XWVOF STGRD PPNAM BRNCH NUMPG ADISC XREF1_HD XREF2_HD XREVERSAL REINDAT RLDNR LDGRP PROPMANO XBLNR_ALT VATDATE PSOTY PSOAK PSOKS PSOSG PSOFN INTFORM INTDATE PSOBT PSOZL PSODT PSOTM FM_UMART CCINS CCNUM SSBLK BATCH SNAME SAMPLED EXCLUDE_FLAG BLIND OFFSET_STATUS OFFSET_REFER_DAT PENRC KNUMV

Most of the fields you will not need or use.

BKPF/BSEG should always be accessed after pre-selection hast been done from one of the secondary index tables

BSAD                           Accounting: Secondary Index for Customers (Cleared Items)
BSAK                           Accounting: Secondary Index for Vendors (Cleared Items)
BSAS                           Accounting: Secondary Index for G/L Accounts (Cleared Items)
BSID                           Accounting: Secondary Index for Customers
BSIK                           Accounting: Secondary Index for Vendors
BSIM                           Secondary Index, Documents for Material
BSIP                           Index for Vendor Validation of Double Documents
BSIS                           Accounting: Secondary Index for G/L Accounts
BSIW                           Index table for customer bills of exchange used
BSIX                           Index table for customer bills of exchange used

Regards,

Clemens