03-24-2010 6:36 AM
Hi SAP Gurus,
Please tell me how to delete adjacent duplicates from the output of a query.
By watching different posts I have found that by writing code in the infoset the duplicates can be deleted, but i not getting the internal table from where the output is displayed, can any one help.
Thanks & Regards,
Pavan.
01-24-2011 12:36 PM
Hello,
I'm facing the same requirement. The internal table should be %dtab, the problem is that I'm not able to write code to delete the duplicate records.
I tried writing in SQ02 in additional coding:
data %dtab type standard table of /1BCDWB/IQ000000001053 with header line.
sort %dtab by vbeln posnr.
DELETE ADJACENT DUPLICATES FROM %dtab.
In this way I get the short dump when running the query: "Statement is not accessible.".
If I declare %dtab in the additional coding under "DATA", when I run the query I get the error "%dtab is already declared".
If I don't declare %dtab, I can't generate the infoset.
Do you have any suggestion?
Thanks.
Best regards,
Andrea