I have used the following query, but it takes long time to execute and affects the performance too.
How can i change this query, i tried the BSAK and BSIK tables also, but
KOART and NEBTR fields not available in those tables, so am supposed to use the table BSEG.
Please advise me to improve the performance of the coding.
Thanks in advance.
INTO TABLE ibseg
WHERE augbl = p_vblnr
AND bukrs = p_bukrs
AND koart = 'K'
AND auggj = p_gjahr
AND belnr NE p_vblnr.
Can you change AUGGJ to GJAHR?? Check once if Fiscal year and fiscal year of posting document are same. this will save a lot of execution time.