Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BSEG extract

BSEG is a cluster table and I need to improve the performance of the extract as given below. This is really taking a long time to run. Any suggestions as to how I can improve the performance?

SELECT BELNR

BUZEI

BSCHL

SHKZG

PRCTR

KOSTL

HKONT

DMBTR

WRBTR

SGTXT

FROM BSEG

INTO TABLE IBSEG

FOR ALL entries in IBKPF

WHERE BELNR = IBKPF-BELNR

AND HKONT in gl_acct.

replied

Hi,

In the IBKPF ..if you have BUKRS GJAHR use them in your where clause..

<b>IF NOT IBKPF[] IS INITIAL.</b>

SELECT BELNR

BUZEI

BSCHL

SHKZG

PRCTR

KOSTL

HKONT

DMBTR

WRBTR

SGTXT

FROM BSEG

INTO TABLE IBSEG

FOR ALL entries in IBKPF

<b>WHERE BUKRS = IBKPF-BUKRS

AND BELNR = IBKPF-BELNR

AND GJAHR = IBKPF-GJAHR</b>

AND HKONT in gl_acct.

<b>ENDIF.</b>

If it is not there in the internal table IBKPF..Add them...

Also check the internal table IBKPF is not initial before using it for BSEG.

Thanks,

Naren

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question