Referential integrity violation mechanism

Hey, I’m trying to create a generic process that checks for referential integrity violations when a user makes an attempt to delete a record X.According to this process i scan all table fields through a report that makes use of the virtual table FIELD. So, i apply a filter on virtual table fields “RelationTableNo” and “RelationFieldNo” in order to find the subset of tables that have as secondary key the primary key of the record that i want to delete…The problem with this scenario is when the relation between the tables is filtered. In this case the fields RelationTableNo and RelationFieldNo are both set to zero. Does anybody know where the information about the table relations in this case is stored? Is there any other virtual table that i can make use of? Is there any other approach that handles the problem of referential integrity in a generic way? thanx