<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Foreign Key issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-key-issue/m-p/2983666#M704494</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hI &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SEE THIS ONE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check table name of the foreign key&lt;/P&gt;&lt;P&gt;Check table&lt;/P&gt;&lt;P&gt;Table whose key fields are used to check the foreign key fields (see Foreign Keys). Only entries that are contained in the key fields of the check table can be contained in the foreign key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The check table is used to check whether the input values are valid and for the input help (F4 help).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field in the foreign key table, which is assigned to the primary key field in the check table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A foreign key creates a link between two tables T1 and T2. Every primary key field from T2 (check table) is assigned a field from table T1 (foreign key field). The fields from T1 assigned to primary key fields are marked as foreign key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the ABAP Dictionary, such relationships between two tables are called foreign keys and they must be defined explicitly for the fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Foreign keys are used to ensure that the data is consistent. Data that has been entered is checked against existing data to ensure that it is consistent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Foreign Key concept with an Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:                                                                                In this example, the foreign key table is table SBOOK. The purpose of the foreign key is to ensure that only valid counters of carriers can be assigned to a booking. Check table SCOUNTER contains exactly this information. Each counter is identified with three key fields in this table: MANDT, CARRID, and COUNTNUM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to define the foreign key, these three fields are assigned to fields of the foreign key table (foreign key fields) with which the input to be checked is entered on the screen. In table SBOOK these are the fields: MANDT, CARRID, COUNTER. The entry is accepted if it represents a valid counter; otherwise the system will reject it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The foreign key is defined for field SBOOK-COUNTER (check field), which means that the entry in this field is checked. Field COUNTER is therefore called the check field for this foreign key.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Nov 2007 08:50:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-09T08:50:53Z</dc:date>
    <item>
      <title>Foreign Key issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-key-issue/m-p/2983663#M704491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I previously posted the same but didnt get answer.The problem is that I created a table zforeign with fid and fname as fields.I mapped fid as foreign key with id field of check table zgtable.When I enter data in zforeign,for fid field list shows with corresponding values from check table.I select any one value and save it.Other than selecting,if i enter a value 123(which is not in check table),this record also gets saved.I think it should prevent me saving since 123 record is not found in check table.Can anyone tell me why its happening like that?Iam using 4.7 and check required check box is clicked while creating foreign key.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2007 05:41:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-key-issue/m-p/2983663#M704491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-09T05:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Key issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-key-issue/m-p/2983664#M704492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Make confirm ur Chack table is ACTIVATED or not. if not Activated, Activated it. &lt;/P&gt;&lt;P&gt;2) Main table and  Check table fields should have same domain. In ur case field &amp;lt;b&amp;gt;fid&amp;lt;/b&amp;gt; should hv same domain in table &amp;lt;b&amp;gt;zforeign and zgtable&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Paras&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Paras&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2007 08:31:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-key-issue/m-p/2983664#M704492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-09T08:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Key issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-key-issue/m-p/2983665#M704493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gopi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure that you have switched on 'Check required' when defining the foreign key in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2007 08:47:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-key-issue/m-p/2983665#M704493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-09T08:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Key issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-key-issue/m-p/2983666#M704494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hI &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SEE THIS ONE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check table name of the foreign key&lt;/P&gt;&lt;P&gt;Check table&lt;/P&gt;&lt;P&gt;Table whose key fields are used to check the foreign key fields (see Foreign Keys). Only entries that are contained in the key fields of the check table can be contained in the foreign key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The check table is used to check whether the input values are valid and for the input help (F4 help).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field in the foreign key table, which is assigned to the primary key field in the check table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A foreign key creates a link between two tables T1 and T2. Every primary key field from T2 (check table) is assigned a field from table T1 (foreign key field). The fields from T1 assigned to primary key fields are marked as foreign key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the ABAP Dictionary, such relationships between two tables are called foreign keys and they must be defined explicitly for the fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Foreign keys are used to ensure that the data is consistent. Data that has been entered is checked against existing data to ensure that it is consistent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Foreign Key concept with an Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:                                                                                In this example, the foreign key table is table SBOOK. The purpose of the foreign key is to ensure that only valid counters of carriers can be assigned to a booking. Check table SCOUNTER contains exactly this information. Each counter is identified with three key fields in this table: MANDT, CARRID, and COUNTNUM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to define the foreign key, these three fields are assigned to fields of the foreign key table (foreign key fields) with which the input to be checked is entered on the screen. In table SBOOK these are the fields: MANDT, CARRID, COUNTER. The entry is accepted if it represents a valid counter; otherwise the system will reject it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The foreign key is defined for field SBOOK-COUNTER (check field), which means that the entry in this field is checked. Field COUNTER is therefore called the check field for this foreign key.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2007 08:50:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-key-issue/m-p/2983666#M704494</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-09T08:50:53Z</dc:date>
    </item>
  </channel>
</rss>

