<?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 Dump when inserting into a specific table ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766252#M906187</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a specific table just like:&lt;/P&gt;&lt;P&gt;Field          Key&lt;/P&gt;&lt;P&gt;MANDT       X&lt;/P&gt;&lt;P&gt;F1&lt;/P&gt;&lt;P&gt;F2&lt;/P&gt;&lt;P&gt;F3&lt;/P&gt;&lt;P&gt;........................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table contains only one key field is MANDT , then I try to insert using command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT zbc00 FROM TABLE wt_zbc00 ACCEPTING DUPLICATE KEYS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table contain 1 entry .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But then I try to insert 1 more record , It gave me an error ( Sy-subrc = 4 ) , this means that an error has occured .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if I do not use 'ACCEPTING DUPLICATE KEYS' Then It gave a dump .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 May 2008 06:14:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-08T06:14:11Z</dc:date>
    <item>
      <title>Dump when inserting into a specific table ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766252#M906187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a specific table just like:&lt;/P&gt;&lt;P&gt;Field          Key&lt;/P&gt;&lt;P&gt;MANDT       X&lt;/P&gt;&lt;P&gt;F1&lt;/P&gt;&lt;P&gt;F2&lt;/P&gt;&lt;P&gt;F3&lt;/P&gt;&lt;P&gt;........................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table contains only one key field is MANDT , then I try to insert using command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT zbc00 FROM TABLE wt_zbc00 ACCEPTING DUPLICATE KEYS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table contain 1 entry .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But then I try to insert 1 more record , It gave me an error ( Sy-subrc = 4 ) , this means that an error has occured .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if I do not use 'ACCEPTING DUPLICATE KEYS' Then It gave a dump .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 06:14:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766252#M906187</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-08T06:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dump when inserting into a specific table ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766253#M906188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since MANDT is your only primary key, the first entry you created fills MANDT with your current client&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any subsequent entry would have the same client and hence create a duplicate key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence the error&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 06:21:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766253#M906188</guid>
      <dc:creator>former_member189059</dc:creator>
      <dc:date>2008-05-08T06:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dump when inserting into a specific table ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766254#M906189</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;Since your table has 1 key field as mandt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so as per key field it will allow only 1 record per client unless u use accepting duplicate keys.&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;&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 06:21:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766254#M906189</guid>
      <dc:creator>rahul_kamble2</dc:creator>
      <dc:date>2008-05-08T06:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dump when inserting into a specific table ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766255#M906190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried to use 'Accept duplicate entry' but I can not insert into the this table ( sy-subrc = 4 )..&lt;/P&gt;&lt;P&gt;How can I do to make it run ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 06:29:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766255#M906190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-08T06:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dump when inserting into a specific table ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766256#M906191</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;  ........ACCEPTING DUPLICATE KEYS.&lt;/P&gt;&lt;P&gt;this option is used in order avoid dumps in the program when unknowingly the user tries to enter duplicate records....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say if the record which u r trying to insert already exists in the DB , then it will not give u dump and instead will return sy-subrc as 4 to show u that the record was not inserted and user shd check the values which he s trying to insert.(i.e either the record exists thats y in was not inserted or some other inconsistency)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please reward points if useful ..... &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 06:38:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766256#M906191</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-08T06:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dump when inserting into a specific table ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766257#M906192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MANDT is needed in your Z..... table? &lt;/P&gt;&lt;P&gt;I mean it is needed but give another key of the field so that it will work.&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;Madan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: madan mohan reddy on May 8, 2008 12:14 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: madan mohan reddy on May 8, 2008 12:15 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 06:43:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766257#M906192</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-08T06:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dump when inserting into a specific table ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766258#M906193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
If you specify an internal table itab, several rows are created from
 its content for insertion in the database table. A row for insertion 
into the table is taken from each row of the internal table according 
to the same rules as for a single work area Einfügenwa. The line 
type of the internal table has to meet the prerequisites for use in 
Open-SQL statements. 

If a row witht he same primary key or a same unique secondary 
index does not already exist in the database table for any of the 
rows to be inserted, all rows are inserted and sy-subrc is set to 0. 
If the internal table is empty, sy-subrc is also set to 0. The system
 field sy-dbcnt is always set to the number of rows that were 
actually inserted. 

If a row with the same primary key or a same unique secondary 
index already exists in the database table for one or more of the 
rows to be inserted, these rows cannot be inserted. In this situation,
 there are three possibilities: 

Use of ACCEPTING DUPLICATE KEYS 

If the addition ACCEPTING DUPLICATE KEYS is specified, all rows 
are inserted for which this is possible. The remaining rows are 
rejected and sy-subrc is set to 4. The system field sy-dbcnt is set
 to the number of lines that are inserted. 


Handling an exception 

If the addition ACCEPTING DUPLICATE KEYS is not specified, a 
treatable exception occurs CX_SY_OPEN_SQL_DB (it always 
occurs since Release 6.10). Rows are inserted until the exception
 occurs. The number of rows that are inserted is not defined. The 
system fields sy-subrc and sy-dbcnt retain their previous value. 

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got this from F1 help&lt;/P&gt;&lt;P&gt;what it means is that.. lets say &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. You have 5 entries in your internal table to be entered in the db&lt;/P&gt;&lt;P&gt;2. The 4th entry is a duplicate entry (already exists in the db)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using 'ACCEPTING DUPLICATE KEYS' will insert records 1, 2, 3 and 5 into the db&lt;/P&gt;&lt;P&gt;without using it, only records 1, 2 and 3 will be inserted&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 06:47:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766258#M906193</guid>
      <dc:creator>former_member189059</dc:creator>
      <dc:date>2008-05-08T06:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dump when inserting into a specific table ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766259#M906194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes , But here I want to insert the duplicate entry too , So is there any way to do this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 06:53:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766259#M906194</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-08T06:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dump when inserting into a specific table ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766260#M906195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do one of the following things&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. remove the mandt field from the db&lt;/P&gt;&lt;P&gt;2. declare one or more of the f1, f2, f3 fields as part of your primary key&lt;/P&gt;&lt;P&gt;3. create another field in the db table such as counter, make it part of the primary key and use it as a count entering different numbers every time&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 06:57:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump-when-inserting-into-a-specific-table/m-p/3766260#M906195</guid>
      <dc:creator>former_member189059</dc:creator>
      <dc:date>2008-05-08T06:57:44Z</dc:date>
    </item>
  </channel>
</rss>

