Creating Foreign Keys
Proceed as follows in the field maintenance screen of the table to maintain foreign keys:
If the domain of the check field has a value table (* entry in the Chk.table column), you can let the system make a proposal for the foreign key. The value table is entered as check table and fields of the foreign key table are assigned to the key fields of the check table with the same domain (if possible). You can then continue processing the proposal.
If the domain does not have a value table or if a proposal was not made, the screen for foreign key maintenance appears without proposals. Enter the check table and choose Save. The check table must have a key field to which the domain of the check field is assigned. You can then let the system make a proposal for assigning of the foreign key fields to the key fields of the check fields.
The system attempts to assign the key fields of the check table to fields of the table with the same domain. If you do not want a proposal, the key fields of the check table are listed and you must assign them to suitable fields of the foreign key table.
Select generic to remove the field from the check against the key fields of the check table. If you want to assign a constant to a foreign key field, you must enter it in the Constant field enclosed in apostrophes (for example ‘constant’).
If you select a field as generic or enter a constant, you must remove the entries for the table name and field name in the Foreign key field column.
This message can be replaced by any message in table T100. In this case you must enter the application area (AppAr) or message number (MsgNo).
If the foreign key is derived from a field of an included table or structure, the Inherited from the included substructure flag is also displayed. Foreign key definitions are usually inherited from the included table to the including table so that the foreign key depends on the definition in the included table.
The flag is normally set. If you cancel the selection, the link between the foreign key and the included table will be canceled. The foreign key no longer adjusts itself when its definition in the included table changes.
See also:
Foreign Keys