‎2009 Jan 06 4:32 PM
HI,
I have a master table and a slave/client table.. in the client table , a non-key field refers to a primary key in the master table. i e. it shud only have values which exist in the master table. This is achieved by setting the foreign key.. But , now.. after filling a record in the client table, i am able to delete that particular record from the master table.. And the corresponding record in the client table continues to exist without error.. Is there a way to prevent the deleting of master records when client records exist..?? or to delete the client records from all tables..??
Suzie.
‎2009 Jan 06 4:43 PM
How did you set the cardinality while defining the check table ?
regards,
Advait
‎2009 Jan 06 4:43 PM
How did you set the cardinality while defining the check table ?
regards,
Advait
‎2009 Jan 06 5:15 PM
I tried with all different options of cardinality.. nothing helps to stop the deleting of master record, but it checks the value when inserted into the client table.. But it still dosnt stop the master record from being deleted
Suzie
‎2009 Jan 06 6:49 PM
Guess you will have to handle this in your program by checking records in the master/client table depending on which table you are deleting from.
regards,
Advait
‎2009 Jan 07 1:05 PM
Thats how I have done it. I wanted to be sure there wasnt any other simpler option, as this is possible in most other languages..
i guess theres no other option. i also heard that this feature is not included in SAP, as it conflicts with some requiremnst in some modules.
So thanx all. ai am closing this topic
Edited by: Suzie on Jan 7, 2009 2:26 PM
‎2009 Jan 06 5:01 PM
HI,
Foreign keys are checked by the user interface only..i.e in a screen when you press enter key,function key ,pushbutton or menu item is selected..They do not exist in the database and hence not checked when you just update data directly ..
Regards
Vasavi
‎2009 Jan 06 5:16 PM
But it shud work when I am trying to do it in ABAP dictionary right?
And even in screens, I am using a table control , i need to use internal tables, and in that case, i cannot check the 'Foreign key' check box.. So its no use..
Suzie