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 493: mtl_material_transactions MMT,

489: SYSDATE
490: FROM oe_order_lines_all OOLA, /*BUG 5768680 Changes introduced to improve performance*/
491: oe_order_headers_all OOHA, /* of the layer cost worker*/
492: mtl_sales_orders MSO,
493: mtl_material_transactions MMT,
494: mtl_cst_actual_cost_details MCACD,
495: cst_cogs_events cce
496: WHERE OOLA.line_id = l_so_line_id
497: AND OOHA.header_id = OOLA.header_id

Line 559: mtl_material_transactions MMT,

555: SYSDATE
556: FROM oe_order_lines_all OOLA, /*BUG 5768680 Changes introduced to improve performance*/
557: oe_order_headers_all OOHA, /* of the layer cost worker*/
558: mtl_sales_orders MSO,
559: mtl_material_transactions MMT,
560: mtl_cst_actual_cost_details MCACD
561: WHERE OOLA.line_id = l_so_line_id
562: AND OOHA.header_id = OOLA.header_id
563: AND MSO.segment1 = TO_CHAR(OOHA.order_number) -- extraneous MSOs are possible

Line 765: from mtl_material_transactions

761: l_stmt_num := 150;
762:
763: select transaction_type_id
764: into l_txn_type_id
765: from mtl_material_transactions
766: where transaction_id = i_txn_id;
767:
768: l_stmt_num := 160;
769: IF ( I_TXN_ACTION_ID = 1 AND L_TXN_TYPE_ID = 34 AND I_TXN_SRC_TYPE = 8) THEN

Line 1240: ** Update Mtl_Material_Transactions **

1236: where clcd.layer_id = i_layer_id);
1237:
1238: l_stmt_num := 60;
1239: /********************************************************************
1240: ** Update Mtl_Material_Transactions **
1241: ********************************************************************/
1242: CSTPAVCP.update_mmt(
1243: i_org_id,
1244: i_txn_id,

Line 1413: from mtl_material_transactions

1409: l_stmt_num := 10;
1410: /* Modified for bug 6635134 */
1411: select transaction_type_id, transaction_action_id
1412: into l_txn_type_id, l_txn_action_id
1413: from mtl_material_transactions
1414: where transaction_id = i_txn_id;
1415: -- borrow / payback end
1416:
1417: l_stmt_num := 15;

Line 1444: , mtl_material_transactions mmt

1440:
1441: select decode(asset_inventory,1,0,1)
1442: into l_exp1
1443: from mtl_secondary_inventories msi
1444: , mtl_material_transactions mmt
1445: where msi.secondary_inventory_name = mmt.subinventory_code
1446: and msi.organization_id = i_org_id
1447: and mmt.transaction_id = i_txn_id
1448: and mmt.organization_id = i_org_id;

Line 1487: from mtl_material_transactions mmt,

1483: 3, 0,
1484: 6, 0,
1485: 4, decode(l_exp1, 1, 1, 0))
1486: into l_exp2
1487: from mtl_material_transactions mmt,
1488: wip_flow_schedules wfs,
1489: wip_accounting_classes wac
1490: where mmt.transaction_id = i_txn_id
1491: and mmt.organization_id = i_org_id

Line 1504: from mtl_material_transactions mmt,

1500: 3, 0,
1501: 6, 0,
1502: 4, decode(l_exp1, 1, 1, 0))
1503: into l_exp2
1504: from mtl_material_transactions mmt,
1505: wip_discrete_jobs wdj,
1506: wip_accounting_classes wac
1507: where mmt.transaction_id = i_txn_id
1508: and mmt.organization_id = i_org_id

Line 1524: , mtl_material_transactions mmt

1520:
1521: select decode(asset_inventory,1,0,1)
1522: into l_exp2
1523: from mtl_secondary_inventories msi
1524: , mtl_material_transactions mmt
1525: where msi.secondary_inventory_name = mmt.transfer_subinventory
1526: and msi.organization_id = i_org_id
1527: and mmt.transaction_id = i_txn_id
1528: and mmt.organization_id = i_org_id;

Line 2067: FROM mtl_material_transactions

2063:
2064: l_stmt_num := 190;
2065: SELECT transfer_transaction_id
2066: INTO l_txf_txn_id
2067: FROM mtl_material_transactions
2068: WHERE transaction_id = i_txn_id;
2069:
2070: l_stmt_num := 200;
2071: UPDATE mtl_material_transactions MMT

Line 2071: UPDATE mtl_material_transactions MMT

2067: FROM mtl_material_transactions
2068: WHERE transaction_id = i_txn_id;
2069:
2070: l_stmt_num := 200;
2071: UPDATE mtl_material_transactions MMT
2072: SET (
2073: last_update_date,
2074: last_updated_by,
2075: last_update_login,

Line 2184: from mtl_material_transactions

2180: l_stmt_num := 5;
2181: /* Added Bug#4259926 */
2182: select transaction_action_id, transaction_source_type_id
2183: into l_txn_action_id,l_src_type
2184: from mtl_material_transactions
2185: where transaction_id = i_txn_id;
2186:
2187: if ( l_txn_action_id = 27 and I_CITW_FLAG = 1 and l_src_type = 5 ) then
2188: l_layer_id := i_txfr_layer_id;

Line 2196: UPDATE mtl_material_transactions mmt

2192:
2193: -- item cost history, update the transfer_prior_costed_quantity
2194: -- is necessary because we need both the from and the to information
2195: -- in item cost history
2196: UPDATE mtl_material_transactions mmt
2197: SET TRANSFER_PRIOR_COSTED_QUANTITY =
2198: (SELECT
2199: layer_quantity
2200: FROM cst_quantity_layers cql

Line 2399: from mtl_material_transactions mmt,

2395: 3, 0,
2396: 6, 0,
2397: 4, decode(i_exp_flag, 1, 1, 0))
2398: into l_exp_flag
2399: from mtl_material_transactions mmt,
2400: wip_flow_schedules wfs,
2401: wip_accounting_classes wac
2402: where mmt.transaction_id = i_txn_id
2403: and mmt.organization_id = i_org_id

Line 2415: from mtl_material_transactions mmt,

2411: 3, 0,
2412: 6, 0,
2413: 4, decode(i_exp_flag, 1, 1, 0))
2414: into l_exp_flag
2415: from mtl_material_transactions mmt,
2416: wip_discrete_jobs wdj,
2417: wip_accounting_classes wac
2418: where mmt.transaction_id = i_txn_id
2419: and mmt.organization_id = i_org_id

Line 3016: from mtl_material_transactions

3012: l_stmt_num := 12;
3013:
3014: select organization_id, transfer_organization_id, primary_quantity
3015: into l_txn_org_id, l_txfr_org_id, l_txn_qty
3016: from mtl_material_transactions
3017: where transaction_id = i_txn_id;
3018:
3019: -- Figure the from and to org for this transaction.
3020: if (i_txn_action_id = 21) then

Line 3705: ** Update Mtl_Material_Transactions **

3701: and cacd.insertion_flag = 'Y';
3702:
3703:
3704: /********************************************************************
3705: ** Update Mtl_Material_Transactions **
3706: ** Need to update prior_costed_quantity now. **
3707: ********************************************************************/
3708: if (i_no_update_mmt = 0) then
3709:

Line 3716: from mtl_material_transactions

3712: /* Changes for VMI. Adding Planning Transfer Transaction */
3713: if (i_txn_action_id IN (2,5,28,55) and i_txn_qty > 0) then
3714: select transfer_transaction_id
3715: into l_txfr_txn_id
3716: from mtl_material_transactions
3717: where transaction_id = i_txn_id;
3718: else
3719: l_txfr_txn_id := -1;
3720: end if;

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

3899: IF g_debug = 'Y' THEN
3900: fnd_file.put_line(fnd_file.log, 'Current_Average_Cost <<<');
3901: END IF;
3902: /********************************************************************
3903: ** Update Mtl_Material_Transactions to set actual cost, prior **
3904: ** cost, new cost and prior costed quantity. **
3905: ********************************************************************/
3906: if (i_no_update_mmt = 0) then
3907: CSTPAVCP.update_mmt(

Line 4044: from mtl_material_transactions

4040:
4041: l_stmt_num := 5;
4042: Select transaction_action_id
4043: into l_transaction_action_id
4044: from mtl_material_transactions
4045: where transaction_id = i_txn_id;
4046: -- for item cost history
4047:
4048: -- Since we are processing shipment side of subinventory

Line 4088: from mtl_material_transactions

4084: decode(cost_group_id, NVL(transfer_cost_group_id, cost_group_id), 0, 1),
4085: 0)
4086: ,0)
4087: into l_citw_flag
4088: from mtl_material_transactions
4089: where transaction_id = i_txn_id;
4090:
4091: -- Added for Bug# 5137993
4092: -- Actual cost should not be populated for expense item

Line 4100: FROM mtl_material_transactions

4096: INTO l_asset_item_flag
4097: FROM mtl_system_items
4098: WHERE organization_id = i_org_id
4099: AND inventory_item_id = (SELECT inventory_item_id
4100: FROM mtl_material_transactions
4101: WHERE transaction_id = i_txn_id);
4102: -- end of changes for Bug# 5137993
4103:
4104: /* Added Bug#4259926 */

Line 4110: Update mtl_material_transactions mmt

4106: l_txn_id := i_txn_id;
4107: End if;
4108:
4109: l_stmt_num := 35;
4110: Update mtl_material_transactions mmt
4111: set (last_update_date,
4112: last_updated_by,
4113: last_update_login,
4114: request_id,

Line 4148: Update mtl_material_transactions mmt

4144: where mmt.transaction_id = l_txn_id;
4145: else
4146: l_stmt_num := 40;
4147:
4148: Update mtl_material_transactions mmt
4149: set last_update_date = sysdate,
4150: last_updated_by = i_user_id,
4151: last_update_login = i_login_id,
4152: request_id = i_req_id,

Line 4175: FROM mtl_material_transactions mmt

4171: SELECT
4172: mmt.inventory_item_id
4173: INTO
4174: l_item_id
4175: FROM mtl_material_transactions mmt
4176: WHERE mmt.transaction_id = i_txn_id;
4177:
4178: l_stmt_num := 44;
4179: UPDATE mtl_material_transactions mmt

Line 4179: UPDATE mtl_material_transactions mmt

4175: FROM mtl_material_transactions mmt
4176: WHERE mmt.transaction_id = i_txn_id;
4177:
4178: l_stmt_num := 44;
4179: UPDATE mtl_material_transactions mmt
4180: SET prior_costed_quantity = (
4181: SELECT cql.layer_quantity - mmt.primary_quantity
4182: FROM cst_quantity_layers cql,
4183: mtl_parameters mp

Line 4228: FROM mtl_material_transactions mmt,

4224: INTO l_from_inv,
4225: l_transfer_txn_id,
4226: l_item_id,
4227: l_transfer_cost_grp_id
4228: FROM mtl_material_transactions mmt,
4229: mtl_secondary_inventories msi
4230: WHERE mmt.transaction_id = i_txn_id
4231: AND mmt.subinventory_code = msi.secondary_inventory_name
4232: AND mmt.organization_id = msi.organization_id;

Line 4237: FROM mtl_material_transactions mmt,

4233:
4234: l_stmt_num := 55;
4235: SELECT nvl(msi.asset_inventory,-9)
4236: INTO l_to_inv
4237: FROM mtl_material_transactions mmt,
4238: mtl_secondary_inventories msi
4239: WHERE mmt.transaction_id = i_txn_id
4240: AND nvl(mmt.transfer_subinventory,mmt.subinventory_code) = msi.secondary_inventory_name
4241: AND mmt.organization_id = msi.organization_id;

Line 4247: UPDATE mtl_material_transactions mmt

4243: -- item cost history stuff
4244: -- from expense to asset sub-transfer
4245: IF ((l_from_inv = 2) and (l_to_inv = 1))then
4246: l_stmt_num := 60;
4247: UPDATE mtl_material_transactions mmt
4248: SET prior_costed_quantity =
4249: (SELECT
4250: layer_quantity
4251: FROM cst_quantity_layers cql

Line 4265: update mtl_material_transactions mmt

4261: AND cql.cost_group_id = l_transfer_cost_grp_id);
4262:
4263:
4264: IF SQL%ROWCOUNT = 0 THEN
4265: update mtl_material_transactions mmt
4266: set prior_costed_quantity = 0
4267: where mmt.transaction_id = l_transfer_txn_id;
4268: END IF;
4269: END IF;

Line 4732: ,mtl_material_transactions mmt

4728: l_stmt_num := 30;
4729: select decode(l_std_exp,1,1,decode(asset_inventory,1,0,1))
4730: into l_std_exp
4731: from mtl_secondary_inventories msi
4732: ,mtl_material_transactions mmt
4733: where mmt.transaction_id = i_txn_id
4734: and mmt.organization_id = l_std_org
4735: and msi.organization_id = l_std_org
4736: and msi.secondary_inventory_name = mmt.subinventory_code;

Line 4827: UPDATE mtl_material_transactions mmt

4823: if i_org_id = l_which_org then -- this takes care the case R/R,
4824: -- cost worker will process the same mmt
4825: -- transaction twice
4826: l_stmt_num := 50;
4827: UPDATE mtl_material_transactions mmt
4828: SET TRANSFER_PRIOR_COSTED_QUANTITY =
4829: (SELECT
4830: layer_quantity
4831: FROM cst_quantity_layers cql

Line 4844: update mtl_material_transactions mmt

4840: AND cql.inventory_item_id = i_item_id
4841: AND cql.cost_group_id = l_which_cst_grp);
4842:
4843: IF SQL%ROWCOUNT = 0 THEN
4844: update mtl_material_transactions mmt
4845: set TRANSFER_PRIOR_COSTED_QUANTITY = 0
4846: where mmt.transaction_id = i_txn_id;
4847: END IF;
4848: end if;

Line 4856: UPDATE mtl_material_transactions mmt

4852:
4853: -- bug 2827548 - took following IF condition out of the one that follows it because we
4854: -- need to update txn_cost of receit txn before returning if shipment is already costed
4855: if (i_txn_action_id = 12 and i_org_id = i_txn_org_id and i_fob_point = 1) then
4856: UPDATE mtl_material_transactions mmt
4857: SET mmt.transaction_cost = (select (mmt1.transaction_cost * mmt1.currency_conversion_rate)
4858: from mtl_material_transactions mmt1
4859: where mmt1.transaction_id = mmt.transfer_transaction_id
4860: and mmt1.costed_flag is null)

Line 4858: from mtl_material_transactions mmt1

4854: -- need to update txn_cost of receit txn before returning if shipment is already costed
4855: if (i_txn_action_id = 12 and i_org_id = i_txn_org_id and i_fob_point = 1) then
4856: UPDATE mtl_material_transactions mmt
4857: SET mmt.transaction_cost = (select (mmt1.transaction_cost * mmt1.currency_conversion_rate)
4858: from mtl_material_transactions mmt1
4859: where mmt1.transaction_id = mmt.transfer_transaction_id
4860: and mmt1.costed_flag is null)
4861: WHERE mmt.transaction_id = i_txn_id
4862: AND nvl(mmt.transaction_cost,0) = 0;

Line 5108: update mtl_material_transactions mmt

5104:
5105: if (i_txn_org_id = l_std_org) then
5106: -- update actual cost column of mmt.
5107: l_stmt_num := 90;
5108: update mtl_material_transactions mmt
5109: set (last_update_date,
5110: last_updated_by,
5111: last_update_login,
5112: request_id,

Line 5145: from mtl_material_transactions

5141: l_stmt_num := 100;
5142:
5143: select transfer_transaction_id
5144: into l_txn_update_id
5145: from mtl_material_transactions
5146: where transaction_id = i_txn_id;
5147: else
5148: l_txn_update_id := i_txn_id;
5149: end if;

Line 5339: Update mtl_material_transactions

5335: -- the transfer cost is always in shipping UOM and currency
5336: -- For FOB receipt, need to convert the primary_quantity (in receiving UOM)
5337: -- to sending primary quantity.
5338: l_stmt_num := 150;
5339: Update mtl_material_transactions
5340: Set transfer_cost =
5341: (select decode(nvl(transfer_percentage, -999),-999, transfer_cost,
5342: (transfer_percentage * l_snd_txn_cost *
5343: decode(i_txn_action_id, 12, abs(primary_quantity)/l_um_rate,

Line 5345: from mtl_material_transactions

5341: (select decode(nvl(transfer_percentage, -999),-999, transfer_cost,
5342: (transfer_percentage * l_snd_txn_cost *
5343: decode(i_txn_action_id, 12, abs(primary_quantity)/l_um_rate,
5344: abs(primary_quantity)))*l_xfer_conv_rate/100) -- bug 2827548-added l_xfer_conv_rate
5345: from mtl_material_transactions
5346: where transaction_id = i_txn_id)
5347: where transaction_id = i_txn_id
5348: or (transaction_id = decode(i_txn_action_id,3,l_txn_update_id,-1));
5349:

Line 5356: from mtl_material_transactions

5352:
5353: select nvl(transfer_cost,0), nvl(transportation_cost,0),
5354: decode(i_txn_action_id,12,(primary_quantity / l_um_rate),primary_quantity)
5355: into l_txfr_cost, l_trans_cost, l_snd_qty
5356: from mtl_material_transactions
5357: where transaction_id = i_txn_id;
5358:
5359: IF g_debug = 'Y' THEN
5360: 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 5479: Update mtl_material_transactions

5475: END IF;
5476:
5477: -- Update the transaction cost column if appropriate.
5478: /* Begin changes and additions for bug 2827548 */
5479: Update mtl_material_transactions
5480: Set transaction_cost = l_new_txn_cost
5481: where transaction_id = i_txn_id;
5482:
5483: if (i_txn_action_id = 3) then

Line 5484: Update mtl_material_transactions

5480: Set transaction_cost = l_new_txn_cost
5481: where transaction_id = i_txn_id;
5482:
5483: if (i_txn_action_id = 3) then
5484: Update mtl_material_transactions
5485: Set transaction_cost = l_rcv_txn_cost
5486: where transaction_id = l_txn_update_id;
5487: end if;
5488:

Line 5492: update mtl_material_transactions mmt

5488:
5489: -- Update the transaction_cost column for receipt txn w/ fob shipment
5490: -- in the receiving org's currency
5491: if (i_txn_action_id = 21 and i_fob_point = 1) then
5492: update mtl_material_transactions mmt
5493: set mmt.transaction_cost = l_rcv_txn_cost
5494: where mmt.transfer_transaction_id = i_txn_id
5495: and mmt.transaction_action_id = 12;
5496: -- Update the transaction_cost column for shipment txn w/ fob receipt

Line 5499: update mtl_material_transactions mmt

5495: and mmt.transaction_action_id = 12;
5496: -- Update the transaction_cost column for shipment txn w/ fob receipt
5497: -- in the sending org's currency
5498: elsif (i_txn_action_id = 12 and i_fob_point = 2) then
5499: update mtl_material_transactions mmt
5500: set mmt.transaction_cost = l_snd_txn_cost
5501: where mmt.transaction_id =
5502: (select mmt1.transfer_transaction_id
5503: from mtl_material_transactions mmt1

Line 5503: from mtl_material_transactions mmt1

5499: update mtl_material_transactions mmt
5500: set mmt.transaction_cost = l_snd_txn_cost
5501: where mmt.transaction_id =
5502: (select mmt1.transfer_transaction_id
5503: from mtl_material_transactions mmt1
5504: where mmt1.transaction_id = i_txn_id)
5505: and mmt.transaction_action_id = 21
5506: and nvl(mmt.transaction_cost,0) = 0;
5507: end if;

Line 5526: from mtl_material_transactions mmt

5522:
5523: l_stmt_num := 180;
5524: select transfer_transaction_id
5525: into l_txfr_txn_id
5526: from mtl_material_transactions mmt
5527: where mmt.transaction_id = i_txn_id;
5528:
5529: l_stmt_num := 190;
5530: select decode(l_txfr_std_exp,1,1,decode(asset_inventory,1,0,1))

Line 5533: ,mtl_material_transactions mmt

5529: l_stmt_num := 190;
5530: select decode(l_txfr_std_exp,1,1,decode(asset_inventory,1,0,1))
5531: into l_txfr_std_exp
5532: from mtl_secondary_inventories msi
5533: ,mtl_material_transactions mmt
5534: where mmt.transaction_id = l_txfr_txn_id
5535: and mmt.organization_id = l_std_org
5536: and msi.organization_id = l_std_org
5537: and msi.secondary_inventory_name = mmt.subinventory_code;

Line 5592: update mtl_material_transactions mmt

5588: WHERE ctcd.transaction_id = l_txn_update_id
5589: AND ctcd.organization_id = l_std_org
5590: /* AND ctcd.transaction_cost >= 0 */; -- modified for bug#3835412
5591:
5592: update mtl_material_transactions mmt
5593: set (last_update_date,
5594: last_updated_by,
5595: last_update_login,
5596: request_id,

Line 5676: update mtl_material_transactions mmt

5672: /* AND ctcd.transaction_cost >= 0 */; -- modified for bug#3835412
5673:
5674: if (l_std_org = i_txn_org_id or i_txn_action_id = 3) then
5675: l_stmt_num := 220;
5676: update mtl_material_transactions mmt
5677: set (last_update_date,
5678: last_updated_by,
5679: last_update_login,
5680: request_id,

Line 5712: from mtl_material_transactions mmt

5708: if (l_to_std_exp = 1) then
5709: if (i_txn_org_id = l_std_org) then
5710: select transfer_transaction_id
5711: into l_txfr_txn_id
5712: from mtl_material_transactions mmt
5713: where mmt.transaction_id = i_txn_id;
5714: end if;
5715:
5716: l_stmt_num := 260;

Line 5770: update mtl_material_transactions mmt

5766: /* AND ctcd.transaction_cost >= 0 */; -- modified for bug#3835412
5767:
5768: -- update mmt if this is the receiving transaction id
5769: if (i_txn_org_id = l_std_org) then
5770: update mtl_material_transactions mmt
5771: set (last_update_date,
5772: last_updated_by,
5773: last_update_login,
5774: request_id,

Line 5897: from mtl_material_transactions

5893: l_stmt_num := 50;
5894:
5895: select currency_conversion_type, TRUNC(transaction_date)
5896: into l_curr_type, l_txn_date
5897: from mtl_material_transactions
5898: where transaction_id = i_txn_id;
5899:
5900: if (l_curr_type is NULL) then
5901: FND_PROFILE.get('CURRENCY_CONVERSION_TYPE', l_curr_type);

Line 6798: FROM mtl_material_transactions mmt,

6794: NVL(mmt.DISTRIBUTION_ACCOUNT_ID, -1) "DISTRIBUTION_ACCOUNT_ID",
6795: mp.primary_cost_method "COST_TYPE_ID", /* For use as cost_type_id */
6796: NVL(mp.AVG_RATES_COST_TYPE_ID, -1) "AVG_RATES_COST_TYPE_ID",
6797: decode(msi.INVENTORY_ASSET_FLAG,'Y',0,1) "EXP_ITEM"
6798: FROM mtl_material_transactions mmt,
6799: mtl_parameters mp,
6800: mtl_system_items_b msi
6801: WHERE mmt.organization_id = mp.organization_id
6802: AND mmt.inventory_item_id = msi.inventory_item_id

Line 6918: from mtl_material_transactions

6914: end if;
6915: else
6916: select organization_id, decode(nvl(logical_transaction, 2), 1, 0, 1)
6917: into l_parent_organization_id, l_parent_transaction_type
6918: from mtl_material_transactions
6919: where transaction_id = p_parent_id;
6920: end if;
6921:
6922: if (c_mmt_txn_rec.organization_id = l_parent_organization_id and

Line 7086: Update mtl_material_transactions mmt

7082: /* Update MMT */
7083:
7084: l_stmt_num := 42;
7085:
7086: Update mtl_material_transactions mmt
7087: set (last_update_date,
7088: last_updated_by,
7089: last_update_login,
7090: request_id,

Line 7181: update mtl_material_transactions

7177: /* Update Costed Flag */
7178: l_stmt_num := 70;
7179: -- Change to PL/SQL Logic for the performance Bug 4773025
7180: if (p_parent_id is not null) then
7181: update mtl_material_transactions
7182: set costed_flag = NULL
7183: WHERE parent_transaction_id = p_parent_id;
7184: else
7185: update mtl_material_transactions

Line 7185: update mtl_material_transactions

7181: update mtl_material_transactions
7182: set costed_flag = NULL
7183: WHERE parent_transaction_id = p_parent_id;
7184: else
7185: update mtl_material_transactions
7186: set costed_flag = NULL
7187: WHERE transaction_id = p_txn_id ;
7188: end if;
7189:

Line 7205: update mtl_material_transactions

7201: l_err_msg || ':' || substr(SQLERRM,1,200);
7202:
7203: /* Modified update statement for performance reasons. See bug#3585779*/
7204: if (p_parent_id is null) then
7205: update mtl_material_transactions
7206: set costed_flag = 'E',
7207: error_code = x_err_code,
7208: error_explanation = x_err_msg
7209: where (p_txn_id is not null

Line 7215: update mtl_material_transactions

7211:
7212: elsif (p_parent_id is not null) then
7213: /* Changed to PL/SQL Logic for performance Bug 4773025 */
7214: if(p_txn_id is not null) then
7215: update mtl_material_transactions
7216: set costed_flag = decode(transaction_id, p_parent_id, 'E', 'N'),
7217: error_code = x_err_code,
7218: error_explanation = x_err_msg
7219: where parent_transaction_id = p_parent_id or

Line 7223: update mtl_material_transactions

7219: where parent_transaction_id = p_parent_id or
7220: (transaction_id = p_parent_id and parent_transaction_id is null) or
7221: (transaction_id = p_txn_id);
7222: else
7223: update mtl_material_transactions
7224: set costed_flag = decode(transaction_id, p_parent_id, 'E', 'N'),
7225: error_code = x_err_code,
7226: error_explanation = x_err_msg
7227: where parent_transaction_id = p_parent_id or

Line 7241: update mtl_material_transactions

7237: substr(SQLERRM,1,200);
7238:
7239: /* Modified update statement for performance reasons. See bug#3585779*/
7240: if (p_parent_id is null) then
7241: update mtl_material_transactions
7242: set costed_flag = 'E',
7243: error_code = x_err_code,
7244: error_explanation = x_err_msg,
7245: request_id = p_request_id

Line 7252: update mtl_material_transactions

7248:
7249: elsif (p_parent_id is not null) then
7250: /* Changed to PL/SQL Logic for performance Bug 4773025 */
7251: if (p_txn_id is not null) then
7252: update mtl_material_transactions
7253: set costed_flag = decode(transaction_id, p_parent_id, 'E', 'N'),
7254: error_code = x_err_code,
7255: error_explanation = x_err_msg,
7256: request_id = p_request_id

Line 7261: update mtl_material_transactions

7257: where parent_transaction_id = p_parent_id or
7258: (transaction_id = p_parent_id and parent_transaction_id is null) or
7259: (transaction_id = p_txn_id);
7260: else
7261: update mtl_material_transactions
7262: set costed_flag = decode(transaction_id, p_parent_id, 'E', 'N'),
7263: error_code = x_err_code,
7264: error_explanation = x_err_msg,
7265: request_id = p_request_id

Line 7839: Update mtl_material_transactions mmt

7835: -- update prior_cost, ew_cost, variance_amount
7836: -- use the MMT of logical transacion to update corresponding parent.
7837: -------------------------------------------------------------------------
7838:
7839: Update mtl_material_transactions mmt
7840: set (last_update_date,
7841: last_updated_by,
7842: last_update_login,
7843: request_id,

Line 7866: from mtl_material_transactions mmt2

7862: mmt2.new_cost,
7863: mmt2.variance_amount,
7864: mmt2.prior_costed_quantity,
7865: mmt2.quantity_adjusted
7866: from mtl_material_transactions mmt2
7867: where mmt2.transaction_id = p_txn_id
7868: and mmt2.organization_id = p_org_id)
7869: where mmt.transaction_id = p_parent_txn_id;
7870:

Line 8128: l_subinventory_code MTL_MATERIAL_TRANSACTIONS.SUBINVENTORY_CODE%TYPE;

8124: l_sending_curr VARCHAR2(15);
8125:
8126: l_exp_item MTL_SYSTEM_ITEMS.INVENTORY_ASSET_FLAG%TYPE;
8127: l_exp_flag VARCHAR2(1);
8128: l_subinventory_code MTL_MATERIAL_TRANSACTIONS.SUBINVENTORY_CODE%TYPE;
8129:
8130:
8131: l_err_num NUMBER;
8132: l_err_code VARCHAR2(240);

Line 8209: mtl_material_transactions mmt, mtl_parameters mpx, mtl_parameters mp

8205: l_parent_org_process_flag,
8206: l_logical_org_id,
8207: l_logical_org_process_flag
8208: FROM
8209: mtl_material_transactions mmt, mtl_parameters mpx, mtl_parameters mp
8210: WHERE
8211: mmt.transaction_id = p_parent_txn_id
8212: AND mpx.organization_id = mmt.transfer_organization_id
8213: AND mp.organization_id = mmt.organization_id

Line 8291: MTL_MATERIAL_TRANSACTIONS

8287: IF l_pd_xfer_ind = 'N' AND -- Bug 5349860: umoogala
8288: l_exp_flag = 'Y' THEN
8289: l_stmt_num := 16;
8290: UPDATE
8291: MTL_MATERIAL_TRANSACTIONS
8292: SET
8293: COSTED_FLAG = NULL,
8294: LAST_UPDATE_DATE = sysdate,
8295: LAST_UPDATED_BY = p_user_id,

Line 8341: MTL_MATERIAL_TRANSACTIONS

8337: l_debit_account,
8338: l_logical_cost_group_id,
8339: l_transfer_price -- Bug 5349860: umoogala
8340: FROM
8341: MTL_MATERIAL_TRANSACTIONS
8342: WHERE
8343: TRANSACTION_ID = l_logical_txn_id;
8344:
8345: IF ( g_debug = 'Y' ) THEN

Line 8814: MTL_MATERIAL_TRANSACTIONS

8810:
8811: -- Update MMT
8812: l_stmt_num := 160;
8813: UPDATE
8814: MTL_MATERIAL_TRANSACTIONS
8815: SET
8816: COSTED_FLAG = NULL,
8817: transaction_group_id = NULL,
8818: ENCUMBRANCE_AMOUNT = l_enc_amount,

Line 8918: UPDATE mtl_material_transactions

8914: FND_FILE.PUT_LINE(FND_FILE.LOG, x_err_msg);
8915:
8916: WHEN FND_API.g_exc_unexpected_error THEN
8917: rollback;
8918: UPDATE mtl_material_transactions
8919: SET costed_flag = 'E',
8920: error_code = substrb(x_err_code,1,240),
8921: error_explanation = substrb(x_err_msg,1,240),
8922: request_id = p_request_id,

Line 9118: UPDATE mtl_material_transactions mmt

9114:
9115: if i_txn_action_id <> 1 and -- Bug 5349860: exculding IO Issue to Exp Destination
9116: i_org_id = l_which_org then
9117: l_stmt_num := 10;
9118: UPDATE mtl_material_transactions mmt
9119: SET TRANSFER_PRIOR_COSTED_QUANTITY =
9120: (SELECT
9121: layer_quantity
9122: FROM cst_quantity_layers cql

Line 9136: update mtl_material_transactions mmt

9132: AND cql.cost_group_id = l_which_cst_grp);
9133:
9134: IF SQL%ROWCOUNT = 0 THEN
9135: l_stmt_num := 20;
9136: update mtl_material_transactions mmt
9137: set TRANSFER_PRIOR_COSTED_QUANTITY = 0
9138: where mmt.transaction_id = i_txn_id;
9139: END IF;
9140: end if;

Line 9158: FROM mtl_material_transactions

9154: IF i_txn_action_id <> 1
9155: THEN
9156: SELECT nvl(transportation_cost,0)
9157: INTO l_trans_cost
9158: FROM mtl_material_transactions
9159: WHERE transaction_id = i_txn_id;
9160: ELSE
9161: l_trans_cost := 0;
9162: END IF;

Line 9211: Update mtl_material_transactions

9207: fnd_file.put_line(fnd_file.log, 'Updating trx: ' || i_txn_id || ' with trxCost: ' || l_new_txn_cost);
9208: END IF;
9209:
9210: l_stmt_num := 50;
9211: Update mtl_material_transactions
9212: Set transaction_cost = l_new_txn_cost
9213: where transaction_id = i_txn_id;
9214:
9215: elsif (i_txn_action_id = 12 AND i_fob_point = 1)

Line 9223: Update mtl_material_transactions

9219: fnd_file.put_line(fnd_file.log, 'Updating trx: ' || i_txn_id || ' with trxCost: ' || l_rcv_txn_cost);
9220: END IF;
9221:
9222: l_stmt_num := 70;
9223: Update mtl_material_transactions
9224: Set transaction_cost = l_rcv_txn_cost
9225: where transaction_id = i_txn_id;
9226:
9227: elsif ((i_txn_action_id = 15) OR

Line 9277: Update mtl_material_transactions

9273: 0);
9274:
9275: l_stmt_num := 90;
9276: -- Update the transaction cost column if appropriate.
9277: Update mtl_material_transactions
9278: Set transaction_cost = l_rcv_txn_cost
9279: where transaction_id = i_txn_id;
9280:
9281: -- Bug 5349860: Internal Order issues to exp can also happen between

Line 9361: p_transaction_id IN MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ID%TYPE,

9357: END Cost_Logical_itr_receipt;
9358:
9359: PROCEDURE CompEncumbrance_IntOrdersExp (
9360: p_api_version IN NUMBER,
9361: p_transaction_id IN MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ID%TYPE,
9362: p_req_line_id IN PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID%TYPE,
9363: p_item_id IN MTL_SYSTEM_ITEMS.INVENTORY_ITEM_ID%TYPE,
9364: p_organization_id IN MTL_PARAMETERS.ORGANIZATION_ID%TYPE,
9365: p_primary_qty IN MTL_MATERIAL_TRANSACTIONS.PRIMARY_QUANTITY%TYPE,

Line 9365: p_primary_qty IN MTL_MATERIAL_TRANSACTIONS.PRIMARY_QUANTITY%TYPE,

9361: p_transaction_id IN MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ID%TYPE,
9362: p_req_line_id IN PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID%TYPE,
9363: p_item_id IN MTL_SYSTEM_ITEMS.INVENTORY_ITEM_ID%TYPE,
9364: p_organization_id IN MTL_PARAMETERS.ORGANIZATION_ID%TYPE,
9365: p_primary_qty IN MTL_MATERIAL_TRANSACTIONS.PRIMARY_QUANTITY%TYPE,
9366: p_total_primary_qty IN NUMBER,
9367: x_encumbrance_amount OUT NOCOPY NUMBER,
9368: x_encumbrance_account OUT NOCOPY NUMBER,
9369: x_return_status OUT NOCOPY VARCHAR,

Line 9561: p_transaction_id IN MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ID%TYPE,

9557: END CompEncumbrance_IntOrdersExp;
9558:
9559: PROCEDURE CompEncumbrance_IntOrdersExp (
9560: p_api_version IN NUMBER,
9561: p_transaction_id IN MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ID%TYPE,
9562: x_encumbrance_amount OUT NOCOPY NUMBER,
9563: x_encumbrance_account OUT NOCOPY NUMBER,
9564: x_return_status OUT NOCOPY VARCHAR,
9565: x_return_message OUT NOCOPY VARCHAR2

Line 9569: l_primary_qty MTL_MATERIAL_TRANSACTIONS.PRIMARY_QUANTITY%TYPE;

9565: x_return_message OUT NOCOPY VARCHAR2
9566: ) IS
9567:
9568: l_total_primary_qty NUMBER;
9569: l_primary_qty MTL_MATERIAL_TRANSACTIONS.PRIMARY_QUANTITY%TYPE;
9570: l_organization_id MTL_MATERIAL_TRANSACTIONS.ORGANIZATION_ID%TYPE;
9571: l_trx_source_line_id MTL_MATERIAL_TRANSACTIONS.TRX_SOURCE_LINE_ID%TYPE;
9572: l_req_line_id PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID%TYPE;
9573: l_item_id MTL_MATERIAL_TRANSACTIONS.INVENTORY_ITEM_ID%TYPE;

Line 9570: l_organization_id MTL_MATERIAL_TRANSACTIONS.ORGANIZATION_ID%TYPE;

9566: ) IS
9567:
9568: l_total_primary_qty NUMBER;
9569: l_primary_qty MTL_MATERIAL_TRANSACTIONS.PRIMARY_QUANTITY%TYPE;
9570: l_organization_id MTL_MATERIAL_TRANSACTIONS.ORGANIZATION_ID%TYPE;
9571: l_trx_source_line_id MTL_MATERIAL_TRANSACTIONS.TRX_SOURCE_LINE_ID%TYPE;
9572: l_req_line_id PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID%TYPE;
9573: l_item_id MTL_MATERIAL_TRANSACTIONS.INVENTORY_ITEM_ID%TYPE;
9574: l_txn_action_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ACTION_ID%TYPE;

Line 9571: l_trx_source_line_id MTL_MATERIAL_TRANSACTIONS.TRX_SOURCE_LINE_ID%TYPE;

9567:
9568: l_total_primary_qty NUMBER;
9569: l_primary_qty MTL_MATERIAL_TRANSACTIONS.PRIMARY_QUANTITY%TYPE;
9570: l_organization_id MTL_MATERIAL_TRANSACTIONS.ORGANIZATION_ID%TYPE;
9571: l_trx_source_line_id MTL_MATERIAL_TRANSACTIONS.TRX_SOURCE_LINE_ID%TYPE;
9572: l_req_line_id PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID%TYPE;
9573: l_item_id MTL_MATERIAL_TRANSACTIONS.INVENTORY_ITEM_ID%TYPE;
9574: l_txn_action_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ACTION_ID%TYPE;
9575: l_txn_src_type_id

Line 9573: l_item_id MTL_MATERIAL_TRANSACTIONS.INVENTORY_ITEM_ID%TYPE;

9569: l_primary_qty MTL_MATERIAL_TRANSACTIONS.PRIMARY_QUANTITY%TYPE;
9570: l_organization_id MTL_MATERIAL_TRANSACTIONS.ORGANIZATION_ID%TYPE;
9571: l_trx_source_line_id MTL_MATERIAL_TRANSACTIONS.TRX_SOURCE_LINE_ID%TYPE;
9572: l_req_line_id PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID%TYPE;
9573: l_item_id MTL_MATERIAL_TRANSACTIONS.INVENTORY_ITEM_ID%TYPE;
9574: l_txn_action_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ACTION_ID%TYPE;
9575: l_txn_src_type_id
9576: MTL_MATERIAL_TRANSACTIONS.TRANSACTION_SOURCE_TYPE_ID%TYPE;
9577: l_rcv_txn_id MTL_MATERIAL_TRANSACTIONS.RCV_TRANSACTION_ID%TYPE;

Line 9574: l_txn_action_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ACTION_ID%TYPE;

9570: l_organization_id MTL_MATERIAL_TRANSACTIONS.ORGANIZATION_ID%TYPE;
9571: l_trx_source_line_id MTL_MATERIAL_TRANSACTIONS.TRX_SOURCE_LINE_ID%TYPE;
9572: l_req_line_id PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID%TYPE;
9573: l_item_id MTL_MATERIAL_TRANSACTIONS.INVENTORY_ITEM_ID%TYPE;
9574: l_txn_action_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ACTION_ID%TYPE;
9575: l_txn_src_type_id
9576: MTL_MATERIAL_TRANSACTIONS.TRANSACTION_SOURCE_TYPE_ID%TYPE;
9577: l_rcv_txn_id MTL_MATERIAL_TRANSACTIONS.RCV_TRANSACTION_ID%TYPE;
9578: l_txn_type_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_TYPE_ID%TYPE;

Line 9576: MTL_MATERIAL_TRANSACTIONS.TRANSACTION_SOURCE_TYPE_ID%TYPE;

9572: l_req_line_id PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID%TYPE;
9573: l_item_id MTL_MATERIAL_TRANSACTIONS.INVENTORY_ITEM_ID%TYPE;
9574: l_txn_action_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ACTION_ID%TYPE;
9575: l_txn_src_type_id
9576: MTL_MATERIAL_TRANSACTIONS.TRANSACTION_SOURCE_TYPE_ID%TYPE;
9577: l_rcv_txn_id MTL_MATERIAL_TRANSACTIONS.RCV_TRANSACTION_ID%TYPE;
9578: l_txn_type_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_TYPE_ID%TYPE;
9579:
9580:

Line 9577: l_rcv_txn_id MTL_MATERIAL_TRANSACTIONS.RCV_TRANSACTION_ID%TYPE;

9573: l_item_id MTL_MATERIAL_TRANSACTIONS.INVENTORY_ITEM_ID%TYPE;
9574: l_txn_action_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ACTION_ID%TYPE;
9575: l_txn_src_type_id
9576: MTL_MATERIAL_TRANSACTIONS.TRANSACTION_SOURCE_TYPE_ID%TYPE;
9577: l_rcv_txn_id MTL_MATERIAL_TRANSACTIONS.RCV_TRANSACTION_ID%TYPE;
9578: l_txn_type_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_TYPE_ID%TYPE;
9579:
9580:
9581: l_stmt_num NUMBER;

Line 9578: l_txn_type_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_TYPE_ID%TYPE;

9574: l_txn_action_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_ACTION_ID%TYPE;
9575: l_txn_src_type_id
9576: MTL_MATERIAL_TRANSACTIONS.TRANSACTION_SOURCE_TYPE_ID%TYPE;
9577: l_rcv_txn_id MTL_MATERIAL_TRANSACTIONS.RCV_TRANSACTION_ID%TYPE;
9578: l_txn_type_id MTL_MATERIAL_TRANSACTIONS.TRANSACTION_TYPE_ID%TYPE;
9579:
9580:
9581: l_stmt_num NUMBER;
9582: l_api_name VARCHAR2(100) := 'CompEncumbrance_IntOrdersExp';

Line 9623: MTL_MATERIAL_TRANSACTIONS mmt

9619: l_txn_src_type_id,
9620: l_txn_type_id,
9621: l_rcv_txn_id
9622: FROM
9623: MTL_MATERIAL_TRANSACTIONS mmt
9624: WHERE
9625: transaction_id = p_transaction_id;
9626:
9627: /* Get total received (and costed) quantity */

Line 9632: from mtl_material_transactions

9628:
9629: l_stmt_num := 20;
9630: SELECT sum(primary_quantity)
9631: INTO l_total_primary_qty
9632: from mtl_material_transactions
9633: where transaction_action_id = l_txn_action_id
9634: and transaction_source_type_id = l_txn_src_type_id
9635: and transaction_type_id = l_txn_type_id
9636: and trx_source_line_id = l_trx_source_line_id

Line 9821: UPDATE mtl_material_transactions

9817: o_err_code := 'CST_NO_COST_HOOK_DATA';
9818: FND_MESSAGE.set_name('BOM', 'CST_NO_COST_HOOK_DATA');
9819: o_err_msg := FND_MESSAGE.Get;
9820:
9821: UPDATE mtl_material_transactions
9822: SET costed_flag = 'E',
9823: error_code = substrb(o_err_code,1,240),
9824: error_explanation = substrb(o_err_msg,1,240),
9825: request_id = i_req_id,

Line 9837: UPDATE mtl_material_transactions

9833: o_err_code := 'CST_CLCD_WITH_INS_FLAG';
9834: FND_MESSAGE.set_name('BOM','CST_CLCD_WITH_INS_FLAG');
9835: FND_MESSAGE.set_token('TXN_ID', i_txn_id);
9836: o_err_msg := FND_MESSAGE.Get;
9837: UPDATE mtl_material_transactions
9838: SET costed_flag = 'E',
9839: error_code = substrb(o_err_code,1,240),
9840: error_explanation = substrb(o_err_msg,1,240),
9841: request_id = i_req_id,

Line 9850: UPDATE mtl_material_transactions

9846: WHEN others THEN
9847: rollback;
9848: o_err_num:=SQLCODE;
9849: o_err_msg:='CSTPAVCP.validate_actual_cost_hook('||to_char(l_stmt_num)||'):'||substr(SQLERRM,1,200);
9850: UPDATE mtl_material_transactions
9851: SET costed_flag = 'E',
9852: error_code = substrb(o_err_code,1,240),
9853: error_explanation = substrb(o_err_msg,1,240),
9854: request_id = i_req_id,