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: 

Why my table is Accepting Duplicate Record?

rahul_1996
Participant
0 Kudos

Hi Guys,

i created a table and i declare 2 fields as primary key aadharno and mobile but when i insert the record in the table one of the 2 fields is accepting duplicate value. Do anyone have the solution to Resolve this Issue, Please Suggest.

1 ACCEPTED SOLUTION

FredericGirod
Active Contributor

I don't see duplicates keys.

The key of your table is in blue, so 3 fields. It is the content of all the 3 fields must be unique in the table, not one by one.

Otherwise, you have to create 2 tables

6 REPLIES 6

kishore_balakrishnan
Participant
0 Kudos

Good day rahul_1996

The uniqueness of the record is based on the combination of all fields that make up the primary key - Pls see https://en.wikipedia.org/wiki/Primary_key

Please check the usage of secondary index - unique index

Best Regards, Kishore

FredericGirod
Active Contributor

I don't see duplicates keys.

The key of your table is in blue, so 3 fields. It is the content of all the 3 fields must be unique in the table, not one by one.

Otherwise, you have to create 2 tables

0 Kudos

Thanks but can you suggest how can i Resolve this Issue.

matt
Active Contributor
0 Kudos

You can't as such. It isn't an issue. It's how databases work.

0 Kudos

matt
Active Contributor
0 Kudos

What you seem to be looking for is unique constraints on a two fields. This is achievable with some databases, but not part, so far as I am aware, of tables defined via the data dictionary (SE11).

The simplest solution is to check your data in ABAP before you update the database that they satisfy the uniqueness constraint.