Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to transfer data from a dynamic internal table

Former Member
0 Kudos

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

3 REPLIES 3

former_member555112
Active Contributor
0 Kudos

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

asik_shameem
Active Contributor
0 Kudos

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.

former_member212005
Active Contributor
0 Kudos

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!