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

INTERNAL TABLE UNIQUE CONTENTS

Former Member
0 Likes
339

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

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

1 REPLY 1
Read only

Former Member
0 Likes
316

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