Académique Documents
Professionnel Documents
Culture Documents
Subscribe
Rich Heilman Print
Business Card Permalink
Company: SAP Labs, LLC Share
Posted on Mar. 07, 2006 01:08 PM in ABAP, Beginner
The Question
The other day, someone asked a question in the ABAP forum, "When using the ASSIGNING
extension of the LOOP statement, is performance improved". To tell the true, I didn't really
know for sure, but I had seen somewhere that using field symbols is faster. Until recently, I never
had the time to try it out. Here are the results of the study.
The Program
I wrote a simple ABAP program to do some measurements. The program creates data in an
internal able, then does two loops. The first loop will loop the internal table in the "normal"
fashion, the second, will use the ASSIGNING extension. Both loops will write out the line of the
internal table. At the end, the runtimes for both loops will be written.
report zloop_performance_test.
start-of-selection.
skip 1.
new -page.
I was surprised to see about a 1 second difference between the two loops. Using field symbols in
the LOOP statement definitely did improve the performance. If processing a huge amount of
data, using the ASSIGNING extention could really help out the overall runtime.
Run this test program in your system and see if you get the same results. Feel free to put your
results in the comment section.