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

fetching data which are not common

Former Member
0 Likes
336

Hi Gurus,

I got an strange requirement it is to fetch data from 2 internal table from the same field name but the values should not be same.can any one tell me some logic for this? eg: fetch matnr from mara and mard into an internal table but the final result in the internal table should be values which are not common in both the tables.

Ragards,

Ravi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
316

how can mara and mard will differe in entries. if there is a entry in MARD there should be an entry in MARA since it is master table. so in this case you can do some thing like this.

first get the data from both the tables..

loop at it_mara.

read table it_mard.
if sy-subrc ne 0.
 "find the material which is not there in MARD and only in MARA
 "append the matnr to another table
endif.

endloop.

may be you have taken a wrong example to describe.

1 REPLY 1
Read only

Former Member
0 Likes
317

how can mara and mard will differe in entries. if there is a entry in MARD there should be an entry in MARA since it is master table. so in this case you can do some thing like this.

first get the data from both the tables..

loop at it_mara.

read table it_mard.
if sy-subrc ne 0.
 "find the material which is not there in MARD and only in MARA
 "append the matnr to another table
endif.

endloop.

may be you have taken a wrong example to describe.