0

I have created a custom table as a data dictionary object in SE11. I have the following fields :

  • ID (KEY Field )
  • NAME (KEY Field )
  • DEP (KEY Field )
  • DESIGNATION

I have activated the table and also generated a table maintenance generator but after some time, I think Field DEP is not required as a key field so I unchecked it as a key field and then again I try to activate my table I am getting this error :

error_tb_primary_key_changed

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
  • it seems you assigned the same table you are editing as a check table for DEP field, you need to unassign it first (on a clean table of course), re-activate the table, and then re-assign again. – Suncatcher Mar 24 '22 at 13:51

2 Answers2

3

There are entries already in the table and if you set a key field as not a key field, the data in the table might not be consistent anymore.

In this case most likely there are several entries with the same ID and NAME, but different DEP. After setting DEP as not a key field, this would not be possible anymore. The table entries have to be cleaned up, so there is only one entry for the same ID and NAME. After that it will be possible to set DEP as not key field. (After that don't forget to regenrate the maintenence view as well.)

József Szikszai
  • 4,791
  • 3
  • 14
  • 24
0

There another table with a foreign key reference to Z_EMP_2410. When this is the case, you are prevented from changing a primary key. Remove this foreign key or keys from Z Tables first. Then try re-Activate the Z_emp_2410 again. Once Z_emp_2410 is activated, you can re-add the foreign key/s in Table z_? pointing to Z_EMP_2410 if it is still appropriate.

phil soady
  • 11,043
  • 5
  • 50
  • 95