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 Comparison

Former Member
0 Likes
321

Dear All,

I need to compare two internal tables such as itab1 and itab2. Both will have common field 'MATNR'. I need to select those records from the internal table itab2 for which MATNR is not existing in internal table itab1. How can I do this? Please help me.

Good solutions will be rewarded.

Best Regards

Renjan

2 REPLIES 2
Read only

anversha_s
Active Contributor
0 Likes
298

hi,

do this.

<b>loop at itab2.</b>

<b>read table itab1</b> with key matnr = itab2-matnr.

<b>if sy-subrc <> 0.</b> " not found

<b>APPEND itab2 TO itab1.</b>

endif.

<b>endloop.</b>

rgds

anver

if hlped pls mark points

Message was edited by: Anversha s

Read only

anversha_s
Active Contributor
0 Likes
298

hi renjan,

did my solution work.

if not pls post ur issue.

so that we can help.

thnanks,

anver