‎2007 Sep 23 10:37 AM
I have a issue with this foreign key.I created two tables like"
zsubmaster:
mandt PK
subid PK
subname
zstudmaster:
mandt PK
studid PK
stud name
stud add
subid FK
First I created zsubmaster,then zstudmaster set subid to FK with zsubmaster.I entered records in zsubmaster 1 english,2 mathematics, 3 social.
I started entering records in zstudmaster and 'check table' push button is visible.When the cursor is in subid,dropdown appeared.When I click it those 1,2 and 3 records are seen.But if i enter 4 in sub id and save it,record is saved.I dont understand how,to my knowledge 4 should exist in zsubmaster or else it should not be saved.Can you please suggest me,how it happened?
Thanks in advance.
‎2007 Sep 23 12:29 PM
Hi
This should not happen really
some where something wrong.
It should not accept the 4 as values if it is not defined in the first table.
Check once again the creation of foreign key and check
Foreign key
A foreign key creates a link between two tables T1 and T2. Every primary key field from T1 (check table) is assigned a field from table T2 (foreign key field). The fields from T2 assigned to primary key fields are marked as foreign key fields.
The most important function of the foreign key is the support of data integrity. The foreign key fields can only accept values which appear in the primary key of the check table. During input the values of the foreign key fields can thus be checked against the entries of the assigned key fields of the check table.
Foreign keys are also the foundation for defining lock objects, maintenance views and help views. These objects contain fields from several tables. All the tables used in such an object must be linked with foreign keys.
Reward if useful
regards
Anji
‎2007 Sep 23 4:22 PM
Hi,
While defining Foreign Key, there will be a Check box in the screen with label "CHECK REQUIRED". You have to select the check box if you want the screen to throw error message while entering records.
Reward if answer is useful.
Regards,
Hema
‎2007 Sep 23 4:48 PM
I think 'Check required' will be clicked by default.Hope Iam not wrong.
‎2007 Oct 30 5:11 AM
hi Gopi,
Please check whether both the tables are maintained.
Else use the table maintenance generator option in 'Utilities' tab.
reward if useful,
Thanks,
Teja