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 duplicates from query output

andrea_brusarestelletti
Active Contributor
0 Likes
1,104

Hello,

I would like to delete duplicated records before the output of a SAP query

I tried writing in SQ02 in additional coding, under "Free 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" has already been declared.".

If I don't declare %dtab, I can't generate the infoset.

Do you have any suggestion about the way of obtaining this result?

Thanks in advance for your support.

Best regards,

Andrea

Hello,

I would like to delete duplicated records before the output of a SAP query

I tried writing in SQ02 in additional coding, under "Free 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" has already been declared.".

If I don't declare %dtab, I can't generate the infoset.

Do you have any suggestion about the way of obtaining this result?

Thanks in advance for your support.

Best regards,

Andrea

4 REPLIES 4
Read only

Rushikesh_Yeole
Contributor
0 Likes
851

did you get any solution on this? i am also facing the same..

please reply me

Read only

0 Likes
851

Hello,

I didn't find any solution to this problem. I choosed another way: I asked an ABAPer to develop a report to get the same information I wanted to get with the query, as in the ABAP report there's more "space to move".

Best regards,

Andrea

Read only

0 Likes
851

Hi,

Did you get the solution, I am also facing the same issue.

What could be the way forward for this, If i get the solution i will let you know u you would have already got the solution please let me know,

Regards

Rohan

Read only

0 Likes
851

Hello,

sorry: I didn't find a solution. To be fair, I'm not looking for it anymore. But if I'll discover something, I'll let you know.

Best regards,

Andrea