<?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 INSERT into database Keyword in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132129#M988124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the INSERT keyword to add new entries to a database table, will it append to the existing entries, or will it overwrite the existing entries...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need it only to append, so if it does overwrite, which keywork can i use?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points will be awarded&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Jul 2008 06:22:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-04T06:22:20Z</dc:date>
    <item>
      <title>INSERT into database Keyword</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132129#M988124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the INSERT keyword to add new entries to a database table, will it append to the existing entries, or will it overwrite the existing entries...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need it only to append, so if it does overwrite, which keywork can i use?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points will be awarded&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jul 2008 06:22:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132129#M988124</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-04T06:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into database Keyword</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132130#M988125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Insert :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adds new record to database table..&lt;/P&gt;&lt;P&gt;This will over write if already existing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead use Modify..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modify :&lt;/P&gt;&lt;P&gt;Inserts new lines  or updates existing lines in a database table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jul 2008 06:25:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132130#M988125</guid>
      <dc:creator>sachin_mathapati</dc:creator>
      <dc:date>2008-07-04T06:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into database Keyword</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132131#M988126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christiaan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "INSERT" statement will always inserts a new record in &lt;/P&gt;&lt;P&gt;the Database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"UPDATE" statement is used to overwrite the details&lt;/P&gt;&lt;P&gt;of the existing record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(See &lt;STRONG&gt;MODIFY&lt;/STRONG&gt; Statement also.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Murthy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jul 2008 06:27:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132131#M988126</guid>
      <dc:creator>former_member787646</dc:creator>
      <dc:date>2008-07-04T06:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into database Keyword</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132132#M988127</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;INSERT will not modify an existing entry, it will only append. To modify there is another keyword MODIFY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the below help also:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;INSERT { {INTO target VALUES source }&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;       &lt;STRONG&gt;| {     target FROM   source } }.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The INSERT statement inserts one or more rows specified in source in the database table specified in target. The two variants with INTO and VALUES or without INTO with FROM behave identically, with the exception that you cannot specify any internal tables in source after VALUES. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System Fields &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The INSERT statement sets the values of the system fields sy-subrc and sy-dbcnt. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sy-subrc Meaning &lt;/P&gt;&lt;P&gt;0 At least one row was inserted. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4 At least one row could not be inserted, because the database table already contains a row with the same primary key or a unique secondary index.&lt;/STRONG&gt; &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;Soumya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jul 2008 06:28:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132132#M988127</guid>
      <dc:creator>soumya_jose3</dc:creator>
      <dc:date>2008-07-04T06:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into database Keyword</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132133#M988128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christiaan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No it won't. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From SAP Help:&lt;/P&gt;&lt;P&gt;The INSERT statement sets the values of the system fields sy-subrc and sy-dbcnt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sy-subrc Meaning &lt;/P&gt;&lt;P&gt;0 At least one row was inserted. &lt;/P&gt;&lt;P&gt;4 At least one row could not be inserted, because the database table already contains a row with the same primary key or a unique secondary index. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The INSERT statement sets sy-dbcnt to the number of rows inserted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Victor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jul 2008 06:28:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132133#M988128</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-04T06:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into database Keyword</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132134#M988129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try this sample coding,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES:MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:ITAB LIKE MARA OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-MATNR = '123ABCDA'. .&lt;/P&gt;&lt;P&gt;ITAB-MBRSH = 'C'.&lt;/P&gt;&lt;P&gt;ITAB-MTART = 'FERT' .&lt;/P&gt;&lt;P&gt;ITAB-MEINS = 'KG' .&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-MATNR = '123ABCDB'. .&lt;/P&gt;&lt;P&gt;ITAB-MBRSH = 'C'.&lt;/P&gt;&lt;P&gt;ITAB-MTART = 'FERT' .&lt;/P&gt;&lt;P&gt;ITAB-MEINS = 'KG' .&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;INSERT MARA FROM ITAB.&lt;/P&gt;&lt;P&gt;MODIFY MARA .&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpfull&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Y.R.Prem Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jul 2008 06:29:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132134#M988129</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-04T06:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into database Keyword</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132135#M988130</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;INSERT is used to append..&lt;/P&gt;&lt;P&gt;MODIFY will change the existing enties...&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;Sai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jul 2008 06:30:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132135#M988130</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-04T06:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into database Keyword</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132136#M988131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Insert will only and only insert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;update will only update,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify is trying to insert, if this will fail, it will update.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jul 2008 06:35:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132136#M988131</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2008-07-04T06:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into database Keyword</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132137#M988132</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;We can use &lt;STRONG&gt;modify&lt;/STRONG&gt; statement so that even if in the case of for appending a new line or updating a existing line , the same command can work. So Modify best suites your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Answer to your question is that INSERT only appends a new line but donot update existing line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Modify :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Inserts new lines or updates existing lines in a database table (s. relational database). If a line with the specified primary key already exists, an UPDATE is executed. Otherwise, an INSERT is performed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system field &lt;STRONG&gt;SY-DBCNT&lt;/STRONG&gt; contains the number of lines processed after the call of the statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Return Code is set as follows : &lt;/P&gt;&lt;P&gt;SY-SUBRC = 0 : &lt;/P&gt;&lt;P&gt;All lines were successfully inserted or updated. &lt;/P&gt;&lt;P&gt;SY-SUBRC = 4 : &lt;/P&gt;&lt;P&gt;One or more lines could not be inserted or updated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this clarifies your doubt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;dhanashri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jul 2008 06:41:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132137#M988132</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-04T06:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into database Keyword</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132138#M988133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;                   INSERT  command is used to APPEND  the values .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for EXAMPLE :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                 Data: Begin of line,&lt;/P&gt;&lt;P&gt;		  col1 type I,&lt;/P&gt;&lt;P&gt;		  col2 type I,&lt;/P&gt;&lt;P&gt;		End of line.&lt;/P&gt;&lt;P&gt;		Data itab like line occurs 10.&lt;/P&gt;&lt;P&gt;		&lt;/P&gt;&lt;P&gt;		Do 2 times.&lt;/P&gt;&lt;P&gt;		   Line-col1 = sy-index.&lt;/P&gt;&lt;P&gt;		   Line-col2 = sy-index ** 2.&lt;/P&gt;&lt;P&gt;		   Append line to itab.&lt;/P&gt;&lt;P&gt;		Enddo&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;		Line-col1 = 11.&lt;/P&gt;&lt;P&gt;		Line-col2 = 22.&lt;/P&gt;&lt;P&gt;		Insert line into itab index 2.&lt;/P&gt;&lt;P&gt;		Insert initial line into itab index 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;		Loop at itab into line.&lt;/P&gt;&lt;P&gt;		   Write: / sy-tabix, Line-col1, Line-col2.&lt;/P&gt;&lt;P&gt;		Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPLANATION :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us consider the example. Here the internal table ITAB is defined to have the structure of line and does not have a Header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the DO LOOP, the columns of the structure are assigned the values of SY-INDEX and its square. SY-INDEX is another system variable which has the value of the loop iteration. At the end of the loop the table ITAB will have following contents:&lt;/P&gt;&lt;P&gt;	1	1&lt;/P&gt;&lt;P&gt;	2	4&lt;/P&gt;&lt;P&gt;Next we are trying to insert the line with values 11 and 22 at index 2. &lt;/P&gt;&lt;P&gt; 	1 	1&lt;/P&gt;&lt;P&gt;	11	22	&lt;/P&gt;&lt;P&gt;	2	4&lt;/P&gt;&lt;P&gt;The next line inserts an initial line at index 1. So, the table contents now become&lt;/P&gt;&lt;P&gt;	0	0&lt;/P&gt;&lt;P&gt;	1	1&lt;/P&gt;&lt;P&gt;	11	22&lt;/P&gt;&lt;P&gt;	2	4&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jul 2008 06:54:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-database-keyword/m-p/4132138#M988133</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-04T06:54:48Z</dc:date>
    </item>
  </channel>
</rss>

