<?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 Problem to insert on dbtable in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-to-insert-on-dbtable/m-p/2075098#M430022</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  Z99BW047.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables : Z99BW69,Z99BW92.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: begin of ITAB1 occurs 0.&lt;/P&gt;&lt;P&gt;  INCLUDE STRUCTURE Z99BW69.&lt;/P&gt;&lt;P&gt;DATA: end of ITAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: begin of ITAB2 occurs 0.&lt;/P&gt;&lt;P&gt;  INCLUDE STRUCTURE Z99BW69.&lt;/P&gt;&lt;P&gt;DATA: end of ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Seleccionamos los PC en una table interna&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from Z99BW69&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE ITAB1&lt;/P&gt;&lt;P&gt;where  VGART ='PC'.&lt;/P&gt;&lt;P&gt;**aND BLDAT ='20060320'&lt;/P&gt;&lt;P&gt;*and MATNR = '000000000000000021'&lt;/P&gt;&lt;P&gt;*and BUKRS ='S00'&lt;/P&gt;&lt;P&gt;*and POPER = '003'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*ordenamos la tabla interna para hacer el AT NEW.&lt;/P&gt;&lt;P&gt;sort itab1 by MANDT BUKRS MATNR POPER BLDAT BELNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Cojemos solo aquellos valors que cambien con el AT NEW.&lt;/P&gt;&lt;P&gt;LOOP AT ITAB1.&lt;/P&gt;&lt;P&gt;AT NEW POPER.&lt;/P&gt;&lt;P&gt;read table itab1 index sy-tabix.&lt;/P&gt;&lt;P&gt;append itab1 to itab2.&lt;/P&gt;&lt;P&gt;ENDAT.&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;break-point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete from Z99BW92.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB2.&lt;/P&gt;&lt;P&gt;read table itab2 index sy-tabix.&lt;/P&gt;&lt;P&gt;INSERT Z99BW92 FROM TABLE ITAB2 ACCEPTING DUPLICATE KEYS.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;break-point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ANd I define Z99BW92 with this keys:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MANDT	CLNT&lt;/P&gt;&lt;P&gt;BUKRS	CHAR&lt;/P&gt;&lt;P&gt;MATNR	CHAR&lt;/P&gt;&lt;P&gt;POPER	NUMC&lt;/P&gt;&lt;P&gt;BLDAT	DATS&lt;/P&gt;&lt;P&gt;CK_BELNR	CHAR&lt;/P&gt;&lt;P&gt;CK_KJAHR	NUMC&lt;/P&gt;&lt;P&gt;CK_MLPOS	NUMC&lt;/P&gt;&lt;P&gt;BDATJ	NUMC&lt;/P&gt;&lt;P&gt;CURTP	CHAR&lt;/P&gt;&lt;P&gt;CPUDT	DATS&lt;/P&gt;&lt;P&gt;TCODE	CHAR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in the final LOOP, if I dont write ACCEPTING DUPLICATE KEYS, the program create a dump in the second register. And the registers are diferents!!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And If I write ACCEPTING DUPLICATE KEYS, the program goes to slow !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont understand anything.... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Mar 2007 13:40:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-28T13:40:23Z</dc:date>
    <item>
      <title>Problem to insert on dbtable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-to-insert-on-dbtable/m-p/2075098#M430022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  Z99BW047.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables : Z99BW69,Z99BW92.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: begin of ITAB1 occurs 0.&lt;/P&gt;&lt;P&gt;  INCLUDE STRUCTURE Z99BW69.&lt;/P&gt;&lt;P&gt;DATA: end of ITAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: begin of ITAB2 occurs 0.&lt;/P&gt;&lt;P&gt;  INCLUDE STRUCTURE Z99BW69.&lt;/P&gt;&lt;P&gt;DATA: end of ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Seleccionamos los PC en una table interna&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from Z99BW69&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE ITAB1&lt;/P&gt;&lt;P&gt;where  VGART ='PC'.&lt;/P&gt;&lt;P&gt;**aND BLDAT ='20060320'&lt;/P&gt;&lt;P&gt;*and MATNR = '000000000000000021'&lt;/P&gt;&lt;P&gt;*and BUKRS ='S00'&lt;/P&gt;&lt;P&gt;*and POPER = '003'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*ordenamos la tabla interna para hacer el AT NEW.&lt;/P&gt;&lt;P&gt;sort itab1 by MANDT BUKRS MATNR POPER BLDAT BELNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Cojemos solo aquellos valors que cambien con el AT NEW.&lt;/P&gt;&lt;P&gt;LOOP AT ITAB1.&lt;/P&gt;&lt;P&gt;AT NEW POPER.&lt;/P&gt;&lt;P&gt;read table itab1 index sy-tabix.&lt;/P&gt;&lt;P&gt;append itab1 to itab2.&lt;/P&gt;&lt;P&gt;ENDAT.&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;break-point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete from Z99BW92.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB2.&lt;/P&gt;&lt;P&gt;read table itab2 index sy-tabix.&lt;/P&gt;&lt;P&gt;INSERT Z99BW92 FROM TABLE ITAB2 ACCEPTING DUPLICATE KEYS.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;break-point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ANd I define Z99BW92 with this keys:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MANDT	CLNT&lt;/P&gt;&lt;P&gt;BUKRS	CHAR&lt;/P&gt;&lt;P&gt;MATNR	CHAR&lt;/P&gt;&lt;P&gt;POPER	NUMC&lt;/P&gt;&lt;P&gt;BLDAT	DATS&lt;/P&gt;&lt;P&gt;CK_BELNR	CHAR&lt;/P&gt;&lt;P&gt;CK_KJAHR	NUMC&lt;/P&gt;&lt;P&gt;CK_MLPOS	NUMC&lt;/P&gt;&lt;P&gt;BDATJ	NUMC&lt;/P&gt;&lt;P&gt;CURTP	CHAR&lt;/P&gt;&lt;P&gt;CPUDT	DATS&lt;/P&gt;&lt;P&gt;TCODE	CHAR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in the final LOOP, if I dont write ACCEPTING DUPLICATE KEYS, the program create a dump in the second register. And the registers are diferents!!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And If I write ACCEPTING DUPLICATE KEYS, the program goes to slow !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont understand anything.... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2007 13:40:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-to-insert-on-dbtable/m-p/2075098#M430022</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-28T13:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to insert on dbtable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-to-insert-on-dbtable/m-p/2075099#M430023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you are using the FROM TABLE syntax, there is no reason to LOOP it.  This is your problem.  This should be all you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;break-point.

delete from Z99BW92.

INSERT Z99BW92 FROM TABLE ITAB2.

break-point.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2007 13:44:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-to-insert-on-dbtable/m-p/2075099#M430023</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-03-28T13:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to insert on dbtable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-to-insert-on-dbtable/m-p/2075100#M430024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of course, you can keep the ACCEPTING DUP KEYS too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;break-point.
 
delete from Z99BW92.
 
INSERT Z99BW92 FROM TABLE ITAB2 ACCEPTING DUPLICATE KEYS.
 
break-point.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2007 13:45:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-to-insert-on-dbtable/m-p/2075100#M430024</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-03-28T13:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to insert on dbtable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-to-insert-on-dbtable/m-p/2075101#M430025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot ! i didnt see it ! &lt;span class="lia-unicode-emoji" title=":winking_face_with_tongue:"&gt;😜&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2007 13:47:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-to-insert-on-dbtable/m-p/2075101#M430025</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-28T13:47:21Z</dc:date>
    </item>
  </channel>
</rss>

