‎2009 Mar 09 2:25 PM
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
‎2009 Mar 09 2:29 PM
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.
‎2009 Mar 09 2:31 PM
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
‎2009 Mar 09 2:41 PM
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
‎2009 Mar 09 3:11 PM
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