cancel
Showing results for 
Search instead for 
Did you mean: 

LOOP AT table with a Reference Variable

kendel
Explorer
0 Kudos
268

Hi Everyone. I'm an ABAP student having a problem to understand the logic when looping a table with a Reference Variable that have different ways to print. Why the figure I just upload when the work area is different to the reference Variable that call de method (get_attribute) the print logic is to get de value assigned to that reference variable 3 times (same lines), but when the work area is the same that the reference variable it prints

1000162195.jpg

all of the correct values of the 3 different reference variables?. Thanks a Lot in advanced.

View Entire Topic
zeno_rummler
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Solution is already given.
I am confused about the title.
In your case both variables are work areas: INTO <wa>
there is no reference variable in the loop: REFERENCE INTO <ref>.

kendel
Explorer
0 Kudos
Hi Zero number, thanks you for your time. As the imágenes says, te variables num, connection and var all of them are Reference Variable. The reason is because they point an Instance called lcl_connnection with the Operator NEW, and they are calling a method defined in the loca types. So thal tyoes