Integration error "Invalid UoM; specify a purchase or sales UoM from ITM3 [ITM9.UomEntry][line: 1]"

Integration error "Invalid UoM; specify a purchase or sales UoM from ITM3 [ITM9.UomEntry][line: 1]"

****** Internal Article ************

Problem Statement

Failed Integration records from iVend to SAP Source type 46 (product), error
"System.Exception: DI:1470000147 - Invalid UoM; specify a purchase or sales UoM from ITM3 [ITM9.UomEntry][line: 1] en
ReplicationSBOIntegrationWinSer.IntegrationObjects.Item.Replicate(Direction From, Direction To, Int32 DatasetRowID)en ReplicationSBOIntegrationWinSer.Integrator.MainStart(DateTime LastRetryAt, Boolean&) Retried "and for Sourcetype 59 (UPCTranslation) also error:
"System.Exception: DI:1470000147 - Invalid UoM; specify a purchase or sales UoM from ITM3 [ITM9.UomEntry][line: 1]en
ReplicationSBOIntegrationWinSer.IntegrationObjects.UPCTranslation90.Replicate(Direction From, Direction To, Int32 DatasetRowID)en ReplicationSBOIntegrationWinSer.IntegrationObjects.UPCTranslation.Replicate(Direction From, Direction To, Int32 DatasetRowID)
en ReplicationSBOIntegrationWinSer.Integrator.MainStart(DateTime LastRetryAt, Boolean& Retried)"

Below is the screenshot of the errors:


Cause

UOM showing at GUI was correct however the data in the relevant tables were not in sync. 
We analyzed that UOM for this failed item was showing in SAP UI Item master data screen as Lets say "Box" under the UoM Code however when we checked SAP table it was linked with UOM code Lets say "Pair" in table OUOM and ITM9 hence causing the issue.
Example:
ItemCode 'A' has UomCode assigned 'Box'
Select * from OITM where ItemCode = 'A'
Select * from ITM3 where ItemCode = 'A' --Pick UomEntry from here
Select * from ITM9 where ItemCode = 'A' --Pick UomEntry from here, Lets say UomEntry =2
Select * from OUOM where UomEntry = '2' --Result UomCode = 'Pair' which is different from actual UomCode 'Box' of this ItemCode A hence causing the issue.

Resolution

Link the product with correct UOM in SAP then retry all related failed records in Integration failure monitor to resolve the issue.