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

Code to move

Former Member
0 Likes
477

Hi ,

Please see the following code.

<b>data : begin of itab1 occurs 0 ,

f1(3) type c ,

f2(10) type c,

end itab1.

data : begin of itab2 occurs 0 ,

f1(6) type c ,

f2(10) type c,

end itab2.

itab1-f1 = 'abc'.

itab1-f2 = 'defghijkl'.

move itab1[] to itab2[].</b>

Now I can debug and find the values.

<b>itab2-f1 = 'abcdef'.

itab2-f2 = 'ghijkl'.</b>

How should I move the values in the right way to get right values.

Please answer.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
454

Since the structures are different, you have to move it like so.

Loop at itab1.
  move-corresponding itab1 to itab2.
  append itab2.
endloop.

Regards,

RIch Heilman

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
455

Since the structures are different, you have to move it like so.

Loop at itab1.
  move-corresponding itab1 to itab2.
  append itab2.
endloop.

Regards,

RIch Heilman

Read only

0 Likes
454

Hi Rich ,

But the itab1 has 15000 records.

Will this not be a performance issue?

Thanks

null

Read only

0 Likes
454

The structures are different, there is nothing else you can do. Perfomance shouldn't be all that noticable.

Regards,

Rich Heilman