Application Development and Automation 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: 
Read only

Table primary key issue

Former Member
0 Likes
1,209

Hello experts,

I have an issue with a table, the system is raisiins the following error:

Table XXXXX has more than 16 key fields (violates SAA standard)

Since i am feeding this table with an Abap program, i would like to know if using a statement like Delete adjacent duplicates comparing (the fields that i couldn't add as primary key) can help me to avoid my issue.

Thanks.

Amine

1 ACCEPTED SOLUTION
Read only

SreekanthKrishn
Contributor
0 Likes
1,055

Amine,

Yes, if you are using delete adjacent duplicates, it will serve your purpose.

But you have to compare the values which are already present in the table as well.

But if you are using these fields (which are not primary keys) to select data to report, the performance wont be that great. You may have to create secondary index for these.

Let me know if this helps.

Thanks,

Sreekanth

4 REPLIES 4
Read only

SreekanthKrishn
Contributor
0 Likes
1,056

Amine,

Yes, if you are using delete adjacent duplicates, it will serve your purpose.

But you have to compare the values which are already present in the table as well.

But if you are using these fields (which are not primary keys) to select data to report, the performance wont be that great. You may have to create secondary index for these.

Let me know if this helps.

Thanks,

Sreekanth

Read only

Former Member
0 Likes
1,055

hello,

Delete adjacent duplicates would not solve the issue in my opinion.

A maximum of 16 key fields are allowed in a table. In your case you need to reduce the key fields to 16 or less.

Check this link

http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb6e446011d189700000e8322d00/content.htm

best regards,

swanand

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,055

Your requirement is not clear. The restriction is on database table, deleting the duplicates in an internal table will only reduce the risk of duplicate keys during insertion, but won't help to bypass the technical limit, you won't be able to have more than 16 primary keys / 255 bytes length for the total.

So reduce to 15 primary keys + a counter (range number associate ?) but manage the unicity of records in each of your programs. (build a FG or simila tool for that, with FM to insert, update or read records...)

Concatenation of key may reach the max length of 255 so may or not be a solution.

Are you truly certain to need all those keys ?

Regards,

Raymond

Read only

Former Member
0 Likes
1,055

Thanks to all for your answers.

I finally choosed to use the 16 keys and removed some keys which contain fixed values.

Thanks.

Amine