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

the two record with the same key

Former Member
0 Likes
1,372

Dear abapers:

I have a add-on table that has 8 keys.I found that I can make the two record with the same key in this table.

But why does the two same key's record exist in the add-on

table? And how?

Who can explain this?

Thanks a lot!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,331

Perhaps you have not declare any key field in this add on table.

Try to declare one or multiple keys as your primary key depending on your requirement..

after this you cannt insert two records with same key in your table.

Hope, this helps you.

Regards,

Tarun

Dear abapers:

I have a add-on table that has 8 keys.I found that I can make the two record with the same key in this table.

But why does the two same key's record exist in the add-on

table? And how?

Who can explain this?

Thanks a lot!

7 REPLIES 7
Read only

Former Member
0 Likes
1,332

Perhaps you have not declare any key field in this add on table.

Try to declare one or multiple keys as your primary key depending on your requirement..

after this you cannt insert two records with same key in your table.

Hope, this helps you.

Regards,

Tarun

Read only

0 Likes
1,331

Thank for answering.

But I am sure that there are 8 primary keys in this add-on table.

Read only

0 Likes
1,331

Hi alex,

Do you mean that the table has entries have repeating entries for primary key.

IF a table has 8 primary keys then it can accept records where atleast one of them have a different value.

Just consider a sample table with FIELD1 FIELD2 FIELD3 as primary key.

Then,


FIELD1 FIELD2 FIELD3
a      b      c
a      b      d
a      b      e

are all valid entries.

Regards,

Wenceslaus.

Read only

0 Likes
1,331

Yes, database will not allow to insert records with duplicate primary keys in table.

If you are saying that there are 2 records with same keys, check the field values - probably if there are character fields, there can be difference in case - some characters are caps and same are in small caps in second record.

Else pls paste data and keys here to have a look upon.

Read only

0 Likes
1,331

I'm sure that I can create two record that all of the primary keys are the same value.

It is funy that when I delete one of the records has the same primary keys, all of them are deleted.

Later maybe I can paste the copy

Read only

0 Likes
1,331

Alex,

If you have declared the keys of the table properly in SE11, then it is not possible to have two records having the same exact keys.

Can you paste the table definition and the two records here?

Regards,

Ravi

Read only

Former Member
0 Likes
1,331

hi alex,

I am also facing this problem of two records with same primary keys. Did u find solution to this problem? Please help. Its urgent

Thanks,

satya