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: 

Copying internal table include structure data to other interal table

Former Member
0 Kudos

Hi

I have one internal table structure which has few fileds and one include structure i have values in that internal table but i need to copy only those include stucture internal table values to other same include strucutre internal table how to do that plz help me out.

DATA: BEGIN OF t_ros,

stat LIKE zpmes002-zzstatus,

usr02 LIKE afvu-usr02,

usr10 LIKE afvu-usr10,

usr11 LIKE afvu-usr11,

labor(13),

changes.

INCLUDE STRUCTURE afvc.

DATA: END OF t_ros.

DATA: i_sub_afvc LIKE t_ros OCCURS 0.

DATA: i_del_afvc TYPE TABLE OF afvc WITH HEADER LINE,

Need to copy from i_sub_afvc to i_del_afvc

2 REPLIES 2

Former Member
0 Kudos

Hi,

Simply use move-corresponding from source workarea to target workarea..

DATA: i_sub_afvc LIKE t_ros OCCURS 0.

DATA: i_del_afvc TYPE TABLE OF afvc WITH HEADER LINE,

Since the above are internal tables, declare workareas for the corresponding:

DATA: wa_sub_afvc TYPE t_ros.

DATA: wa_del_afvc TYPE afvc,

Now use : Move-corresponding wa_sub_afvc to wa_del_afvc.

append wa_del_afvc to i_del_afvc.

Hope this helps you

Regards

Shiva

kesavadas_thekkillath
Active Contributor
0 Kudos

Like this.

loop at it1.

move-corresponding it1 to it2.

append it2.

clear it2.

endloop.