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: 

Deleted a primary key on a custom table. Now I can't activate the table.

walkerist
Participant
0 Kudos
1,004

I tried removing the TEST_ASD as primary key. Now I can't activate it.

Quite not sure with the error log provided.

7 REPLIES 7

yashoratna
Active Participant
840

Hello Wane,

please perform where used list on the field and see where it has been used. If field is being used as a foreign key then it is quite possible that it will not allow to delete. Seems like this table-field is in relationship with any other table and playing role of foreign key over there,

0 Kudos
840

Is there a workaround for this? User wants to delete one of the primary keys of a table.

0 Kudos
840

Unfortunately, first you need to break foreign key relationship before deleting the primary key from this table, otherwise it would create inconsistency. This is a hard error by SAP on foreign-key concept and can't be avoided.

I think this table field is in relationship with another Z-table. Just remove the foreign-key relationship from another Z-table, come back and delete the primary key from this table.

FredericGirod
Active Contributor
840

SAP explains you the issu, the solution is to follow the SAP recommendation

raymond_giuseppi
Active Contributor
840
  1. Carry out the where-used list function for this table, use Transaction SE11 for this.
  2. Remove any reference to this table:
    - Views (remove key)
    - Foreign keys relation with other tables
    - Domains which uses this table for values
  3. activate dependant objects
  4. then change primary key and activate table (as long as no duplicate are created)
  5. then redefine the deleted reference
  6. activate dependant objects

(what was written after 'Check table' in the log?)

0 Kudos
840

Here raymond.giuseppi

0 Kudos
840

You forgot to deactivate a table value check, run the where-used search again (table value of a domain or another table)