Hello Amine,
Try with the below logic.
DSO1:
ID | Code1 | Code2 |
---|---|---|
1 | A | B |
2 | A | B |
3 | D | E |
4 | D | E |
5 | C | F |
DSO2:
ID | Code1 | Code2 |
---|---|---|
2 | A | B |
RESULT DSO1:
ID | Code1 | Code2 |
---|---|---|
1 | A | B |
2 | A | B |
3 | D | E |
5 | C | F |
SORT dso1 BY id code1 code2.
DELETE ADJACENT DUPLICATES FROM dso1 COMPARING code1 code2.
LOOP AT dso2 INTO wa2.
READ TABLE dso1 INTO wa1
WITH KEY id = wa2-id
code1 = wa2-code1
code2 = wa2-code2.
IF sy-subrc = 0.
INSERT wa1 INTO TABLE dso1.
ENDIF.
ENDLOOP.
Hope this answers your question.
Regards,
Thanga