Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

Foreign Key issue

Former Member
0 Kudos

I have a issue with this foreign key.I created two tables like"


mandt PK

subid PK



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.


Former Member
0 Kudos


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



Former Member
0 Kudos


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.



0 Kudos

I think 'Check required' will be clicked by default.Hope Iam not wrong.

Former Member
0 Kudos

hi Gopi,

Please check whether both the tables are maintained.

Else use the table maintenance generator option in 'Utilities' tab.

reward if useful,