What are Foreign Keys
You can define the relationships between tables in the ABAP Dictionary by creating foreign keys.Using foreign keys, you can easily create value checks for input fields. Foreign keys can also be used to link several tables in a view or a lock object.
Field Assignment in the Foreign Key
A foreign key links two tables T1 and T2 by assigning fields of table T1 to the primary key fields of table T2.
Table T1 is called the foreign key table (dependent table) and table T2 the check table (referenced table). The pair of fields for the two tables must have the same data type and length. One field of the foreign key table therefore corresponds to each key field of the check table. This field is called the foreign key field.A foreign key permits you to assign data records in the foreign key table and check table. One record of the foreign key table uniquely identifies one record of the check table using the entries in the foreign key fields.
Check Field and Value Check
One of the foreign key fields is marked as the check field. This means that the foreign key relationship is maintained for this field.
When an entry is made in the check field, there is a check whether the check table contains a record with the key defined by the values in the foreign key fields. If this is so, the entry is valid. Otherwise the system rejects the entry.
In this example the entry Field2 = 2 and Field4 = 2 would be rejected since T2 does not contain a record with the key Field5 = 2 and Field6 = 2.
If you do not want to check against all the key fields of the check table, you can exclude fields of the foreign key table from the assignment of the fields to the check table with generic and constant foreign keys.
Variants
Variants allow you to save sets of input values for programs that you often start with the same selections. You can use them for any programs except subroutine pools
SEARCH HELP
The input help (F4 help) is a standard function of the R/3 System. It permits the user to display a list of possible values for a screen field. A value can be directly copied to an input field by list selection.
You can define the relationships between tables in the ABAP Dictionary by creating foreign keys.Using foreign keys, you can easily create value checks for input fields. Foreign keys can also be used to link several tables in a view or a lock object.
Field Assignment in the Foreign Key
A foreign key links two tables T1 and T2 by assigning fields of table T1 to the primary key fields of table T2.
Table T1 is called the foreign key table (dependent table) and table T2 the check table (referenced table). The pair of fields for the two tables must have the same data type and length. One field of the foreign key table therefore corresponds to each key field of the check table. This field is called the foreign key field.A foreign key permits you to assign data records in the foreign key table and check table. One record of the foreign key table uniquely identifies one record of the check table using the entries in the foreign key fields.
Check Field and Value Check
One of the foreign key fields is marked as the check field. This means that the foreign key relationship is maintained for this field.
When an entry is made in the check field, there is a check whether the check table contains a record with the key defined by the values in the foreign key fields. If this is so, the entry is valid. Otherwise the system rejects the entry.
In this example the entry Field2 = 2 and Field4 = 2 would be rejected since T2 does not contain a record with the key Field5 = 2 and Field6 = 2.
If you do not want to check against all the key fields of the check table, you can exclude fields of the foreign key table from the assignment of the fields to the check table with generic and constant foreign keys.
Variants
Variants allow you to save sets of input values for programs that you often start with the same selections. You can use them for any programs except subroutine pools
SEARCH HELP
The input help (F4 help) is a standard function of the R/3 System. It permits the user to display a list of possible values for a screen field. A value can be directly copied to an input field by list selection.
Confused? Feel free to ask
Your feedback is always appreciated.I will try to reply Ur queries as soon as time allows.
Regards,
SAPhelpdesk
0 comments:
Post a Comment