cancel
Showing results for 
Search instead for 
Did you mean: 

Merge table

Former Member
0 Kudos

Dear All

how to two intinal tables merge in sap pls send sample code

Thanks and Regards

Suresh

Accepted Solutions (0)

Answers (1)

Answers (1)

sailaja_vadlamudi
Contributor
0 Kudos

Hi

Merging in sense,you need data to be appended from one to other.

For this:

If both the structure are same, we can do that by:

APPEND lines of itab1 to itab2.
 
if structures are different.
loop at itab1.
     clear: itab2.
     move-corresponding itab1 to itab2.
     append itab2.
endloop.

.

if two internal tables are of same type then u can merge these into third one

1

.append lines of itb1to itab3.
append lines of itab2 to itab3.
delete adjacent duplicates fro itab3 comparing all fields.

2.if internal tables are of different type the.

loop at itab1.
move-corresponding itab1 to itab3.
append itab3.
endloop.
loop at itab2.
move-corresponding itab2 to itab3.
append itab3.
endloop.
delete adjacent duplicates fro itab3 comparing all fields.

Sail