Foreign Key Requirements
A combination of fields in a table is called a foreign key, if this field combination is the primary key of another table.
A foreign key links two tables.
The check table is a table whose key fields are checked. This table is also called the referenced table.
The field of the foreign key table to be checked is called the check field.
Foreign keys are only checked by the system during screen input and screen value help. In contrast to that, ABAP programs are able to modify database table content ignoring foreign keys. For example, a new entry is to be made in table SPFLI (flight schedule). There is a check whether the airline carrier entered is stored in table SCARR (carrier) for field SPFLI-CARRID. The record is only copied to table SPFLI (foreign key table) if this is the case. A foreign key is defined for field SPFLI-CARRID (check field); for example, the checks are on this field. The corresponding check table is table SCARR with the primary key fields CLIENT and CARRID.

Foreign Key Definitions and Domains
In the ABAP Dictionary, the same domain is required for the check field and referenced key field of the check table so that you do not compare fields with different data types and field lengths. Domain equality is essential. Different data elements can be used, but they must refer to the same domain. The requirement for domain equality is only valid for the check field. For all other foreign key fields, it is sufficient if the data type and the field length are equal. Nevertheless, you should strive for domain equality. In this case, the foreign key will remain consistent if the field length is changed because the corresponding fields are both changed. If the domains are different, the foreign key would be inconsistent if, for example, the field length was changed.

Value Table
If the domain of the check field has a value table, you can have the system make a proposal with the value table as a check table. In this case, a proposal is created for the field assignment in the foreign key.
Specifying a value table does not automatically provide value help and input validation. To make the entire value help and validation functions available, you must also define an appropriate foreign key. The domain value table is simply used by the system to create automatic proposals for defining foreign keys.
