DBA Data[Home] [Help]

APPS.CSTPLVCP dependencies on MTL_MATERIAL_TRANSACTIONS

Line 95: FROM mtl_parameters mp, mtl_material_transactions mmt

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

Line 328: from mtl_material_transactions

324: l_stmt_num := 60;
325:
326: select transaction_type_id
327: into l_txn_type_id
328: from mtl_material_transactions
329: where transaction_id = i_txn_id;
330:
331: if (l_txn_type_id = 68) and (i_layer_id <> i_txfr_layer_id) then
332: /* if payback txn and txn involved different projects

Line 382: FROM mtl_material_transactions MMT,

378: -- Check if Sales Order is referenced
379: l_stmt_num := 72;
380: SELECT MIN(OOLA.reference_line_id)
381: INTO l_so_line_id
382: FROM mtl_material_transactions MMT,
383: oe_order_lines_all OOLA
384: WHERE MMT.transaction_id = i_txn_id
385: AND OOLA.line_id = MMT.trx_source_line_id;
386:

Line 426: mtl_material_transactions MMT,

422: SYSDATE
423: FROM oe_order_lines_all OOLA, /*BUG 5768680 Changes introduced to improve performance*/
424: oe_order_headers_all OOHA, /* of the layer cost worker*/
425: mtl_sales_orders MSO,
426: mtl_material_transactions MMT,
427: mtl_cst_actual_cost_details MCACD
428: WHERE OOLA.line_id = l_so_line_id
429: AND OOHA.header_id = OOLA.header_id
430: AND MSO.segment1 = TO_CHAR(OOHA.order_number) -- extraneous MSOs are possible

Line 610: mtl_material_transactions mmt

606: l_stmt_num := 103;
607: select decode(l_to_std_exp,1,1,decode(asset_inventory,1,0,1))
608: into l_to_std_exp
609: from mtl_secondary_inventories msi,
610: mtl_material_transactions mmt
611: where mmt.transaction_id = i_txn_id
612: and mmt.organization_id = l_std_org
613: and msi.organization_id = l_std_org
614: and msi.secondary_inventory_name = mmt.subinventory_code;

Line 650: from mtl_material_transactions

646: l_stmt_num := 110;
647:
648: select transaction_type_id
649: into l_txn_type_id
650: from mtl_material_transactions
651: where transaction_id = i_txn_id;
652:
653: l_stmt_num := 120;
654: IF ( I_TXN_ACTION_ID = 1 AND L_TXN_TYPE_ID = 34 AND I_TXN_SRC_TYPE = 8) THEN

Line 737: UPDATE mtl_material_transactions mmt

733: l_stmt_num := 10;
734: -- item cost history, update the transfer_prior_costed_quantity
735: -- is necessary because we need both the from and the to information
736: -- in item cost history
737: UPDATE mtl_material_transactions mmt
738: SET TRANSFER_PRIOR_COSTED_QUANTITY =
739: (SELECT
740: layer_quantity
741: FROM cst_quantity_layers cql

Line 799: from mtl_material_transactions mmt,

795: select decode(wac.class_type, 1, 0,
796: 3, 0,
797: 4, decode(i_exp_flag, 1, 1, 0))
798: into l_exp_flag
799: from mtl_material_transactions mmt,
800: wip_flow_schedules wfs,
801: wip_accounting_classes wac
802: where mmt.transaction_id = i_txn_id
803: and mmt.organization_id = i_org_id

Line 814: from mtl_material_transactions mmt,

810: select decode(wac.class_type, 1, 0,
811: 3, 0,
812: 4, decode(i_exp_flag, 1, 1, 0))
813: into l_exp_flag
814: from mtl_material_transactions mmt,
815: wip_discrete_jobs wdj,
816: wip_accounting_classes wac
817: where mmt.transaction_id = i_txn_id
818: and mmt.organization_id = i_org_id

Line 1089: ,mtl_material_transactions mmt

1085: l_stmt_num := 30;
1086: select decode(l_std_exp,1,1,decode(asset_inventory,1,0,1))
1087: into l_std_exp
1088: from mtl_secondary_inventories msi
1089: ,mtl_material_transactions mmt
1090: where mmt.transaction_id = i_txn_id
1091: and mmt.organization_id = l_std_org
1092: and msi.organization_id = l_std_org
1093: and msi.secondary_inventory_name = mmt.subinventory_code;

Line 1172: UPDATE mtl_material_transactions mmt

1168: if i_org_id = l_which_org then -- this takes care the case R/R,
1169: -- cost worker will process the same mmt
1170: -- transaction twice
1171: l_stmt_num := 50;
1172: UPDATE mtl_material_transactions mmt
1173: SET TRANSFER_PRIOR_COSTED_QUANTITY =
1174: (SELECT
1175: layer_quantity
1176: FROM cst_quantity_layers cql

Line 1189: update mtl_material_transactions mmt

1185: AND cql.inventory_item_id = i_item_id
1186: AND cql.cost_group_id = l_which_cst_grp);
1187:
1188: IF SQL%ROWCOUNT = 0 THEN
1189: update mtl_material_transactions mmt
1190: set TRANSFER_PRIOR_COSTED_QUANTITY = 0
1191: where mmt.transaction_id = i_txn_id;
1192: END IF;
1193: end if;

Line 1201: UPDATE mtl_material_transactions mmt

1197:
1198: -- bug 2827548 - took following IF condition out of the one that follows it because we
1199: -- need to update txn_cost of receit txn before returning if shipment is already costed
1200: if (i_txn_action_id = 12 and i_org_id = i_txn_org_id and i_fob_point = 1) then
1201: UPDATE mtl_material_transactions mmt
1202: SET mmt.transaction_cost = (select (mmt1.transaction_cost * mmt1.currency_conversion_rate)
1203: from mtl_material_transactions mmt1
1204: where mmt1.transaction_id = mmt.transfer_transaction_id
1205: and mmt1.costed_flag is null)

Line 1203: from mtl_material_transactions mmt1

1199: -- need to update txn_cost of receit txn before returning if shipment is already costed
1200: if (i_txn_action_id = 12 and i_org_id = i_txn_org_id and i_fob_point = 1) then
1201: UPDATE mtl_material_transactions mmt
1202: SET mmt.transaction_cost = (select (mmt1.transaction_cost * mmt1.currency_conversion_rate)
1203: from mtl_material_transactions mmt1
1204: where mmt1.transaction_id = mmt.transfer_transaction_id
1205: and mmt1.costed_flag is null)
1206: WHERE mmt.transaction_id = i_txn_id
1207: AND nvl(mmt.transaction_cost,0) = 0;

Line 1550: update mtl_material_transactions mmt

1546: if (i_txn_org_id = l_std_org) then
1547: -- update actual cost column of mmt.
1548: l_stmt_num := 90;
1549:
1550: update mtl_material_transactions mmt
1551: set (last_update_date,
1552: last_updated_by,
1553: last_update_login,
1554: request_id,

Line 1587: from mtl_material_transactions

1583: l_stmt_num := 100;
1584:
1585: select transfer_transaction_id
1586: into l_txn_update_id
1587: from mtl_material_transactions
1588: where transaction_id = i_txn_id;
1589: else
1590: l_txn_update_id := i_txn_id;
1591: end if;

Line 1697: Update mtl_material_transactions

1693: -- the transfer cost is always in shipping UOM and currency
1694: -- For FOB receipt, need to convert the primary_quantity (in receiving UOM)
1695: -- to sending primary quantity.
1696: l_stmt_num := 150;
1697: Update mtl_material_transactions
1698: Set transfer_cost =
1699: (select decode(nvl(transfer_percentage, -999),-999, transfer_cost,
1700: (transfer_percentage * l_snd_txn_cost *
1701: decode(i_txn_action_id, 12, abs(primary_quantity)/l_um_rate,

Line 1703: from mtl_material_transactions

1699: (select decode(nvl(transfer_percentage, -999),-999, transfer_cost,
1700: (transfer_percentage * l_snd_txn_cost *
1701: decode(i_txn_action_id, 12, abs(primary_quantity)/l_um_rate,
1702: abs(primary_quantity)))*l_xfer_conv_rate/100) -- bug 2827548-added l_xfer_conv_rate
1703: from mtl_material_transactions
1704: where transaction_id = i_txn_id)
1705: where transaction_id = i_txn_id
1706: or (transaction_id = decode(i_txn_action_id,3,l_txn_update_id,-1));
1707:

Line 1714: from mtl_material_transactions

1710:
1711: select nvl(transfer_cost,0), nvl(transportation_cost,0),
1712: decode(i_txn_action_id,12,(primary_quantity / l_um_rate),primary_quantity)
1713: into l_txfr_cost, l_trans_cost, l_snd_qty
1714: from mtl_material_transactions
1715: where transaction_id = i_txn_id;
1716:
1717: /* TPRICE: If the transfer pricing option is yes, set transfer credit to be zero */
1718: if (i_tprice_option <> 0) then

Line 1862: Update mtl_material_transactions

1858: end if;
1859:
1860: -- Update the transaction cost column if appropriate.
1861: /* Begin changes and additions for bug 2827548 */
1862: Update mtl_material_transactions
1863: Set transaction_cost = l_new_txn_cost
1864: where transaction_id = i_txn_id;
1865:
1866: if (i_txn_action_id = 3) then

Line 1867: Update mtl_material_transactions

1863: Set transaction_cost = l_new_txn_cost
1864: where transaction_id = i_txn_id;
1865:
1866: if (i_txn_action_id = 3) then
1867: Update mtl_material_transactions
1868: Set transaction_cost = l_rcv_txn_cost
1869: where transaction_id = l_txn_update_id;
1870: end if;
1871:

Line 1875: update mtl_material_transactions mmt

1871:
1872: -- Update the transaction_cost column for receipt txn w/ fob shipment
1873: -- in the receiving org's currency
1874: if (i_txn_action_id = 21 and i_fob_point = 1) then
1875: update mtl_material_transactions mmt
1876: set mmt.transaction_cost = l_rcv_txn_cost
1877: where mmt.transfer_transaction_id = i_txn_id
1878: and mmt.transaction_action_id = 12;
1879: -- Update the transaction_cost column for shipment txn w/ fob receipt

Line 1882: update mtl_material_transactions mmt

1878: and mmt.transaction_action_id = 12;
1879: -- Update the transaction_cost column for shipment txn w/ fob receipt
1880: -- in the sending org's currency
1881: elsif (i_txn_action_id = 12 and i_fob_point = 2) then
1882: update mtl_material_transactions mmt
1883: set mmt.transaction_cost = l_snd_txn_cost
1884: where mmt.transaction_id =
1885: (select mmt1.transfer_transaction_id
1886: from mtl_material_transactions mmt1

Line 1886: from mtl_material_transactions mmt1

1882: update mtl_material_transactions mmt
1883: set mmt.transaction_cost = l_snd_txn_cost
1884: where mmt.transaction_id =
1885: (select mmt1.transfer_transaction_id
1886: from mtl_material_transactions mmt1
1887: where mmt1.transaction_id = i_txn_id)
1888: and mmt.transaction_action_id = 21
1889: and nvl(mmt.transaction_cost,0) = 0;
1890: end if;

Line 1954: update mtl_material_transactions mmt

1950:
1951: if (l_std_org = i_txn_org_id or i_txn_action_id = 3) then
1952: l_stmt_num := 220;
1953:
1954: update mtl_material_transactions mmt
1955: set (last_update_date,
1956: last_updated_by,
1957: last_update_login,
1958: request_id,

Line 1993: from mtl_material_transactions mmt

1989:
1990: l_stmt_num := 240;
1991: select transfer_transaction_id
1992: into l_txfr_txn_id
1993: from mtl_material_transactions mmt
1994: where mmt.transaction_id = i_txn_id;
1995:
1996: l_stmt_num := 250;
1997: select decode(l_txfr_std_exp,1,1,decode(asset_inventory,1,0,1))

Line 2000: ,mtl_material_transactions mmt

1996: l_stmt_num := 250;
1997: select decode(l_txfr_std_exp,1,1,decode(asset_inventory,1,0,1))
1998: into l_txfr_std_exp
1999: from mtl_secondary_inventories msi
2000: ,mtl_material_transactions mmt
2001: where mmt.transaction_id = l_txfr_txn_id
2002: and mmt.organization_id = l_std_org
2003: and msi.organization_id = l_std_org
2004: and msi.secondary_inventory_name = mmt.subinventory_code;

Line 2061: update mtl_material_transactions mmt

2057: AND ctcd.organization_id = l_std_org
2058: /* AND ctcd.transaction_cost >= 0 */; -- modified for bug #3835412
2059:
2060: FND_FILE.PUT_LINE(FND_FILE.LOG, to_char(l_stmt_num) || ' update MMT from MCACD with l_txfr_std_exp = 1');
2061: update mtl_material_transactions mmt
2062: set (last_update_date,
2063: last_updated_by,
2064: last_update_login,
2065: request_id,

Line 2098: from mtl_material_transactions mmt

2094:
2095: if (i_txn_org_id = l_std_org) then
2096: select transfer_transaction_id
2097: into l_txfr_txn_id
2098: from mtl_material_transactions mmt
2099: where mmt.transaction_id = i_txn_id;
2100: end if;
2101:
2102: l_stmt_num := 270;

Line 2158: update mtl_material_transactions mmt

2154:
2155: -- update mmt if this is the receiving transaction id
2156: if (i_txn_org_id = l_std_org) then
2157: FND_FILE.PUT_LINE(FND_FILE.LOG, to_char(l_stmt_num) || ' update MMT from MCACD with l_to_std_exp = 1');
2158: update mtl_material_transactions mmt
2159: set (last_update_date,
2160: last_updated_by,
2161: last_update_login,
2162: request_id,

Line 2271: from mtl_material_transactions

2267: l_stmt_num := 50;
2268:
2269: select currency_conversion_type, TRUNC(transaction_date)
2270: into l_curr_type, l_txn_date
2271: from mtl_material_transactions
2272: where transaction_id = i_txn_id;
2273:
2274: if (l_curr_type is NULL) then
2275: FND_PROFILE.get('CURRENCY_CONVERSION_TYPE', l_curr_type);

Line 2975: from mtl_material_transactions

2971: ********************************************************************/
2972: l_stmt_num := 10;
2973: select transaction_type_id
2974: into l_txn_type_id
2975: from mtl_material_transactions
2976: where transaction_id = i_txn_id;
2977:
2978: if ((i_txfr_layer_id is not NULL) and (i_txfr_layer_id <> i_layer_id)) then
2979: l_layer_chg := 1;

Line 2999: mtl_material_transactions mmt

2995:
2996: select decode(asset_inventory,1,0,1)
2997: into l_exp1
2998: from mtl_secondary_inventories msi,
2999: mtl_material_transactions mmt
3000: where msi.secondary_inventory_name = mmt.subinventory_code
3001: and msi.organization_id = i_org_id
3002: and mmt.transaction_id = i_txn_id
3003: and mmt.organization_id = i_org_id;

Line 3031: from mtl_material_transactions mmt,

3027: select decode(wac.class_type, 1, 0,
3028: 3, 0,
3029: 4, decode(l_exp1, 1, 1, 0))
3030: into l_exp2
3031: from mtl_material_transactions mmt,
3032: wip_flow_schedules wfs,
3033: wip_accounting_classes wac
3034: where mmt.transaction_id = i_txn_id
3035: and mmt.organization_id = i_org_id

Line 3047: from mtl_material_transactions mmt,

3043: select decode(wac.class_type, 1, 0,
3044: 3, 0,
3045: 4, decode(l_exp1, 1, 1, 0))
3046: into l_exp2
3047: from mtl_material_transactions mmt,
3048: wip_discrete_jobs wdj,
3049: wip_accounting_classes wac
3050: where mmt.transaction_id = i_txn_id
3051: and mmt.organization_id = i_org_id

Line 3062: mtl_material_transactions mmt

3058: elsif (i_txn_action_id IN (2,5,28)) then
3059: select decode(asset_inventory,1,0,1)
3060: into l_exp2
3061: from mtl_secondary_inventories msi,
3062: mtl_material_transactions mmt
3063: where msi.secondary_inventory_name = mmt.transfer_subinventory
3064: and msi.organization_id = i_org_id
3065: and mmt.transaction_id = i_txn_id
3066: and mmt.organization_id = i_org_id;

Line 3305: FROM mtl_material_transactions

3301: FROM dual;
3302: l_stmt_num :=87;
3303: SELECT transaction_source_id
3304: INTO l_src_id
3305: FROM mtl_material_transactions
3306: WHERE transaction_id = i_txn_id;
3307: l_stmt_num :=88;
3308: l_src_number := CSTPLENG.GET_SOURCE_NUMBER(i_txn_id,i_txn_src_type,l_src_id);
3309: l_stmt_num :=89;

Line 3921: from mtl_material_transactions

3917: if (i_txn_action_id IN (2,5,28,55)) then
3918:
3919: select transfer_transaction_id
3920: into l_txf_txn_id
3921: from mtl_material_transactions
3922: where transaction_id = i_txn_id;
3923:
3924: l_stmt_num := 170;
3925:

Line 3926: update mtl_material_transactions mmt1

3922: where transaction_id = i_txn_id;
3923:
3924: l_stmt_num := 170;
3925:
3926: update mtl_material_transactions mmt1
3927: set (last_update_date,
3928: last_updated_by,
3929: last_update_login,
3930: request_id,

Line 4394: UPDATE mtl_material_transactions mmt

4390: l_which_cst_grp := i_cost_grp_id;
4391:
4392: if i_org_id = l_which_org then
4393: l_stmt_num := 10;
4394: UPDATE mtl_material_transactions mmt
4395: SET TRANSFER_PRIOR_COSTED_QUANTITY =
4396: (SELECT
4397: layer_quantity
4398: FROM cst_quantity_layers cql

Line 4412: update mtl_material_transactions mmt

4408: AND cql.cost_group_id = l_which_cst_grp);
4409:
4410: IF SQL%ROWCOUNT = 0 THEN
4411: l_stmt_num := 20;
4412: update mtl_material_transactions mmt
4413: set TRANSFER_PRIOR_COSTED_QUANTITY = 0
4414: where mmt.transaction_id = i_txn_id;
4415: END IF;
4416: end if;

Line 4429: FROM mtl_material_transactions

4425:
4426: l_stmt_num := 30;
4427: SELECT nvl(transportation_cost,0)
4428: INTO l_trans_cost
4429: FROM mtl_material_transactions
4430: WHERE transaction_id = i_txn_id;
4431:
4432: --
4433: -- No need for any UOM or currency conversion as it is already done

Line 4497: Update mtl_material_transactions

4493: fnd_file.put_line(fnd_file.log, 'Updating trx: ' || i_txn_id || ' with trxCost: ' || l_rcv_txn_cost);
4494: END IF;
4495:
4496: l_stmt_num := 50;
4497: Update mtl_material_transactions
4498: Set transaction_cost = l_rcv_txn_cost
4499: where transaction_id = i_txn_id;
4500:
4501:

Line 4552: Update mtl_material_transactions

4548: fnd_file.put_line(fnd_file.log, 'Updating trx: ' || i_txn_id || ' with trxCost: ' || l_rcv_txn_cost);
4549: END IF;
4550:
4551: l_stmt_num := 70;
4552: Update mtl_material_transactions
4553: Set transaction_cost = l_rcv_txn_cost
4554: where transaction_id = i_txn_id;
4555:
4556: elsif ((i_txn_action_id = 15) OR

Line 4606: Update mtl_material_transactions

4602: 0);
4603:
4604: l_stmt_num := 90;
4605: -- Update the transaction cost column if appropriate.
4606: Update mtl_material_transactions
4607: Set transaction_cost = l_rcv_txn_cost
4608: where transaction_id = i_txn_id;
4609:
4610: if (l_to_method <> 1) then