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

INTERNAL TABLE UNIQUE CONTENTS

Hi to all

Plz tell me I want to select unique enteries from an internal table then then counting of that unique entrie.

For example

ITAB

EBELN

0026000060

0026000060

0026000060

0026000060

0026000061

0026000061

0026000061

0026000062

0026000062

0026000062

I NEED COUNT = 3.

THANKS

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 01:16 PM

    Hi Anubhav Gupta,

    <b>Method one</b>

    1) copy itab

    itab2[] = itab[].

    2) sort itab2

    SORT itab2[] BY ebeln.

    3) delete duplicates

    delete adjacent duplicates FROM itab comparing ebeln.

    4)get record

    describe table itab2[] LINES num. "num will contain 3

    <b>Method two</b>

    sort itab by ebeln.
    LOOP AT itab.
    AT new ebeln.
      count = count +1
    ENDAT.
    
    ENDLOOP.

    rgs 😉

    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.