16
Jul
LOOP AT WHERE. Vs LOOP.IF. in ABAP
Posted by Admin, under ABAP, TutorialAt first sight, both the statements ( loop at itab where <key> = <val> ; loop at itab. if <key> = <val>. ) looks like performing the same task.
But when it comes to performance, both beats each other in there own domain.
It all comes down to number of “‘matches” in the WHERE/IF-clause.
In case you have a rare match, the WHERE-method is better.
In case you have an always match, the IF-method is better.
When the match was done on 1-out-1000:

- match ratio: 1 – out of – 1000
When the match was done at 1 – out of -2 :

- match ratio: 1 – out of – 2
and when the “match” is matching every line

- Match ratio : matching every line
*source = Harry Dietz
You might also be interested in these posts:

Interesting. Good comparison. Thanks.
Post a Comment