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: 

Regading SAP Query

Former Member
0 Kudos

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.

1 REPLY 1

andrea_brusarestelletti
Active Contributor
0 Kudos

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