Reputation: 21
I'm interviewing for a job, and on the test they sent me they provided the following image of 2 ABAP loops on an internal table, and asked which loop will execute faster:
After checking heavily on the internet I came to this 2 different outcomes:
Am I missing something? is there an obvious 1 answer to this question?
Upvotes: 1
Views: 2034
Reputation: 13646
Your screenshot comes from the program RSHOWTIM
(or SE38
> menu Environment > Examples -> Performance examples), which is available in all ABAP-based software.
The two algorithms are doing exactly the same thing (*), but one is more performing than the other. SY-TABIX
is the line number of the last iterated line inside the LOOP AT
block (providing that it's a standard or sorted table).
(*) see Gert comment
The full screen is this one (in ABAP 7.52):
NB: you could install an ABAP trial system on your computer if you need to train. Or you can use Cloud trials (you have then to pay for the network/disk usage).
Upvotes: 3