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

Primary key foreign key remove problem

Former Member
0 Likes
3,340

hi expretrs,

I create 5 tables in ddic.

1. zpr_cmp Company Master

2. zpr_dpt Department Master

3. zpr_dsg Designation Master

4. zpr_emp Employee master.

5. zpr_slm Salary Master.

Foreign key reference in zpr_emp from table 1,2 and 3 created and

table zpr_emp has

cmpcd, Company Code

empcd, Employee Code

dptcd , Department Code

dsgcd Designation Code

as key fields.

I have upload data and create module pool and reports.

My problem that hr person say that we want to change deptcd/dsgcd of employee (zpr_emp) and

dptcd and dsgcd is as key fields in zpr_emp when i change the table zpr_emp and remove

two key fields dptcd/dsgcd and active error display.

I also try with se14 (Activate and Adjust database) but error still.

how can i remove key field from zpr_emp and active table without loss data and without any change of

module pool/reports

pl. help

10 REPLIES 10
Read only

Former Member
0 Likes
2,162

Change the field in SE11 and then go for Adjust the Database

Read only

0 Likes
2,162

i also try using se14 but displaying error, problem still.

Read only

0 Likes
2,162

Can you post the Error Description ?

Read only

0 Likes
2,162

yes,

Error when activate the table:

TABL ZPR_EMP was not activated

Check table ZPR_EMP (ABAPRSAL/15.05.09/11:24)

Enhancement category for table missing

Primary key change not permitted for value table ZPR_EMP

Old key field SCPCD is now non-key field

Structure change at field level (convert table ZPR_EMP)

Check on table ZPR_EMP resulted in errors

help urgetn

Read only

0 Likes
2,162

Check the Enhancement category. and see if it is checked on " Can be enhanced "

otherwise, delete all the foreign key relationship and then change, activate and convert the database.

Read only

0 Likes
2,162

after deleting data and foreign key

and se11 > activate and adjust database

error.

Request: Delete and recreate Table ZPR_EMP (ABAPRSAL/15.05.09/17:30)

Process: devecc_0

Primary key change not permitted for value table ZPR_EMP

Activation of Table ZPR_EMP not possible (please check)

Request for ZPR_EMP could not be executed

pl. help

Read only

0 Likes
2,162

Diagnosis

ZPR_EMP table is defined as a check table. For reasons of consistency, changes to the primary key of the table are not allowed.

Procedure

If it is essential that you change the primary key, you must delete the relevant foreign keys. Refer to the where-used list to find all tables containing a field that is checked against this table. Delete the foreign keys for these fields.

If necessary, maintain the deleted foreign keys again.

Value table - It's a field in a domain it helps in domain level data validation.

Check table - unlike value table it helps in feild level data validation.

The relational data model contains not only tables, but also relationships between tables. These relationships are defined in the ABAP/4 Dictionary by foreign keys. An important function of foreign keys is to support data integrity in the relational data model. Foreign key fields may assume only those values allowed by the check table, in other words, values occurring in the primary key of the check table.

A foreign key provides a link between two tables, for eg.,T1 and T2 by including a reference in table T1 to the primary key of table T2. For this purpose, Foreign key fields assigned to the primary key fields of T2 are included in T1. Table T1, which is the one being checked, is called a foreign key table, and table T2 is called a check table. The terms dependent (foreign key) table and referenced (check) table are also used.

VALUE TABLE:If the domain of the check field has a value table, this is proposed by the system as check table in the foreign field maintenance. The key fields of the value table are in this case assigned fields of the foreign key table with the same domain. These fields may assume only those values allowed by the value table.

The value range of the domain can be defined by specifying value table.All table fields referring to this domain can then be checked against the corresponding field of this value table.In order the check can be executed, a foreign key must be defined for the value table.

Read only

0 Likes
2,162

Problem is still pending pl .help

Read only

Former Member
0 Likes
2,162

self solved

Read only

0 Likes
2,162

Hi Narendra,

can you please brief us how you resolved the above mentioned problem

Regards