Register Login

Create Foreign Key in SAP

Updated May 22, 2022

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.

SE11

Next on ABAP Dictionary: Initial Screen enter the Database table name and click Create button to create a new table.

Database Table

Enter a Short Description of the new table and specify the Delivery Class as shown in the image below.

Description

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.

New Table

Now click the Foreign Key icon as shown in the image below. 

Foreign Key

Now a new windows will pop-up, specify the Check table name, that contains the master data

Check Table

Now select the Foreign key field type among the four options mentioned below.

Foreign key field type

Now Save and Activate the new Foreign key in SAP ABAP

Activate

You have successfully created and activated a foreign key in SAP


×