Skip to Content
0
Former Member
Oct 16, 2007 at 07:26 AM

performance

15 Views

here is a piece of code where i am facing problem:

FORM F001-FETCH_DATA .

  • FETCH HEADER LEVEL DATA

SELECT BUKRS

BELNR

BLART

BLDAT

BUDAT

XBLNR

FROM BKPF

INTO TABLE IT_BKPF

WHERE BUKRS = PR_COMP

AND BLART IN (W_YA, W_YB, W_YC)

AND BUDAT IN SO_BUDAT.

  • AND BLDAT IN SO_BLDAT.

IF SY-SUBRC <> 0.

MESSAGE E000(8I) WITH TEXT-043.

ENDIF.

if not it_bkpf[] is initial. "+PS101007

sort it_bkpf by belnr. "+PS101007

  • FETCH ITEM LEVEL DATA

SELECT BELNR

KOART

SHKZG

GSBER

MWSKZ

WRBTR

SGTXT

HKONT

KUNNR

ZFBDT

ZTERM

MATNR

WERKS

MENGE

MEINS

XREF1

XREF2

FROM BSEG

INTO TABLE IT_BSEG

FOR ALL ENTRIES IN IT_BKPF

WHERE BELNR = IT_BKPF-BELNR

AND KUNNR IN SO_CUST

AND MWSKZ IN SO_TAX

AND GSBER IN SO_BUS.

ENDIF. "+PS101007

here as so many records are getting selected in 1st SELECT statement its getting stuck in the 2nd SELECT.

how to solve this problem?

plz help...