Description |
When we are doing a production in MFG Screen, we are calling the SP " *uspICPostCosting* " while producing a lot.
It is throwing unit level error. This is a blocker for MFG Module.
==============================================
{color:#ff0000} *If you run the below script, you will get the same error:* {color}
DECLARE @ItemsForPost AS ItemCostingTableType
INSERT INTO @ItemsForPost (
intItemId
,intItemLocationId
,intItemUOMId
,dtmDate
,dblQty
,dblUOMQty
,dblCost
,dblSalesPrice
,intCurrencyId
,dblExchangeRate
,intTransactionId
,strTransactionId
,intTransactionTypeId
,intLotId
,intSubLocationId
,intStorageLocationId
)
SELECT intItemId = 59
,intItemLocationId = 47
,intItemUOMId = 245
,dtmDate = '2015-10-16'
,dblQty = 60.000000
,dblUOMQty = 1
,dblCost = 0
,dblSalesPrice = 0
,intCurrencyId = NULL
,dblExchangeRate = 1
,intTransactionId = 1
,strTransactionId = 'ABC'
,intTransactionTypeId = 9
,intLotId = 8127
,intSubLocationId = 11
,intStorageLocationId = 6
EXEC dbo. *{color:#ff0000}uspICPostCosting {color}* @ItemsForPost
,'BATCH-1640'
,NULL
,1
====================================================================
*Error message:*
(1 row(s) affected)
Msg 8672, Level 16, State 1, Procedure uspICPostStockQuantity, Line 98
The MERGE statement attempted to UPDATE or DELETE the same row more than once. This happens when a target row matches more than one source row. A MERGE statement cannot UPDATE/DELETE the same row of the target table multiple times. Refine the ON clause to ensure a target row matches at most one source row, or use the GROUP BY clause to group the source rows.
|