Anda di halaman 1dari 8

REM THE FOLLOWING STEPS CAN BE FOLLOWED FIRST IN TEST INSTANCE

REM FOR THE CUSTOMER WHO HAS TRANSACTIONS WHICH ARE NOT
REM GETTING COSTED AND THE TRANSACTIONS DO NOT ERROR OUT ALSO.
REM **** PLEASE NOTE THAT THE STEPS ARE ONLY APPLICABLE FOR PERPETUAL COSTING ****
REM
REM CHANGE HISTORY
REM Author Date Description
REM anjha 31-JUL-2006 Initial creation
REM anjha 01-JAN-2007 added patch for bug3339616 as
REM anjha required for OSFM 11.5.9 customers.

STEP0: Check if the cost manager is active or not.


If not then lauch the cost manager and see if the transactions
get costed or not.
STEP1: Find out what is the costing method of the organization.
The following sql can be used to get the costing method
of the organization.
select organization_id,
organization_code,
primary_cost_method,
nvl(WSM_ENABLED_FLAG,'N') WSM_ENABLED_FLAG
from mtl_parameters
where organization_id = &organization_id

primary_cost_method Cost method


------------------- ------------
1 Standard
2 Average
5 FIFO
6 LIFO
STEP2 : If the Cost method is Standard and WSM_ENABLED_FLAG is 'N' then
follow the following :

STEP2-A: For the particular transaction which is not getting costed


Run the following sql :
select transaction_id,
inventory_item_id,
transaction_date,
transaction_group_id,
transaction_action_id,
transaction_source_type_id,
completion_transaction_id,
flow_schedule,
organization_id,
transfer_organization_id
from mtl_material_transactions
where transaction_id = &txn_id
STEP2-B: a) If customer release is equal to or more than 1157 then run the
following sql :
select cost_cutoff_date
from mtl_parameters
where organization_id = &organization_id

If the (cost_cutoff_date < transaction_date) then please ask the


customer to update the cost cutoff date in organization parameter
form greater than the transaction date and check if the transaction
is getting costed.

b)If the transaction_action_id is in (1, 27, 33, 34)


and transaction_source_type_id = 5
and flow_schedule = 'Y'
then run the following sql :
select costed_flag
from mtl_material_transactions
where completion_transaction_id = &comp_txn_got_from_step2A
and transaction_source_type_id = 5
and transaction_action_id not in (1, 27, 33, 34)

(i) If the costed_flag is null then this would mean that the
transaction is orphaned and cannot be picked up for costing.
In this case only option is to perform GL adjustments.
To carry out the GL adjustments please follow the steps
outlined in the file steps_orphaned_txn.txt.
(ii) If the completion_transaction_id is null in STEP2-A
OR if the above sql in (b) of STEP2-B returns no row
then contact Inventory development team as this would
mean that the backflush for a flow schedule is created
with incorrect completion_transaction_id.
(iii) If the costed_flag is 'N' then contact costing team.

c) if the transaction_Action_id is not in (2,28,3,55,5)


and tranfer_transaction_id is not null then
Please run the following :

update mtl_material_transactions
set transfer_transaction_id = null
where transaction_Action_id not in (2,28,3,55,5)
and transaction_id = &txn_id;

commit;

Resubmit the transaction for costing through the transaction


form.And check if the transaction gets costed.

d) If the transaction_action_id is in (3,21,12) and the


transfer_organization_id is also standard costing organization
and the customer's release is 1157 or above
then check the cost cut off date of the transfer organization .
Following sql can be used to get the primary Cost method
and cost cut off date of the tranfer_organization_id.
select organization_code,
primary_cost_method,
cost_cutoff_date
from mtl_parameters
where organization_id = &txfr_organization_id

If the cost_cutoff_date < transaction_date of the txn then


then please ask the customer to update the cost cutoff date
in organization parameter form for the transfer_organization_id
greater than the transaction date and check if the transaction
is getting costed.

e) If the transaction_action_id is in (3,21,12) and the


transfer_organization_id is NOT standard costing organization
then follow the STEPS given in STEP4 for the transfer_organization_id
as this transaction would get costed by the transfer organization_id.
f) If nothing of the above is applicable then contact Costing Dev.
NOTE:- ALL THE ABOVE CASES EXCEPT THE ISSUES RELATED TO COST CUTOFF DATE
ARE RELATED TO DATA CORRUPTION IN MTL_MATERIAL_TRANSACTIONS.
AND IF THERE IS A REPRODUCIBLE TEST CASE THE ROOT CAUSE BUG
SHOULD BE LOGGED WITH INVENTORY OTHERWISE THESE KIND OF
ISSUES WILL KEEP ON REPEATING.

STEP3 : If the Cost method is Standard and WSM_ENABLED_FLAG is 'Y' then


follow the following :

STEP3-A: If the customer is on 11.5.9 then make sure that the patch for
bug3339616 has been applied.

STEP3-B: For the particular transaction which is not getting costed


Run the following sql :
select transaction_id,
inventory_item_id,
transaction_date,
transaction_group_id,
transaction_action_id,
transaction_source_type_id,
completion_transaction_id,
flow_schedule,
organization_id,
transfer_organization_id
from mtl_material_transactions
where transaction_id = &txn_id
STEP3-C: a) If customer release is equal to or more than 1157 then run the
following sql :
select cost_cutoff_date
from mtl_parameters
where organization_id = &organization_id

If the (cost_cutoff_date < transaction_date) then please ask the


customer to update the cost cutoff date in organization parameter
form greater than the transaction date and check if the transaction
is getting costed.

b)If the transaction_action_id is in (1, 27, 33, 34)


and transaction_source_type_id = 5
and flow_schedule = 'Y'
then run the following sql :
select costed_flag
from mtl_material_transactions
where completion_transaction_id = &comp_txn_got_from_step3A
and transaction_source_type_id = 5
and transaction_action_id not in (1, 27, 33, 34)

(i) If the costed_flag is null then this would mean that the
transaction is orphaned and cannot be picked up for costing.
In this case only option is to perform GL adjustments.
To carry out the GL adjustments please follow the steps
outlined in the file steps_orphaned_txn.txt.
(ii) If the completion_transaction_id is null in STEP3-A
OR if the above sql in (b) of STEP3-B returns no row
then contact Inventory development team as this would
mean that the backflush for a flow schedule is created
with incorrect completion_transaction_id.
(iii) If the costed_flag is 'N' then contact costing team.
c) if the transaction_Action_id is not in (2,28,3,55,5)
and tranfer_transaction_id is not null then
Please run the following :

update mtl_material_transactions
set transfer_transaction_id = null
where transaction_Action_id not in (2,28,3,55,5)
and transaction_id = &txn_id;

commit;

Resubmit the transaction for costing through the transaction


form.And check if the transaction gets costed.

d) If the transaction_action_id is in (3,21,12) and the


transfer_organization_id is also standard costing organization
and the customer's release is 1157 or above
then check the cost cut off date of the transfer organization .
Following sql can be used to get the primary Cost method
and cost cut off date of the tranfer_organization_id.
select organization_code,
primary_cost_method,
cost_cutoff_date
from mtl_parameters
where organization_id = &txfr_organization_id

If the cost_cutoff_date < transaction_date of the txn then


then please ask the customer to update the cost cutoff date
in organization parameter form for the transfer_organization_id
greater than the transaction date and check if the transaction
is getting costed.

e) If the transaction_action_id is in (3,21,12) and the


transfer_organization_id is NOT standard costing organization
then follow the STEPS given in STEP4 for the transfer_organization_id
as this transaction would get costed by the transfer organization_id.

f) If the transaction_source_type_id is 5 in STEP3-A then run the


following sql :
SELECT min(txn_dt) date_till_which_txn_will_cost
from
( SELECT min(transaction_date) txn_dt
FROM wip_cost_txn_interface wcti
WHERE wcti.organization_id = &organization_id
AND wcti.entity_type = 5
AND wcti.process_status = 3
union
SELECT min(transaction_date)
FROM mtl_material_transactions mmt
WHERE mmt.transaction_source_type_id = 5
AND mmt.organization_id = &organization_id
AND mmt.costed_flag = 'E'
AND exists (SELECT 1
FROM wip_entities we
WHERE we.wip_entity_id = mmt.transaction_source_id
AND we.organization_id = mmt.organization_id
AND we.entity_type = 5)
);
Run the following also :
select 'IT is lot based job'
from mtl_material_transactions mmt,
wip_entities we
where mmt.transaction_id =&txn_id
and mmt.transaction_source_type_id = 5
and we.wip_entity_id = mmt.transaction_source_id
and we.organization_id = mmt.organization_id
and we.entity_type = 5
If the above returns 'IT is lot based job' and
date_till_which_txn_will_cost
is less than the transaction_date of the transaction then ask the
customer
to see the error for erred transaction in mtl_material_transaction
and wip transaction and address those errors. Once the erred
transactions
are cleared the transaction in question would get costed.

g) If nothing of the above is applicable then contact Costing Dev.

NOTE:- ALL THE ABOVE CASES EXCEPT THE ISSUES RELATED TO COST CUTOFF DATE
ARE RELATED TO DATA CORRUPTION IN MTL_MATERIAL_TRANSACTIONS.
AND IF THERE IS A REPRODUCIBLE TEST CASE THE ROOT CAUSE BUG
SHOULD BE LOGGED WITH INVENTORY OTHERWISE THESE KIND OF
ISSUES WILL KEEP ON REPEATING.

STEP4 : If the Cost method is ACTUAL(Average/FIFO/LIFO) then follow the following


steps:
STEP4-A: Run the file stuck_info.sql .This will create a table Stuck_Costing).
STEP4-B: Run the following ql for the average costing organization :
select organization_id,
bottle_neck_txn_id ,
txn_date ,
txn_org ,
txn_txfr_org ,
txn_txfr_txn_id ,
txn_action_id ,
txn_source_type_id ,
txn_cost ,
txn_shipment_costed ,
txn_move_txn_id ,
txn_comp_txn_id ,
txn_costed_flag,
waiting_org
from Stuck_Costing
where organization_id = &organization_id
STEP4-C: a) If customer release is equal to or more than 1157 then run the
following sql :
select cost_cutoff_date
from mtl_parameters
where organization_id = &organization_id

If the (cost_cutoff_date < txn_date) then please ask the


customer to update the cost cutoff date in organization parameter
form greater than the transaction date and check if the transaction
is getting costed.

b) if txn_source_type_id is 5 then that means there are backflush


transactions stuck in mtl_material_transactions_temp(MMTT).
Untill and unless the transactions in MMTT are cleared the
transactions in the organization would not process.
To get the transactions stuck in MMTT following sql can be run:
select MMTT.*
from mtl_material_transactions_temp mmtt,
Stuck_Costing sc
where sc.organization_id = &organization_id
and sc.txn_source_type_id = 5
and mmtt.organization_id = sc.organization_id
and (mmtt.completion_transaction_id = sc.txn_comp_txn_id
or mmtt.move_transaction_id = sc.txn_move_txn_id)

Get the transactions cleared from the table


mtl_material_transactions_temp and see if the transaction in
question gets costed or not.

c) if the txn_action_id is 3 then run the following sql :


select 'The transfer cost should not be null'
from Stuck_Costing sc
where sc.bottle_neck_txn_id is not null
and sc.txn_action_id = 3
and sc.txn_cost is null
and exists ( select 'X'
from mtl_material_transactions mmt
where mmt.transaction_id = sc.txn_txfr_txn_id
and mmt.costed_flag is null
)
and sc.organization_id = &&organization_id

If the above returns 'The transfer cost should not be null'


then run the following update and see if the transaction gets
picked for costing.

update mtl_material_transactions mmt


set transaction_cost = ( select sum(mctcd.transaction_cost)
from mtl_cst_txn_cost_details mctcd
where mctcd.transaction_id = mmt.transaction_id
)
where mmt.transaction_id = (select sc.bottle_neck_txn_id
from Stuck_Costing sc
where sc.bottle_neck_txn_id is not null
and sc.txn_action_id = 3
and sc.txn_cost is null
and exists ( select 'X'
from
mtl_material_transactions mmt
where mmt.transaction_id =
sc.txn_txfr_txn_id
and mmt.costed_flag is
null
)
and sc.organization_id =
&&organization_id
)
The run the following sql :
select mmt.transaction_cost
from mtl_material_transactions mmt
where mmt.transaction_id = (select sc.bottle_neck_txn_id
from Stuck_Costing sc
where sc.bottle_neck_txn_id is not null
and sc.txn_action_id = 3
and sc.txn_cost is null
and exists ( select 'X'
from
mtl_material_transactions mmt
where mmt.transaction_id =
sc.txn_txfr_txn_id
and mmt.costed_flag is
null
)
and sc.organization_id =
&&organization_id
)
If the above gives a transaction_cost and is not equal to NULL then
COMMIT.
And see if the cost manger picks up the transaction for costing.

If the transaction_cost is still null then contact Costing development.

d) if the txn_action_id is 12 or 21 then run the following sql :


select 'The shipment costed should be y'
from Stuck_Costing sc
where sc.txn_action_id in (12,21)
and sc.txn_shipment_costed is null
and exists ( select 'X'
from mtl_cst_txn_cost_details mctcd
where mctcd.transaction_id = sc.bottle_neck_txn_id
and mctcd.organization_id = sc.organization_id
)
and sc.bottle_neck_txn_id is not null
and sc.organization_id = &&organization_id

If the above returns 'The shipment costed should be y' then run the
following update stmt :
update mtl_material_transactions mmt
set shipment_costed = 'Y'
where mmt.transaction_id = (
select sc.bottle_neck_txn_id
from Stuck_Costing sc
where sc.txn_action_id in (12,21)
and sc.txn_shipment_costed is null
and exists ( select 'X'
from mtl_cst_txn_cost_details mctcd
where mctcd.transaction_id = sc.bottle_neck_txn_id
and mctcd.organization_id = sc.organization_id
)
and sc.bottle_neck_txn_id is not null
and sc.organization_id = &&organization_id
)

COMMIT
And then see if the transaction gets costed or not.

e) if the txn_costed_flag is 'E' then that means that there is a


txn in the organization which is in error status.
The errored out transaction needs to be rectified so that other txns
can be picked up by the cost manager.

f) Run the following :


select sc2.organization_id,
sc2.bottle_neck_txn_id ,
sc2.txn_date ,
sc2.txn_org ,
sc2.txn_txfr_org ,
sc2.txn_txfr_txn_id ,
sc2.txn_action_id ,
sc2.txn_source_type_id ,
sc2.txn_cost ,
sc2.txn_shipment_costed ,
sc2.txn_move_txn_id ,
sc2.txn_comp_txn_id ,
sc2.txn_costed_flag,
sc2.waiting_org
from stuck_costing sc2
where sc2.bottle_neck_txn_id is not null
and sc2.txn_action_id in (3,12,21)
and sc2.txn_date <= ( select sc.txn_date
from stuck_costing sc
where sc.txn_action_id in (3,12,21)
and sc.organization_id = &&organization_id
)
start with sc2.organization_id = &&organization_id
connect by sc2.organization_id = prior sc2.waiting_org

The above sql query will give the details of the organization waiting
on other organization's transactions.
Follow the steps given from STEP4-C: a) to f) for the organization
which comes in last row for the above query.

If nothing of the above is applicable then contact Costing Development.

NOTE:- ALL THE ABOVE CASES EXCEPT THE ISSUES RELATED TO COST CUTOFF DATE
AND THE CASE RELATED TO MTL_MATERIAL_TRANSACTIONS_TEMP
ARE RELATED TO DATA CORRUPTION .
AND IF THERE IS A REPRODUCIBLE TEST CASE THEN ROOT CAUSE BUG
SHOULD BE LOGGED WITH COSTING OTHERWISE THESE KIND OF
ISSUES WILL KEEP ON REPEATING.

Anda mungkin juga menyukai