{"id":610,"date":"2011-01-20T11:56:04","date_gmt":"2011-01-20T08:56:04","guid":{"rendered":"https:\/\/enginhafizoglu.com\/?p=610"},"modified":"2011-09-29T10:15:57","modified_gmt":"2011-09-29T07:15:57","slug":"record-not-found-in-wip_period_balance","status":"publish","type":"post","link":"https:\/\/enginhafizoglu.com\/?p=610","title":{"rendered":"Record not found in WIP_PERIOD_BALANCE (metalink note ID 1080033.6)"},"content":{"rendered":"<p>Unable to close EAM Work Orders because Resource transactions are not being processed by the Cost Manager. Records are stuck in the wip_cost_txn_interface (WCTI) \u00a0table with process_status = 1 (pending). Actual Cost Worker, CMCACW,\u00a0ends with an error and the corresponding material transaction is erred in the mtl_material_transactions\u00a0 (MMT) table with costed_flag = E. The work order for the erred record in mtl_material_transactions is in Failed Close Status. <!--more--><\/p>\n<p><span style=\"font-family: Courier New;\">Problem Description<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nYou cannot close the period due to errored transactions in the<br \/>\nMTL_MATERIAL_TRANSACTIONS (MMT) table. In the worker log, you may get a<br \/>\ngeneric message that reads:<\/span><\/p>\n<p>APP-00001 Cannot find message name INV_NO_UPDATE<\/p>\n<p>Solution Description<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nI. Normally, when there are records in MTL_MATERIAL_TRANSACTIONS with the<br \/>\nCosted_Flag = &#8216;E&#8217; you would resubmit these records by doing the following:<\/p>\n<p>a. Backup the rows to be updated.<br \/>\nb. Turn off the Cost Manager.<br \/>\nc. Run the SQL statement:<\/p>\n<p>[sql]UPDATE MTL_MATERIAL_TRANSACTIONS<br \/>\nSET costed_flag=&#8217;N&#8217;,<br \/>\nerror_code = NULL,<br \/>\nerror_explanation = NULL,<br \/>\ntransaction_group_id=NULL<br \/>\nWHERE  organization_id=&lt;your org id&gt; and<br \/>\ntransaction_source_id=&lt;your wip entity id&gt; and<br \/>\ncosted_flag IS NOT NULL; [\/sql]<\/p>\n<p>II. When this does not work, it is usually due to one or more of the following<br \/>\nthree conditions (see <a href=\"https:\/\/support.oracle.com\/CSP\/main\/article?cmd=show&amp;type=BUG&amp;id=573272\">BUG:573272<\/a> for more information on this topic):<\/p>\n<p>* Item costs are not defined for Frozen cost type in CST_ITEM_COSTS.<br \/>\n* WIP_PERIOD_BALANCES is missing rows for the acct_period_id.<br \/>\n* If a repetitive schedule, MTL_MATERIAL_TXN_ALLOCATIONS is missing rows<br \/>\nfor the corresponding transaction_id from MTL_MATERIAL_TRANSACTIONS.<\/p>\n<p>1. If you are running inltcp.opp 50.90 or lower, please apply patch for<br \/>\nBUG 559432 for version 50.91 (or INV patchset C or higher).<\/p>\n<p>2. Fixing missing rows in WIP_PERIOD_BALANCES for transactions that are<br \/>\nthe result of a DISCRETE JOB requires you to use the below cm276916.sql<br \/>\nscript. The rows are missing in WIP_PERIOD_BALANCES because status<br \/>\ntypes 14 (Pending Close) and 15 (Failed Close) were not included while<br \/>\ninserting rows for discrete jobs in this table.<\/p>\n<p>To determine if you need to insert records into WIP_PERIOD_BALANCES,<br \/>\nchange the INSERT statement to a SELECT. If more than zero rows are<br \/>\nreturned, then re-run the script with INSERT and resubmit the<br \/>\nrecords in MTL_MATERIAL_TRANSACTIONS.<\/p>\n<p>NOTE: THIS DOES NOT APPLY TO CLOSED DISCRETE JOBS WDJ.STATUS_TYPE = 12)<\/p>\n<p>====================================================================<br \/>\n| Run the sql script cm276916.sql to create missing balances in |<br \/>\n| the wip_period_balances table. Run this script as APPS user: |<br \/>\n| For example, from UNIX shell, type: |<br \/>\n| sqlplus &lt;APPS username\/APPS password&gt; @$BOM_TOP\/sql\/cm276916.sql |<br \/>\n====================================================================<\/p>\n<p>[sql]<br \/>\nINSERT INTO WIP_PERIOD_BALANCES<br \/>\n(ACCT_PERIOD_ID, WIP_ENTITY_ID,<br \/>\nREPETITIVE_SCHEDULE_ID, LAST_UPDATE_DATE,<br \/>\nLAST_UPDATED_BY, CREATION_DATE,<br \/>\nCREATED_BY, LAST_UPDATE_LOGIN,<br \/>\nORGANIZATION_ID, CLASS_TYPE,<br \/>\nTL_RESOURCE_IN, TL_OVERHEAD_IN,<br \/>\nTL_OUTSIDE_PROCESSING_IN, PL_MATERIAL_IN,<br \/>\nPL_MATERIAL_OVERHEAD_IN, PL_RESOURCE_IN,<br \/>\nPL_OVERHEAD_IN, PL_OUTSIDE_PROCESSING_IN,<br \/>\nTL_MATERIAL_OUT, TL_MATERIAL_OVERHEAD_OUT, TL_RESOURCE_OUT,<br \/>\nTL_OVERHEAD_OUT, TL_OUTSIDE_PROCESSING_OUT,<br \/>\nPL_MATERIAL_OUT, PL_MATERIAL_OVERHEAD_OUT,<br \/>\nPL_RESOURCE_OUT, PL_OVERHEAD_OUT,<br \/>\nPL_OUTSIDE_PROCESSING_OUT,<br \/>\nPL_MATERIAL_VAR, PL_MATERIAL_OVERHEAD_VAR,<br \/>\nPL_RESOURCE_VAR, PL_OUTSIDE_PROCESSING_VAR,<br \/>\nPL_OVERHEAD_VAR, TL_MATERIAL_VAR, TL_MATERIAL_OVERHEAD_VAR,<br \/>\nTL_RESOURCE_VAR, TL_OUTSIDE_PROCESSING_VAR,<br \/>\nTL_OVERHEAD_VAR)<br \/>\nSELECT<br \/>\nOAP.acct_period_id, WDJ.WIP_ENTITY_ID,<br \/>\nNULL, SYSDATE,<br \/>\n0, SYSDATE,<br \/>\n0, 0,<br \/>\nWDJ.ORGANIZATION_ID, WAC.CLASS_TYPE,<br \/>\n0,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<br \/>\nFROM    WIP_ACCOUNTING_CLASSES WAC,<br \/>\nORG_ACCT_PERIODS OAP,<br \/>\nWIP_DISCRETE_JOBS WDJ<br \/>\nWHERE   WDJ.STATUS_TYPE IN (3, 4, 5, 6, 7, 14, 15)<br \/>\nAND     WAC.CLASS_CODE = WDJ.CLASS_CODE<br \/>\nAND     WDJ.ORGANIZATION_ID = WAC.ORGANIZATION_ID<br \/>\nAND     OAP.ORGANIZATION_ID = WDJ.ORGANIZATION_ID<br \/>\nAND     OAP.OPEN_FLAG = &#8216;Y&#8217;<br \/>\nAND     OAP.PERIOD_CLOSE_DATE IS NULL<br \/>\nAND     OAP.SCHEDULE_CLOSE_DATE &gt;= NVL(WDJ.DATE_RELEASED,WDJ.CREATION_DATE)<br \/>\nAND     WAC.CLASS_TYPE != 2<br \/>\nAND     NOT EXISTS<br \/>\n(<br \/>\n             SELECT &#8216;X&#8217; FROM WIP_PERIOD_BALANCES WPB<br \/>\n             WHERE  WPB.REPETITIVE_SCHEDULE_ID IS NULL<br \/>\n             AND   WPB.WIP_ENTITY_ID = WDJ.WIP_ENTITY_ID<br \/>\n             AND   WPB.ORGANIZATION_ID = WDJ.ORGANIZATION_ID<br \/>\n             AND   WPB.ACCT_PERIOD_ID = OAP.ACCT_PERIOD_ID);<br \/>\n             [\/sql]<\/p>\n<p>3. For repetitive schedules, you may need to fix missing records in<br \/>\nWIP_PERIOD_BALANCES as well as in MTL_MATERIAL_TXN_ALLOCATIONS.<\/p>\n<p>A. To fix missing rows in WIP_PERIOD_BALANCES as a result of a<br \/>\ntransaction that was due to a REPETITIVE SCHEDULE, you<br \/>\nwill need to run the cm325424.sql script. It has been modified<br \/>\nto include status_type=5 so that rows are inserted for closed<br \/>\nschedules too.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n| FILENAME |<br \/>\n| cm325424.sql |<br \/>\n| |<br \/>\n| DESCRIPTION |<br \/>\n| Bug fix 325424 |<br \/>\n| 1. Insert missing rows in wip_period_balances |<br \/>\n| |<br \/>\n| NOTES |<br \/>\n| Invoking Syntax: |<br \/>\n| sqlplus &lt;APPS username&gt;\/&lt;APPS password&gt; @cm325424.sql |<br \/>\n| HISTORY |<br \/>\n| 28 NOV 95 Rina Banerjee Creation |<br \/>\n+================================================================+<\/p>\n<p>[sql]INSERT INTO WIP_PERIOD_BALANCES<br \/>\n(ACCT_PERIOD_ID, WIP_ENTITY_ID,<br \/>\nREPETITIVE_SCHEDULE_ID, LAST_UPDATE_DATE,<br \/>\nLAST_UPDATED_BY, CREATION_DATE,<br \/>\nCREATED_BY, LAST_UPDATE_LOGIN,<br \/>\nORGANIZATION_ID, CLASS_TYPE,<br \/>\nTL_RESOURCE_IN, TL_OVERHEAD_IN,<br \/>\nTL_OUTSIDE_PROCESSING_IN, PL_MATERIAL_IN,<br \/>\nPL_MATERIAL_OVERHEAD_IN, PL_RESOURCE_IN,<br \/>\nPL_OVERHEAD_IN, PL_OUTSIDE_PROCESSING_IN,<br \/>\nTL_MATERIAL_OUT, TL_MATERIAL_OVERHEAD_OUT, TL_RESOURCE_OUT,<br \/>\nTL_OVERHEAD_OUT, TL_OUTSIDE_PROCESSING_OUT,<br \/>\nPL_MATERIAL_OUT, PL_MATERIAL_OVERHEAD_OUT,<br \/>\nPL_RESOURCE_OUT, PL_OVERHEAD_OUT,<br \/>\nPL_OUTSIDE_PROCESSING_OUT,<br \/>\nPL_MATERIAL_VAR, PL_MATERIAL_OVERHEAD_VAR,<br \/>\nPL_RESOURCE_VAR, PL_OUTSIDE_PROCESSING_VAR,<br \/>\nPL_OVERHEAD_VAR, TL_MATERIAL_VAR, TL_MATERIAL_OVERHEAD_VAR,<br \/>\nTL_RESOURCE_VAR, TL_OUTSIDE_PROCESSING_VAR,<br \/>\nTL_OVERHEAD_VAR)<br \/>\nSELECT<br \/>\nOAP.acct_period_id, WRS.WIP_ENTITY_ID,<br \/>\nWRS.REPETITIVE_SCHEDULE_ID, SYSDATE,<br \/>\n0, SYSDATE,<br \/>\n0, 0,<br \/>\nWRS.ORGANIZATION_ID, 2,<br \/>\n0,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<br \/>\nFROM WIP_REPETITIVE_SCHEDULES WRS,<br \/>\nORG_ACCT_PERIODS OAP<br \/>\nWHERE WRS.STATUS_TYPE IN (3, 4, 5, 6)<br \/>\nAND   WRS.ORGANIZATION_ID = OAP.ORGANIZATION_ID<br \/>\nAND   OAP.OPEN_FLAG = &#8216;Y&#8217;<br \/>\nAND   OAP.PERIOD_CLOSE_DATE IS NULL<br \/>\nAND   OAP.SCHEDULE_CLOSE_DATE &gt;= NVL(WRS.DATE_RELEASED,<br \/>\nWRS.CREATION_DATE)<br \/>\nAND   NOT EXISTS<br \/>\n(<br \/>\nSELECT &#8216;X&#8217; FROM WIP_PERIOD_BALANCES WPB<br \/>\n    WHERE  WPB.REPETITIVE_SCHEDULE_ID IS NOT NULL<br \/>\n    AND   WPB.WIP_ENTITY_ID = WRS.WIP_ENTITY_ID<br \/>\n    AND   WPB.REPETITIVE_SCHEDULE_ID = WRS.REPETITIVE_SCHEDULE_ID<br \/>\nAND   WPB.ORGANIZATION_ID = WRS.ORGANIZATION_ID<br \/>\n    AND   WPB.ACCT_PERIOD_ID = OAP.ACCT_PERIOD_ID);<br \/>\n&#8212;&#8212;&#8212;&#8212;[\/sql]<\/p>\n<p><span style=\"font-family: Courier New;\"> B. To fix missing rows in MTL_MATERIAL_TXN_ALLOCATIONS (MMTA):<\/span><\/p>\n<p>a. Run the following select statement to see if you have missing<br \/>\nrows:<\/p>\n<p>[sql]select mmt.transaction_id id,mmt.transaction_quantity qty,<br \/>\nmove_transaction_id moveid, transaction_source_id txnsource<br \/>\nfrom   mtl_material_transactions mmt<br \/>\nwhere  mmt.transaction_source_id=&lt;wip_entity_id&gt;<br \/>\nand    mmt.organization_id=&lt;your organization_id&gt;<br \/>\nand    not exists<br \/>\n(select &#8216;x&#8217;<br \/>\nfrom  mtl_material_txn_allocations mmta<br \/>\nwhere mmta.transaction_id=mmt.transaction_id<br \/>\nand   mmta.organization_id=mmt.organization_id)[\/sql]<\/p>\n<p>b. Run the following select statement to see what repetitive<br \/>\nschedules do not have records in MMTA. When inserted, the<br \/>\nmissing rows from above will be allocated to the schedule(s)<br \/>\nfrom below:<\/p>\n<p>[sql]select repetitive_schedule_id,<br \/>\n(daily_production_rate * processing_work_days) schedqty<br \/>\nquantity_completed, status_type status<br \/>\nfrom wip_repetitive_schedules wrs<br \/>\nwhere  wip_entity_id=&lt;wip_entity_id used above&gt;<br \/>\nand not exists<br \/>\n(select &#8216;x&#8217;<br \/>\nfrom mtl_material_txn_allocations  mmta<br \/>\nwhere mmta.repetitive_schedule_id=wrs.repetitive_schedule_id<br \/>\nand mmta.organization_id=wrs.organization_id)[\/sql]<\/p>\n<p>c. Set the schedule to Complete-Charges Allowed by running the<br \/>\nfollowing:<\/p>\n<p>[sql] update wip_repetitive_schedules<br \/>\nset    date_closed=NULL, status_type=4<br \/>\nwhere  repetitive_schedule_id=&lt;repetitive_schedule_id above&gt;<br \/>\nand    organization_id = &lt;your organization_id&gt; [\/sql]<\/p>\n<p>\/<\/p>\n<p>d. Insert record into MMTA:<\/p>\n<p>[sql]INSERT INTO MTL_MATERIAL_TXN_ALLOCATIONS<br \/>\n(TRANSACTION_ID,REPETITIVE_SCHEDULE_ID, ORGANIZATION_ID,<br \/>\nLAST_UPDATE_DATE,LAST_UPDATED_BY, CREATION_DATE, CREATED_BY,<br \/>\nLAST_UPDATE_LOGIN,REQUEST_ID,PROGRAM_APPLICATION_ID,<br \/>\nPROGRAM_ID, PROGRAM_UPDATE_DATE,PRIMARY_QUANTITY,<br \/>\nTRANSACTION_QUANTITY, TRANSACTION_DATE)<br \/>\n(select mmtt.material_allocation_temp_id,&lt;repetitive_schedule_id above&gt;,<br \/>\nmmtt.organization_id, mmtt.last_update_date,<br \/>\nmmtt.last_updated_by,<br \/>\nmmtt.creation_date, mmtt.created_by, mmtt.last_update_login,<br \/>\nmmtt.REQUEST_ID, mmtt.PROGRAM_APPLICATION_ID,mmtt.PROGRAM_ID,<br \/>\nmmtt.program_update_date,mmtt.primary_quantity,<br \/>\nmmtt.transaction_quantity,<br \/>\nmmtt.transaction_date<br \/>\nfrom   mtl_material_transactions_temp mmtt<br \/>\nwhere  mmtt.transaction_source_id=&lt;wip_entity_id?from w_p_b?&gt;<br \/>\nand  mmtt.organization_id=&lt;your organization_id&gt;)[\/sql]<\/p>\n<p>e. Set the schedule status back to Complete-No Charges Allowed:<\/p>\n<p>[sql] update wip_repetitive_schedules<br \/>\nset    date_closed=NULL,<br \/>\nstatus_type=5<br \/>\nwhere  repetitive_schedule_id=&lt;repetitive_schedule_id above&gt;<br \/>\nand    organization_id = &lt;your organization_id&gt;[\/sql]<\/p>\n<p>4. To fix the generic error message in the log file:<\/p>\n<p>&#8211; Apply patch for bug 624269 (cmlwmx.ppc 50.23). It changes the<br \/>\nerror message from: APP-00001 Cannot find message name INV_NO_UPDATE<br \/>\nto: No rows were updated in table WIP_PERIOD_BALANCES.<\/p>\n<p>5. To prevent entries for Repetitive Schedules in unopened periods:<\/p>\n<p>&#8211; Apply patch for bug 776068 for non-character Rel 10.7.16.1,<br \/>\nWIPREMDF.fmb 61.47 and Rel 11, WIPREMDF.fmb 110.27(or WIP Patchset D)<br \/>\n&#8211; Apply patch for bug 876983 for character (WIPREMDF.inp 51.2)<\/p>\n<p>6. One enhancement to keep an eye on&#8230;..bug 881684<\/p>\n<p>Release 11i will have an enhancement to the View Material Transactions<br \/>\nform. This enhancement will allow the user to view material<br \/>\ntransactions (MMT table) which are uncosted (mmt.costed_flag = N) or<br \/>\nerred out during cost processing (mmt.costed_flag = E). It will also<br \/>\nlet the user resubmit those pending and erred transactions from the<br \/>\nsame form.<\/p>\n<p>Additional Search Words<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nperiod close errored<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unable to close EAM Work Orders because Resource transactions are not being processed by the Cost Manager. Records are stuck in the wip_cost_txn_interface (WCTI) \u00a0table with process_status = 1 (pending). Actual Cost Worker, CMCACW,\u00a0ends with an error and the corresponding material transaction is erred in the mtl_material_transactions\u00a0 (MMT) table with costed_flag = E. The work [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[111,110],"class_list":["post-610","post","type-post","status-publish","format-standard","hentry","category-oracle-e-is-yonetim-sistemi","tag-record-not-found","tag-wip_period_balance"],"_links":{"self":[{"href":"https:\/\/enginhafizoglu.com\/index.php?rest_route=\/wp\/v2\/posts\/610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enginhafizoglu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enginhafizoglu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enginhafizoglu.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/enginhafizoglu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=610"}],"version-history":[{"count":10,"href":"https:\/\/enginhafizoglu.com\/index.php?rest_route=\/wp\/v2\/posts\/610\/revisions"}],"predecessor-version":[{"id":611,"href":"https:\/\/enginhafizoglu.com\/index.php?rest_route=\/wp\/v2\/posts\/610\/revisions\/611"}],"wp:attachment":[{"href":"https:\/\/enginhafizoglu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enginhafizoglu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enginhafizoglu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}