Skip to Content
0
Former Member
Mar 02, 2007 at 06:48 AM

Performance optimization in Select query

71 Views

Hi All,

Please suggest good performance practice for the below code.

SELECT * FROM BKPF WHERE BUKRS IN SO_BUKRS

AND BELNR IN SO_BELNR

AND GJAHR IN SO_GJAHR

AND BLART IN SO_BLART

AND BUDAT IN SO_BUDAT

AND USNAM IN SO_USNAM.

CLEAR BSEG.

SELECT * FROM BSEG WHERE BUKRS EQ BKPF-BUKRS

AND BELNR EQ BKPF-BELNR

AND GJAHR EQ BKPF-GJAHR

AND KOART EQ 'K'.

SELECT SINGLE * FROM LFA1 WHERE LIFNR EQ BSEG-LIFNR

AND KTOKK IN SO_KTOKK.

CHECK SY-SUBRC EQ 0.

MOVE-CORRESPONDING BKPF TO ITAB2.

MOVE BSEG-LIFNR TO ITAB2-LIFNR.

APPEND ITAB2.

ENDSELECT.

PERFORM CHECK_FOR_REVERSAL.

ENDSELECT.

Thanks

Sonal