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

Problem in eliminating duplicates

Former Member
0 Likes
804

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

GauthamV
Active Contributor
0 Likes
760

hi,

use this.

DELETE ADJACENT DUPLICATES FROM it_final COMPARING pernr.

8 REPLIES 8
Read only

GauthamV
Active Contributor
0 Likes
761

hi,

use this.

DELETE ADJACENT DUPLICATES FROM it_final COMPARING pernr.

Read only

Former Member
0 Likes
760
SORT it_final by emp_name.
DELETE ADJACENT DUPLICATES FROM it_final comparing emp_name.
Read only

Former Member
0 Likes
760

Hi,

Check this thread,

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

Regards

Guru

Read only

bpawanchand
Active Contributor
0 Likes
760

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

Read only

Former Member
0 Likes
760

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.

Read only

Former Member
0 Likes
760

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

Read only

Former Member
0 Likes
760

Hi,

Use the code below.

sort it_final in ascending by emp_name.

delete adjacent duplicates from it_final comparing emp_name

Read only

Former Member
0 Likes
760

thanx for all