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: 

View: Duplicate Records in View with no join condition

Former Member
0 Kudos

Hi,

I created a database view with 2 fields each from two table with no join condition. There are duplicate entries in the view as there is no join condition. My requirement is to remove that duplicate entries.

table A

CCode Sales Division

C1 S1 D1

C1 S1 D2

C1 S1 D3

Table B

CCode Plant Status

C1 P1 X

C1 P2 X

View

Sales Plant

S1 P1

S1 P2

S1 P1

S1 P2

S1 P1

S1 P2

I want to delete these duplicate records.

Regards

Suresh

4 REPLIES 4

Former Member
0 Kudos

you can delete the records in se11

Former Member
0 Kudos

Hi ,

There are 2 cases.

If your requirement is to delete duplicate entries during your flow logic simply use DELETE ADJACENT DUPLICATE COMPARING. ( Check syntax).

2nd If you want to delete from view itself . Just design a simple program which selects the data form this view into a internal table. Sort this internal table. Move into another table with of same structure.Delete adjacent duplicates from 2nd internal table. Comapre the data in both tables . If valuse does not match ..just delete them.

Reward if helpful!!

Regards

Sourabh

0 Kudos

Hi Sourabh,

Thanks for your reply.

The second solution you proposed is not possible. I want to delete this in the flow logic itself. So can i use the delete duplicate record statement? If so where?

Regards

Suresh

0 Kudos

Hi,

Delete the duplicates entries once you have taken all the entries in the internal table.

Please make sure that you sort the internal table by primary key before deleting the records.

regards

Sourabh