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

internal table modify

Former Member
0 Likes
612

i have itabA like this

A1 B1 21 abc

A1 B1 22 pqr

A1 B1 23 xyz

A1 B2 24 abc

A1 B2 25 pqr

A1 B2 26 xyz

itabB like this

A1 B1 31

A1 B1 32

A1 B1 33

A1 B2 34

A1 B2 35

A1 B2 36

now i want to change ItabB from ItabA like this

A1 B1 31 abc

A1 B1 32 pqr

A1 B1 33 xyz

A1 B2 34 abc

A1 B2 35 pqr

A1 B2 36 xyz

how to do that.?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
592
loop at itabB.
read table itab1 with key fld1 = itabB-fld1 fld2 = itabB-fld2.
if sy-subrc is initial.
itabB-fld4 = itabA-fld4.
modify itabB.
endif.
endloop.
5 REPLIES 5
Read only

Former Member
0 Likes
593
loop at itabB.
read table itab1 with key fld1 = itabB-fld1 fld2 = itabB-fld2.
if sy-subrc is initial.
itabB-fld4 = itabA-fld4.
modify itabB.
endif.
endloop.
Read only

0 Likes
592

loop at itabB.

read table itab1 with key fld1 = itabB-fld1 fld2 = itabB-fld2.

if sy-subrc =0

itabB-fld4 = itabA-fld4.

modify itabB.

endif.

endloop

Read only

0 Likes
592

loop at itabB INTO waB.

V_IND = SY-TABIX

read table itab1 INTO waA with key field1 = waB-field1

field2 = waB-field2.

if sy-subrc =0.

waB-field4 = waA-field4.

modify itabB FROM waB INDEX v_ind transporting field4.

endif.

endloop.

Read only

Vijay
Active Contributor
0 Likes
592

hi

try like this.

loop at itab2 into wa2.

modify table itab1 from wa2 index sy-tabix transporting wa2-f1 wa2-f2 wa-f3.

clear wa2.

endloop

regards

vijay

reward points if helpful

Read only

Former Member
0 Likes
592
loop at itabB.
read table itabA  with key fld1 = itabB-fld1 fld2 = itabB-fld2.
if sy-subrc is 0.
itabB-fld4 = itabA-fld4.
modify itabB transporting fld4.
endif.
endloop.

Regards