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 record from sap tables

Former Member
0 Kudos
289

Hi,

i wont to delete duplicates recored from sap standard table,

i can do that?

Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos
230

Hi Ricardo.

As you know we can use the concept of DELETE ADJACENT DUPLICATES FROM with options according to your specifications like

COMPARING

OR

COMPARING ALL FIELDS... (ADDITIONS).

But, don't forget to sort the table according to the COMPARISON ORDER.

Reward points if usefull.

Regards

Harsh

11 REPLIES 11

Former Member
0 Kudos
230

Hi,

There is concept called primary key, with this concept you will not have any duplicate records.

Thanks,

Sriram Ponna.

Former Member
0 Kudos
230

hi,

Make the required fields as primary key fields which stops duplicates entries in the table ..

regards,

Santosh

Former Member
0 Kudos
230

Hi Ricardo,

Can you be clear in your question. Do you want to remove duplicate records from SAP standrad tables. I don't think so, that SAP Standard tables have duplicate records.

Hope this helps you.

Regards,

Chandra Sekhar

0 Kudos
230

Hi,

sorry i don't explain my self well,

in the sap tables i have record of

datb

rt123

rt222

rt646

rt545

rt4664

and i wont to have just 2 recored with rt i can do that?

Regards

0 Kudos
230

hi ricardo,

which ever field you are taking from data base table...for your sap tables...make that field as primary key...

it will automatically stop duplicate entries..

and in case if you want to delete some entry from your sap tables...go to table maintenance and delete those entries..

hope this helps u

regards

kanika

0 Kudos
230

Hi Ricardo,

rt123
rt222
rt646
rt545
rt4664

But you dont have any duplicate records here.

Best regards,

raam

Former Member
0 Kudos
230

hi,

will you plz be more specific in your question because as far as i know there are no duplicate records in the Standard SAP tables.

All Records are uniquely Identified on primary and Secondary key fields.

Regards.

Sumit Agarwal

former_member212653
Active Contributor
0 Kudos
230

tables dbtab.

select * from dbtab.

sort dbtab.

delete adjacent duplicates from dbtab comapring field1.
loop at dbtab.
delete from dbtab where key1 =  dbtab-key1
                                    key2 = dbtab-key2.
commit work.
endloop.

Former Member
0 Kudos
230

Hi Ricardo,

Generally a table does not have duplicate entries, because of the primary key in the table. Ypu can find duplicate entries with repect to non primary keys.

If you want to delete these records then u can write a program, selecting the duplicate records into a internal table and use statement

DELETE ADJECENT DUPLICATES....

modify the database table

Best regards,

raam

Former Member
0 Kudos
230

Hi,

You can first delete the entries which you dont want in your table, through Transaction SM30 and then make the field as primary in your table, for which you dont want duplicate values. This way you could avoid entering duplicate values.

Former Member
0 Kudos
231

Hi Ricardo.

As you know we can use the concept of DELETE ADJACENT DUPLICATES FROM with options according to your specifications like

COMPARING

OR

COMPARING ALL FIELDS... (ADDITIONS).

But, don't forget to sort the table according to the COMPARISON ORDER.

Reward points if usefull.

Regards

Harsh