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

selecting DISTINCT values from ITABS

Former Member
0 Likes
588

How can I select distinct values from an internal table?

I'd like to do the following:

DATA: BEGIN OF ITAB_CAT OCCURS 0,
      AISCATALOG LIKE ZDOLTARC02-AISCATALOG,
      END OF ITAB_CAT.
DATA: BEGIN OF ITAB_FLDCAT,
      SEARCHFLD LIKE ZDOLTARC03-SEARCHFLD,
      VALUE LIKE ZDOLTARC03-VALUE,
      CATALOG LIKE ZDOLTARC02-AISCATALOG,
      END OF ITAB_FLDCAT.
*
*
*
SELECT DISTINCT CATALOG INTO ITab_CAT FROM ITAB_FldCat.

please help if you have a chance,

N L

1 ACCEPTED SOLUTION
Read only

andreas_mann3
Active Contributor
0 Likes
553

hi,

look f1 to read table !

read table ITAB_CAT with key f1 = fl1

f2 = fl2

...

regards Andreas

hi,

look f1 to read table !

read table ITAB_CAT with key f1 = fl1

f2 = fl2

...

regards Andreas

2 REPLIES 2
Read only

andreas_mann3
Active Contributor
0 Likes
554

hi,

look f1 to read table !

read table ITAB_CAT with key f1 = fl1

f2 = fl2

...

regards Andreas

Read only

juan_suros
Contributor
0 Likes
553

This may be the simplest solution:

LOOP AT itab_fldcat.
  APPEND itab_fldcat-catalog TO itab_cat.
ENDLOOP.
SORT itab_cat.
DELETE ADJACENT DUPLICATES FROM itab_cat.