Hi All,
I am trying to access an internal table's attributes using attribute names generated at runtime. For example,
-
DATA: cnt TYPE n VALUE 1,
new_field TYPE char10.
DO 10 TIMES.
concatenate 'test' cnt into new_field.
write \ itab-new_field.
add 1 to cnt.
ENDDO.
-
But unfortunately, it gives me an error because component itab-new_field doesn't exist. However, component itab-test1, itab-test2, itab-test3 does exist.
Is there a way to refer to table components through dynamic variables rather than component names?
Thanks in advance for your help.
Roman D.
Yes, I believe you can do this thru field symbols.
Regards,
Rich Heilman
Add a comment