Dump with message 'The ABAP/4 Open SQL array insert results in duplicate database records.' happens during replication of Employee data from SF EC to ERP system.
- Replicating Employee master data and organizational assignment data from Employee Central to SAP ERP HCM(BIB)
Reproducing the Issue
Replicate employee data and org.assignment data from EC to ERP.
Duplicated data exists on key field in table a_ecpao_invt_infty_new_db_tab which is used to update DDIC inventory table ECPAO_INVT_INFTY.
Employee has country reassignment, the company code is changed, in this situation, there will be new pernr generated in standard design.
However you implement the BADI 'ECPAO_IN_EXT_PERNR_MAP' to assign SF external employee ID to pernr, so original pernr in old company code is used again in new company code.
It causes that two same pernr information exists in PERNR_STRUCTURE_TAB. Thus, infotypes are added into a_ecpao_invt_infty_new_db_tab twice. Then dump happens.
For country reassignment or company code change scenario, new pernr should be generated for new Org. assignment.
You should not simply implement BADI 'ECPAO_IN_EXT_PERNR_MAP' to assign SF external employee ID.
ECPAO_INVT_INFTY; SAPSQL_ARRAY_INSERT_DUPREC; CX_SY_OPEN_SQL_DB; FLUSH" "(METHOD) , KBA , LOD-SF-INT-SAP , SAP OnPremise Payroll & Migration , Problem