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: 

Custom table data entry

Former Member
0 Kudos

Hi All,

I have a scenario...

where I have three key fields in my table: zgrp, zrole and zdate and two non key fields zdatum and zpur

Now I want to enter the following records:

zgrp - > 1

zrole-> xyz

zdate->12/12/2008

zdatum->12/11/2007

zpur->1

zgrp - > 1

zrole-> xyz

zdate->12/12/2008

zdatum->12/11/2006

zpur->2

zgrp - > 1

zrole-> xyz

zdate->12/12/2008

zdatum->12/11/2007

zpur->3

zgrp - > 2

zrole-> abc

zdate->12/12/2008

zdatum->12/11/2007

zpur->1

zgrp - > 2

zrole-> abc

zdate->12/12/2008

zdatum->12/11/2007

zpur->2

but I am not being able to insert these records, as soon as I enter the first record it gives me the follwoing error:

"An entry already exists with the same key"

Thanks,

Rajeev

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello ,

The first 3 entries that you want to add to you table all have exactly the same values for the key field. That is why you are getting the error.

You will need to rethink the keys that are needed for you table. You may need to add another key field to make the entries in you table unique by those key values.

Regards

Greg Kern

4 REPLIES 4

Former Member
0 Kudos

How about looking in the table with SE16 to see what's already in there?

edit.

By the way: even if you manage to insert the first one, other's will go wrong. Given your examples: your primary key is not unique.

0 Kudos

The table has just one recoed that I entered !!!!

Former Member
0 Kudos

Hello ,

The first 3 entries that you want to add to you table all have exactly the same values for the key field. That is why you are getting the error.

You will need to rethink the keys that are needed for you table. You may need to add another key field to make the entries in you table unique by those key values.

Regards

Greg Kern

former_member226519
Active Contributor
0 Kudos

you need one more key field to build an unique key: i.e. zcount type numc4 so you could add from 1 to 9999 records with eaqual keys.

you can not add a second record with key

zgrp - > 1

zrole-> xyz

zdate->12/12/2008