Skip to Content
0
Nov 07, 2013 at 10:27 AM

Tables completion

40 Views

Hi experts,

I have 2 tabes ; Table 1 and Table 2.

Table 1 has more records then table 2 and both of them have a common field, let's say fieldY.

I would like to add in table 1 all the entries present in table 2 and not in table 1 and ignore the common records between both tables.

I tought about the following:

Copy the content of table 2 in copytabe2.

Loop at copytabe2 into wa.

Read table 1 with key fieldY = wa-fieldY.

if sy-subrc eq 0.

delete copytabe2 .

endif.

endloop.

Append lines of copytable2 into table1.

Thanks for your support.

Amine

PS:All the tables are internal tables in a program.