Wednesday, 17 August 2016

"CSTPACWC: complete:250:ORA-01426: numeric overflow" Error log in "Actual Cost Worker"

Error log in Actual Cost Worker" 
Cause
In stmt num 30 of procedure calc_average_cost, calculation of new_cost and variance_amount is
done without applying any rounding logic. Figures resulting from this calcualtion could
contribute to numeric overflow.

Solution
To implement the solution, please execute the following steps:

Datafix.
============
STEP 1 :
Run following datafix.
a) Datafix - 1 :
UPDATE CST_LAYER_COST_DETAILS
SET item_cost = ROUND(item_cost, 30);
commit;

b) Datafix - 2 :
UPDATE CST_QUANTITY_LAYERS
SET item_cost = ROUND(item_cost, 30),
PL_MATERIAL = ROUND(PL_MATERIAL, 30),
TL_MATERIAL = ROUND(TL_MATERIAL, 30),
PL_MATERIAL_OVERHEAD=ROUND(PL_MATERIAL_OVERHEAD,30),
TL_MATERIAL_OVERHEAD=ROUND(TL_MATERIAL_OVERHEAD,30),
PL_RESOURCE =ROUND(PL_RESOURCE,30),
TL_RESOURCE=ROUND(TL_RESOURCE,30),
PL_OVERHEAD=ROUND(PL_OVERHEAD,30),
TL_OVERHEAD=ROUND(TL_OVERHEAD,30),
PL_OUTSIDE_PROCESSING=ROUND(PL_OUTSIDE_PROCESSING,30),
TL_OUTSIDE_PROCESSING=ROUND(TL_OUTSIDE_PROCESSING,30),
MATERIAL_COST = ROUND(MATERIAL_COST, 30),
MATERIAL_OVERHEAD_COST=ROUND(MATERIAL_OVERHEAD_COST,30),
RESOURCE_COST =ROUND(RESOURCE_COST,30),
OVERHEAD_COST=ROUND(OVERHEAD_COST,30),
OUTSIDE_PROCESSING_COST=ROUND(OUTSIDE_PROCESSING_COST,30),
PL_ITEM_COST = ROUND(PL_ITEM_COST, 30),
TL_ITEM_COST = ROUND(TL_ITEM_COST, 30),
UNBURDENED_COST = ROUND(UNBURDENED_COST, 30) ;

commit;

STEP 3:
Cancel the Cost Manager:
System Administrator -- Requests -- View -- Go To Specific Request and in the Name give Cost
Manager.From here cancel the Cost Manager that is Pending Scheduled.

STEP 4:
Resubmit the errored transactions

    update mtl_material_transactions MMT
    set MMT.costed_flag = 'N',
    MMT.error_code = NULL,
    MMT.error_explanation = NULL,
    MMT.transaction_group_id = NULL,
    MMT.transaction_set_id = NULL
    where MMT.organization_id = ‘&organization_id’
    and MMT.costed_flag in ('N','E')
    and NOT  EXISTS ( SELECT 1
    FROM MTL_TRANSACTION_ACCOUNTS MTA
    WHERE MMT.TRANSACTION_ID = MTA.TRANSACTION_ID);
Commit

STEP 5:

Launch the Cost Manager
Inventory -- Setup -- Transactions -- Interface Managers --- Tools (Menu Bar) -- Launch Manager
--Submit
(No scheduling for the Cost Manager should be done in the Request Form)


Incase issue is not solved

If issue in WIP job completion you can use the following data fix and Re submit the Particular Material transaction
UPDATE WIP_REQ_OPERATION_COST_DETAILS
SET
APPLIED_MATL_VALUE = ROUND(APPLIED_MATL_VALUE , 30),
RELIEVED_MATL_COMPLETION_VALUE = ROUND(RELIEVED_MATL_COMPLETION_VALUE , 30),
RELIEVED_MATL_SCRAP_VALUE = ROUND(RELIEVED_MATL_SCRAP_VALUE , 30),
RELIEVED_VARIANCE_VALUE = ROUND(RELIEVED_VARIANCE_VALUE , 30),
TEMP_RELIEVED_VALUE = ROUND(TEMP_RELIEVED_VALUE , 30)
WHERE WIP_ENTITY_ID = “Your Problematic job’s WIP_Entity_Id