DBA Data[Home] [Help]

APPS.CSTPAVCP dependencies on MTL_MATERIAL_TRANSACTIONS

Line 92: FROM mtl_parameters mp, mtl_material_transactions mmt

88:
89: /* INVCONV sschinch Check if this transaction is a process discrete transfer */
90: SELECT MOD(SUM(DECODE(mp.process_enabled_flag, 'Y', 1, 2)), 2)
91: INTO l_pd_txfr_ind
92: FROM mtl_parameters mp, mtl_material_transactions mmt
93: WHERE mmt.transaction_id = i_txn_id
94: AND (mmt.organization_id = mp.organization_id
95: OR mmt.transfer_organization_id = mp.organization_id);
96:

Line 398: from mtl_material_transactions

394: if i_txn_action_id IN (2,5,28,55) then
395: l_stmt_num := 70;
396: select transaction_type_id
397: into l_txn_type_id
398: from mtl_material_transactions
399: where transaction_id = i_txn_id;
400:
401: if (l_txn_type_id = 68) and (i_layer_id <> i_txfr_layer_id) then
402: -- if payback txn and txn involved different projects then populate MCTCD

Line 446: FROM mtl_material_transactions MMT,

442: -- Check if Sales Order is referenced
443: l_stmt_num := 83;
444: SELECT MIN(OOLA.reference_line_id)
445: INTO l_so_line_id
446: FROM mtl_material_transactions MMT,
447: oe_order_lines_all OOLA
448: WHERE MMT.transaction_id = i_txn_id
449: AND OOLA.line_id = MMT.trx_source_line_id;
450:

Line 490: mtl_material_transactions MMT,

486: SYSDATE
487: FROM oe_order_lines_all OOLA, /*BUG 5768680 Changes introduced to improve performance*/
488: oe_order_headers_all OOHA, /* of the layer cost worker*/
489: mtl_sales_orders MSO,
490: mtl_material_transactions MMT,
491: mtl_cst_actual_cost_details MCACD
492: WHERE OOLA.line_id = l_so_line_id
493: AND OOHA.header_id = OOLA.header_id
494: AND MSO.segment1 = TO_CHAR(OOHA.order_number) -- extraneous MSOs are possible

Line 696: from mtl_material_transactions

692: l_stmt_num := 150;
693:
694: select transaction_type_id
695: into l_txn_type_id
696: from mtl_material_transactions
697: where transaction_id = i_txn_id;
698:
699: l_stmt_num := 160;
700: IF ( I_TXN_ACTION_ID = 1 AND L_TXN_TYPE_ID = 34 AND I_TXN_SRC_TYPE = 8) THEN

Line 1092: ** Update Mtl_Material_Transactions **

1088: where clcd.layer_id = i_layer_id);
1089:
1090: l_stmt_num := 60;
1091: /********************************************************************
1092: ** Update Mtl_Material_Transactions **
1093: ********************************************************************/
1094: CSTPAVCP.update_mmt(
1095: i_org_id,
1096: i_txn_id,

Line 1261: from mtl_material_transactions

1257: -- borrow / payback
1258: l_stmt_num := 10;
1259: select transaction_type_id
1260: into l_txn_type_id
1261: from mtl_material_transactions
1262: where transaction_id = i_txn_id;
1263: -- borrow / payback end
1264:
1265: l_stmt_num := 15;

Line 1292: , mtl_material_transactions mmt

1288:
1289: select decode(asset_inventory,1,0,1)
1290: into l_exp1
1291: from mtl_secondary_inventories msi
1292: , mtl_material_transactions mmt
1293: where msi.secondary_inventory_name = mmt.subinventory_code
1294: and msi.organization_id = i_org_id
1295: and mmt.transaction_id = i_txn_id
1296: and mmt.organization_id = i_org_id;

Line 1335: from mtl_material_transactions mmt,

1331: 3, 0,
1332: 6, 0,
1333: 4, decode(l_exp1, 1, 1, 0))
1334: into l_exp2
1335: from mtl_material_transactions mmt,
1336: wip_flow_schedules wfs,
1337: wip_accounting_classes wac
1338: where mmt.transaction_id = i_txn_id
1339: and mmt.organization_id = i_org_id

Line 1352: from mtl_material_transactions mmt,

1348: 3, 0,
1349: 6, 0,
1350: 4, decode(l_exp1, 1, 1, 0))
1351: into l_exp2
1352: from mtl_material_transactions mmt,
1353: wip_discrete_jobs wdj,
1354: wip_accounting_classes wac
1355: where mmt.transaction_id = i_txn_id
1356: and mmt.organization_id = i_org_id

Line 1372: , mtl_material_transactions mmt

1368:
1369: select decode(asset_inventory,1,0,1)
1370: into l_exp2
1371: from mtl_secondary_inventories msi
1372: , mtl_material_transactions mmt
1373: where msi.secondary_inventory_name = mmt.transfer_subinventory
1374: and msi.organization_id = i_org_id
1375: and mmt.transaction_id = i_txn_id
1376: and mmt.organization_id = i_org_id;

Line 1910: FROM mtl_material_transactions

1906:
1907: l_stmt_num := 190;
1908: SELECT transfer_transaction_id
1909: INTO l_txf_txn_id
1910: FROM mtl_material_transactions
1911: WHERE transaction_id = i_txn_id;
1912:
1913: l_stmt_num := 200;
1914: UPDATE mtl_material_transactions MMT

Line 1914: UPDATE mtl_material_transactions MMT

1910: FROM mtl_material_transactions
1911: WHERE transaction_id = i_txn_id;
1912:
1913: l_stmt_num := 200;
1914: UPDATE mtl_material_transactions MMT
1915: SET (
1916: last_update_date,
1917: last_updated_by,
1918: last_update_login,

Line 2027: from mtl_material_transactions

2023: l_stmt_num := 5;
2024: /* Added Bug#4259926 */
2025: select transaction_action_id, transaction_source_type_id
2026: into l_txn_action_id,l_src_type
2027: from mtl_material_transactions
2028: where transaction_id = i_txn_id;
2029:
2030: if ( l_txn_action_id = 27 and I_CITW_FLAG = 1 and l_src_type = 5 ) then
2031: l_layer_id := i_txfr_layer_id;

Line 2039: UPDATE mtl_material_transactions mmt

2035:
2036: -- item cost history, update the transfer_prior_costed_quantity
2037: -- is necessary because we need both the from and the to information
2038: -- in item cost history
2039: UPDATE mtl_material_transactions mmt
2040: SET TRANSFER_PRIOR_COSTED_QUANTITY =
2041: (SELECT
2042: layer_quantity
2043: FROM cst_quantity_layers cql

Line 2236: from mtl_material_transactions mmt,

2232: 3, 0,
2233: 6, 0,
2234: 4, decode(i_exp_flag, 1, 1, 0))
2235: into l_exp_flag
2236: from mtl_material_transactions mmt,
2237: wip_flow_schedules wfs,
2238: wip_accounting_classes wac
2239: where mmt.transaction_id = i_txn_id
2240: and mmt.organization_id = i_org_id

Line 2252: from mtl_material_transactions mmt,

2248: 3, 0,
2249: 6, 0,
2250: 4, decode(i_exp_flag, 1, 1, 0))
2251: into l_exp_flag
2252: from mtl_material_transactions mmt,
2253: wip_discrete_jobs wdj,
2254: wip_accounting_classes wac
2255: where mmt.transaction_id = i_txn_id
2256: and mmt.organization_id = i_org_id

Line 2849: from mtl_material_transactions

2845: l_stmt_num := 12;
2846:
2847: select organization_id, transfer_organization_id, primary_quantity
2848: into l_txn_org_id, l_txfr_org_id, l_txn_qty
2849: from mtl_material_transactions
2850: where transaction_id = i_txn_id;
2851:
2852: -- Figure the from and to org for this transaction.
2853: if (i_txn_action_id = 21) then

Line 3534: ** Update Mtl_Material_Transactions **

3530: and cacd.insertion_flag = 'Y';
3531:
3532:
3533: /********************************************************************
3534: ** Update Mtl_Material_Transactions **
3535: ** Need to update prior_costed_quantity now. **
3536: ********************************************************************/
3537: if (i_no_update_mmt = 0) then
3538:

Line 3545: from mtl_material_transactions

3541: /* Changes for VMI. Adding Planning Transfer Transaction */
3542: if (i_txn_action_id IN (2,5,28,55) and i_txn_qty > 0) then
3543: select transfer_transaction_id
3544: into l_txfr_txn_id
3545: from mtl_material_transactions
3546: where transaction_id = i_txn_id;
3547: else
3548: l_txfr_txn_id := -1;
3549: end if;

Line 3732: ** Update Mtl_Material_Transactions to set actual cost, prior **

3728: IF g_debug = 'Y' THEN
3729: fnd_file.put_line(fnd_file.log, 'Current_Average_Cost <<<');
3730: END IF;
3731: /********************************************************************
3732: ** Update Mtl_Material_Transactions to set actual cost, prior **
3733: ** cost, new cost and prior costed quantity. **
3734: ********************************************************************/
3735: if (i_no_update_mmt = 0) then
3736: CSTPAVCP.update_mmt(

Line 3873: from mtl_material_transactions

3869:
3870: l_stmt_num := 5;
3871: Select transaction_action_id
3872: into l_transaction_action_id
3873: from mtl_material_transactions
3874: where transaction_id = i_txn_id;
3875: -- for item cost history
3876:
3877: -- Since we are processing shipment side of subinventory

Line 3917: from mtl_material_transactions

3913: decode(cost_group_id, NVL(transfer_cost_group_id, cost_group_id), 0, 1),
3914: 0)
3915: ,0)
3916: into l_citw_flag
3917: from mtl_material_transactions
3918: where transaction_id = i_txn_id;
3919:
3920: -- Added for Bug# 5137993
3921: -- Actual cost should not be populated for expense item

Line 3929: FROM mtl_material_transactions

3925: INTO l_asset_item_flag
3926: FROM mtl_system_items
3927: WHERE organization_id = i_org_id
3928: AND inventory_item_id = (SELECT inventory_item_id
3929: FROM mtl_material_transactions
3930: WHERE transaction_id = i_txn_id);
3931: -- end of changes for Bug# 5137993
3932:
3933: /* Added Bug#4259926 */

Line 3939: Update mtl_material_transactions mmt

3935: l_txn_id := i_txn_id;
3936: End if;
3937:
3938: l_stmt_num := 35;
3939: Update mtl_material_transactions mmt
3940: set (last_update_date,
3941: last_updated_by,
3942: last_update_login,
3943: request_id,

Line 3977: Update mtl_material_transactions mmt

3973: where mmt.transaction_id = l_txn_id;
3974: else
3975: l_stmt_num := 40;
3976:
3977: Update mtl_material_transactions mmt
3978: set last_update_date = sysdate,
3979: last_updated_by = i_user_id,
3980: last_update_login = i_login_id,
3981: request_id = i_req_id,

Line 4003: FROM mtl_material_transactions mmt

3999: SELECT
4000: mmt.inventory_item_id
4001: INTO
4002: l_item_id
4003: FROM mtl_material_transactions mmt
4004: WHERE mmt.transaction_id = i_txn_id;
4005:
4006: l_stmt_num := 44;
4007: UPDATE mtl_material_transactions mmt

Line 4007: UPDATE mtl_material_transactions mmt

4003: FROM mtl_material_transactions mmt
4004: WHERE mmt.transaction_id = i_txn_id;
4005:
4006: l_stmt_num := 44;
4007: UPDATE mtl_material_transactions mmt
4008: SET prior_costed_quantity = (
4009: SELECT cql.layer_quantity - mmt.primary_quantity
4010: FROM cst_quantity_layers cql,
4011: mtl_parameters mp

Line 4056: FROM mtl_material_transactions mmt,

4052: INTO l_from_inv,
4053: l_transfer_txn_id,
4054: l_item_id,
4055: l_transfer_cost_grp_id
4056: FROM mtl_material_transactions mmt,
4057: mtl_secondary_inventories msi
4058: WHERE mmt.transaction_id = i_txn_id
4059: AND mmt.subinventory_code = msi.secondary_inventory_name
4060: AND mmt.organization_id = msi.organization_id;

Line 4065: FROM mtl_material_transactions mmt,

4061:
4062: l_stmt_num := 55;
4063: SELECT nvl(msi.asset_inventory,-9)
4064: INTO l_to_inv
4065: FROM mtl_material_transactions mmt,
4066: mtl_secondary_inventories msi
4067: WHERE mmt.transaction_id = i_txn_id
4068: AND nvl(mmt.transfer_subinventory,mmt.subinventory_code) = msi.secondary_inventory_name
4069: AND mmt.organization_id = msi.organization_id;

Line 4075: UPDATE mtl_material_transactions mmt

4071: -- item cost history stuff
4072: -- from expense to asset sub-transfer
4073: IF ((l_from_inv = 2) and (l_to_inv = 1))then
4074: l_stmt_num := 60;
4075: UPDATE mtl_material_transactions mmt
4076: SET prior_costed_quantity =
4077: (SELECT
4078: layer_quantity
4079: FROM cst_quantity_layers cql

Line 4093: update mtl_material_transactions mmt

4089: AND cql.cost_group_id = l_transfer_cost_grp_id);
4090:
4091:
4092: IF SQL%ROWCOUNT = 0 THEN
4093: update mtl_material_transactions mmt
4094: set prior_costed_quantity = 0
4095: where mmt.transaction_id = l_transfer_txn_id;
4096: END IF;
4097: END IF;

Line 4557: ,mtl_material_transactions mmt

4553: l_stmt_num := 30;
4554: select decode(l_std_exp,1,1,decode(asset_inventory,1,0,1))
4555: into l_std_exp
4556: from mtl_secondary_inventories msi
4557: ,mtl_material_transactions mmt
4558: where mmt.transaction_id = i_txn_id
4559: and mmt.organization_id = l_std_org
4560: and msi.organization_id = l_std_org
4561: and msi.secondary_inventory_name = mmt.subinventory_code;

Line 4652: UPDATE mtl_material_transactions mmt

4648: if i_org_id = l_which_org then -- this takes care the case R/R,
4649: -- cost worker will process the same mmt
4650: -- transaction twice
4651: l_stmt_num := 50;
4652: UPDATE mtl_material_transactions mmt
4653: SET TRANSFER_PRIOR_COSTED_QUANTITY =
4654: (SELECT
4655: layer_quantity
4656: FROM cst_quantity_layers cql

Line 4669: update mtl_material_transactions mmt

4665: AND cql.inventory_item_id = i_item_id
4666: AND cql.cost_group_id = l_which_cst_grp);
4667:
4668: IF SQL%ROWCOUNT = 0 THEN
4669: update mtl_material_transactions mmt
4670: set TRANSFER_PRIOR_COSTED_QUANTITY = 0
4671: where mmt.transaction_id = i_txn_id;
4672: END IF;
4673: end if;

Line 4681: UPDATE mtl_material_transactions mmt

4677:
4678: -- bug 2827548 - took following IF condition out of the one that follows it because we
4679: -- need to update txn_cost of receit txn before returning if shipment is already costed
4680: if (i_txn_action_id = 12 and i_org_id = i_txn_org_id and i_fob_point = 1) then
4681: UPDATE mtl_material_transactions mmt
4682: SET mmt.transaction_cost = (select (mmt1.transaction_cost * mmt1.currency_conversion_rate)
4683: from mtl_material_transactions mmt1
4684: where mmt1.transaction_id = mmt.transfer_transaction_id
4685: and mmt1.costed_flag is null)

Line 4683: from mtl_material_transactions mmt1

4679: -- need to update txn_cost of receit txn before returning if shipment is already costed
4680: if (i_txn_action_id = 12 and i_org_id = i_txn_org_id and i_fob_point = 1) then
4681: UPDATE mtl_material_transactions mmt
4682: SET mmt.transaction_cost = (select (mmt1.transaction_cost * mmt1.currency_conversion_rate)
4683: from mtl_material_transactions mmt1
4684: where mmt1.transaction_id = mmt.transfer_transaction_id
4685: and mmt1.costed_flag is null)
4686: WHERE mmt.transaction_id = i_txn_id
4687: AND nvl(mmt.transaction_cost,0) = 0;

Line 4933: update mtl_material_transactions mmt

4929:
4930: if (i_txn_org_id = l_std_org) then
4931: -- update actual cost column of mmt.
4932: l_stmt_num := 90;
4933: update mtl_material_transactions mmt
4934: set (last_update_date,
4935: last_updated_by,
4936: last_update_login,
4937: request_id,

Line 4970: from mtl_material_transactions

4966: l_stmt_num := 100;
4967:
4968: select transfer_transaction_id
4969: into l_txn_update_id
4970: from mtl_material_transactions
4971: where transaction_id = i_txn_id;
4972: else
4973: l_txn_update_id := i_txn_id;
4974: end if;

Line 5164: Update mtl_material_transactions

5160: -- the transfer cost is always in shipping UOM and currency
5161: -- For FOB receipt, need to convert the primary_quantity (in receiving UOM)
5162: -- to sending primary quantity.
5163: l_stmt_num := 150;
5164: Update mtl_material_transactions
5165: Set transfer_cost =
5166: (select decode(nvl(transfer_percentage, -999),-999, transfer_cost,
5167: (transfer_percentage * l_snd_txn_cost *
5168: decode(i_txn_action_id, 12, abs(primary_quantity)/l_um_rate,

Line 5170: from mtl_material_transactions

5166: (select decode(nvl(transfer_percentage, -999),-999, transfer_cost,
5167: (transfer_percentage * l_snd_txn_cost *
5168: decode(i_txn_action_id, 12, abs(primary_quantity)/l_um_rate,
5169: abs(primary_quantity)))*l_xfer_conv_rate/100) -- bug 2827548-added l_xfer_conv_rate
5170: from mtl_material_transactions
5171: where transaction_id = i_txn_id)
5172: where transaction_id = i_txn_id
5173: or (transaction_id = decode(i_txn_action_id,3,l_txn_update_id,-1));
5174:

Line 5181: from mtl_material_transactions

5177:
5178: select nvl(transfer_cost,0), nvl(transportation_cost,0),
5179: decode(i_txn_action_id,12,(primary_quantity / l_um_rate),primary_quantity)
5180: into l_txfr_cost, l_trans_cost, l_snd_qty
5181: from mtl_material_transactions
5182: where transaction_id = i_txn_id;
5183:
5184: IF g_debug = 'Y' THEN
5185: fnd_file.put_line(fnd_file.log, '>>>Transfer cost: '||to_char(l_txfr_cost)||' Transportation cost: '||to_char(l_trans_cost)||' Sending quantity: '||to_char(l_snd_qty));

Line 5286: Update mtl_material_transactions

5282: END IF;
5283:
5284: -- Update the transaction cost column if appropriate.
5285: /* Begin changes and additions for bug 2827548 */
5286: Update mtl_material_transactions
5287: Set transaction_cost = l_new_txn_cost
5288: where transaction_id = i_txn_id;
5289:
5290: if (i_txn_action_id = 3) then

Line 5291: Update mtl_material_transactions

5287: Set transaction_cost = l_new_txn_cost
5288: where transaction_id = i_txn_id;
5289:
5290: if (i_txn_action_id = 3) then
5291: Update mtl_material_transactions
5292: Set transaction_cost = l_rcv_txn_cost
5293: where transaction_id = l_txn_update_id;
5294: end if;
5295:

Line 5299: update mtl_material_transactions mmt

5295:
5296: -- Update the transaction_cost column for receipt txn w/ fob shipment
5297: -- in the receiving org's currency
5298: if (i_txn_action_id = 21 and i_fob_point = 1) then
5299: update mtl_material_transactions mmt
5300: set mmt.transaction_cost = l_rcv_txn_cost
5301: where mmt.transfer_transaction_id = i_txn_id
5302: and mmt.transaction_action_id = 12;
5303: -- Update the transaction_cost column for shipment txn w/ fob receipt

Line 5306: update mtl_material_transactions mmt

5302: and mmt.transaction_action_id = 12;
5303: -- Update the transaction_cost column for shipment txn w/ fob receipt
5304: -- in the sending org's currency
5305: elsif (i_txn_action_id = 12 and i_fob_point = 2) then
5306: update mtl_material_transactions mmt
5307: set mmt.transaction_cost = l_snd_txn_cost
5308: where mmt.transaction_id =
5309: (select mmt1.transfer_transaction_id
5310: from mtl_material_transactions mmt1

Line 5310: from mtl_material_transactions mmt1

5306: update mtl_material_transactions mmt
5307: set mmt.transaction_cost = l_snd_txn_cost
5308: where mmt.transaction_id =
5309: (select mmt1.transfer_transaction_id
5310: from mtl_material_transactions mmt1
5311: where mmt1.transaction_id = i_txn_id)
5312: and mmt.transaction_action_id = 21
5313: and nvl(mmt.transaction_cost,0) = 0;
5314: end if;

Line 5333: from mtl_material_transactions mmt

5329:
5330: l_stmt_num := 180;
5331: select transfer_transaction_id
5332: into l_txfr_txn_id
5333: from mtl_material_transactions mmt
5334: where mmt.transaction_id = i_txn_id;
5335:
5336: l_stmt_num := 190;
5337: select decode(l_txfr_std_exp,1,1,decode(asset_inventory,1,0,1))

Line 5340: ,mtl_material_transactions mmt

5336: l_stmt_num := 190;
5337: select decode(l_txfr_std_exp,1,1,decode(asset_inventory,1,0,1))
5338: into l_txfr_std_exp
5339: from mtl_secondary_inventories msi
5340: ,mtl_material_transactions mmt
5341: where mmt.transaction_id = l_txfr_txn_id
5342: and mmt.organization_id = l_std_org
5343: and msi.organization_id = l_std_org
5344: and msi.secondary_inventory_name = mmt.subinventory_code;

Line 5399: update mtl_material_transactions mmt

5395: WHERE ctcd.transaction_id = l_txn_update_id
5396: AND ctcd.organization_id = l_std_org
5397: /* AND ctcd.transaction_cost >= 0 */; -- modified for bug#3835412
5398:
5399: update mtl_material_transactions mmt
5400: set (last_update_date,
5401: last_updated_by,
5402: last_update_login,
5403: request_id,

Line 5483: update mtl_material_transactions mmt

5479: /* AND ctcd.transaction_cost >= 0 */; -- modified for bug#3835412
5480:
5481: if (l_std_org = i_txn_org_id or i_txn_action_id = 3) then
5482: l_stmt_num := 220;
5483: update mtl_material_transactions mmt
5484: set (last_update_date,
5485: last_updated_by,
5486: last_update_login,
5487: request_id,

Line 5519: from mtl_material_transactions mmt

5515: if (l_to_std_exp = 1) then
5516: if (i_txn_org_id = l_std_org) then
5517: select transfer_transaction_id
5518: into l_txfr_txn_id
5519: from mtl_material_transactions mmt
5520: where mmt.transaction_id = i_txn_id;
5521: end if;
5522:
5523: l_stmt_num := 260;

Line 5577: update mtl_material_transactions mmt

5573: /* AND ctcd.transaction_cost >= 0 */; -- modified for bug#3835412
5574:
5575: -- update mmt if this is the receiving transaction id
5576: if (i_txn_org_id = l_std_org) then
5577: update mtl_material_transactions mmt
5578: set (last_update_date,
5579: last_updated_by,
5580: last_update_login,
5581: request_id,

Line 5704: from mtl_material_transactions

5700: l_stmt_num := 50;
5701:
5702: select currency_conversion_type, TRUNC(transaction_date)
5703: into l_curr_type, l_txn_date
5704: from mtl_material_transactions
5705: where transaction_id = i_txn_id;
5706:
5707: if (l_curr_type is NULL) then
5708: FND_PROFILE.get('CURRENCY_CONVERSION_TYPE', l_curr_type);

Line 6605: FROM mtl_material_transactions mmt,

6601: NVL(mmt.DISTRIBUTION_ACCOUNT_ID, -1) "DISTRIBUTION_ACCOUNT_ID",
6602: mp.primary_cost_method "COST_TYPE_ID", /* For use as cost_type_id */
6603: NVL(mp.AVG_RATES_COST_TYPE_ID, -1) "AVG_RATES_COST_TYPE_ID",
6604: decode(msi.INVENTORY_ASSET_FLAG,'Y',0,1) "EXP_ITEM"
6605: FROM mtl_material_transactions mmt,
6606: mtl_parameters mp,
6607: mtl_system_items_b msi
6608: WHERE mmt.organization_id = mp.organization_id
6609: AND mmt.inventory_item_id = msi.inventory_item_id

Line 6725: from mtl_material_transactions

6721: end if;
6722: else
6723: select organization_id, decode(nvl(logical_transaction, 2), 1, 0, 1)
6724: into l_parent_organization_id, l_parent_transaction_type
6725: from mtl_material_transactions
6726: where transaction_id = p_parent_id;
6727: end if;
6728:
6729: if (c_mmt_txn_rec.organization_id = l_parent_organization_id and

Line 6893: Update mtl_material_transactions mmt

6889: /* Update MMT */
6890:
6891: l_stmt_num := 42;
6892:
6893: Update mtl_material_transactions mmt
6894: set (last_update_date,
6895: last_updated_by,
6896: last_update_login,
6897: request_id,

Line 6988: update mtl_material_transactions

6984: /* Update Costed Flag */
6985: l_stmt_num := 70;
6986: -- Change to PL/SQL Logic for the performance Bug 4773025
6987: if (p_parent_id is not null) then
6988: update mtl_material_transactions
6989: set costed_flag = NULL
6990: WHERE parent_transaction_id = p_parent_id;
6991: else
6992: update mtl_material_transactions

Line 6992: update mtl_material_transactions

6988: update mtl_material_transactions
6989: set costed_flag = NULL
6990: WHERE parent_transaction_id = p_parent_id;
6991: else
6992: update mtl_material_transactions
6993: set costed_flag = NULL
6994: WHERE transaction_id = p_txn_id ;
6995: end if;
6996:

Line 7011: update mtl_material_transactions

7007: l_err_msg || ':' || substr(SQLERRM,1,200);
7008:
7009: /* Modified update statement for performance reasons. See bug#3585779*/
7010: if (p_parent_id is null) then
7011: update mtl_material_transactions
7012: set costed_flag = 'E',
7013: error_code = x_err_code,
7014: error_explanation = x_err_msg
7015: where (p_txn_id is not null

Line 7021: update mtl_material_transactions

7017:
7018: elsif (p_parent_id is not null) then
7019: /* Changed to PL/SQL Logic for performance Bug 4773025 */
7020: if(p_txn_id is not null) then
7021: update mtl_material_transactions
7022: set costed_flag = decode(transaction_id, p_parent_id, 'E', 'N'),
7023: error_code = x_err_code,
7024: error_explanation = x_err_msg
7025: where parent_transaction_id = p_parent_id or

Line 7029: update mtl_material_transactions

7025: where parent_transaction_id = p_parent_id or
7026: (transaction_id = p_parent_id and parent_transaction_id is null) or
7027: (transaction_id = p_txn_id);
7028: else
7029: update mtl_material_transactions
7030: set costed_flag = decode(transaction_id, p_parent_id, 'E', 'N'),
7031: error_code = x_err_code,
7032: error_explanation = x_err_msg
7033: where parent_transaction_id = p_parent_id or

Line 7046: update mtl_material_transactions

7042: substr(SQLERRM,1,200);
7043:
7044: /* Modified update statement for performance reasons. See bug#3585779*/
7045: if (p_parent_id is null) then
7046: update mtl_material_transactions
7047: set costed_flag = 'E',
7048: error_code = x_err_code,
7049: error_explanation = x_err_msg,
7050: request_id = p_request_id

Line 7057: update mtl_material_transactions

7053:
7054: elsif (p_parent_id is not null) then
7055: /* Changed to PL/SQL Logic for performance Bug 4773025 */
7056: if (p_txn_id is not null) then
7057: update mtl_material_transactions
7058: set costed_flag = decode(transaction_id, p_parent_id, 'E', 'N'),
7059: error_code = x_err_code,
7060: error_explanation = x_err_msg,
7061: request_id = p_request_id

Line 7066: update mtl_material_transactions

7062: where parent_transaction_id = p_parent_id or
7063: (transaction_id = p_parent_id and parent_transaction_id is null) or
7064: (transaction_id = p_txn_id);
7065: else
7066: update mtl_material_transactions
7067: set costed_flag = decode(transaction_id, p_parent_id, 'E', 'N'),
7068: error_code = x_err_code,
7069: error_explanation = x_err_msg,
7070: request_id = p_request_id

Line 7644: Update mtl_material_transactions mmt

7640: -- update prior_cost, ew_cost, variance_amount
7641: -- use the MMT of logical transacion to update corresponding parent.
7642: -------------------------------------------------------------------------
7643:
7644: Update mtl_material_transactions mmt
7645: set (last_update_date,
7646: last_updated_by,
7647: last_update_login,
7648: request_id,

Line 7671: from mtl_material_transactions mmt2

7667: mmt2.new_cost,
7668: mmt2.variance_amount,
7669: mmt2.prior_costed_quantity,
7670: mmt2.quantity_adjusted
7671: from mtl_material_transactions mmt2
7672: where mmt2.transaction_id = p_txn_id
7673: and mmt2.organization_id = p_org_id)
7674: where mmt.transaction_id = p_parent_txn_id;
7675:

Line 7933: l_subinventory_code MTL_MATERIAL_TRANSACTIONS.SUBINVENTORY_CODE%TYPE;

7929: l_sending_curr VARCHAR2(15);
7930:
7931: l_exp_item MTL_SYSTEM_ITEMS.INVENTORY_ASSET_FLAG%TYPE;
7932: l_exp_flag VARCHAR2(1);
7933: l_subinventory_code MTL_MATERIAL_TRANSACTIONS.SUBINVENTORY_CODE%TYPE;
7934:
7935:
7936: l_err_num NUMBER;
7937: l_err_code VARCHAR2(240);

Line 8014: mtl_material_transactions mmt, mtl_parameters mpx, mtl_parameters mp

8010: l_parent_org_process_flag,
8011: l_logical_org_id,
8012: l_logical_org_process_flag
8013: FROM
8014: mtl_material_transactions mmt, mtl_parameters mpx, mtl_parameters mp
8015: WHERE
8016: mmt.transaction_id = p_parent_txn_id
8017: AND mpx.organization_id = mmt.transfer_organization_id
8018: AND mp.organization_id = mmt.organization_id

Line 8096: MTL_MATERIAL_TRANSACTIONS

8092: IF l_pd_xfer_ind = 'N' AND -- Bug 5349860: umoogala
8093: l_exp_flag = 'Y' THEN
8094: l_stmt_num := 16;
8095: UPDATE
8096: MTL_MATERIAL_TRANSACTIONS
8097: SET
8098: COSTED_FLAG = NULL,
8099: LAST_UPDATE_DATE = sysdate,
8100: LAST_UPDATED_BY = p_user_id,

Line 8146: MTL_MATERIAL_TRANSACTIONS

8142: l_debit_account,
8143: l_logical_cost_group_id,
8144: l_transfer_price -- Bug 5349860: umoogala
8145: FROM
8146: MTL_MATERIAL_TRANSACTIONS
8147: WHERE
8148: TRANSACTION_ID = l_logical_txn_id;
8149:
8150: IF ( g_debug = 'Y' ) THEN

Line 8617: MTL_MATERIAL_TRANSACTIONS

8613:
8614: -- Update MMT
8615: l_stmt_num := 160;
8616: UPDATE
8617: MTL_MATERIAL_TRANSACTIONS
8618: SET
8619: COSTED_FLAG = NULL,
8620: transaction_group_id = NULL,
8621: ENCUMBRANCE_AMOUNT = l_enc_amount,

Line 8721: UPDATE mtl_material_transactions

8717: FND_FILE.PUT_LINE(FND_FILE.LOG, x_err_msg);
8718:
8719: WHEN FND_API.g_exc_unexpected_error THEN
8720: rollback;
8721: UPDATE mtl_material_transactions
8722: SET costed_flag = 'E',
8723: error_code = substrb(x_err_code,1,240),
8724: error_explanation = substrb(x_err_msg,1,240),
8725: request_id = p_request_id,

Line 8921: UPDATE mtl_material_transactions mmt

8917:
8918: if i_txn_action_id <> 1 and -- Bug 5349860: exculding IO Issue to Exp Destination
8919: i_org_id = l_which_org then
8920: l_stmt_num := 10;
8921: UPDATE mtl_material_transactions mmt
8922: SET TRANSFER_PRIOR_COSTED_QUANTITY =
8923: (SELECT
8924: layer_quantity
8925: FROM cst_quantity_layers cql

Line 8939: update mtl_material_transactions mmt

8935: AND cql.cost_group_id = l_which_cst_grp);
8936:
8937: IF SQL%ROWCOUNT = 0 THEN
8938: l_stmt_num := 20;
8939: update mtl_material_transactions mmt
8940: set TRANSFER_PRIOR_COSTED_QUANTITY = 0
8941: where mmt.transaction_id = i_txn_id;
8942: END IF;
8943: end if;

Line 8961: FROM mtl_material_transactions

8957: IF i_txn_action_id <> 1
8958: THEN
8959: SELECT nvl(transportation_cost,0)
8960: INTO l_trans_cost
8961: FROM mtl_material_transactions
8962: WHERE transaction_id = i_txn_id;
8963: ELSE
8964: l_trans_cost := 0;
8965: END IF;

Line 9014: Update mtl_material_transactions

9010: fnd_file.put_line(fnd_file.log, 'Updating trx: ' || i_txn_id || ' with trxCost: ' || l_new_txn_cost);
9011: END IF;
9012:
9013: l_stmt_num := 50;
9014: Update mtl_material_transactions
9015: Set transaction_cost = l_new_txn_cost
9016: where transaction_id = i_txn_id;
9017:
9018: elsif (i_txn_action_id = 12 AND i_fob_point = 1)

Line 9026: Update mtl_material_transactions

9022: fnd_file.put_line(fnd_file.log, 'Updating trx: ' || i_txn_id || ' with trxCost: ' || l_rcv_txn_cost);
9023: END IF;
9024:
9025: l_stmt_num := 70;
9026: Update mtl_material_transactions
9027: Set transaction_cost = l_rcv_txn_cost
9028: where transaction_id = i_txn_id;
9029:
9030: elsif ((i_txn_action_id = 15) OR

Line 9080: Update mtl_material_transactions

9076: 0);
9077:
9078: l_stmt_num := 90;
9079: -- Update the transaction cost column if appropriate.
9080: Update mtl_material_transactions
9081: Set transaction_cost = l_rcv_txn_cost
9082: where transaction_id = i_txn_id;
9083:
9084: -- Bug 5349860: Internal Order issues to exp can also happen between

Line 9164: p_transaction_id IN MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ID%TYPE,

9160: END Cost_Logical_itr_receipt;
9161:
9162: PROCEDURE CompEncumbrance_IntOrdersExp (
9163: p_api_version IN NUMBER,
9164: p_transaction_id IN MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ID%TYPE,
9165: p_req_line_id IN PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID%TYPE,
9166: p_item_id IN MTL_SYSTEM_ITEMS.INVENTORY_ITEM_ID%TYPE,
9167: p_organization_id IN MTL_PARAMETERS.ORGANIZATION_ID%TYPE,
9168: p_primary_qty IN MTL_MATERIAL_TRANSACTIONS.PRIMARY_QUANTITY%TYPE,

Line 9168: p_primary_qty IN MTL_MATERIAL_TRANSACTIONS.PRIMARY_QUANTITY%TYPE,

9164: p_transaction_id IN MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ID%TYPE,
9165: p_req_line_id IN PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID%TYPE,
9166: p_item_id IN MTL_SYSTEM_ITEMS.INVENTORY_ITEM_ID%TYPE,
9167: p_organization_id IN MTL_PARAMETERS.ORGANIZATION_ID%TYPE,
9168: p_primary_qty IN MTL_MATERIAL_TRANSACTIONS.PRIMARY_QUANTITY%TYPE,
9169: p_total_primary_qty IN NUMBER,
9170: x_encumbrance_amount OUT NOCOPY NUMBER,
9171: x_encumbrance_account OUT NOCOPY NUMBER,
9172: x_return_status OUT NOCOPY VARCHAR,

Line 9364: p_transaction_id IN MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ID%TYPE,

9360: END CompEncumbrance_IntOrdersExp;
9361:
9362: PROCEDURE CompEncumbrance_IntOrdersExp (
9363: p_api_version IN NUMBER,
9364: p_transaction_id IN MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ID%TYPE,
9365: x_encumbrance_amount OUT NOCOPY NUMBER,
9366: x_encumbrance_account OUT NOCOPY NUMBER,
9367: x_return_status OUT NOCOPY VARCHAR,
9368: x_return_message OUT NOCOPY VARCHAR2

Line 9372: l_primary_qty MTL_MATERIAL_TRANSACTIONS.PRIMARY_QUANTITY%TYPE;

9368: x_return_message OUT NOCOPY VARCHAR2
9369: ) IS
9370:
9371: l_total_primary_qty NUMBER;
9372: l_primary_qty MTL_MATERIAL_TRANSACTIONS.PRIMARY_QUANTITY%TYPE;
9373: l_organization_id MTL_MATERIAL_TRANSACTIONS.ORGANIZATION_ID%TYPE;
9374: l_trx_source_line_id MTL_MATERIAL_TRANSACTIONS.TRX_SOURCE_LINE_ID%TYPE;
9375: l_req_line_id PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID%TYPE;
9376: l_item_id MTL_MATERIAL_TRANSACTIONS.INVENTORY_ITEM_ID%TYPE;

Line 9373: l_organization_id MTL_MATERIAL_TRANSACTIONS.ORGANIZATION_ID%TYPE;

9369: ) IS
9370:
9371: l_total_primary_qty NUMBER;
9372: l_primary_qty MTL_MATERIAL_TRANSACTIONS.PRIMARY_QUANTITY%TYPE;
9373: l_organization_id MTL_MATERIAL_TRANSACTIONS.ORGANIZATION_ID%TYPE;
9374: l_trx_source_line_id MTL_MATERIAL_TRANSACTIONS.TRX_SOURCE_LINE_ID%TYPE;
9375: l_req_line_id PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID%TYPE;
9376: l_item_id MTL_MATERIAL_TRANSACTIONS.INVENTORY_ITEM_ID%TYPE;
9377: l_txn_action_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ACTION_ID%TYPE;

Line 9374: l_trx_source_line_id MTL_MATERIAL_TRANSACTIONS.TRX_SOURCE_LINE_ID%TYPE;

9370:
9371: l_total_primary_qty NUMBER;
9372: l_primary_qty MTL_MATERIAL_TRANSACTIONS.PRIMARY_QUANTITY%TYPE;
9373: l_organization_id MTL_MATERIAL_TRANSACTIONS.ORGANIZATION_ID%TYPE;
9374: l_trx_source_line_id MTL_MATERIAL_TRANSACTIONS.TRX_SOURCE_LINE_ID%TYPE;
9375: l_req_line_id PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID%TYPE;
9376: l_item_id MTL_MATERIAL_TRANSACTIONS.INVENTORY_ITEM_ID%TYPE;
9377: l_txn_action_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ACTION_ID%TYPE;
9378: l_txn_src_type_id

Line 9376: l_item_id MTL_MATERIAL_TRANSACTIONS.INVENTORY_ITEM_ID%TYPE;

9372: l_primary_qty MTL_MATERIAL_TRANSACTIONS.PRIMARY_QUANTITY%TYPE;
9373: l_organization_id MTL_MATERIAL_TRANSACTIONS.ORGANIZATION_ID%TYPE;
9374: l_trx_source_line_id MTL_MATERIAL_TRANSACTIONS.TRX_SOURCE_LINE_ID%TYPE;
9375: l_req_line_id PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID%TYPE;
9376: l_item_id MTL_MATERIAL_TRANSACTIONS.INVENTORY_ITEM_ID%TYPE;
9377: l_txn_action_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ACTION_ID%TYPE;
9378: l_txn_src_type_id
9379: MTL_MATERIAL_TRANSACTIONS.TRANSACTION_SOURCE_TYPE_ID%TYPE;
9380: l_rcv_txn_id MTL_MATERIAL_TRANSACTIONS.RCV_TRANSACTION_ID%TYPE;

Line 9377: l_txn_action_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ACTION_ID%TYPE;

9373: l_organization_id MTL_MATERIAL_TRANSACTIONS.ORGANIZATION_ID%TYPE;
9374: l_trx_source_line_id MTL_MATERIAL_TRANSACTIONS.TRX_SOURCE_LINE_ID%TYPE;
9375: l_req_line_id PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID%TYPE;
9376: l_item_id MTL_MATERIAL_TRANSACTIONS.INVENTORY_ITEM_ID%TYPE;
9377: l_txn_action_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ACTION_ID%TYPE;
9378: l_txn_src_type_id
9379: MTL_MATERIAL_TRANSACTIONS.TRANSACTION_SOURCE_TYPE_ID%TYPE;
9380: l_rcv_txn_id MTL_MATERIAL_TRANSACTIONS.RCV_TRANSACTION_ID%TYPE;
9381: l_txn_type_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_TYPE_ID%TYPE;

Line 9379: MTL_MATERIAL_TRANSACTIONS.TRANSACTION_SOURCE_TYPE_ID%TYPE;

9375: l_req_line_id PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID%TYPE;
9376: l_item_id MTL_MATERIAL_TRANSACTIONS.INVENTORY_ITEM_ID%TYPE;
9377: l_txn_action_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ACTION_ID%TYPE;
9378: l_txn_src_type_id
9379: MTL_MATERIAL_TRANSACTIONS.TRANSACTION_SOURCE_TYPE_ID%TYPE;
9380: l_rcv_txn_id MTL_MATERIAL_TRANSACTIONS.RCV_TRANSACTION_ID%TYPE;
9381: l_txn_type_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_TYPE_ID%TYPE;
9382:
9383:

Line 9380: l_rcv_txn_id MTL_MATERIAL_TRANSACTIONS.RCV_TRANSACTION_ID%TYPE;

9376: l_item_id MTL_MATERIAL_TRANSACTIONS.INVENTORY_ITEM_ID%TYPE;
9377: l_txn_action_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ACTION_ID%TYPE;
9378: l_txn_src_type_id
9379: MTL_MATERIAL_TRANSACTIONS.TRANSACTION_SOURCE_TYPE_ID%TYPE;
9380: l_rcv_txn_id MTL_MATERIAL_TRANSACTIONS.RCV_TRANSACTION_ID%TYPE;
9381: l_txn_type_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_TYPE_ID%TYPE;
9382:
9383:
9384: l_stmt_num NUMBER;

Line 9381: l_txn_type_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_TYPE_ID%TYPE;

9377: l_txn_action_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ACTION_ID%TYPE;
9378: l_txn_src_type_id
9379: MTL_MATERIAL_TRANSACTIONS.TRANSACTION_SOURCE_TYPE_ID%TYPE;
9380: l_rcv_txn_id MTL_MATERIAL_TRANSACTIONS.RCV_TRANSACTION_ID%TYPE;
9381: l_txn_type_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_TYPE_ID%TYPE;
9382:
9383:
9384: l_stmt_num NUMBER;
9385: l_api_name VARCHAR2(100) := 'CompEncumbrance_IntOrdersExp';

Line 9426: MTL_MATERIAL_TRANSACTIONS mmt

9422: l_txn_src_type_id,
9423: l_txn_type_id,
9424: l_rcv_txn_id
9425: FROM
9426: MTL_MATERIAL_TRANSACTIONS mmt
9427: WHERE
9428: transaction_id = p_transaction_id;
9429:
9430: /* Get total received (and costed) quantity */

Line 9435: from mtl_material_transactions

9431:
9432: l_stmt_num := 20;
9433: SELECT sum(primary_quantity)
9434: INTO l_total_primary_qty
9435: from mtl_material_transactions
9436: where transaction_action_id = l_txn_action_id
9437: and transaction_source_type_id = l_txn_src_type_id
9438: and transaction_type_id = l_txn_type_id
9439: and trx_source_line_id = l_trx_source_line_id

Line 9623: UPDATE mtl_material_transactions

9619: o_err_code := 'CST_NO_COST_HOOK_DATA';
9620: FND_MESSAGE.set_name('BOM', 'CST_NO_COST_HOOK_DATA');
9621: o_err_msg := FND_MESSAGE.Get;
9622:
9623: UPDATE mtl_material_transactions
9624: SET costed_flag = 'E',
9625: error_code = substrb(o_err_code,1,240),
9626: error_explanation = substrb(o_err_msg,1,240),
9627: request_id = i_req_id,

Line 9639: UPDATE mtl_material_transactions

9635: o_err_code := 'CST_CLCD_WITH_INS_FLAG';
9636: FND_MESSAGE.set_name('BOM','CST_CLCD_WITH_INS_FLAG');
9637: FND_MESSAGE.set_token('TXN_ID', i_txn_id);
9638: o_err_msg := FND_MESSAGE.Get;
9639: UPDATE mtl_material_transactions
9640: SET costed_flag = 'E',
9641: error_code = substrb(o_err_code,1,240),
9642: error_explanation = substrb(o_err_msg,1,240),
9643: request_id = i_req_id,

Line 9652: UPDATE mtl_material_transactions

9648: WHEN others THEN
9649: rollback;
9650: o_err_num:=SQLCODE;
9651: o_err_msg:='CSTPAVCP.validate_actual_cost_hook('||to_char(l_stmt_num)||'):'||substr(SQLERRM,1,200);
9652: UPDATE mtl_material_transactions
9653: SET costed_flag = 'E',
9654: error_code = substrb(o_err_code,1,240),
9655: error_explanation = substrb(o_err_msg,1,240),
9656: request_id = i_req_id,