Show TOC

 Creating Foreign KeysLocate this document in the navigation structure

Procedure
  1. On the field maintenance screen of the table, select the check field and choose  with the quick info text Foreign keys. Perform one of the following
    • If the domain of the check field has a value table , you can let the system create a proposal with the value table as a check table. In this case, a proposal is made for the field assignment in the foreign key.
    • If the domain does not have a value table or if you reject the proposal, the screen for foreign key maintenance appears without proposals. In this case, enter the check table and save your entries. 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 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.

  2. In the Short text field, enter an explanatory short text.

    The short text provides technical documentation of the meaning of the foreign key.

  3. Choose Copy.

    The system saves the foreign key and returns you to the maintenance screen for the table.

Additional Options

  • Remove fields from the assignment:

    You can remove foreign key fields (with the exception of the check field) from the assignment to the key fields of the check table (see Generic and Constant Foreign Keys ).

    Select Generic to remove a 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'). In both cases you must remove the entries in fields For. key table and Foreign key field.

  • Deactivate value check:

    If the foreign key must not be used for a value check, cancel the selection in the Check required field. This definition is valid for all screens in which the field appears. It is advisable to deactivate the check for example if the foreign key is only used to define maintenance views , help views or lock objects .

  • Assign a message:

    A standard message is output if the value check by the foreign key on the screen field results in an invalid input. You can replace this standard message with any message. To do this, you must enter the message class of the message in the Areafield and the message number in the MsgNo field. For more information, see Error Message in the Foreign Key Check .

  • Semantic attributes:

    Optionally you can define the semantic attributes of the foreign key. These are primarily for documentation purposes.

    Note

    If the foreign key is derived from a field of an included table or structure (see Includes ), the Inherited from the include flag is also displayed. In most cases, foreign key definitions are inherited from the included table or structure to the including table or structure, so that the foreign key depends on the definition in the included table.

    The flag is set in principle. If you cancel the selection, the link between the foreign key and the included table or structure is canceled. The foreign key no longer adjusts itself when its definition in the included table or structure changes.

See also:

Foreign Keys