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: 

Problem in eliminating duplicates

Former Member
0 Kudos

hi EXPERT

i want to take off the duplicates

eg

Emp Name

BALAJI

BALAJI

Bala

nela

anbu

MUMBAI

R

R

Amman

Amman

i have used

1. SORT it_final.

DELETE ADJACENT DUPLICATES FROM it_final.

and

2. select distict

-


but i dont find any change

it appears with duplicates

...

CAN YOU PLS HELP ME OUT

THANX IN ADVANCE.\

RACHEL

1 ACCEPTED SOLUTION

GauthamV
Active Contributor
0 Kudos

hi,

use this.

DELETE ADJACENT DUPLICATES FROM it_final COMPARING pernr.

8 REPLIES 8

GauthamV
Active Contributor
0 Kudos

hi,

use this.

DELETE ADJACENT DUPLICATES FROM it_final COMPARING pernr.

former_member223537
Active Contributor
0 Kudos
SORT it_final by emp_name.
DELETE ADJACENT DUPLICATES FROM it_final comparing emp_name.

Former Member
0 Kudos

Hi,

Check this thread,

http://www.geekinterview.com/question_details/1495

Regards

Guru

bpawanchand
Active Contributor
0 Kudos

Hi

DATA :

BEGIN OF fs_name,

empnam TYPE string,

END OF fs_name.

DATA :

t_name LIKE STANDARD TABLE OF fs_name.

CLEAR fs_name.

fs_name-empnam = 'XYZ'.

APPEND fs_name TO t_name.

CLEAR fs_name.

fs_name-empnam = 'XYZ'.

APPEND fs_name TO t_name.

CLEAR fs_name.

fs_name-empnam = 'ABC'.

APPEND fs_name TO t_name.

CLEAR fs_name.

fs_name-empnam = 'ABC'.

APPEND fs_name TO t_name.

CLEAR fs_name.

fs_name-empnam = 'XYZ'.

APPEND fs_name TO t_name.

CLEAR fs_name.

fs_name-empnam = 'XYZ'.

APPEND fs_name TO t_name.

SORT t_name.

LOOP AT t_name INTO fs_name.

WRITE :

/ fs_name-empnam.

ENDLOOP.

DELETE ADJACENT DUPLICATES FROM t_name.

skip 5.

LOOP AT t_name INTO fs_name.

WRITE :

/ fs_name-empnam.

ENDLOOP.

Regards

Pavan

Former Member
0 Kudos

Hi Rachel,

What you are doing is right! But try to mention the Field name while sorting and also use the Comparing option in your DELETE Adjacent ...statement. So, now ur statements would be like the one below :

Sort IT_FINAL by empname.

Delete adjacent duplicates from it_final comparing empname.

This will definitely solve.

Regards,

Swapna.

Former Member
0 Kudos

Hi Friend,

First you need to sort the table using emp_name and then use DELETE ADJACENT DUPLICATES.

Try the following:

SORT it_final by emp_name.

DELETE ADJACENT DUPLICATES FROM it_final COMPARING emp_name.

Regards,

Chandra Sekhar

Former Member
0 Kudos

Hi,

Use the code below.

sort it_final in ascending by emp_name.

delete adjacent duplicates from it_final comparing emp_name

Former Member
0 Kudos

thanx for all