105: l_stmt_num := 10;
106:
107: select count(*)
108: into l_txn_cost_exist
109: from mtl_pac_txn_cost_details
110: where transaction_id = i_txn_id
111: and cost_group_id = i_cost_group_id
112: and pac_period_id = i_pac_period_id;
113:
173: 'Y',
174: 'N',
175: NULL,
176: i_txn_category
177: FROM mtl_pac_txn_cost_details mptcd
178: WHERE transaction_id = i_txn_id
179: AND pac_period_id = i_pac_period_id
180: AND cost_group_id = i_cost_group_id;
181:
1619: FROM cst_pac_item_cost_details cpicd
1620: WHERE cpicd.cost_layer_id = i_cost_layer_id
1621: AND not exists (
1622: SELECT 'not exists in mptcd'
1623: FROM mtl_pac_txn_cost_details mptcd
1624: WHERE mptcd.transaction_id = i_txn_id
1625: AND mptcd.pac_period_id = i_pac_period_id
1626: AND mptcd.cost_group_id = i_cost_group_id
1627: AND mptcd.cost_element_id = cpicd.cost_element_id
1768: ),
1769: 0
1770: )
1771: )
1772: FROM mtl_pac_txn_cost_details mptcd,
1773: cst_pac_item_cost_details cpicd,
1774: cst_pac_quantity_layers cpql
1775: WHERE mptcd.transaction_id = i_txn_id
1776: AND mptcd.pac_period_id = i_pac_period_id
1828: /* item cost with the new cost. Otherwise set it to 0 */
1829: l_stmt_num := 40;
1830: SELECT DECODE(MAX(value_change),NULL, 1, 0)
1831: INTO l_update_flag
1832: FROM mtl_pac_txn_cost_details mptcd
1833: WHERE mptcd.transaction_id = i_txn_id
1834: AND mptcd.pac_period_id = i_pac_period_id
1835: AND mptcd.cost_group_id = i_cost_group_id;
1836: