<?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: checking foreign key relation while updating table though program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-foreign-key-relation-while-updating-table-though-program/m-p/10847199#M1885194</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No way as far as I know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you insert value by value then in screen fields, google check table and value table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From Abap, unlike for instance MS Sql there is no auto check when inserting. Thats what frustrated me for a while, but Sap wanted to work on most Databases so here You go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can manipulate DB directly, constraint, but I would not do that for such trivial thing...or ever.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 lines of code, 1 select and IF &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1103/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recommend get data in Alv, test mode, flag wrong inserts etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without code, use Winshuttle.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Feb 2015 20:35:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-02-04T20:35:49Z</dc:date>
    <item>
      <title>checking foreign key relation while updating table though program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-foreign-key-relation-while-updating-table-though-program/m-p/10847195#M1885190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table A in which a field z_field&amp;nbsp; is having Entry/Check on table B. So if I update table A in SM30 I can see that it is checking table B for field Z_field so if I enter anything that is not available in B it would throw error. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can we achieve the same when we are uploading data through a program using modify statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks &lt;/P&gt;&lt;P&gt;Rahul.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 19:36:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-foreign-key-relation-while-updating-table-though-program/m-p/10847195#M1885190</guid>
      <dc:creator>uttam_kumar4</dc:creator>
      <dc:date>2015-02-04T19:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: checking foreign key relation while updating table though program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-foreign-key-relation-while-updating-table-though-program/m-p/10847196#M1885191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select by fkey in B table and if not exist, adapt your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 19:50:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-foreign-key-relation-while-updating-table-though-program/m-p/10847196#M1885191</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-02-04T19:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: checking foreign key relation while updating table though program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-foreign-key-relation-while-updating-table-though-program/m-p/10847197#M1885192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wanted it without code.. with code of course I can do that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards, &lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 20:03:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-foreign-key-relation-while-updating-table-though-program/m-p/10847197#M1885192</guid>
      <dc:creator>uttam_kumar4</dc:creator>
      <dc:date>2015-02-04T20:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: checking foreign key relation while updating table though program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-foreign-key-relation-while-updating-table-though-program/m-p/10847198#M1885193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want stuff without code, then why post in &lt;A __default_attr="2015" __jive_macro_name="community" class="jive_macro_community jive_macro" data-objecttype="14" data-orig-content="ABAP Development" href="https://community.sap.com/"&gt;&lt;/A&gt; ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 20:10:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-foreign-key-relation-while-updating-table-though-program/m-p/10847198#M1885193</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2015-02-04T20:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: checking foreign key relation while updating table though program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-foreign-key-relation-while-updating-table-though-program/m-p/10847199#M1885194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No way as far as I know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you insert value by value then in screen fields, google check table and value table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From Abap, unlike for instance MS Sql there is no auto check when inserting. Thats what frustrated me for a while, but Sap wanted to work on most Databases so here You go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can manipulate DB directly, constraint, but I would not do that for such trivial thing...or ever.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 lines of code, 1 select and IF &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1103/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recommend get data in Alv, test mode, flag wrong inserts etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without code, use Winshuttle.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 20:35:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-foreign-key-relation-while-updating-table-though-program/m-p/10847199#M1885194</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-02-04T20:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: checking foreign key relation while updating table though program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-foreign-key-relation-while-updating-table-though-program/m-p/10847200#M1885195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use a generic check tool which was developed in HR : method CHECK_STRUCTURE of class CL_HRBAS_FOREIGN_KEY_CHECK.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;ls_structure&lt;SPAN class="L0S70"&gt;-mtart &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'????'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;. &lt;/SPAN&gt;&lt;SPAN class="L0S31"&gt;" wrong value&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="L0S52"&gt;CREATE &lt;/SPAN&gt;OBJECT&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;lr_key_check&lt;SPAN class="L0S55"&gt;, &lt;/SPAN&gt;lr_message_handler&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="L0S52"&gt;TRY&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lr_key_check&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;check_structure&lt;SPAN class="L0S55"&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;EXPORTING&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;structure&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;ls_structure&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; excluded_fields&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;lt_excluded_fields&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ignore_initial_fields &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;lv_ignore_initial_fields&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; message_handler&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;lr_message_handler&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IMPORTING&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is_ok&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;is_ok &lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CATCH &lt;/SPAN&gt;cx_hrbas_violated_assertion&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="L0S52"&gt;ENDTRY&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 07:55:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-foreign-key-relation-while-updating-table-though-program/m-p/10847200#M1885195</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2015-02-05T07:55:32Z</dc:date>
    </item>
  </channel>
</rss>

