Wednesday, January 9, 2013

How to cancel/ launched Cost Manager :


How to cancel/ launched Cost Manager  :

- to launch severals cost manager at the same time
- to have warning message in CMCTCM log saying :
"A Cost Manager is already launched.
Action: If you want to launch a new manager, cancel earlier manager first."

Solution :

1 - To cancel the Cost Manager : use one of the following method:
   a) use 'System Administrator' responsibility
       Navigate to Concurrent/Request/view
       Set : specific Request=on
       Name=Cost Manager.

In the lower part of the Find requests window there is a field "Select the Number of Days to view" set by default to 7 days.
-> Set "Select the Number of Days to view"=9999
In fact this field is a filter which limits how far back it will query requests.

From here Cancel the Cost Manager which is Pending Scheduled.

or

b) Use the following SQL script:

SELECT request_id RequestId,
request_date RequestDt, concurrent_program_name,
phase_code Phase,
status_code Status FROM
fnd_concurrent_requests fcr,
fnd_concurrent_programs fcp
WHERE fcp.application_id = 702 AND
fcp.concurrent_program_name in ('CMCTCM', 'CMCMCW', 'CMCACW') AND
fcr.concurrent_program_id = fcp.concurrent_program_id AND
fcr.program_application_id = 702 AND fcr.phase_code <> 'C';

(OR)

SELECT 'Cost Manager',
       request_id "Request Id",
       request_date "Request Date",
       decode(phase_code,'I','Inactive',
                         'P','Pending',
                         'R', 'Running',
                         'C','Completed')  Phase,
       decode(status_code,'U', 'Disabled',
                          'W', 'Paused',
                          'X', 'Terminated',
                          'Z', 'Waiting',
                          'M', 'No Manager',
                          'Q', 'Standby',
                          'R', 'Normal',
                          'S', 'Suspended',
                          'T', 'Terminating',
                          'D', 'Cancelled',
                          'E', 'Error',
                          'F',' Scheduled',
                          'G', 'Warning',
                          'H', 'On Hold',
                          'I', 'Normal',
                          'A', 'Waiting',
                          'B', 'Resuming',
                          'C', 'Normal') Status
FROM applsys.fnd_concurrent_requests fcr,
     applsys.fnd_concurrent_programs fcp
WHERE fcp.application_id = 702 AND
      fcp.concurrent_program_name = 'CMCTCM' AND
      fcr.concurrent_program_id = fcp.concurrent_program_id AND
      fcr.program_application_id = 702 AND fcr.phase_code not in ( 'C','R');

Cancel all the requests from the above output by navigating to, System Administrator> Concurrent> Request.  Query for the RequestId returned from the select above.

In the lower part of the Find requests window there is a field "Select the Number of Days to view" set by default to 7 days
-> Set "Select the Number of Days to view"=9999
In fact this field is a filter which limits how far back it will query requests.

Cancel the request id other than running. Let the running request get over. 

2 - Run the cmclean.sql script available from MOS Note 134007.1

3 - Restart the Cost Manager
     Inventory> Setup : Transactions> Interface Managers
     Select  'Cost Manager' - choose Tools > Launch Manager

Also review << Note 304313.1>>

4. Restart the concurrent processes.
5. Run the below select and update scripts to update the uncosted and/or erred records in the tables indicated.
6. Relaunch the Cost Manager. Select and Update scripts for paragraph 5. above:

SQL> select count(*) from MTL_MATERIAL_TRANSACTIONS where COSTED_FLAG = 'E';
SQL> select count(*) from MTL_MATERIAL_TRANSACTIONS where COSTED_FLAG = 'N';
SQL > Update MTL_MATERIAL_TRANSACTIONS set COSTED_FLAG = 'N', TRANSACTION_GROUP_ID = NULL where COSTED_FLAG = 'E' or COSTED_FLAG = 'N';
If there are unprocessed records in MTL_MATERIAL_TRANSACTIONS_TEMP, then, also run the following:
  a. To see if there are records in mtl_material_transactions_temp, run:

SQL> select * from mtl_material_transactions_temp;

  b. If rows are returned from the SQL in a. above, then run:

SQL> Update MTL_MATERIAL_TRANSACTIONS_TEMP Set PROCESS_FLAG = 'Y', LOCK_FLAG = 'N', TRANSACTION_MODE = 3, ERROR_CODE = NULL Where TRANSACTION_HEADER_ID = ;

(OR)

Resubmit all transactions using this procedure:
  • Shut down the cost manager
  • Make a backup of the table mtl_material_transactions
  • Perform the following update 
SQL > update mtl_material_transactions
set costed_flag = 'N',
transaction_group_id = NULL,
transaction_set_id = NULL
where costed_flag = 'E' or costed_flag = 'N' ;
Commit ;

+++++++++++++++++++++++++++
ID 304313.1
ID 203504.1
+++++++++++++++++++++++++++


1 comment:

  1. This article are supper help full if you want to know more about New Managers then please click here.

    ReplyDelete