<?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: Reg: Exception on INSERT Statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355713#M1399609</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Another thing is I dont want to modify the record. If the record is already present, then i should not insert into the database.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This means that you must use INSERT statement only. UPDATE &amp;amp; MODIFY are not to be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also FYI if you try to insert a record with the same key which exists in the DB you will get the exception  DBIF_RSQL_KEY_ALREADY_EXISTS of class CX_SY_OPEN_SQL_DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be you can get the text of this exception &amp;amp; check what is the error you are getting:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data OREF type ref to CX_ROOT.
data TEXT type STRING.

    CATCH CX_SY_OPEN_SQL_DB into OREF.
      TEXT = OREF-&amp;gt;GET_TEXT( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Nov 23, 2009 11:37 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Nov 2009 10:27:02 GMT</pubDate>
    <dc:creator>SuhaSaha</dc:creator>
    <dc:date>2009-11-23T10:27:02Z</dc:date>
    <item>
      <title>Reg: Exception on INSERT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355707#M1399603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting the CX_SY_OPEN_SQL_DB type of exception quit offen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no duplicate records in the table.  still i am gettin the &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exception. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  TRY.       &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      INSERT ZSC_FOUNDRY_RECS FROM TABLE IT_VAL_FOUNDRY_RECS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CATCH CX_SY_OPEN_SQL_DB.                        &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ROLLBACK WORK.                 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      MESSAGE I234. "Error occured while inserting record into ZSC_FOUNDRY_RECS table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could any one tel mem, what could be the reason for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2009 10:12:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355707#M1399603</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-23T10:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: Exception on INSERT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355708#M1399604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dont check the database table , check the internal table content from which the records are inserted and also consider blank values of field while doing so.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2009 10:15:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355708#M1399604</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-23T10:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: Exception on INSERT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355709#M1399605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;change it as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY ZSC_FOUNDRY_RECS FROM TABLE IT_VAL_FOUNDRY_RECS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2009 10:15:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355709#M1399605</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2009-11-23T10:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: Exception on INSERT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355710#M1399606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;change it as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY ZSC_FOUNDRY_RECS FROM TABLE IT_VAL_FOUNDRY_RECS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i hope the IT_VAL_FOUNDRY_RECS structure is same as of ZSC_FOUNDRY_RECS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2009 10:18:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355710#M1399606</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2009-11-23T10:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: Exception on INSERT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355711#M1399607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have checked bot the Internal table and the Database table.&lt;/P&gt;&lt;P&gt;Another thing is I dont want to modify the record. If the record is already present, then i should not insert into the database.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2009 10:19:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355711#M1399607</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-23T10:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: Exception on INSERT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355712#M1399608</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;Check if you have the MANDT field in your internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2009 10:25:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355712#M1399608</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-23T10:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: Exception on INSERT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355713#M1399609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Another thing is I dont want to modify the record. If the record is already present, then i should not insert into the database.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This means that you must use INSERT statement only. UPDATE &amp;amp; MODIFY are not to be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also FYI if you try to insert a record with the same key which exists in the DB you will get the exception  DBIF_RSQL_KEY_ALREADY_EXISTS of class CX_SY_OPEN_SQL_DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be you can get the text of this exception &amp;amp; check what is the error you are getting:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data OREF type ref to CX_ROOT.
data TEXT type STRING.

    CATCH CX_SY_OPEN_SQL_DB into OREF.
      TEXT = OREF-&amp;gt;GET_TEXT( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Nov 23, 2009 11:37 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2009 10:27:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355713#M1399609</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-11-23T10:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: Exception on INSERT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355714#M1399610</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;Try these things:&lt;/P&gt;&lt;P&gt;1) Use COMMIT WORK AND WAIT after Insert and update statement to release the lock.Check for sy-subrc = 0.&lt;/P&gt;&lt;P&gt;2) Use Select single for update instead of Select single.&lt;/P&gt;&lt;P&gt;3) Rollback if insert statement fails.&lt;/P&gt;&lt;P&gt;4) Try to catch the exception by inserting exception block.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rocky.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2009 10:27:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355714#M1399610</guid>
      <dc:creator>Rocky1</dc:creator>
      <dc:date>2009-11-23T10:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: Exception on INSERT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355715#M1399611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a question, Is there a possibility that, i have inserted records from internal table. I have not used the commit work statement. then i am having another insert statement, where i am trying to update the DB from another internal table.&lt;/P&gt;&lt;P&gt;Wheter, any exeception will be raised?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2009 10:40:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355715#M1399611</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-23T10:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: Exception on INSERT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355716#M1399612</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;Yes, exception will be raised, if within a loop you are trying to insert a data and without committing trying to update or read the data in the next loop pass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Rocky&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2009 10:43:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355716#M1399612</guid>
      <dc:creator>Rocky1</dc:creator>
      <dc:date>2009-11-23T10:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: Exception on INSERT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355717#M1399613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CX_SY_OPEN_SQL_DB not always refer to duplicate records, try to find the actual error in SM21 syslog. (there can be mapping errors on numeric or complex string fields)&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>Mon, 23 Nov 2009 10:52:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-exception-on-insert-statement/m-p/6355717#M1399613</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2009-11-23T10:52:36Z</dc:date>
    </item>
  </channel>
</rss>

