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

moving data

Former Member
0 Likes
886

hi,

i have 2 internal tables itab1,itab2.itab1 contains fields A,B,C,D,E & ITAB2 has fields C ,E,F only.how can i move the values of C& E in itab1 to C&E in ITAB2.plz help.

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
869

hi srinivas,

this will create new lines in itab1, I hope this is what you want:

LOOP AT itab1.

itab2-c = itab1-c.

itab2-e = itab1-e.

APPEND itab2.

ENDLOOP.

hope this helps

ec

8 REPLIES 8
Read only

Former Member
0 Likes
869

Hi,

Use the below statement.

MOVE-CORRESPONDING xbap-matnr TO itab-matnr.

MOVE-CORRESPONDING xbap-quantity TO itab-quantity.

Hope it helps.

rewards point.

Read only

Former Member
0 Likes
869

use this

loop at itab1.

itab2-c = itab1-c.

itab2-e - itab1-e

modify itab1.

endloop.

Read only

JozsefSzikszai
Active Contributor
0 Likes
870

hi srinivas,

this will create new lines in itab1, I hope this is what you want:

LOOP AT itab1.

itab2-c = itab1-c.

itab2-e = itab1-e.

APPEND itab2.

ENDLOOP.

hope this helps

ec

Read only

Former Member
0 Likes
869

move corresponding itab1 to itab2.

Read only

Former Member
0 Likes
869

Hi Srinivas,

You need to loop in first itab and modify the 2nd itab as follows:

LOOP AT ITAB1 into LS_ITAB1.

READ ITAB2 into LS_ITAB2WITH KEY C = LS_ITAB1-C

E = LS_ITAB1-E

BINARY SEARCH.

IF SY-SUBRC = 0.

MODIFY ITAB2 INDEX sy-tabix TRANSPORTING C

E.

ENDIF.

ENDLOOP.

<b>Reward points for helpful answers.</b>

Best Regards,

Ram.

Read only

Former Member
0 Likes
869

Hi,

U can move values of C and E in itab1 to itab2 by looping on itab1.

loop itab1.

itab2-C = itab1-C.

itab2-E = itab1-E.

append itab2.

clear itab2.

endloop.

Regards,

Sankar

Read only

Former Member
0 Likes
869

using corresponding fields

move correponding fields of itab1 to itab2.

Read only

Former Member
0 Likes
869

using corresponding fields

move correponding fields itab1 to itab2.

MOVE-CORRESPONDING struc1 TO struc2.