12-16-2021 6:16 AM
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.
12-16-2021 6:40 AM
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
12-16-2021 6:39 AM
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
12-16-2021 6:40 AM
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
12-16-2021 6:44 AM
12-16-2021 7:25 AM
12-16-2021 7:26 AM
if you plan to use SM30 to maintain this table, check
https://blogs.sap.com/2015/10/29/validate-data-in-table-maintenance-generator-event/
12-16-2021 7:30 AM
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.