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

delete adjecant duplicates/sort on dynamic internal table

Former Member
0 Likes
1,075

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
Read only

Former Member
0 Likes
619

Try:


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

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

2 REPLIES 2
Read only

Former Member
0 Likes
620

Try:


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

Read only

0 Likes
617

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