Application Development 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: 

delete adjecant duplicates/sort on dynamic internal table

Former Member
0 Kudos

Hi,

I've a dynamic internal table which I need to delete the adjecant duplicates of certain fields (thus not all fields!)

Specifying:

delete adjacent duplicates from <ftab> comparing fielda fieldb.

doesn't activate since the fields aren't known yet

Doing things like:

data: dajdupl type string.
  dajdupl = 'fielda fieldb'. 
  delete adjacent duplicates from <ftab> comparing (dajdupl).

gives a dump with ITAB_ILLEGAL_COMPONENT

The same occurs btw if I do a sort on these fields. I could bypass this by sorting within my select statement, but I would like to know how to do this with a sort.

Eddy

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Try:


data: dajdupl1 type string,
         dajdupl2 type string
  dajdupl1 = 'fielda'.
 dajdupl2  = 'fieldb'. 
  delete adjacent duplicates from <ftab> comparing (dajdupl1) (dajdupl2).

2 REPLIES 2

Former Member
0 Kudos

Try:


data: dajdupl1 type string,
         dajdupl2 type string
  dajdupl1 = 'fielda'.
 dajdupl2  = 'fieldb'. 
  delete adjacent duplicates from <ftab> comparing (dajdupl1) (dajdupl2).

0 Kudos

That does indeed the trick. Many thanks for the quick reply.