<?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 keys in open sql in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-keys-in-open-sql/m-p/6013370#M1346473</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;If your data is coming through a screen and the screen fields are linked to data elements/domains, then the screen will take care of the foreign field check. if you are directly updating the database tables through a program which doesnot involve screens or screen fields which do not refer to the data elements/domains there will not be any check in this case. so try as said above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will serve your purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ramc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Aug 2009 08:46:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-20T08:46:08Z</dc:date>
    <item>
      <title>foreign keys in open sql</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-keys-in-open-sql/m-p/6013368#M1346471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody.&lt;/P&gt;&lt;P&gt;I defined foreign keys between tables in ABAP dictionary and wrote Open SQL code in ABAP, which worked with this tables.&lt;/P&gt;&lt;P&gt;This code changed values in column, which was defined as foreign key. New value, which wasn't in check table, was successfully inserted and even sy-subrc was equal to 0. I found this problem on forums and found 2 workarounds: 1) use explicit checks on check table before updating. 2) use Native SQL to define foreign keys. Both solutions aren't good for me. How can we turn on implicit checks on foreign keys?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 08:18:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-keys-in-open-sql/m-p/6013368#M1346471</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-20T08:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: foreign keys in open sql</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-keys-in-open-sql/m-p/6013369#M1346472</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;Reasons for an UPDATE statement failure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If CONSTRAINT definitions exist for base tables in which rows were updated with the UPDATE statement, each row that was updated is checked against the CONSTRAINT definitions. The UPDATE statement fails if this is not the case for at least one modified row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each row in which the value of foreign key columns has been updated with the UPDATE statement, the database system checks whether the respective resulting foreign key exists as a key or as a value of an index defined with UNIQUE (see CREATE INDEX statement) in the corresponding referenced table. The UPDATE statement fails if this is the case for at least one modified row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each row in which the value of a referenced column of a referential CONSTRAINT definition is to be updated using the update statement, the database system checks whether there are rows in the corresponding foreign key table that contain the old column values as foreign keys. The UPDATE statement fails if this is the case for at least one row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If triggers that are to be executed after an UPDATE statement were defined for base tables in which rows are to be updated with the UPDATE statement, they are executed accordingly. The UPDATE statement will fail if one of these triggers fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shamma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 08:35:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-keys-in-open-sql/m-p/6013369#M1346472</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-20T08:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: foreign keys in open sql</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-keys-in-open-sql/m-p/6013370#M1346473</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;If your data is coming through a screen and the screen fields are linked to data elements/domains, then the screen will take care of the foreign field check. if you are directly updating the database tables through a program which doesnot involve screens or screen fields which do not refer to the data elements/domains there will not be any check in this case. so try as said above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will serve your purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ramc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 08:46:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-keys-in-open-sql/m-p/6013370#M1346473</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-20T08:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: foreign keys in open sql</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-keys-in-open-sql/m-p/6013371#M1346474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check doesn't work both in INSERT and UPDATE statements in Open SQL. I tried it 5 minutes ago. I created foreign key correctly because If I try to add wrong value on screen, system checks check table and doesn't insert it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 09:28:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-keys-in-open-sql/m-p/6013371#M1346474</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-20T09:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: foreign keys in open sql</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-keys-in-open-sql/m-p/6013372#M1346475</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;SQL statements are not implicitly checking foreign key relationships; the application logic must take care of this.&lt;/P&gt;&lt;P&gt;Never manipulate SAP standard tables directly via own program code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Integrity is turned OFF for Open SQL statements but is turned ON for screen fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can explicitly assign different input help or search help for certain screen field independently of type it is referring i.e. by means of fm F4IF_FIELD_VALUE_REQUEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This however still relates only to screen fields, not fields used directly in ABAP statement.&lt;/P&gt;&lt;P&gt;try this function module..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HELP_VALUES_GET_WITH_CHECKTAB&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;Shamma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 10:22:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-keys-in-open-sql/m-p/6013372#M1346475</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-20T10:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: foreign keys in open sql</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-keys-in-open-sql/m-p/6013373#M1346476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Everything you wrote in your message I had written in my question. I know that I have the opportunity to make an explicit check. All I want to know if there is a chance to turn on an implicit check.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 11:21:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/foreign-keys-in-open-sql/m-p/6013373#M1346476</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-20T11:21:49Z</dc:date>
    </item>
  </channel>
</rss>

