<?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 ME_UPDATE_DOCUMENT insert table ekki error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/me-update-document-insert-table-ekki-error/m-p/7842164#M1591043</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm facing the following problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to use the FM ME_UPDATE_DOCUMENT to change a data in a Purchase Order,&lt;/P&gt;&lt;P&gt;but when i execute this function the error "The ABAP/4 Open SQL array insert results in &lt;/P&gt;&lt;P&gt;duplicate database records." happens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below there is the code where the error ocurred.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  
DESCRIBE TABLE xekki LINES sy-tfill.
IF sy-tfill GT 0.
  INSERT ekki FROM TABLE xekki.  --&amp;gt; the error is happening here
  IF sy-subrc NE 0.
    MESSAGE a807 WITH 'EKKI'.
  ENDIF.
  REFRESH xekki.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;During the debug i saw the values that the program was trying to insert. &lt;/P&gt;&lt;P&gt;Looking in the table EKKI the values were really there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I calling the FM in this way:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  
select *
    into corresponding fields of table it_xkomv
    from konv
   where knumv = wa_oekko-knumv.

  CALL FUNCTION 'ME_UPDATE_DOCUMENT'
    EXPORTING
      NEKKO  = wa_nekko
      OEKKO  = wa_oekko
    TABLES
      XEKET  = it_xeket
      XEKKN  = it_xekkn
      XEKPO  = it_xekpo
      XKOMV  = it_xkomv
      YEKET  = it_yeket
      YEKKN  = it_yekkn
      YEKPO  = it_yekpo
      YKOMVI = it_ykomv
      XEKBES = it_xekbe.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do i need to pass diferent parameters for this function?&lt;/P&gt;&lt;P&gt;I don't know how to solve this problem, can anyone 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;P&gt;Fabio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 May 2011 22:52:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-05-05T22:52:29Z</dc:date>
    <item>
      <title>ME_UPDATE_DOCUMENT insert table ekki error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/me-update-document-insert-table-ekki-error/m-p/7842164#M1591043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm facing the following problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to use the FM ME_UPDATE_DOCUMENT to change a data in a Purchase Order,&lt;/P&gt;&lt;P&gt;but when i execute this function the error "The ABAP/4 Open SQL array insert results in &lt;/P&gt;&lt;P&gt;duplicate database records." happens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below there is the code where the error ocurred.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  
DESCRIBE TABLE xekki LINES sy-tfill.
IF sy-tfill GT 0.
  INSERT ekki FROM TABLE xekki.  --&amp;gt; the error is happening here
  IF sy-subrc NE 0.
    MESSAGE a807 WITH 'EKKI'.
  ENDIF.
  REFRESH xekki.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;During the debug i saw the values that the program was trying to insert. &lt;/P&gt;&lt;P&gt;Looking in the table EKKI the values were really there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I calling the FM in this way:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  
select *
    into corresponding fields of table it_xkomv
    from konv
   where knumv = wa_oekko-knumv.

  CALL FUNCTION 'ME_UPDATE_DOCUMENT'
    EXPORTING
      NEKKO  = wa_nekko
      OEKKO  = wa_oekko
    TABLES
      XEKET  = it_xeket
      XEKKN  = it_xekkn
      XEKPO  = it_xekpo
      XKOMV  = it_xkomv
      YEKET  = it_yeket
      YEKKN  = it_yekkn
      YEKPO  = it_yekpo
      YKOMVI = it_ykomv
      XEKBES = it_xekbe.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do i need to pass diferent parameters for this function?&lt;/P&gt;&lt;P&gt;I don't know how to solve this problem, can anyone 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;P&gt;Fabio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2011 22:52:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/me-update-document-insert-table-ekki-error/m-p/7842164#M1591043</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-05T22:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: ME_UPDATE_DOCUMENT insert table ekki error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/me-update-document-insert-table-ekki-error/m-p/7842165#M1591044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fabio,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put a break point at the INSERT statement and check, if there are any duplicate entries in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue here is that either the internal table XEKKI contains duplicate entries or the entries that are being inserted are already existing in EKKI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If XEKKI contains duplicate entries, then debug "ME_UPDATE_DOCUMENT" to see how it is building XEKKI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: All the fields in EKKI are primary keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 May 2011 09:21:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/me-update-document-insert-table-ekki-error/m-p/7842165#M1591044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-06T09:21:20Z</dc:date>
    </item>
  </channel>
</rss>

