‎2011 May 05 11:52 PM
Hi experts,
I'm facing the following problem:
I'm trying to use the FM ME_UPDATE_DOCUMENT to change a data in a Purchase Order,
but when i execute this function the error "The ABAP/4 Open SQL array insert results in
duplicate database records." happens.
Below there is the code where the error ocurred.
DESCRIBE TABLE xekki LINES sy-tfill.
IF sy-tfill GT 0.
INSERT ekki FROM TABLE xekki. --> the error is happening here
IF sy-subrc NE 0.
MESSAGE a807 WITH 'EKKI'.
ENDIF.
REFRESH xekki.
ENDIF.
During the debug i saw the values that the program was trying to insert.
Looking in the table EKKI the values were really there.
I calling the FM in this way:
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.
Do i need to pass diferent parameters for this function?
I don't know how to solve this problem, can anyone help me?
Thanks
Fabio
‎2011 May 06 10:21 AM
Hi Fabio,
Put a break point at the INSERT statement and check, if there are any duplicate entries in the internal table.
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.
If XEKKI contains duplicate entries, then debug "ME_UPDATE_DOCUMENT" to see how it is building XEKKI.
Note: All the fields in EKKI are primary keys.
Regards,
Chen