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: 

Deleting duplicate data from a deep structure

Former Member
0 Kudos

Hi Friends,

I have this deep structure in my program (an internal table which contains another internal table).

I fetch data in it and now I want to delete adjacent duplicates from that deep structure.

I have used the command " DELTE ADJACENT DUPLICATES..COMPARING ALL FIELDS".

But it appears this has no effect on the deep structure.

Kindly suggest or let me know if my understanding is wrong.

Regards,

Shoeb

4 REPLIES 4

Former Member
0 Kudos

Hi,

Take the deep internal table data in to seperate internal table and use DELETE ADJACENT DUPLICATES statement on it and then update the Deep internal table with the new internal table.

0 Kudos

Hi Avinash,

thanks for d suggestion but can you tell me if my assumption dat this DELETE ADJACENT does not works on Deep structure is right or wrong?

Regards,

Shoeb

Former Member
0 Kudos

Hi,

You need to specify the name of the deep internal table in a separate statment.

Try this example


here itab is the main table and itab1 is the deep table within itab.
DELETE ADJACENT DUPLICATES from itab-itab1 comparing all fields

regards,

Advait

0 Kudos

Just one correction to my code is that you will have loop at the main table and then within that delete the duplicates of the deep table.


"here itab is the main table and itab1 is the deep table within itab.

Sort itab.
DELETE ADJACENT DUPLICATES from itab comparing all fields.  " this will not delete the records from inner tables,

" to delete duplicates of deep table

Loop at itab.
 Sort itab-itab1.
 DELETE ADJACENT DUPLICATES from itab-itab1 comparing all fields.
Endloop.

So to answer your question, the delete adjacent duplicates does work on deep tables, but they need to be handled separately as given in the above code.

regards,

Advait