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

Creating a foreign key

Former Member
0 Likes
1,973

Few fields of my table has to be maintaied a foreign key relation.

Can some one help me how to do this?

Please give me step-by-step procedure.

Thanks in advance

Regds

kiran

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,541

i ve deleted the foreign key flds and took enter. it pop-ups a msg to maintain the foreign key flds..

regds

kiran

9 REPLIES 9
Read only

anversha_s
Active Contributor
0 Likes
1,541

Hi,

Check the sap help on Foregin key and Check table

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ea77446011d189700000e8322d00/content.htm

regards

Anver

Read only

Former Member
0 Likes
1,541

Hi kiran,

There is no specific rule to determine which are the foreign key fields in a table.U can apply simple logic as what all fields determine the relation between the tables and make them as foreign keys.

regards

Sandeep

Read only

Former Member
0 Likes
1,541

Hi Kiran,

In order to have a foreign Key relationship.. Both the fields of the 2 tables should have same domain names and also One of the Field should be a primary key. Ok.

Then After Having all this things click on the button (Key) to establish relation. After Clicking on it then a separate screen is opened asking for a proposed table. then provide the second table name and Click on GEnerate Proposal. The Automatically the fields in that particular table are displayed Then Click on "copy" to get all the fields related. If u want only that particular field to have relation. Just check the "Generic" Check box and Then Clear the Contents in the Fields Foreign Key Fields in that screen which foreign key is not required. Then Click on " Copy" Foreign Key relation is maintain.

Bye

Murthy

Read only

Former Member
0 Likes
1,541

hi murthy,

tx for the instant reply.

i have 3 fld in chek table. n when i say generate proposal, it fetches 2flds in which 1 fld is grayed out. screen shot shown here.i want only that grayed out field. i dont want the other field. so it doesnt allow me 2 clik generic.

how can i do this...

kiran

Read only

0 Likes
1,541

Hi Kiran,

Did u check the Check box and and did u clear the Foreign Key Fields Do this both Then it will allow to cerate a foreign key relation and u will get only the greyed out field.

try and see if u have any problem. MAil me back .

Bye

Murthy

Read only

Former Member
0 Likes
1,542

i ve deleted the foreign key flds and took enter. it pop-ups a msg to maintain the foreign key flds..

regds

kiran

Read only

0 Likes
1,541

Kiran See Did u clear the field "For.Key Table" and "Foreign Key Field" for the field to which u don't want to create a foreign key relationship. After Clearing them Check the checkbox "Generic" to the Fields to which u don't want to have Foreign Key relation. and then Clik on Copy. It will Work. Do the Above for the Fields to Which u don't want to Create a Foreign Key Relation

Bye

Murthy

Read only

Former Member
0 Likes
1,541

tx murthy, its working fine now.

tx for the help.

awarding points 2 u and others also.

regds

kiran

Read only

Former Member
0 Likes
1,541

hi,

please make sure that the foreign field in the check table and actual table must have same domail ( not data type but data element ).

bye