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: 

How to do a loop condition on a table and retrieve the column name and row

Former Member
0 Kudos

To do a loop on all data in a table, given total row count of 5 for example.

Want to do a loop on all the fields.

2 REPLIES 2

Former Member
0 Kudos

I think that you need to use field symbols to loop the table and into each row you should use assign component of structure

<wa> should have the structure of your table.

<fs> type any

loop table asinging <wa>

do.

assign component sy-index of structure <wa> into <fs>.

if not <fs> is assigned.

exit.

else.

YOUR CODE HERE

unassign <fs>.

endif.

enddo.

endloop.

Regards

Former Member
0 Kudos

Sorry i'm new to abap. I dun really understand how the code works.

Any full sample code?