07-06-2009 8:12 AM
Hi All
I want to transfer data from a dynamic internal table<dyn_table>
to a non dynamic internal table itab which should have the same structure as <dyn_table>.
How can this be done?
Regards,
Harshit Rungta
07-06-2009 8:28 AM
Hi
You will have to make use of field-symbols.
Refer to this wiki link.
[http://wiki.sdn.sap.com/wiki/x/UYA_Bg]
Regards,
Ankur Parab
07-06-2009 8:41 AM
Hi,
If it is of same structure, it is just straight forward.
gt_itab = <ft_table>. " OR
APPEND LINES OF <ft_table> TO gt_itab.
07-06-2009 8:43 AM
As stated earlier this can be done only through field symbols...
You cannot create an non dynamic internal table with ANY structure...using DATA statement
If the strucutre is defined well and good...you can create an non-dynamic internal table...
If you do not know the structure then the internal table has to be dynamic...and to be generated using field symbols
DATA: lv_ref TYPE REF TO data.
FIELD-SYMBOLS: <fs_dyn_table> TYPE STANDARD TABLE.
* You create a dynamic internal table...
CREATE DATA lv_ref LIKE (your_dynamic_internal_table).
ASSIGN lv_ref->* TO <fs_dyn_table>.
Now...do the transfer.
<fs_dyn_table> = "your_dynamic_internal_Table
Hope it helps!