<?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: Insert/Update fields into custom table by checking key field in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-update-fields-into-custom-table-by-checking-key-field/m-p/6276337#M1387466</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;  Get the data of your table DEPT into internal table.&lt;/P&gt;&lt;P&gt;  while inserting the data check if the work area Deptid id is present in the internal table of DEPT.&lt;/P&gt;&lt;P&gt;  if yes then insert the record into the EMP table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 14 Nov 2009 06:15:21 GMT</pubDate>
    <dc:creator>nirajgadre</dc:creator>
    <dc:date>2009-11-14T06:15:21Z</dc:date>
    <item>
      <title>Insert/Update fields into custom table by checking key field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-update-fields-into-custom-table-by-checking-key-field/m-p/6276336#M1387465</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;I have to two tables like Dept in which fields are&lt;/P&gt;&lt;P&gt;DEPT&lt;/P&gt;&lt;P&gt;===========&lt;/P&gt;&lt;P&gt; CLNT&lt;/P&gt;&lt;P&gt; DEPTID( PK )&lt;/P&gt;&lt;P&gt; ,DEPTNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another table is EMP, the fields are&lt;/P&gt;&lt;P&gt;EMP&lt;/P&gt;&lt;P&gt;============&lt;/P&gt;&lt;P&gt;CLNT&lt;/P&gt;&lt;P&gt;EMPID(PK)&lt;/P&gt;&lt;P&gt;DEPTID(PK)&lt;/P&gt;&lt;P&gt;EMPNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this created a foreign key relation ship withEMP-DEPTID =  DEPt-Deptid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to insert some records to my custom table EMP.&lt;/P&gt;&lt;P&gt;There It should accept only emp-deptid value if it exists in Dept-deptid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what statement I should write.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I write " insert into zEMP values &amp;lt;workarea&amp;gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Nov 2009 06:08:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-update-fields-into-custom-table-by-checking-key-field/m-p/6276336#M1387465</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-14T06:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Insert/Update fields into custom table by checking key field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-update-fields-into-custom-table-by-checking-key-field/m-p/6276337#M1387466</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;  Get the data of your table DEPT into internal table.&lt;/P&gt;&lt;P&gt;  while inserting the data check if the work area Deptid id is present in the internal table of DEPT.&lt;/P&gt;&lt;P&gt;  if yes then insert the record into the EMP table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Nov 2009 06:15:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-update-fields-into-custom-table-by-checking-key-field/m-p/6276337#M1387466</guid>
      <dc:creator>nirajgadre</dc:creator>
      <dc:date>2009-11-14T06:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Insert/Update fields into custom table by checking key field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-update-fields-into-custom-table-by-checking-key-field/m-p/6276338#M1387467</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;This is very simple...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.Just before the insert statement READ TABLE DEPT WITH DEPTid = DEPTID.&lt;/P&gt;&lt;P&gt;2. check for sy-subrc value for 0&lt;/P&gt;&lt;P&gt;3.if yes then insert else prompt the erroe message or do nothing depending upon the requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pooja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Nov 2009 15:05:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-update-fields-into-custom-table-by-checking-key-field/m-p/6276338#M1387467</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-14T15:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Insert/Update fields into custom table by checking key field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-update-fields-into-custom-table-by-checking-key-field/m-p/6276339#M1387468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pooja,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not in front of the SAP Login now. So, can't confirm.&lt;/P&gt;&lt;P&gt;Doesn't the table throw an error when there is a foreign key violation?? &lt;/P&gt;&lt;P&gt;I didn't know we were supposed to write a check explicitly !!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@OP&lt;/P&gt;&lt;P&gt;I am not too sure about this. Probably you can check for yourself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Nov 2009 15:30:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-update-fields-into-custom-table-by-checking-key-field/m-p/6276339#M1387468</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-14T15:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Insert/Update fields into custom table by checking key field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-update-fields-into-custom-table-by-checking-key-field/m-p/6276340#M1387469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its better that you create a foreign key relationship between these two tables.&lt;/P&gt;&lt;P&gt;Are you using table maintenance to insert data ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if its from your program just use &lt;STRONG&gt;modify table&lt;/STRONG&gt; statement&lt;/P&gt;&lt;P&gt;Check F1 help documentation for &lt;STRONG&gt;modify table&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Nov 2009 15:32:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-update-fields-into-custom-table-by-checking-key-field/m-p/6276340#M1387469</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2009-11-14T15:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: Insert/Update fields into custom table by checking key field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-update-fields-into-custom-table-by-checking-key-field/m-p/6276341#M1387470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bachi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the existance of record in foregin table and then only insert the record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first insert in the foregin key table and then insert your table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you get it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Nov 2009 15:34:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-update-fields-into-custom-table-by-checking-key-field/m-p/6276341#M1387470</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-14T15:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: Insert/Update fields into custom table by checking key field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-update-fields-into-custom-table-by-checking-key-field/m-p/6276342#M1387471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using table maintenance to insert data ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;before table updation just put a query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single * from table1 where empid =empid.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;"True&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;"false.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try function module &lt;STRONG&gt;HELP_VALUES_GET_WITH_CHECKTAB&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also Check F1 help documentation for &lt;STRONG&gt;modify table&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Nov 2009 15:37:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-update-fields-into-custom-table-by-checking-key-field/m-p/6276342#M1387471</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2009-11-14T15:37:57Z</dc:date>
    </item>
  </channel>
</rss>

