‎2009 Nov 05 1:43 PM
Good morning to everybody
Is it possible using the dinamic table with "loop at" ? I tried this code belove but I got a mistake.
DATA: tablename(10).
*
MOVE 'LT_ITAB' TO tablename.
*
LOOP AT (tablename).
.....
endloop.
‎2009 Nov 05 1:47 PM
‎2009 Nov 05 1:47 PM
Hi
U need to use a field-symbols to do it:
FIELD-SYMBOLS: <MY_ITAB> TYPE TABLE,
<MY_WA> TYPE ANY.
DATA: MY_ITAB(30).
MY_ITAB = 'LT_ITAB[]'.
ASSIGN (MY_ITAB) TO <MY_ITAB>.
LOOP AT <MY_ITAB> ASSIGNING <MY_WA>.
ENDLOOP.Max
‎2009 Nov 05 1:51 PM
‎2009 Nov 05 1:53 PM
hi,
it seems that u r passing a character value to the variable and then trying to loop. This won't work. You need to declare a field symbol with type table and then assign your table structure to this field symbol.
FIELD-SYMBOLS: <li_table> TYPE table.
ASSIGN LT_ITAB->* TO <li_table>. "Create internal table
ASSIGN LOCAL COPY OF INITIAL LINE OF <li_table> TO <ls_table>. "Create work area
loop at <li_table> into <ls_table>.
endloop.
regards,
nilesh.