Skip to Content
0
May 10, 2010 at 11:46 AM

Dynamic Field-Symbols

2048 Views

Hi.

Currently I have the following code:

field-symbols: <it1> type table.
field-symbols: <it2> type table.
field-symbols: <it3> type table.
..
field-symbols: <it10> type table.

loop at it...assign <fs>
   case counter.
    when '1'.
       assign <fs>-table->* to <it1>
       wa_table-name = '<it1>'.
    when '2'.
       assign <fs>-table->* to <it2>
       wa_table-name = '<it2>'.

    when '3'.
..
..
    when '10'.

endloop.

  • How can I do the same dynamically?*

I don't want to specify the FIELD-SYMBOLS command explicity, only when needed.

I wanted to do something like the following:


data: fs_name type string.
fs_name = '<it >'.
loop..
  write sy-index to fs_name+3(1).
  field-symbols (fs_name) type table.
   assign <fs>-table->* to (fs_name).

endloop.


Thanks

Ariel

  • I have a solution, more like a workaround using INSERT REPORT and there I can build as I wish...