Show TOC

Foreign Key AnnotationsLocate this document in the navigation structure

If the component has a foreign key relationship, the following foreign key annotations can be added:

Note You will find examples of all foreign key annotations in the Foreign Keys chapter.

Foreign Key Short Description

Syntax Form
@AbapCatalog.foreignKey.label: 'literal_string'
Definition

The short text is used as an explanatory text for a foreign key relationship.

Foreign Key Field Type

Syntax Form
@AbapCatalog.foreignKey.keyType : #KEY | 
                                  #NON_KEY | 
                                  #TEXT_KEY
Definition

The foreign key field type of a foreign key describes the meaning of the foreign key fields in the foreign key table. In structures, this information is used for documentation purposes only.

Notes

You can assign the following values of foreign key types to a component:

Table 1: List of Availabe Foreign Key Field Values
Values in ADT Description
#NON_KEY No key fields / key candidates: The foreign key fields are not primary key fields of the foreign key table and do not uniquely identify a record of the foreign key table.
#KEY Key fields / key candidates: The foreign key fields are either primary key fields of the foreign key table or they uniquely identify a record of the foreign key table as a key candidate.
#TEXT_KEY Key fields of a text table: If this type of foreign key field is defined, the foreign key table is handled as a text table of the check table. The primary key of the foreign key table must match the check table, plus a language key field with the LANG type. There can be only one text table for each check table. Otherwise, an activation warning occurs. The texts in a text table are used, for example, to explain input helps on dynpros and Web Dynpros.

Input Value Check on Dynpro

Syntax Form
@AbapCatalog.foreignKey.screenCheck : true | false
Definition

The input value check on dynpros and Web Dynpros tests whether the check table contains a record with the key given by the values in the foreign key fields.

Notes

You can define the values true (for activation) and false (for deactivation).

Message Class and Message Number

Syntax Form
@AbapCatalog.foreignKey.messageClass  : 'message_class_name'
@AbapCatalog.foreignKey.messageNumber : 'message_number'
Definition

If an input value check on a dynpro or Web Dynpro fails, a standard message is displayed. This standard message can be replaced with any message in the definition of the foreign key. To define this, you can set a message class and message number through its annotation.

Notes

You should only add a message class if the screenCheck annotation is set on true.