In a method I have a reference to a table that was declared like this:
DATA: tabname TYPE tabname,
dref TYPE REF TO data,
FIELD-SYMBOLS: <itab> TYPE ANY TABLE.
CREATE DATA dref TYPE TABLE OF (tabname).
ASSIGN dref->* TO <itab>.
SELECT * FROM (tabname)
UP TO 5 ROWS
INTO TABLE <itab>.
How do I create a structure based on ?
Just use good ol' RTTS for that. You can create reference and read directly into it
or create field-symbol based on this reference and use it in READ TABLE
Pay attention I declared
<itab>as STANDARD table to get rid of index error operation you got.UPDATE: for creating structure from
<itab>object use this syntax:The last two lines will be identical.