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: Select From BSEG & BKPF

Former Member
0 Likes
672

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’

3 REPLIES 3
Read only

Former Member
0 Likes
591

Instead of BSEG use its secondary index table BSIK aur BSAK

Read only

Former Member
0 Likes
591

Hi,

to improve the performance, you can use the secondary indices viz., BSIK / BSAK, BSID / BSAD, BSIS.

Hope this helps.

Best Regards, Murugesh AS

Read only

0 Likes
591

Can you show me the selects from the secondary indexes tables BSIK,BSAK,BSID,BSAD,BSIS?