Application Development 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: 

values comparision in 2 transparent tables

Former Member
0 Kudos
155

I Have table A with MSEH MSEHT MSEHL ISOCODE KZEH, fields and I have another table B which is exactly a snap shot of A.

I want to check B aganist A to wether the values are exactly in same as in A.

Can anyone suggest how to do this in ABAP.( with internal tables.)

can anyone write some code

Oli

7 REPLIES 7

Former Member
0 Kudos
123

Hi Oliver,

Try "Check : A[] = B[]"

0 Kudos
123

Thanks Donald,

Where can I find info on this..can you send a link?

regards

Oli

0 Kudos
123

I probably found this in the ABAP help a long time ago.

It's one of things I know works but can't remember where I first saw it.

Cheers

James

Former Member
0 Kudos
123

If there are not many entries, probably you can do :


data : lt_a type table of A.

select *
  into lt_a
  from a inner join b
    on a~mseh = b~mseh
  where a~mseht <> b~mseht
     or a~msehl <> b~msehl
     or a~isocode <> b~isocode
     or a~kzeh <> b~kzeh.

if lt_a is initial.
write: 'Entries exactly match'.
else.
write: 'Entries don't match'.
endif.

lt_a will have all those entries which are not matching in both the tables

Only if it does not have many entries, you should use the above code.

Hopefully it will work as you intended.

Regards,

Subramanian V.

I keep making too many mistakes, just corrected the code

Message was edited by: Subramanian Venkateswaran

0 Kudos
123

Thanks subramanian:)

Oli

Former Member
0 Kudos
123

Hi Oli.

Copy a[] and b[] to c[] as you like and

DELETE ADJACENT DUPLICATES FROM c.

describe table c lines anyLines.

and you have the answer

Regards

Bartosz

0 Kudos
123

Thanks Bartosz Szmajdziñski..Oli