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: 

Deleting entries from a Standard View

Former Member
0 Kudos

Hi,

How do I delete duplicate entries from an Standard View in an Abap Code?

Thanks,

Pravs

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Then it becomes complicated. Are you trying to delete the duplicates from a view? Then look at your view definition and see if you can avoid duplicates by changing its selection criteria. Also take note of Rob's comment.

If you are trying to delete from a database table as opposed to a view, then I don't know how you achieved the feat of having duplicate entries as any duplicate inserts with same key fields would have resulted in dump. Can you please clarify?

5 REPLIES 5

Former Member
0 Kudos

Are you pulling the entries into an internal table or do you want to delete them on the db table itself? If you want to achieve this in the internal table, then you can use

SORT itab BY keyfields.

DELETE ADJACENT DUPLICATES FROM itab COMPARING keyfields(or ALL FIELDS)

0 Kudos

Hi Srinivas,

I want to delete the duplicate entries from the Database not from the Internal table.

Former Member
0 Kudos

Hi,

populate itab (internal table) with the entries u want to delete from db view. then use

DELETE dbtab FROM TABLE itab

(dbtab = db view name)

Former Member
0 Kudos

According to the help for SELECT:

You can delete data using a view only if the view refers to a single table and was created in the ABAP Dictionary with the maintenance status "No restriction".

Rob

Former Member
0 Kudos

Then it becomes complicated. Are you trying to delete the duplicates from a view? Then look at your view definition and see if you can avoid duplicates by changing its selection criteria. Also take note of Rob's comment.

If you are trying to delete from a database table as opposed to a view, then I don't know how you achieved the feat of having duplicate entries as any duplicate inserts with same key fields would have resulted in dump. Can you please clarify?