Skip to Content
0
Dec 30, 2015 at 11:04 AM

Replacing Read with Loop will make a difference performance wise

248 Views

Hi all, I have checked all the forums but i just have a doubt which i need to clarify. My basic requirement is to optimize the abap code which is written in BW Field Routine. I know that we cannot use Relational operator with Read Statement So, if we replace Read Statement with Loop Statement. Will it be same Performance wise. Because what i feel is it will loop multiple times which again will slow down the performance if we have millions records.

Read table ITAB into WA With KEY

F1 = SF-F1

AND F2 = SF-F2

AND F3 > SF-F3.

(ERROR as it does not accept relational Op) RESULT = XYZ.

****************************************************************************************************************************

LOOP AT ITAB ASSIGNING Field Symbol FS WHERE F1 = SF-F1 AND F2 = SF-F2 AND F3 > SF-F3.

RESULT = XYZ.

ENDLOOP.

Or Do we have any other alternative to replace read statement in a better way?

Message was edited by: Matthew Billingham - fixed formatting (to an extent)