Hello,
when using data-references double memory consumption seems to be unavoidable:
In the following example, we take the fm-parameter table_to_display (without any type) and convert it into a dynamically created internal table.
DATA: tab_ref type ref to data.
field-symbols: <g_outtab> type standard table.
CREATE DATA tab_ref TYPE STANDARD TABLE OF (p_structure).
ASSIGN tab_ref->* TO <g_outtab>.
LOOP AT table_to_display ASSIGNING <wa_outtab>.
lv_tabix = sy-tabix.
APPEND <wa_outtab> TO <g_outtab>.
DELETE table_to_display INDEX lv_tabix.
ENDLOOP.
ENDIF.
REFRESH table_to_display[].
When starting the program and analysing the memory in the debugger tab_ref and <g_outtab> both allocate (nearly) the same memory.
If we have large lists, we sometimes run out of memory.
Does anybody know, how to release one of the data objects?
Thanks in advance
kind regards
Olaf