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: 

delete adjacent duplicates

Former Member
0 Kudos

hii the data in internal table is like this

i want to delete duplicate record if exists co mparing all fields

BUT WHEN I AMD DOING

delete adjacent duplicates from it_dup_record comparing all fields.

ITS NOT DELETING THE DUPLICATE RECORD AS IN BOLD IT IS STILL THERE IN THE INTERNAL TABLE WHY PLS SUGGEST?

ALL THREE FIELDS ARE PRIMARY KEY BUT I DONT THING THAT HAS TO DO ANYTHING WITH INTERNAL TABLE I JUST WANT TO DELTE THE DUPLICATE RECORDS IF ANY EXAXTLY SIMILAR AND SAME IE ALL THREE FIELDS

CUSTEOMER NAME AND EMAIL IS SAME FOR THE TWO RECORDS THEN I WANT TO DELTE

PLS SUGGEST ASAP

|0000000011|Cypress Semiconduct<12 |0000000011|Cypress Semiconduct<12345dfdfdfdfd

<b> |0000000011|Cypress Semiconduct<13

|0000000011|Cypress Semiconduct<13 </b>

|0000000011|Cypress Semiconduct<13456dfdfddfdfdfdfd

6 REPLIES 6

Former Member
0 Kudos

HI,

Try like this..

Sort the table first ...

and then write delete statement without any comparision ..

Regards,

Omkar.

0 Kudos

Hi Nishant.,.,

delete adjacent duplicates from it_dup_record comparing all fields.

dont give comparing all fields

Before that

SORT it_dup_record.(Based on Primery Key.,.,in ur case 3 are there right.,)

DELETE ADJACENT DUPLICATES FROM it_dup_record .

it will solve ur problem

Deb

Message was edited by:

Debasish Das

gopi_narendra
Active Contributor
0 Kudos

Sort the internal table first with the 3 fields which you want.

Then use the Delete Adjacenet Duplicates statement to delete the duplicate entires in that internal table.

Hope this sovles

Regards

Gopi

Former Member
0 Kudos

Hi Arora,

Try this.

sort it_dup_record by customer name email.

delete adjacent duplicates from it_dup_record.

or

sort it_dup_record by customer name email.

delete adjacent duplicates from it_dup_record comparing customer name email.

Reward if useful.

Regards,

Chitra

0 Kudos

hi all

i ahve found the solution

it should be delete adjacent duplicate by all primary key name ie pk1 pk2 pk3

comparing all fields somtimes dont delete the records

arora

Former Member
0 Kudos

answered