Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

add fields from tab2 to tab1

hallow

i have two internal tables with same type fields and i wont to add fields of table 2

to table 1 what is the best way to do that?

<b>i reward</b>

ex.

itab1

a1 a2 a3 a4 a5

1 2 3 4 5

itab 2

b1 b2 b3 b4 b5

6 7 8 9 10

i wont in itab 1

<b>a1 a2 a3 a4 a5

7 9 11 13 15 <---a1+b1 in field a1 in itab 1</b>

Regards

Tags:
Former Member
Former Member replied

loop at itab1.

read table itab2 index sy-tabix.

itab1-a1 = itab1-a1 + itab2-b1.

itab1-a2 = itab1-a2 + itab2-b2.

itab1-a3 = itab1-a3 + itab2-b3.

itab1-a4 = itab1-a4 + itab2-b4.

itab1-a5 = itab1-a5 + itab2-b5.

modify itab1.

endloop.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question