Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Can i create a table with out promary key ?

Former Member
0 Kudos

Hi,

Can i create a table with out promary key ?

Rahul

1 ACCEPTED SOLUTION

MarcinPciak
Active Contributor
0 Kudos

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

13 REPLIES 13

MarcinPciak
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Yes.

Rob

Former Member
0 Kudos

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?

0 Kudos

My answer may be misleading, but it is correct for the question that was actually asked.

Rob

rahul2000
Contributor
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

hi,

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

Thanks and Regards

Suarj S. Nair.

Former Member
0 Kudos

Hi,

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

Best Regards

Ravi

0 Kudos

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

former_member217316
Contributor
0 Kudos

Hi Rahul

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

You can give it a try.

Harsh

Former Member
0 Kudos

Hello friend,

It is not possible to create a DDIC table without Primary key. Even if you try to create a table with the MANDT (for client specific) field than MANDT will also be primary key. in this case, people can assume that they are giving there all field without primary key or KEY except MANDT.

Hope it'll solve ur problem.

Former Member
0 Kudos

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