<?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: Modify dbtab Statement WIth Check Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298365#M1725932</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vikram,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you said it works if i'm updating the Table if the entry with primary exists .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let says if the records doesn't exist then i have to insert the record if the id exists in EMP_ID table (WHich is the check table for ID field of EMP_PAY Table) . Again this is much simple example , i have 10 check tables for 10 different columns in a table , so i have to take each field and get the check table and see that records exists in the check table .. its a tedious job&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought when SAP does this check for you when you're creating entries from SE11 why not from Program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Mar 2013 16:19:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2013-03-05T16:19:17Z</dc:date>
    <item>
      <title>Modify dbtab Statement WIth Check Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298363#M1725930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 tables say &lt;/P&gt;&lt;P&gt;EMP_ID Table&amp;nbsp; with fields&amp;nbsp; ID and Name&amp;nbsp; and i have EMP_PAY Table with 2 fields ID and Pay&amp;nbsp; (In both the Tables my ID is Primary key)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to have entry with ID and Pay in EMP_PAY , i need to have an entry EMP_ID Table with ID and Name so i add check table EMP_ID&amp;nbsp; to ID field in EMP_PAY table and it works fine when i try to create entries directly using SE 11&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i have written a small program using Modify Statement to insert a record in EMP_PAY with an ID that doesn't exist in EMP_ID ( From SE11 it gives me an error saying record doesn't exist in EMP_ID Table but with modify statement in abap program it creates and entry and returns SY-subrc eq 0 and SY-DBCNT = 1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 files that user uploads ,if he uploads the EMP_PAY file first it should update EMP_PAY table only if the the records exist in EMP_PAY and EMP_ID and do an insert if it ID exists in EMP_ID table and doesn't exist in EMP_PAY. To cover these 2 bases i have used Modify Statement but its not working as i intented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've an internal table that needs to Update EMP_PAY , is there any simple way to tell me what are rejected records because of no correponding entry in EMP_ID Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 14:45:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298363#M1725930</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-05T14:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Modify dbtab Statement WIth Check Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298364#M1725931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Venkat, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to have the code optimized for performance, the normal tendency is to use the internal table to update/insert records. This way we hit the DB just once instead of writing insert/modify inside a loop. This is the best approach. Unfortunately this will not tell you what records were successfully updated and what not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the only to check this is to perform a select on the DB table against the records in your internal table after the insert is done. Then loop thru the records and compare.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vikram.M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 15:24:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298364#M1725931</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-05T15:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Modify dbtab Statement WIth Check Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298365#M1725932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vikram,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you said it works if i'm updating the Table if the entry with primary exists .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let says if the records doesn't exist then i have to insert the record if the id exists in EMP_ID table (WHich is the check table for ID field of EMP_PAY Table) . Again this is much simple example , i have 10 check tables for 10 different columns in a table , so i have to take each field and get the check table and see that records exists in the check table .. its a tedious job&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought when SAP does this check for you when you're creating entries from SE11 why not from Program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 16:19:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298365#M1725932</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-05T16:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Modify dbtab Statement WIth Check Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298366#M1725933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Venkat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are declaring EMP_ID as a foreign key?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see &lt;A href="https://help.sap.com/saphelp_nw04/helpdata/en/cf/21ea77446011d189700000e8322d00/content.htm"&gt;https://help.sap.com/saphelp_nw04/helpdata/en/cf/21ea77446011d189700000e8322d00/content.htm&lt;/A&gt; for documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 16:45:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298366#M1725933</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-05T16:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Modify dbtab Statement WIth Check Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298367#M1725934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve ,&lt;/P&gt;&lt;P&gt;I understand the concept of Foregin and Check Table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have maintained it the check table and foregin key in SE11 and it works fine when i try to create an entry in EMP_PAY, ID in EMP_PAY will need t have an entry in EMP_ID Table - This works when i create entry in table using SE11 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i insert a new record using SE38 Program iusing Modify Statement it won;t check the check table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say My EMP_ID has following records &lt;/P&gt;&lt;P&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; def&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assume EMP_PAY is Blank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if i try to create a record using SE11 Like&lt;/P&gt;&lt;P&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;Pay&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp; , it won't let me save that record because ID = 3 doesn't exist in EMP_ID Table and i get an error message&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now say i do the same using an ABAP Program and my internal table&amp;nbsp; itab has record&lt;/P&gt;&lt;P&gt;id&amp;nbsp;&amp;nbsp;&amp;nbsp; pay&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nowi say MODIFY EMP_PAY FROM ITAB. (It returns SY-SUBRC EQ 0 and SY-DBCNT = 1) AND When i check the EMP_PAY Table it has 1 new record 3 and 10 and still ID =3 Doesn't exist in EMP_ID &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anything in SAP which check the corresponding check&amp;nbsp; Table if a field has one &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you see the Foreign Check Table Link in SE11 -It says Check Table Box checked on screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/192245" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 17:58:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298367#M1725934</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-05T17:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Modify dbtab Statement WIth Check Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298368#M1725935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The MODIFY statement will only take care of INSERT or UPDATE if record exists already in target table. But it will not take any care of foreign keys constraints. You have to code this contraint yourself as SAP do in generated SE11 report or SM30 dialog maintenance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, read from file data to be updated or inserted. Then check for constraints (eg. SELECT from foreign_key_table(s) FOR ALL ENTRIES IN table_to_update, then remove records without match in the new extracted table, and use INSERT/UPDATE or MODIFY statement on the resulting internal table.&lt;/P&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>Tue, 05 Mar 2013 18:09:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298368#M1725935</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2013-03-05T18:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Modify dbtab Statement WIth Check Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298369#M1725936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Venkat, This is cuz the statement MODIFY does not check for foreign key constraints but INSERT does. If you are always expecting records to be inserted, just go for insert&amp;nbsp; than MODIFY. Otherwise you first need to check if the key exists and then based on that decide whether to use modify or insert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vikram.M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 22:46:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298369#M1725936</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-05T22:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Modify dbtab Statement WIth Check Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298370#M1725937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vikram,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think even INSERT checks for foreign key constraints. Whether you are inserting or updating (or modifying) records programmatically, the foreign key constraints won't be enforced.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 03:29:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298370#M1725937</guid>
      <dc:creator>kakshat</dc:creator>
      <dc:date>2013-03-06T03:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Modify dbtab Statement WIth Check Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298371#M1725938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Venkat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree to &lt;A __default_attr="311021" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://community.sap.com/"&gt;&lt;/A&gt;&lt;SPAN&gt; and &lt;A __default_attr="12565" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://community.sap.com/" modifiedtitle="true" title="Kumar Akshat"&gt;&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Foreign key is not checked by INSERT MODIFY and UPDATE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You will have write in the program Select from check table to check if the entry present then INSERT or MODIFY.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks &amp;amp; Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Vignesh Yeram&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 10:27:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298371#M1725938</guid>
      <dc:creator>vigneshyeram</dc:creator>
      <dc:date>2013-03-06T10:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Modify dbtab Statement WIth Check Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298372#M1725939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks All. I just need a confirmation before i strted writing the code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 14:11:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298372#M1725939</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-06T14:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Modify dbtab Statement WIth Check Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298373#M1725940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kumar. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 10:12:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298373#M1725940</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-07T10:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Modify dbtab Statement WIth Check Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298374#M1725941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1245/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt; No problem!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 10:21:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-dbtab-statement-with-check-table/m-p/9298374#M1725941</guid>
      <dc:creator>kakshat</dc:creator>
      <dc:date>2013-03-07T10:21:21Z</dc:date>
    </item>
  </channel>
</rss>

