Application Development and Automation 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: 
Read only

Move data from one internal table to another

Former Member
0 Likes
688

Hi,

I have two internal tables l_s_data and l_s_data_line. Both the tables are identical except for one field in l_s_data. Now I want to move all the content from l_s_data_line to l_s_data.

Can some one tell me how to do it? Thanks in advance.

5 REPLIES 5
Read only

Former Member
0 Likes
661

Declare two work area and following the coding as follows.

loop at l_s_data into wa_s_data.

move-corresponding wa_s_data to wa_s_data_line.

append wa_s_data_line to l_s_data_line.

endloop.

Read only

0 Likes
661

thanks Baburaj. could you please also tell me how to define wa_s_data in the data section.

will the following work?

data wa_s_data like l_s_data.

Thanks

Read only

0 Likes
661

data: wa_l_s_data like line of l_s_data,

wa_l_s_data_line like line of l_s_data_line.

Thanks

Seshu

Read only

0 Likes
661

ya kiran u can do that like... in my above code

data: wa_tab like line of l_s_data,

wa_tab1 line like line of l_s_data_line.

Read only

Former Member
0 Likes
661

hi,

u have to use the loop.

say one internal table is l_s_data and the other is l_s_data_line

also workarea are wa_tab,wa_tab1 respectively.

Loop at l_s_data into wa_tab.

move-corresponding wa_tab to wa_tab1.

append l_s_data_line from wa_tab1.

clear : wa_tab,

wa_tab1.

Endloop.