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 adjacent duplicates

Former Member
0 Likes
882

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
Read only

Former Member
0 Likes
801

HI,

Try like this..

Sort the table first ...

and then write delete statement without any comparision ..

Regards,

Omkar.

Read only

Former Member
0 Likes
801

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

Read only

gopi_narendra
Active Contributor
0 Likes
801

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

Read only

Former Member
0 Likes
801

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

Read only

0 Likes
801

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

Read only

Former Member
0 Likes
801

answered