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

Primary Key

Former Member
0 Likes
829

hi all,

i have created ZTABLE with MANDT key and Maintenance View. i have entered one record through Maintenance View. while trying to save second record it is giving error 'An entry already exists with the same key'. my ztable is

Field Key Initial Type

MANDT X X MANDT

FIELD1

FIELD2

FIELD3

No Primary Key except MANDT. but it is giving error while saving 2nd record.

pl. give me solution any one.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
734

hi,

you have declared mandt as primary key thats why when you are trying to save second record mandt is same and as it is primary it cant be duplicate, so u have to declare one more field as primary key,

if you dont have any field for primary key use serial no.1,2,3 etc.

now u have to create table again and do tale maintenance also, cos u cant make changes in fields once maintenance generation is done.

5 REPLIES 5
Read only

Former Member
0 Likes
734

hi,

try giving one more field as the key field.

are u entering MANDT in the maintenace view while entering records?

Read only

Former Member
0 Likes
734

Hi,

I think you should have another primary key in your ztable.

As mandt will always be same for every entry.

Regards,

Pritha.

Read only

Former Member
0 Likes
735

hi,

you have declared mandt as primary key thats why when you are trying to save second record mandt is same and as it is primary it cant be duplicate, so u have to declare one more field as primary key,

if you dont have any field for primary key use serial no.1,2,3 etc.

now u have to create table again and do tale maintenance also, cos u cant make changes in fields once maintenance generation is done.

Read only

0 Likes
734

Thank you sonali. you solved my problem.

Read only

Former Member
0 Likes
734

hI

THE PROBLEM WITH UR TABLE IS

YOU HAD DECLARED <b>MANDT</b> AS THE PRIMARY KEY AND THERE IS NO OTHER KEY IN UR TABLE

WHEN YOU ENTER THE DATA IN YOUR TABLE IT WILL ACCEPT UR 1ST RECORD DATA

WHEN YOUR TRYING TO PUT ANOTHER RECORD THEN AT THAT TIME THE MANDT VALUE IS SAME THAT WHY IT IS SHOWING THE ERROR MESSAGE

<b>SO TRY TO PUT ONE MORE FIELD AS THE PRIMARY KEY SO THAT YOUR PROBLEM WILL SOLVE VERY EASILY</b>

MANDT VALUE ALLWAYS DEPENDS ON THE CLIENT

IF YOU ENTER IN THE 800 CLIENT THEN FOR THAT TABLE THE 800 VALUE IS SAME FOR ALL RECORDS

<b>REWARD IF USEFUL</b>