‎2007 Sep 06 7:07 AM
Hi experts,
Performance issue on the select statements; how can I improve the performance?
Select Company Code (BUKRS)
Accounting Document Number (BELNR)
Document Type (BLART)
Posting Date in the Document (BUDAT)
Document Status (BSTAT)
Reversal Document or Reversed Document Indicator (XREVERSAL)
From Accounting Document Header (BKPF)
Into I_BKPF
Where BKPF-BUKRS = I_VBAK-BUKRS_VF
BKPF-BLART = KI
BKPF-BUDAT = SY-DATUM 2 days
BKPF-BSTAT = Initial
BKPF-XREVERSAL <> 1 or 2
Select Company Code (BUKRS)
Accounting Document Number (BELNR)
Assignment Number (ZUONR)
Sales Document (VBEL2)
Sales Document Item (POSN2)
P & L Statement Account Type (GVTYP)
From Accounting Document Segment (BSEG)
Into I_BSEG
Where BSEG-BUKRS = I_VBAK-BUKRS
BSEG-VBELN = I_VBAK-VBEL2
BSEG-POSN2 = I_VBAP-POSNR
BSEG-BELNR = I_BKPF-BELNR
P & L Statement Account Type (GVTYP) = X
‎2007 Sep 06 7:21 AM
‎2007 Sep 06 7:33 AM
Hi,
to improve the performance, you can use the secondary indices viz., BSIK / BSAK, BSID / BSAD, BSIS.
Hope this helps.
Best Regards, Murugesh AS
‎2007 Sep 06 7:39 AM
Can you show me the selects from the secondary indexes tables BSIK,BSAK,BSID,BSAD,BSIS?