08-12-2009 10:15 AM
Hi,
I have a requirement to create table without primary key.
It shows error when i create table without primary key.
Can anyone help me to create table without primary key.
Thanks in advance
Regards
Shanthi
08-13-2009 5:02 AM
Hi Shanthi,
You can't create a table without Primary key in SAP DDIC.
Better you consider 3 rows instead of 2 rows.
the first row will be a dummy row with Serial No..
2nd and 3rd rows will be ROLE and Employee ID as usual.
Make this 1st row as primary key field
Regards,
Anirban
08-12-2009 10:20 AM
No, u will surely get warnings and error messages if u wont put any primary key in ur table.
Why du want a table without primary key. Wats ur requirement?
08-12-2009 10:24 AM
Maintain only MANDT as primary key.
Goto SE14 and click on activate and adjust database.
Thanks and Regards,
Chandra
08-12-2009 10:24 AM
Hi,
I have two fields in the table Role and Employee id.
There will be persons who will not have employee id but a role.
so they are asking to create table without primary key.
Regards
Shanthi
08-12-2009 10:30 AM
Hi,
As Chandra mentioned, use MANDT field in your table at the beginning and have that as your primary key.
08-12-2009 10:30 AM
HI,
There will be no problem if you keep MANDT as primary key. And it will be allowed.
It only keep the client no. And it will be taken care automatically by SAP.
You could maintain role without employee code.
Regards,
Nitin.
08-12-2009 10:41 AM
>
> Hi,
>
> As Chandra mentioned, use MANDT field in your table at the beginning and have that as your primary key.
If you do this then you will only be allowed to create a single record in the table per client - which I don't think is what you want to do. I would generate a unique reference for each record and use that as the key. Though of course you should always include MANDT as the first column in a table and have that as the first column in each index, unless you want your table to be non-client specific.
08-12-2009 10:59 AM
If you not use this table in foreign key relationship u can create a table without primary key,
so that the primary key is not must for all the situation.
Edited by: jamuna palanisamy on Aug 12, 2009 11:59 AM
08-12-2009 11:11 AM
Hi,
I am not using any foreign key relationship.
Can u help me how to create table without primary key.
Regards
Shanthi
08-12-2009 11:21 AM
Hi,
Yes ,u can create a table without primary key
Create a MANDT column is an option but it allows only one row per client.
Other option is u can create a identity type of column as primary key which can auto increment by one on every new row.
Thamks,
Smita
08-12-2009 11:27 AM
Hi smita,
How to create identity type of column as primary key which can auto increment by one on every new row.
Thank you for all your response.
Thanks,
shanthi
08-12-2009 12:45 PM
Hi
YOu can use the FM NUMBER_GET_NEXT and pass the number generated here to the Ztable which will identify the row uniquely
and creatre this as the first Field of your table so that it will identify your row as unique, or you can make this as your
PRIMARY KEY
Cheers
Ramchander Rao.K
Edited by: Ramchander Krishnamraju on Aug 12, 2009 1:50 PM
08-12-2009 12:59 PM
Hi,
You can make all your fields as composite primary key...
Regards,
Nibha
08-13-2009 5:02 AM
Hi Shanthi,
You can't create a table without Primary key in SAP DDIC.
Better you consider 3 rows instead of 2 rows.
the first row will be a dummy row with Serial No..
2nd and 3rd rows will be ROLE and Employee ID as usual.
Make this 1st row as primary key field
Regards,
Anirban
08-14-2009 9:18 AM
Hi,
Choose both the fields as primary keys. It means the same person cannot have the same role more than once. But he can have a different role. I think this would be the best solution. Let me know if you have any Queries.
- Sheeba.