Skip to Content
avatar image
Former Member

Table without primary key

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 13, 2009 at 04: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

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 12, 2009 at 09: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?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 12, 2009 at 09:24 AM

    Maintain only MANDT as primary key.

    Goto SE14 and click on activate and adjust database.

    Thanks and Regards,

    Chandra

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 12, 2009 at 09: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

    Add comment
    10|10000 characters needed characters exceeded

    • >

      > 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.

  • avatar image
    Former Member
    Aug 12, 2009 at 09: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 12, 2009 at 10: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 14, 2009 at 08: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.

    Add comment
    10|10000 characters needed characters exceeded