‎2009 Sep 29 5:48 AM
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
‎2009 Sep 29 5:52 AM
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.
‎2009 Sep 29 5:56 AM
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.
‎2009 Sep 29 9:59 AM
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 usedRegards,
Clemens