In SAP ABAP you will learn the step-by-step procedure to create a foreign key in SAP ABAP with proper screenshots of every step.
What are Foreign Keys in SAP ABAP?
In SAP ABAP foreign keys are the keys that are used by SAP users to create a relationship between tables present in the ABAP dictionary.
How to Create Foreign Keys in SAP ABAP?
Please for the steps below to create foreign keys in SAP ABAP:
Enter the t-code SE11 in the SAP Command Fields and Execute it.
Next on ABAP Dictionary: Initial Screen enter the Database table name and click Create button to create a new table.
Enter a Short Description of the new table and specify the Delivery Class as shown in the image below.
Now click the Save button to save the new table.
Enter the package and click the Save icon or save the table as a Local object
Now similarly create a new table by following the step mentioned above.
Now click the Foreign Key icon as shown in the image below.
Now a new windows will pop-up, specify the Check table name, that contains the master data
Now select the Foreign key field type among the four options mentioned below.
Now Save and Activate the new Foreign key in SAP ABAP
You have successfully created and activated a foreign key in SAP