Dec-2008
Objectives
The participants will be able to:
Define and Use Foreign Keys
Understand the Prerequisites for Constructing Foreign Key Relationships
Interpret Cardinality and Foreign Key Field Types
Create Foreign Key Relation
Dec-2008
Dec-2008
Dec-2008
Dec-2008
Value Table
Check Table
Dec-2008
Check
Table
Value
Table
Dec-2008
Check
Table
Value
Table
Dec-2008
Dec-2008
Cardinality
When creating foreign key relationships, you should always specify the cardinality
of that relationship
n : m
1
C
N
CN
10
Dec-2008
11
Dec-2008
Check table
Maintain foreign
key type
Maintain cardinality n : m
12
Dec-2008
13
Dec-2008
Field-By-Field Assignment
When performing a field-by-field assignment, all key fields in the check table
are used to determine valid entries in the foreign key table.
14
Check Table
Dec-2008
15
Dec-2008
Only records in the check table with that value in the corresponding field are
used to determine whether records in the foreign key table are valid.
16
Dec-2008
17
Dec-2008
Demonstration
Creation of a new transparent table for holding the payroll data for employees in
an organization and establish a foreign key relationship with the employee table
created for the previous chapter.
18
Dec-2008
Practice
19
Creation of a new transparent table for holding the payroll data for employees in
an organization and establish a foreign key relationship with the employee table
created for the previous chapter.
Dec-2008
Summary
Relationships between tables are represented in the ABAP Dictionary by foreign
keys. A foreign key is a field (or combination of fields) that represents the primary
key of another table.
Foreign keys maintain data integrity & provide help texts.
In order to establish a foreign key relationship in SAP, the fields involved must
share the same domain.
20
Dec-2008
Questions
What is a foreign key ?
21
Dec-2008