Skip to Content
0

Table with too many number of keys

Dec 07, 2017 at 10:10 AM

76

avatar image

Hello every one.

I recently have a requirement that lead to a table with more than 16 key field. Its not allowed in SAP so i were trying to split this table to 2 smaller tables, each one have 8 keys and link each other by some kind of foreign key then use maintenance view to insert, update both of them. But it failed. When i made a new entry, it only update the first table and clear the check table...I need those keys to make an unique record in table, is there any one know how to do this.

10 |10000 characters needed characters left characters exceeded

Why do you need that many keys? This is very unusual.

1

Hi Mike.

Its a table of production's characteristics. I cant tell you more detail but that is the user's requirement.

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Horst Keller
Dec 07, 2017 at 10:29 AM
0

Mike is right.

Nevertheless, if you need it, you can try to create unique values from your key fields that fit into one field and use that as a logical key.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks Horst Keller.

I do think about create unique values from other key fields, its the best and simple way to do but my consultant team said its not fit to their spec since that table have some other relationships table, that change could effect other people work...thats why my choice is break big table to smaller tables. I read about this on community and seem like not only me want this feature but no one success yet...can you tell me this is not supported by SAP or I did something wrong (I look at SAP Wiki and feel like it work that way but not...)

0
Jörgen Lindqvist Dec 08, 2017 at 06:38 AM
0

What Horst and Mike said.


But do you really (like REALLY) need these fields to be keys in the database table. For relationships to other tables, you would need them in separate fields yes, but as for the database table key, you could follow Horst Kellers suggestion and merge it in some way into another field, that is set up to be the database table key. Or simply use a UUID as key, generated by cl_system_uuid class.

This approach requires more program logic in order to ensure uniqueness than a simple maintenance view though. Either way, on insert you need to generate the key in some way and I don't think that can be done in SM30 automatically... Also you need to make sure that the uniqueness requirements are fulfilled at changes.

Share
10 |10000 characters needed characters left characters exceeded