DBA Data[Home] [Help]

APPS.CSTPFCHK dependencies on MTL_PAC_ACTUAL_COST_DETAILS

Line 119: INSERT INTO mtl_pac_actual_cost_details (

115:
116: l_ret_val := 1;
117: l_stmt_num := 20;
118:
119: INSERT INTO mtl_pac_actual_cost_details (
120: transaction_id,
121: pac_period_id,
122: cost_type_id,
123: cost_group_id,

Line 186: ** Create detail rows in MTL_PAC_ACTUAL_COST_DETAILS based on **

182: else
183: l_ret_val := 0;
184:
185: /********************************************************************
186: ** Create detail rows in MTL_PAC_ACTUAL_COST_DETAILS based on **
187: ** records in CST_PAC_ITEM_COST_DETAILS. Since we are using **
188: ** current average the actual cost, prior cost and new cost are **
189: ** all the same. **
190: ** If detail rows do not exist in CST_PAC_ITEM_COST_DETAILS, **

Line 206: INSERT INTO mtl_pac_actual_cost_details (

202:
203: l_stmt_num := 40;
204:
205:
206: INSERT INTO mtl_pac_actual_cost_details (
207: transaction_id,
208: pac_period_id,
209: cost_type_id,
210: cost_group_id,

Line 270: INSERT INTO mtl_pac_actual_cost_details (

266:
267: else
268: l_stmt_num := 50;
269:
270: INSERT INTO mtl_pac_actual_cost_details (
271: transaction_id,
272: pac_period_id,
273: cost_type_id,
274: cost_group_id,

Line 444: ** Update mtl_pac_actual_cost_details and update the prior cost **

440: l_new_make_qty := 0;
441:
442:
443: /********************************************************************
444: ** Update mtl_pac_actual_cost_details and update the prior cost **
445: ** to the current average for the elements that exists and insert **
446: ** in to mtl_pac_actual_cost_details the current average cost for **
447: ** the elements that do not exist. **
448: ********************************************************************/

Line 446: ** in to mtl_pac_actual_cost_details the current average cost for **

442:
443: /********************************************************************
444: ** Update mtl_pac_actual_cost_details and update the prior cost **
445: ** to the current average for the elements that exists and insert **
446: ** in to mtl_pac_actual_cost_details the current average cost for **
447: ** the elements that do not exist. **
448: ********************************************************************/
449:
450: l_stmt_num := 10;

Line 452: UPDATE mtl_pac_actual_cost_details mpacd

448: ********************************************************************/
449:
450: l_stmt_num := 10;
451:
452: UPDATE mtl_pac_actual_cost_details mpacd
453: SET prior_cost = 0,
454: prior_buy_cost = 0,
455: prior_make_cost = 0,
456: new_cost = NULL,

Line 465: UPDATE mtl_pac_actual_cost_details mpacd

461: AND mpacd.cost_layer_id = i_cost_layer_id;
462:
463: l_stmt_num := 20;
464:
465: UPDATE mtl_pac_actual_cost_details mpacd
466: SET (prior_cost,
467: prior_buy_cost,
468: prior_make_cost,
469: insertion_flag) =

Line 490: INSERT INTO mtl_pac_actual_cost_details (

486: AND cpicd.level_type = mpacd.level_type);
487:
488: l_stmt_num := 30;
489:
490: INSERT INTO mtl_pac_actual_cost_details (
491: transaction_id,
492: pac_period_id,
493: cost_type_id,
494: cost_group_id,

Line 551: FROM mtl_pac_actual_cost_details mpacd

547: FROM cst_pac_item_cost_details cpicd
548: WHERE cost_layer_id = i_cost_layer_id
549: AND NOT EXISTS
550: (SELECT 'this detail is not in mpacd already'
551: FROM mtl_pac_actual_cost_details mpacd
552: WHERE mpacd.transaction_id = i_txn_id
553: AND mpacd.cost_group_id = i_cost_group_id
554: AND mpacd.cost_layer_id = i_cost_layer_id
555: AND mpacd.cost_element_id = cpicd.cost_element_id

Line 584: UPDATE mtl_pac_actual_cost_details mpacd

580:
581:
582: l_stmt_num := 50;
583:
584: UPDATE mtl_pac_actual_cost_details mpacd
585: SET new_cost =
586: decode(sign(l_cur_onhand),-1,
587: decode(sign(i_txn_qty), -1,
588: (mpacd.prior_cost*l_cur_onhand + mpacd.actual_cost*i_txn_qty)/l_new_onhand,

Line 651: FROM mtl_pac_actual_cost_details mpacd

647: sysdate,
648: new_cost,
649: new_buy_cost,
650: new_make_cost
651: FROM mtl_pac_actual_cost_details mpacd
652: WHERE mpacd.transaction_id = i_txn_id
653: AND mpacd.cost_group_id = i_cost_group_id
654: AND mpacd.cost_layer_id = i_cost_layer_id
655: AND mpacd.cost_element_id = cpicd.cost_element_id

Line 692: FROM mtl_pac_actual_cost_details mpacd

688: sysdate,
689: mpacd.new_cost,
690: mpacd.new_buy_cost,
691: mpacd.new_make_cost
692: FROM mtl_pac_actual_cost_details mpacd
693: WHERE mpacd.transaction_id = i_txn_id
694: AND mpacd.cost_group_id = i_cost_group_id
695: AND mpacd.cost_layer_id = i_cost_layer_id
696: AND mpacd.insertion_flag = 'Y';

Line 1559: INSERT INTO mtl_pac_actual_cost_details (

1555: ** - exists in cpicd, but not exists in mptcd **
1556: ** It will use the current cost in cpicd as the new cost **
1557: ********************************************************************/
1558: l_stmt_num := 5;
1559: INSERT INTO mtl_pac_actual_cost_details (
1560: transaction_id,
1561: pac_period_id,
1562: cost_type_id,
1563: cost_group_id,

Line 1638: INSERT INTO mtl_pac_actual_cost_details (

1634: ** New cost will be calculated based on current cost (if exists) **
1635: ** and cost change in mptcd. **
1636: ********************************************************************/
1637: l_stmt_num := 10;
1638: INSERT INTO mtl_pac_actual_cost_details (
1639: transaction_id,
1640: pac_period_id,
1641: cost_type_id,
1642: cost_group_id,

Line 1820: FROM mtl_pac_actual_cost_details mpacd

1816: sysdate,
1817: mpacd.new_cost,
1818: mpacd.new_buy_cost,
1819: mpacd.new_make_cost
1820: FROM mtl_pac_actual_cost_details mpacd
1821: WHERE mpacd.transaction_id = i_txn_id
1822: AND mpacd.cost_group_id = i_cost_group_id
1823: AND mpacd.cost_layer_id = i_cost_layer_id
1824: AND mpacd.insertion_flag = 'Y';