Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Same reference for 2 field symbols

tglowka
Discoverer
0 Kudos

Hi,

How can I assign table record into 2 different field symbols in a loop?

I am planning to loop over table and keep reference to the 1st record of the group, so at the end of group I can change the 1st record. Something like:

LOOP AT itab ASSIGNING <fs>.
AT NEW plant.
"store reference of <fs> to <fs_ref>.
ENDAT.
ADD 1 TO lv_counter.
AT LAST.
<fs_ref>-counter = lv_counter.
ENDAT.
ENDLOOP.
1 ACCEPTED SOLUTION

sergei-u-niq
Active Contributor

using ABAP ASSIGN statement, you can assign one field symbol to “point” to the same data another field symbol is “pointing to”
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapassign.htm

2 REPLIES 2

sergei-u-niq
Active Contributor

using ABAP ASSIGN statement, you can assign one field symbol to “point” to the same data another field symbol is “pointing to”
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapassign.htm

tglowka

so, something like this (to do only for the 1st record of the group):

ASSIGN <fs> TO <fs_ref>.