Skip to Content
author's profile photo Former Member
Former Member

Comparing Table Content

Hi, I need to read two tables, and compare the field content in each. It's not just a case of checking how many lines are in each. Do I have to loop at each line then field, or does anyone know of a clever way of doing this ?

Thanks

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 10:52 AM

    Hi Jill Thompson

    Can you elaborate on your question?

    I mean the structure of 2 tables.

    and

    what exactly you want to do.

    Like: Do you want to show a message of typemismatch if any of field mismatches or else?

    Regards,

    Vijay Raheja

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hi,

      suppose you have itab1 and itab2

      first compare like itab1[] = itab2[]

      if sy-subrc is zero then there is no difference.

      else if you want to find out particular line difference means you must go loop only

      cheers,

      sasi

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 10:51 AM

    Hi,

    loop at itab.

    read table itab1 with key matnr = itab-matnr

    .........

    if itab-matnr ne itab1-matnr.

    move .......to itab2.

    endloop.

    I hope it will be use full to u.

    Thanks.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 21, 2005 at 10:51 AM

    Hi,

    if you only want to know if there's a difference,

    you can say :

    if itab1[] = itab2[].

    or by standard tables (without header line)

    if itab1 = itab2.

    regards Andreas

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.