Skip to Content
author's profile photo Former Member
Former Member

Can i create a table with out promary key ?

Hi,

Can i create a table with out promary key ?

Rahul

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

11 Answers

  • Best Answer
    Posted on Mar 12, 2009 at 03:08 PM

    Hi Rahul,

    This is not possible. When you create a table in DDIC you have to mark at least one field as key field in order data can be uniquely stored in DB. Your primary key fields by default will be used to formulate primary key then. You can't ommit that.

    Regards

    Marcin

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 12, 2009 at 03:27 PM

    One of the Mandatory requirements for requirement for creating a table is Primary key.

    System will not allow you to create DDIC TABLE without Primary key.It will through error message.

    Atleast one primary is mandatory to create a table so that data of the table can be identified in

    Database.

    Regards,

    Gurpreet

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 12, 2009 at 03:39 PM

    Yes.

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 12, 2009 at 04:34 PM

    Rahul, you can not create a table without a primary key using SE11. Some relational databases don't need a primary key, but you have to use DB tools to create such tables.

    Rob, could you elaborate on your answer?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 18, 2009 at 01:41 PM

    Hi,

    all tables you create in the ABAP dictionary are created WITHOUT a primary key.

    SAP uses UNIQUE indexes to enforce a "primary key" wich is defined

    by the key flag in the field definition.

    In relational databases "Primary keys" are so-called constraints and can be supported

    by a unique index (but it's not mandatory):

    The primary key can be supported by

    1) a unique index with all index fields not null

    2) a non-unique index wich has index fields being unique (well, you don't have to classify it with UNIQUE when you your index fields make up a unique key)

    3) no index at all (you can drop an index of type 2 leaving the PK in place;

    and , yes you can have no Primary key (you can drop the PK leaving the index in place)

    The separation of constraints and the object supporting it leave some advantages in data handling

    that SAP forego to use.

    bye

    yk

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 16, 2009 at 12:09 PM

    Yes Rahul,You can.

    I don't see any problem in creating a table withou primary key.

    The problem may arise later wherein you might get DUMP due to duplicate records.

    Rahul.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 16, 2009 at 01:05 PM

    Hi,

    In SAP you can not create a table without a primary key. Client handling in open sql is automatic that means you will not be able to enter anyrthing in the field if mandt is the only and key field. If you have more than one field but only one key field (MANDT) then you will be able to enter one entry only as duplicates will not be allowed in the table and MANDT is the client on which you are working on. So one entry per client will only be possible.

    Thanks.

    Smita

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 17, 2009 at 09:48 AM

    hi,

    Try doing that , the system will not allow u to do.

    Thanks and Regards

    Suarj S. Nair.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 17, 2009 at 10:50 AM

    Hi,

    I think it is not possible. if you do not have primary key, dupplicate entries are possible.

    Best Regards

    Ravi

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Final Answer:

      It is never possible to create a database table without a Primary key. You will get an error message, when you check for consistency(by pressing CTRL+F2) after creating a database table in SE11. When you double click it you will get the following error message:

      Message no. AD321

      Diagnosis

      When defining table fields, you omitted to specify a primary key.

      Procedure

      Include one or more table fields by marking the key field in the primary key in the field maintenance screen.

      The reason is:

      Whenever you create a database table, the SAP system will create a Primary Index which is a combination of all the primary keys.

      So when you are not creating primary key, the SAP system may not be able to create a Primary key for your database table. Based on which the system performance may go very poor, when you create a program and process the table entries from this database table.

      Hence SAP restricts from creating a database table without a primary key.

      Best Regards,

      Suresh

  • Posted on Mar 18, 2009 at 10:42 AM

    Hi Rahul

    You cannot create a ZTable in Se11 without using a primary key.

    You can give it a try.

    Harsh

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.