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
1,301

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

9 REPLIES 9
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,162

Hi,

What error you are facing while activating the table?

Rgds,

Sandeep

Read only

0 Likes
1,162

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

Read only

0 Likes
1,162

Hi,

IS there any records in the table? if yes then delete all the records from the table and then make your changes and then check and activate.

Read only

0 Likes
1,162

Enhancement category for table missing ==> You can assign enhancement category to the table , goto -> extras-enhancement category

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)

Delete the records and then change the primary keys and activate and adjust the table

Read only

0 Likes
1,162

Error still after deleting data .

TABL ZPR_EMP was not activated

Check table ZPR_EMP (ABAPRSAL/15.05.09/12:10)

Primary key change not permitted for value table ZPR_EMP

Old key field SCPCD is now non-key field

Table ZPR_EMP is modified (Deleted or deleted/created new)

Check on table ZPR_EMP resulted in errors

Read only

0 Likes
1,162

Hi Experts,

problem is still pending pl. help;

Read only

Former Member
0 Likes
1,162

Hi,

1. First remove the data from the child table and parent table and remove the foriegn key combination from the table zpcr_emp.

2. Save, check and activate the child and parent tables.

3. Now you can upload the data into zpcr_emp and test the module pool program.

Thanks.

Read only

Former Member
0 Likes
1,162

Hi,

First remove foreign key chk from table zpr_emp for the flds dptcd , Department Code

dsgcd Designation Code

also remove key chk box selection for these flds & delete and add again these 2 flds as u want ;

now chk foreign key box & map to Pkey from their parent table also chk Primary key box ;

finally do se14 ( database utility-adjust data base & activate )

Edited by: devaramaraju on May 19, 2009 3:06 PM

Edited by: devaramaraju on May 19, 2009 3:08 PM

Read only

Former Member
0 Likes
1,162

nn