<?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: Unable to insert record in database table with INSERT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646444#M1284935</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Prabhu...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used Modify as suggested by you..butstill no use. unable to inert records into databse table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any clues what i am missing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 May 2009 18:57:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-11T18:57:29Z</dc:date>
    <item>
      <title>Unable to insert record in database table with INSERT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646442#M1284933</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 am trying to insert data into databse table CRMD_PARTNER in CRM. and I wrote the following code.&lt;/P&gt;&lt;P&gt;But the records are not getting inserted. but if i hard code the values then i am able to insert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
.....

if not Jtab[] is initial.
INSERT CRMD_PARTNER FROM TABLE JTAB ACCEPTING DUPLICATE KEYS.
COMMIT WORK.
ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can some one tell me what is wrong? i am unable to insert the records..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jessica Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2009 18:42:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646442#M1284933</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-11T18:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to insert record in database table with INSERT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646443#M1284934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jessica,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you try to insert the new values with duplicates by accepting , it will not insert because it is database table define with some Primary key Fields..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to use the MOdify command instead of Insert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so if any Duplicates comes it will overwrite the existing record if any new record comes it will insert..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 if not Jtab[] is initial.
    loop at JTAB.
       Modify CRMD_PARTNER FROM JTAB .
      if sy-subrc = 0.
        COMMIT WORK.
     else.
        Roll Back.
     endif.
  endloop.
 ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2009 18:48:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646443#M1284934</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-11T18:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to insert record in database table with INSERT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646444#M1284935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Prabhu...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used Modify as suggested by you..butstill no use. unable to inert records into databse table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any clues what i am missing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2009 18:57:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646444#M1284935</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-11T18:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to insert record in database table with INSERT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646445#M1284936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ACCEPTING DUPLICATE KEYS won't allow you to insert more than one record with duplicate keys. It just won't give a non-zero SY-SUBRC if it encounters the situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try pressing F1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2009 19:02:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646445#M1284936</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-11T19:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to insert record in database table with INSERT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646446#M1284937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;H Jessica,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the Table JTAB Structure , it should be equal to the CRMD_PARTNER table structure..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and check r u passing the All key field ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2009 19:04:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646446#M1284937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-11T19:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to insert record in database table with INSERT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646447#M1284938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Possible reasons insert got failed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Same primary key values are already available in table CRMD_PARTNER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this code before making INSERT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at jtab.
v_tabix = sy-tabix. 
  select single * from crmd_partner where &amp;lt;primary key&amp;gt; = jtab-&amp;lt;primary key&amp;gt;
  if sy-subrc 0.
    delete jtab index v_tabix.
     continue.
  endif.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2009 19:06:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646447#M1284938</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-05-11T19:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to insert record in database table with INSERT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646448#M1284939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried everything. I am passing all key fields and my structute of jtab is same as that of  the table, but still i dont see any records being inserted in my table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of Jtab occurs 0.
        INCLUDE STRUCTURE CRMD_PARTNER.
DATA: end of Jtab
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if not Jtab[] is initial.
   loop at JTAB.
      Modify CRMD_PARTNER FROM JTAB .
     if sy-subrc = 0.
       COMMIT WORK.
    else.
       MSG5 = 'SOME RECORD MISSED'.
  MOVE MSG5 TO IT_RESULT-MESSAGE.
  APPEND IT_RESULT.
    endif.
 endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;some one please help..i am trying to insert data into the database and that doesnt get instered ..any clues about what i am missing wil be highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;jessica sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2009 19:50:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646448#M1284939</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-11T19:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to insert record in database table with INSERT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646449#M1284940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jessica,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Is it possible to post the entire program? If the program is too long, please create a short sample program, make sure that doesn't work, and then post the code here.&lt;/P&gt;&lt;P&gt;2) Do you know for a fact that Jtab[] is not initial? Did you go into debug and verify?&lt;/P&gt;&lt;P&gt;3) Don't go in a loop and modify one record at a time. Modify everything in one shot. Place the cursor on MODIFY statement and hit F1 key for the syntax.&lt;/P&gt;&lt;P&gt;4) MODIFY, INSERT, and UPDATE statements work fine. You will have to figure out what you are doing wrong. Code snippets you are posting are not enough for us to guess the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Debugger is a programmer's best friend. Learn to use it, and you will solve most of your programming problems and feel really good by the end of the day.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2009 21:17:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-insert-record-in-database-table-with-insert/m-p/5646449#M1284940</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-11T21:17:57Z</dc:date>
    </item>
  </channel>
</rss>

