Material and Resource Transactions With Error Code CST_INVALID_WIP because of missing record in WIP_PERIOD_BALANCES (文档 ID 553138.1) |
![]() |
![]() |

In this Document
APPLIES TO:Oracle Work in Process - Version 11.5.9 and laterOracle Enterprise Asset Management - Version 11.5.9 and later Oracle Cost Management - Version 11.5.9 and later Information in this document applies to any platform. SYMPTOMSThis note provides solution for following situations: A. Material Transactions There are transactions in MTL_MATERIAL_TRANSACTIONS related to DISCRETE JOB which have following error :
ERROR CODE: CST_INVALID_WIP
The issue can be reproduced at will with the following steps: 1. WIP > Material Transactions > View Material Transactions > Select Status=Error or 2. Inventory > Transactions > Material Transactions > Select Status=Error
B. Resource Transactions There are Resource Transactions stuck in pending in WIP_COST_TXN_INTERFACE with following error explanation:
Record not found in WIP_PERIOD_BALANCE
This same error can also occur for Resource transactions where in MTL_MATERIAL_TRANSACTIONS the transaction_source_id is a negative number. See Note 1344384.1 for details.
CAUSE
The cause of the issue is missing records in WIP_PERIOD_BALANCES
But there were also some bugs: Patch 13605602:R12.INV.B - 1OFF:12410248:12.1.3:12.1.3:MISSING RECORD IN WIP_PERIOD_BALANCE EVEN AFTER APPL.... see more in Document.1416033.1 This will bring fixed versions: INVTTGPM.fmb 120.21.12010000.10 INVMOCLB.pls 120.6.12010000.8
Patch:18101499:R12.WIP.B WIP_PERIOD_BALANCES NOT CREATED FROM CANCELLED TO COMPLETE NO CHARGES ............. see more in Document.1664618.1 SOLUTIONTo implement the solution, please execute the following steps: For the root cause please make sure you have applied appropriate patches from previous section (as per your current EBS release)
1. For fixing the data,identify the problematic jobs using following script in SQLPlus:
SET LINES 180
2. Create backup of WIP_PERIOD_BALANCES table
System Administrator Responsibility>Requests>query for specific 'Cost Manager' and increase the Number of Days to view from 7 to 1000>Find>Cancel request
INSERT INTO WIP_PERIOD_BALANCES
(ACCT_PERIOD_ID, WIP_ENTITY_ID, REPETITIVE_SCHEDULE_ID, LAST_UPDATE_DATE, LAST_UPDATED_BY, CREATION_DATE, CREATED_BY, LAST_UPDATE_LOGIN, ORGANIZATION_ID, CLASS_TYPE, TL_RESOURCE_IN, TL_OVERHEAD_IN, TL_OUTSIDE_PROCESSING_IN, PL_MATERIAL_IN, PL_MATERIAL_OVERHEAD_IN, PL_RESOURCE_IN, PL_OVERHEAD_IN, PL_OUTSIDE_PROCESSING_IN, TL_MATERIAL_OUT, TL_MATERIAL_OVERHEAD_OUT, TL_RESOURCE_OUT, TL_OVERHEAD_OUT, TL_OUTSIDE_PROCESSING_OUT, PL_MATERIAL_OUT, PL_MATERIAL_OVERHEAD_OUT, PL_RESOURCE_OUT, PL_OVERHEAD_OUT, PL_OUTSIDE_PROCESSING_OUT, PL_MATERIAL_VAR, PL_MATERIAL_OVERHEAD_VAR, PL_RESOURCE_VAR, PL_OUTSIDE_PROCESSING_VAR, PL_OVERHEAD_VAR, TL_MATERIAL_VAR, TL_MATERIAL_OVERHEAD_VAR, TL_RESOURCE_VAR, TL_OUTSIDE_PROCESSING_VAR, TL_OVERHEAD_VAR) SELECT OAP.acct_period_id, WDJ.WIP_ENTITY_ID, NULL, SYSDATE, 0, SYSDATE, 0, 0, WDJ.ORGANIZATION_ID, WAC.CLASS_TYPE, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 FROM WIP_ACCOUNTING_CLASSES WAC, ORG_ACCT_PERIODS OAP, WIP_DISCRETE_JOBS WDJ WHERE WDJ.STATUS_TYPE IN (3, 4, 5, 6, 7, 14, 15) AND WAC.CLASS_CODE = WDJ.CLASS_CODE AND WDJ.ORGANIZATION_ID = WAC.ORGANIZATION_ID AND OAP.ORGANIZATION_ID = WDJ.ORGANIZATION_ID AND OAP.OPEN_FLAG = 'Y' AND OAP.PERIOD_CLOSE_DATE IS NULL AND OAP.SCHEDULE_CLOSE_DATE >= TRUNC(NVL(WDJ.DATE_RELEASED, WDJ.CREATION_DATE)) AND WAC.CLASS_TYPE != 2 AND NOT EXISTS ( SELECT 'X' FROM WIP_PERIOD_BALANCES WPB WHERE WPB.REPETITIVE_SCHEDULE_ID IS NULL AND WPB.WIP_ENTITY_ID = WDJ.WIP_ENTITY_ID AND WPB.ORGANIZATION_ID = WDJ.ORGANIZATION_ID AND WPB.ACCT_PERIOD_ID = OAP.ACCT_PERIOD_ID);
5. Run again select from step 1 which should return no records now. If so, then issue a commit. 6.1 create backup for problematic records in wip_discrete_jobs
create table XX_WDJ_BACKUP_FC_02
as select * from wip_discrete_jobs where date_released is null and status_type in (3, 4, 5, 6, 7, 14, 15);
6.2 populate date_released for problematic jobs
update wip_discrete_jobs wdj
set wdj.date_released = (select min(oap.period_start_date) from org_acct_periods oap where (oap.acct_period_id, oap.organization_id) in (select wpb.acct_period_id, wpb.organization_id from wip_period_balances wpb where wpb.wip_entity_id = wdj.wip_entity_id)) where wdj.date_released is null and WDJ.STATUS_TYPE IN (3, 4, 5, 6, 7, 14, 15);
7. After committing the transaction, resubmit the erred material and resource transactions Fr materials: Inventory > Transactions > Material Transactions > query for error transactions > resubmit For resources: WIP > Resource Transactions > Pending Resource Transactions 8. Launch the Cost Manager: Inventory > Setup > Transactions > Interface Managers 9. Check if Cost Worker is spawned and transactions are processed.
Note: also data fix cm276916.sql in Note 1080033.6 can be used for resolving this kind of errors but data fix in Note 1080033.6 will not work for jobs released in the last day of the month because in table ORG_ACCT_PERIODS the field SCHEDULE_CLOSE_DATE has no time stamp but at the same time in table WIP_DISCRETE_JOBS both fields DATE_RELEASED and CREATION_DATE have time stamp and it happens that jobs released in the last day of the months will only be found by the script if we use
OAP.SCHEDULE_CLOSE_DATE >= NVL(WDJ.DATE_RELEASED, instead of OAP.SCHEDULE_CLOSE_DATE >= TRUNC(NVL(WDJ.DATE_RELEASED, WDJ.CREATION_DATE))
For Additional information, please review: REFERENCESNOTE:1080033.6 - Errored Transactions in MTL_MATERIAL_TRANSACTIONS INV_NO_UPDATE / CST_INVALID_WIPBUG:6709562 - DATAFIX: WIP TRANSACTIONS STUCK WITH COSTED_FLAG ERROR CST_INVALID_WIP NOTE:1416033.1 - Root Cause Fix: Missing Record In WIP_PERIOD_BALANCES and CST_INVALID_WIP Errors - Most Current or Recent Root Cause Fix BUG:6709562 - DATAFIX: WIP TRANSACTIONS STUCK WITH COSTED_FLAG ERROR CST_INVALID_WIP NOTE:1344384.1 - Uncosted Material Transactions Error Out With Error Code: CST_INVALID_WIP having Negative TRANSACTION_SOURCE_ID in MMT |