2013 Aug 09 7:03 AM
I have created three tables as per following,
1) Department
fields: dep_id(primary key),
dep_name
2)Faculty Table
fields: fac_id(primary key),
fac_name,
dep_id(foreign key)
3)Student Table
fields: std_id(primary key),
std_name,
std_add,
fac_id(foreign key),
dep_id(foreign key).
Now i want to make condition that fac_id and dep_id should be correspond in student table ,
for example ,
if i enter 1 as fac_id then it should automatically fetch it's dep_id from the fac_id..
2013 Aug 09 7:36 AM
Hello,
As per my understanding there is no need to dep_id in student table , b'cz based on Student id you can get a Unique fac_id and Based on fac_id u can get unique Dept_id and Name, so remove
dep_id from student table.
BR
Chandra..
2013 Aug 09 7:19 AM
Hi Alex Hanes
See this link to create foreign key for table
http://www.saphub.com/abap-tutorial/how-to-create-a-foreign-key-in-sap-table/
2013 Aug 09 7:25 AM
Thanks on your prompt reply to this.I am able to make it work with 2 tables.But, when i try it on 3 tables things get messy. It looses it's consistency.
2013 Aug 09 7:19 AM
Hi Alex,
I'm not sure you could do this (easily) with SAP. Maybe if you build a logical database (with some Abap code). But SAP didn't use the "advanced tools" of Oracle because it could used several different database.
regards
Fred
2013 Aug 09 7:36 AM
Hello,
As per my understanding there is no need to dep_id in student table , b'cz based on Student id you can get a Unique fac_id and Based on fac_id u can get unique Dept_id and Name, so remove
dep_id from student table.
BR
Chandra..
2013 Aug 09 8:00 AM