‎2008 Aug 19 2:42 PM
Hi all,
I have created a database table with the following fields
1) mandt
2) matnr
3) werks
4) lgort
5) length - used my own datatype
6) erfme
7) erfmg
i have mandt as primary field.
now after inserting the first record while i am trying to insert a new one, it always gives me the same message however i change the data.
it says A DATA RECORD WITH THE SPECIFIED KEY ALREADY EXISTS.
plz help me out on this.
Thanks and Regards,
C.A
‎2008 Aug 19 2:44 PM
Hi
MANDT is the client login number so when ever you try to insert another record with the same primary key it triggers an error.
you should define along with MANDT one more fields as primary KEY
Regards
pavan
‎2008 Aug 19 2:44 PM
> i have mandt as primary field.
what about other key fields will that table in active state.
If you enter duplicate keys then it will not allow you to create the entries.
‎2008 Aug 19 2:45 PM
‎2008 Aug 19 2:48 PM
Hello
For correct work it is necessary to do several primary fields.
For example - mandt + matnr + werks
‎2008 Aug 19 2:49 PM
If you have one primary key that is mandt then how can you insert the other records.
include other key/s and it will allow you to create multiple entries, until unless you don't have any duplicates.
‎2008 Aug 19 2:44 PM
Hi
MANDT is the client login number so when ever you try to insert another record with the same primary key it triggers an error.
you should define along with MANDT one more fields as primary KEY
Regards
pavan
‎2008 Aug 19 2:45 PM
The thing is you have specified only MANDT as primary key. So, it always holds only record and so it gives the message.
You need to specify more fields as key fields. May be MATNR and WERKS also make them as primary keys...
In this way you can insert more records...
‎2008 Aug 19 2:47 PM
Hi,
In the Database table you have mentioned MANDT as primary key.
But Mandt by default filled as the logon client number.
So again if you insert new records it will take same client no but in Database table it is not possible. Thats why it is showing the error.
Better you add one more primary key except MANDT then there will be no problem.
Regards,
Sujit
‎2008 Aug 19 2:48 PM
Hi,
When you used only MANDT as key field
it will not allow to enter the records more than 1
Because the table checks the entries against key fields in the table
So it looks for mandt in your case. but the record will be in the table already
So you need to create one more key field based on your requirement.
Regards,
Siva Chalasani
‎2008 Aug 19 2:49 PM
along wiht MANDT, you should set the 2) matnr
3) werks
fields also key fields. then it consider the combination of these three fields is unique.