10-04-2008 10:25 PM
Hi All.
I am working on an issue....there is one ztable named as zemp with the following fields:
MANDT MANDT CLNT 3 0 Client
ZNUM ZNUM CHAR 6 0 Employee number
ZDATE ZDATE DATS 8 0
ZROLE ZROLE CHAR 1 0 emp role
ZCLASS ZCLASS CHAR 2 0 emp class
where mandt is the only key field in it and now I am trying to put the data in it, when I put the first entry using sm30
1.
empnum 1
date 08/08/2008
zrole 3
empclass 12
and now when I am trying to enter the second record:
empnum 1
date 08/08/2008
zrole 2
empclass 12
it's giving me the following error:
An entry already exists with the same key
can you please tell me what exactly the problem is..
Thanks,
Rajeev
10-05-2008 2:26 AM
Give the value like this,
empnum 1234
date 08/08/2008
zrole 2
empclass 12
empnum 1235
date 08/08/2008
zrole 3
empclass 12
Regards,
Midhun Abraham
Edited by: Midhun Abraham on Oct 5, 2008 3:27 AM
10-04-2008 10:37 PM
Hi Rajiv,
The problem is with the KEY field MANDT, as you have mentioned "mandt" as the only key field it is throwing out this error. This is because when you are working on a system, suppose say your clinet number (MANDT) is "800", you are trying to enter second record with the same client, moreover you have made this "mandt" as the key field. This is the cause for your errot.
I think your requirement is to enter different employee data into this table. Now, make mandt & emp no (both of them ) as the key fields and try entering the data.
This should not create any problem.
10-04-2008 11:42 PM
Thanks for the reply srinivas. This time I amde enum also as a key field and tries to enter the following records:
empnum 1234
date 08/08/2008
zrole 2
empclass 12
and now when I tried to enter the seod record as :
empnum 1234
date 08/08/2008
zrole 3
empclass 12
I am facing the same problem !!!
10-04-2008 11:09 PM
Hi,
Make Empname also key field and enter your data.
1.
mandt 200
empnum 1
date 08/08/2008
zrole 3
empclass 12 like this...you dont get any error.
Thanks,
Sree.
10-05-2008 2:26 AM
Give the value like this,
empnum 1234
date 08/08/2008
zrole 2
empclass 12
empnum 1235
date 08/08/2008
zrole 3
empclass 12
Regards,
Midhun Abraham
Edited by: Midhun Abraham on Oct 5, 2008 3:27 AM
10-05-2008 3:12 AM
Hi Midhun.
My problem is in my scenario a employee can have multiple roles .....
10-05-2008 3:18 AM
10-05-2008 3:21 AM
10-05-2008 3:26 AM
hey ,when you make the empnum as the key field it will not allow similar enteries ,for example in the key field there should be change so that the values you give.Here you are entering 1234 for the both of the enteries that will not be accepted because repeatation occurs.So check that will you be able to make some other fields as the key field.