cancel
Showing results for 
Search instead for 
Did you mean: 

LOOP AT table with a Reference Variable

kendel
Explorer
0 Kudos
269

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

num is not linked in any way to the first loop. You can even move the num statement out of the loop.

  • line 42 creates num, there is no change to num reference
  • line 34 creates connection, connection is overwritten in line 58.
kendel
Explorer
0 Kudos
Zeno_rummler I am really grateful about your comment. Could You please help me with the central party of the topic?. Read this please:Hi MBartsch71,thanks for your time, that is a good option, but as I ask, when the work area is the same as the variable reference that call te method get_attributes the result is the exactly the same, in other words when I use "INTO var" with "var->get..." , "INTO num" with "num->get..." Or "INTO connection" with "connection->get..." With all of them I recieve the same result as You SEE in the second loop of the image. I am trying to understand the logic of the loop. Why if i put as a variable "num" (work area) and variable reference num to call the method "get attribute" it give me as result the three flights connections store in var, in num and connection.