2007 Apr 11 12:55 PM
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.
2007 Apr 13 6:34 AM
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.
2007 Apr 11 1:02 PM
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
2007 Apr 12 2:41 PM
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!
2007 Apr 12 2:47 PM
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.
2007 Apr 13 9:25 AM
HI
Thanks for the reply, I used coding to handle this.
Veerendra.
2007 Apr 13 9:58 AM
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.
2007 Apr 16 5:59 AM
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.
2007 Apr 13 6:34 AM
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.