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: 

Issue with check table

Former Member
0 Kudos
138

Hi,

I created One foreign key table z_gl, using this table as check table in table z_gl_prd.

Table z_gl_prd got dependent records from z_gl.

If I delete the unique record using table maintenance from z_gl, It is allowing to delete. Actually my requirement is . it should check the dependent tables.

Please provide the solution.

Thanks,

Veerendra.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
84

Hi Veerendra,

Check table <------- Foreign key table

10 -


10

30 -


20

30 -


40

You <b>can delete</b> 20 and 40 entries in check table,

But you <b>cannot delete</b> the entries 10 and 30 from check table.

" It is possible to delete these entries 10 and 30 from check table through PROGRAM " ,But it leads to database inconsistency.

Your are allowed to delete all entries in Foreign key table.

<b>Hope you understand the above concept about Check table vs Foreign key table.

If you have any further queries you are welcome.

Reward if helpful.</b>

Regards,

V.Raghavender.

7 REPLIES 7

raymond_giuseppi
Active Contributor
0 Kudos
84

Create a cluster of view with the two tables.

Look at <a href="http://help.sap.com/saphelp_46c/helpdata/en/d0/999246b2aa11d1a5700000e82deaaa/frameset.htm">Create a View Cluster</a>

Regards

Former Member
0 Kudos
84

can you please check the declarations of the tables again.

when you delete entries in z_gl they should delete the entries in th dependent tables or else the data base goes into inconsistenet state......

plz check!

Former Member
0 Kudos
84

ur just using z_gl_prd as a check table for z_gl. So, if u add entries to this table it will try to check whether the values exists in z_gl_prd table or not.....

but, when u try to delete entries in z_gl, it wont check for any dependencies for z_gl_prd table as such.

to do this u need to implement some code in the table maintenance of z_gl as such. U will have a FM in which u need to write the validation code.

0 Kudos
84

HI

Thanks for the reply, I used coding to handle this.

Veerendra.

0 Kudos
84

Hi veerendra,

In the above posts of mine I have specially mentioned that, through program

it is possible to delete entries in the table. Even if it is violating the Foreign key relationship rules.You consider my post as a least priority one.

<b>

May I known the reason,please.</b>

Regards,

V.Raghavender.

0 Kudos
84

The concept you have given is correct, but my requirement is at table maintenance level. So I am not developing separate program to handle this. I did the coding at table maintenance level itself.

I have given the rating as per my requirement solution.

Sorry, if I hurt you.

Thanks for your inputs.

Veerendra.

Former Member
0 Kudos
85

Hi Veerendra,

Check table <------- Foreign key table

10 -


10

30 -


20

30 -


40

You <b>can delete</b> 20 and 40 entries in check table,

But you <b>cannot delete</b> the entries 10 and 30 from check table.

" It is possible to delete these entries 10 and 30 from check table through PROGRAM " ,But it leads to database inconsistency.

Your are allowed to delete all entries in Foreign key table.

<b>Hope you understand the above concept about Check table vs Foreign key table.

If you have any further queries you are welcome.

Reward if helpful.</b>

Regards,

V.Raghavender.