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 record

Former Member
0 Kudos

HI,

How to delete duplicates rows

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi sagar,

Delete adjacent duplicates from itab comparing primarykey.

<b>

Regards,

Azhar</b>

7 REPLIES 7

former_member223537
Active Contributor
0 Kudos
DATA: BEGIN OF connection, 
        cityfrom TYPE spfli-cityfrom, 
        cityto   TYPE spfli-cityto, 
        distid   TYPE spfli-distid, 
        distance TYPE spfli-distance, 
      END OF connection. 

DATA connection_tab LIKE SORTED TABLE OF connection 
                    WITH NON-UNIQUE KEY cityfrom cityto 
                                        distid distance. 

SELECT cityfrom cityto distid distance 
       FROM spfli 
       INTO TABLE connection_tab. 

DELETE ADJACENT DUPLICATES FROM connection_tab.

Former Member
0 Kudos

Hi sagar,

Delete adjacent duplicates from itab comparing primarykey.

<b>

Regards,

Azhar</b>

paruchuri_nagesh
Active Contributor
0 Kudos

hi use key word

DELETE ADJACENT DUPLICATES FROM ITAB COMPARING <FIELD1>

regards

Nagesh.Paruchuri

Former Member
0 Kudos

Hi

from Internal Table?

SORT the Internal table by Key fields

the use

DELETE ADJACENT DUPLICATES FROM ITAB COMPARING <FIELD1> <FIELD2>

DELETE

DELETE { {FROM target [WHERE sql_cond]}

| {target FROM source} }.

The statement DELETE deletes one or more rows from the database table specified in target. The rows that are to be deleted are specified either in a WHERE condition sql_cond or with data objects in source.

Regards

Anji

Former Member
0 Kudos

sort the itab...

thene write foll. code...

DELETE ADJACENT DUPLICATES FROM ITAB.

Former Member
0 Kudos

hi,

first sort your itab whith the unique key that you have in itab or all those fields according to which you want to delete records,

i.e sort itab by fld1 fld2.

delete adjacent duplicates comparing fld1 fld2.

Former Member
0 Kudos

First most important is to SORT the table by the key which u dont want as duplicate and then use DELETE ADJACENT DUPLICATES

Regards,

Reward if helpful