‎2007 Jan 13 8:26 AM
Dear All ,
I have created two tables one is ZEMPTABLE and ZDEPTABLE . The Fields are LIsted Below .
Fileds OF ZEMPTABLE .
EMPID Key
EMPNAME
EMPDEP .
Fields of ZDEPTABLE .
DEPID key
DEPNAME .
I have given same domain for EMPDEP and DEPID . I have used ZDEPTABLE as a check table for ZEMPTABLE . I am very sure about creating foreign key .I have 4 entries in ZDEPTABLE viz : 10 , 20 , 30 and 40 .
As of My understanding when I enter the EMPDEP in ZEMPTABLE through SE11 -> Utilities -> Table Contents -> Create Entries , system should not allow me to enter anything apart from 10 , 20 , 30 and 40 .All tables and releated objects are Active .
Now the problem is EMPDEP field of ZEMPTABLE takes any value and does not check for entries in check table . what may the reason . I am struggling for this from last 2 days . Please let me know if any thing else is required .
I am very much sure about the way which i have followed to create foregin key is right .
Please throw some light on my problem . Thanks in Advance .
‎2007 Jan 13 9:08 AM
Hi
It depends on how these hits are entered.
The control of check table is triggered only in the dynpro, but if you have some programs fill ZEMPTABLE by SQL statament (INSERT or MODIFY), no control of check table can be triggered.
Max
‎2007 Jan 13 9:30 AM
Hello ,
I am etries using standard DYNPRO of se11 but it is not working
‎2007 Jan 13 9:40 AM
Hi
I've defined your tables in my system as you've mentioned and it works fine: so are you sure all links are right?
Max
‎2007 Jan 13 10:01 AM
Hello Max ,
First of all Thank you for you response . I am very much sure what ever problem i have given is very much right and I have done the foreign key creation in same way .
‎2007 Jan 15 4:49 AM
When we define foreign key constraint, there will be screen check.. but through SQL stateements we can violate these constraints.
As you said, you have defined the constraing properly than also check the following:-
In table ZEMPTABLE-->
for the field EMPDEP-->in foreign key dialog:-
Under Screen check:-
1. Select the the "Check require" checkbox (without this i guess there will be no screen check.)
2.In semeantics attariburtes:-->select key fields/attibutes radio button and
3. set the cardinality to 1:CN
‎2007 Jan 16 6:54 AM
Hi,
Just creating the foreign key will not help u in restricting the values. Go to Table Maintenance Generator and create the Table maintenance for your foreign key table. Now try to enter values and now it will act as you like. If u need step by step infn. then mail me.
U. Uma
‎2007 May 10 11:10 AM
Hi Uma!!
I have also faced the same problem mentioned here ,But yeah I did not create any table maintenance generator.So I feel am struggling with the steps I should follow.So can u please send me the deatils of creating foreign key relatioships??
Will be waiting for your help.
Thanks & regards,
Deepa.