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: 

How to remove duplicates in SAP Query

Former Member
0 Kudos

Dear Frns,

I created a simple SAP query with quickviewer by table join option.

tables are MAST & STPO.

Link is only STLNR.

I am getting a duplicate extra line with same data.

Can anyone suggest me how it happened.

Is there anyway to remove these duplicate lines.

pl suggest

5 REPLIES 5

Former Member
0 Kudos

Hi,

You can sort the internal table and then delete the duplicate entries.

sort itab ascending by STLNR.

delete adjacent duplicates from itab comparing STLNR.

Reward points for useful answers.

Former Member
0 Kudos

YOu can Use Deleate Adjacent duplicates from ITAB.

Shreekant

0 Kudos

Hi Gurus,

It is not in SQL .

It is in Quick viewer (SQVI) even in SQ02.

pl give ur valuable suggestions.

Former Member
0 Kudos

Hi Vijay,

There will be a <b>Code tab</b> for every query. You can write the code over there to delete the adjucent duplicates.

Reward if it helps,

Satish

0 Kudos

Dear sathish,

i am not finding any code tab in quick viewer( SQVI).

The code tab is available only in SQ02.

When creating queries we will not store in any internal table.

so pl guide me what kind of code I can write to remove the duplicates.