Skip to Content
0
Apr 24, 2007 at 08:30 AM

sy-index / sy-tabix wrong within loop

787 Views

Hi friends,

i do a loop over a a table and am writing out the field contents like this:

 LOOP AT <dyn_table> INTO <dyn_wa>.

        do.

      assign component sy-index
         of structure <dyn_wa> to <dyn_field>.
        if sy-subrc <> 0.
         EXIT.
        else.
* Here it gets the name of the field based on the sy-index of the component

        READ TABLE l_tab_fields INTO w_tab_fields INDEX sy-index.
      endif.

  ENDLOOP.

What now doesnt work is, that whenever i have the read statement uncommented the loop doesnt increment so i only get the first row but that n-times.

any idea where the error is ?

thank you! i am awarding points generously 😉