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

Compare rows of same internal table

Hi folks,

I have to compare the fields value of f2, f3 in between rows of same internal table. how can I achieve this...Please help me out...

thanks in advance

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 22, 2008 at 05:05 PM

    Try something this way

    
    itab_t[] = itab[].
    
    loop at itab.
      v_tabix = sy-tabix.
      read table itab_t index v_tabix.
      if itab_t-f2 = itab_t-f3.
         " do your validation.
      endif.
    endloop.
    
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 05:25 PM

    Hi Kartikey,

    What exactly is your requirement? Can you be little more specific.

    Regards,

    Bharati

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Just some changes to Shanthi Kumar Juluru's post

      LOOP AT t_data INTO w_data.

      LOOP AT t_data INTO w_data1 WHERE f2 = w_data-f2.

      if w_data1-f2 = w_data-f2.

      v_count = v_count + 1.

      endif.

      ENDLOOP.

      IF v_count > 1.

      " f2 column has repeated value

      CLEAR: v_count.

      exit.

      ENDIF.

      ENDLOOP.

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.