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: cst_cogs_events CCE /*Bug Fix 16766955*/
429: WHERE OOLA.line_id = l_so_line_id
430: AND OOHA.header_id = OOLA.header_id

Line 489: mtl_material_transactions MMT,

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

Line 676: mtl_material_transactions mmt

672: l_stmt_num := 103;
673: select decode(l_to_std_exp,1,1,decode(asset_inventory,1,0,1))
674: into l_to_std_exp
675: from mtl_secondary_inventories msi,
676: mtl_material_transactions mmt
677: where mmt.transaction_id = i_txn_id
678: and mmt.organization_id = l_std_org
679: and msi.organization_id = l_std_org
680: and msi.secondary_inventory_name = mmt.subinventory_code;

Line 716: from mtl_material_transactions

712: l_stmt_num := 110;
713:
714: select transaction_type_id
715: into l_txn_type_id
716: from mtl_material_transactions
717: where transaction_id = i_txn_id;
718:
719: l_stmt_num := 120;
720: IF ( I_TXN_ACTION_ID = 1 AND L_TXN_TYPE_ID = 34 AND I_TXN_SRC_TYPE = 8) THEN

Line 803: UPDATE mtl_material_transactions mmt

799: l_stmt_num := 10;
800: -- item cost history, update the transfer_prior_costed_quantity
801: -- is necessary because we need both the from and the to information
802: -- in item cost history
803: UPDATE mtl_material_transactions mmt
804: SET TRANSFER_PRIOR_COSTED_QUANTITY =
805: (SELECT
806: layer_quantity
807: FROM cst_quantity_layers cql

Line 865: from mtl_material_transactions mmt,

861: select decode(wac.class_type, 1, 0,
862: 3, 0,
863: 4, decode(i_exp_flag, 1, 1, 0))
864: into l_exp_flag
865: from mtl_material_transactions mmt,
866: wip_flow_schedules wfs,
867: wip_accounting_classes wac
868: where mmt.transaction_id = i_txn_id
869: and mmt.organization_id = i_org_id

Line 880: from mtl_material_transactions mmt,

876: select decode(wac.class_type, 1, 0,
877: 3, 0,
878: 4, decode(i_exp_flag, 1, 1, 0))
879: into l_exp_flag
880: from mtl_material_transactions mmt,
881: wip_discrete_jobs wdj,
882: wip_accounting_classes wac
883: where mmt.transaction_id = i_txn_id
884: and mmt.organization_id = i_org_id

Line 1155: ,mtl_material_transactions mmt

1151: l_stmt_num := 30;
1152: select decode(l_std_exp,1,1,decode(asset_inventory,1,0,1))
1153: into l_std_exp
1154: from mtl_secondary_inventories msi
1155: ,mtl_material_transactions mmt
1156: where mmt.transaction_id = i_txn_id
1157: and mmt.organization_id = l_std_org
1158: and msi.organization_id = l_std_org
1159: and msi.secondary_inventory_name = mmt.subinventory_code;

Line 1238: UPDATE mtl_material_transactions mmt

1234: if i_org_id = l_which_org then -- this takes care the case R/R,
1235: -- cost worker will process the same mmt
1236: -- transaction twice
1237: l_stmt_num := 50;
1238: UPDATE mtl_material_transactions mmt
1239: SET TRANSFER_PRIOR_COSTED_QUANTITY =
1240: (SELECT
1241: layer_quantity
1242: FROM cst_quantity_layers cql

Line 1255: update mtl_material_transactions mmt

1251: AND cql.inventory_item_id = i_item_id
1252: AND cql.cost_group_id = l_which_cst_grp);
1253:
1254: IF SQL%ROWCOUNT = 0 THEN
1255: update mtl_material_transactions mmt
1256: set TRANSFER_PRIOR_COSTED_QUANTITY = 0
1257: where mmt.transaction_id = i_txn_id;
1258: END IF;
1259: end if;

Line 1267: UPDATE mtl_material_transactions mmt

1263:
1264: -- bug 2827548 - took following IF condition out of the one that follows it because we
1265: -- need to update txn_cost of receit txn before returning if shipment is already costed
1266: if (i_txn_action_id = 12 and i_org_id = i_txn_org_id and i_fob_point = 1) then
1267: UPDATE mtl_material_transactions mmt
1268: SET mmt.transaction_cost = (select (mmt1.transaction_cost * mmt1.currency_conversion_rate)
1269: from mtl_material_transactions mmt1
1270: where mmt1.transaction_id = mmt.transfer_transaction_id
1271: and mmt1.costed_flag is null)

Line 1269: from mtl_material_transactions mmt1

1265: -- need to update txn_cost of receit txn before returning if shipment is already costed
1266: if (i_txn_action_id = 12 and i_org_id = i_txn_org_id and i_fob_point = 1) then
1267: UPDATE mtl_material_transactions mmt
1268: SET mmt.transaction_cost = (select (mmt1.transaction_cost * mmt1.currency_conversion_rate)
1269: from mtl_material_transactions mmt1
1270: where mmt1.transaction_id = mmt.transfer_transaction_id
1271: and mmt1.costed_flag is null)
1272: WHERE mmt.transaction_id = i_txn_id
1273: AND nvl(mmt.transaction_cost,0) = 0;

Line 1616: update mtl_material_transactions mmt

1612: if (i_txn_org_id = l_std_org) then
1613: -- update actual cost column of mmt.
1614: l_stmt_num := 90;
1615:
1616: update mtl_material_transactions mmt
1617: set (last_update_date,
1618: last_updated_by,
1619: last_update_login,
1620: request_id,

Line 1653: from mtl_material_transactions

1649: l_stmt_num := 100;
1650:
1651: select transfer_transaction_id
1652: into l_txn_update_id
1653: from mtl_material_transactions
1654: where transaction_id = i_txn_id;
1655: else
1656: l_txn_update_id := i_txn_id;
1657: end if;

Line 1763: Update mtl_material_transactions

1759: -- the transfer cost is always in shipping UOM and currency
1760: -- For FOB receipt, need to convert the primary_quantity (in receiving UOM)
1761: -- to sending primary quantity.
1762: l_stmt_num := 150;
1763: Update mtl_material_transactions
1764: Set transfer_cost =
1765: (select decode(nvl(transfer_percentage, -999),-999, transfer_cost,
1766: (transfer_percentage * l_snd_txn_cost *
1767: decode(i_txn_action_id, 12, abs(primary_quantity)/l_um_rate,

Line 1769: from mtl_material_transactions

1765: (select decode(nvl(transfer_percentage, -999),-999, transfer_cost,
1766: (transfer_percentage * l_snd_txn_cost *
1767: decode(i_txn_action_id, 12, abs(primary_quantity)/l_um_rate,
1768: abs(primary_quantity)))*l_xfer_conv_rate/100) -- bug 2827548-added l_xfer_conv_rate
1769: from mtl_material_transactions
1770: where transaction_id = i_txn_id)
1771: where transaction_id = i_txn_id
1772: or (transaction_id = decode(i_txn_action_id,3,l_txn_update_id,-1));
1773:

Line 1780: from mtl_material_transactions

1776:
1777: select nvl(transfer_cost,0), nvl(transportation_cost,0),
1778: decode(i_txn_action_id,12,(primary_quantity / l_um_rate),primary_quantity)
1779: into l_txfr_cost, l_trans_cost, l_snd_qty
1780: from mtl_material_transactions
1781: where transaction_id = i_txn_id;
1782:
1783: /* TPRICE: If the transfer pricing option is yes, set transfer credit to be zero */
1784: if (i_tprice_option <> 0) then

Line 1928: Update mtl_material_transactions

1924: end if;
1925:
1926: -- Update the transaction cost column if appropriate.
1927: /* Begin changes and additions for bug 2827548 */
1928: Update mtl_material_transactions
1929: Set transaction_cost = l_new_txn_cost
1930: where transaction_id = i_txn_id;
1931:
1932: if (i_txn_action_id = 3) then

Line 1933: Update mtl_material_transactions

1929: Set transaction_cost = l_new_txn_cost
1930: where transaction_id = i_txn_id;
1931:
1932: if (i_txn_action_id = 3) then
1933: Update mtl_material_transactions
1934: Set transaction_cost = l_rcv_txn_cost
1935: where transaction_id = l_txn_update_id;
1936: end if;
1937:

Line 1941: update mtl_material_transactions mmt

1937:
1938: -- Update the transaction_cost column for receipt txn w/ fob shipment
1939: -- in the receiving org's currency
1940: if (i_txn_action_id = 21 and i_fob_point = 1) then
1941: update mtl_material_transactions mmt
1942: set mmt.transaction_cost = l_rcv_txn_cost
1943: where mmt.transfer_transaction_id = i_txn_id
1944: and mmt.transaction_action_id = 12;
1945: -- Update the transaction_cost column for shipment txn w/ fob receipt

Line 1948: update mtl_material_transactions mmt

1944: and mmt.transaction_action_id = 12;
1945: -- Update the transaction_cost column for shipment txn w/ fob receipt
1946: -- in the sending org's currency
1947: elsif (i_txn_action_id = 12 and i_fob_point = 2) then
1948: update mtl_material_transactions mmt
1949: set mmt.transaction_cost = l_snd_txn_cost
1950: where mmt.transaction_id =
1951: (select mmt1.transfer_transaction_id
1952: from mtl_material_transactions mmt1

Line 1952: from mtl_material_transactions mmt1

1948: update mtl_material_transactions mmt
1949: set mmt.transaction_cost = l_snd_txn_cost
1950: where mmt.transaction_id =
1951: (select mmt1.transfer_transaction_id
1952: from mtl_material_transactions mmt1
1953: where mmt1.transaction_id = i_txn_id)
1954: and mmt.transaction_action_id = 21
1955: and nvl(mmt.transaction_cost,0) = 0;
1956: end if;

Line 2020: update mtl_material_transactions mmt

2016:
2017: if (l_std_org = i_txn_org_id or i_txn_action_id = 3) then
2018: l_stmt_num := 220;
2019:
2020: update mtl_material_transactions mmt
2021: set (last_update_date,
2022: last_updated_by,
2023: last_update_login,
2024: request_id,

Line 2059: from mtl_material_transactions mmt

2055:
2056: l_stmt_num := 240;
2057: select transfer_transaction_id
2058: into l_txfr_txn_id
2059: from mtl_material_transactions mmt
2060: where mmt.transaction_id = i_txn_id;
2061:
2062: l_stmt_num := 250;
2063: select decode(l_txfr_std_exp,1,1,decode(asset_inventory,1,0,1))

Line 2066: ,mtl_material_transactions mmt

2062: l_stmt_num := 250;
2063: select decode(l_txfr_std_exp,1,1,decode(asset_inventory,1,0,1))
2064: into l_txfr_std_exp
2065: from mtl_secondary_inventories msi
2066: ,mtl_material_transactions mmt
2067: where mmt.transaction_id = l_txfr_txn_id
2068: and mmt.organization_id = l_std_org
2069: and msi.organization_id = l_std_org
2070: and msi.secondary_inventory_name = mmt.subinventory_code;

Line 2127: update mtl_material_transactions mmt

2123: AND ctcd.organization_id = l_std_org
2124: /* AND ctcd.transaction_cost >= 0 */; -- modified for bug #3835412
2125:
2126: FND_FILE.PUT_LINE(FND_FILE.LOG, to_char(l_stmt_num) || ' update MMT from MCACD with l_txfr_std_exp = 1');
2127: update mtl_material_transactions mmt
2128: set (last_update_date,
2129: last_updated_by,
2130: last_update_login,
2131: request_id,

Line 2164: from mtl_material_transactions mmt

2160:
2161: if (i_txn_org_id = l_std_org) then
2162: select transfer_transaction_id
2163: into l_txfr_txn_id
2164: from mtl_material_transactions mmt
2165: where mmt.transaction_id = i_txn_id;
2166: end if;
2167:
2168: l_stmt_num := 270;

Line 2224: update mtl_material_transactions mmt

2220:
2221: -- update mmt if this is the receiving transaction id
2222: if (i_txn_org_id = l_std_org) then
2223: FND_FILE.PUT_LINE(FND_FILE.LOG, to_char(l_stmt_num) || ' update MMT from MCACD with l_to_std_exp = 1');
2224: update mtl_material_transactions mmt
2225: set (last_update_date,
2226: last_updated_by,
2227: last_update_login,
2228: request_id,

Line 2337: from mtl_material_transactions

2333: l_stmt_num := 50;
2334:
2335: select currency_conversion_type, TRUNC(transaction_date)
2336: into l_curr_type, l_txn_date
2337: from mtl_material_transactions
2338: where transaction_id = i_txn_id;
2339:
2340: if (l_curr_type is NULL) then
2341: FND_PROFILE.get('CURRENCY_CONVERSION_TYPE', l_curr_type);

Line 3041: from mtl_material_transactions

3037: ********************************************************************/
3038: l_stmt_num := 10;
3039: select transaction_type_id
3040: into l_txn_type_id
3041: from mtl_material_transactions
3042: where transaction_id = i_txn_id;
3043:
3044: if ((i_txfr_layer_id is not NULL) and (i_txfr_layer_id <> i_layer_id)) then
3045: l_layer_chg := 1;

Line 3065: mtl_material_transactions mmt

3061:
3062: select decode(asset_inventory,1,0,1)
3063: into l_exp1
3064: from mtl_secondary_inventories msi,
3065: mtl_material_transactions mmt
3066: where msi.secondary_inventory_name = mmt.subinventory_code
3067: and msi.organization_id = i_org_id
3068: and mmt.transaction_id = i_txn_id
3069: and mmt.organization_id = i_org_id;

Line 3097: from mtl_material_transactions mmt,

3093: select decode(wac.class_type, 1, 0,
3094: 3, 0,
3095: 4, decode(l_exp1, 1, 1, 0))
3096: into l_exp2
3097: from mtl_material_transactions mmt,
3098: wip_flow_schedules wfs,
3099: wip_accounting_classes wac
3100: where mmt.transaction_id = i_txn_id
3101: and mmt.organization_id = i_org_id

Line 3113: from mtl_material_transactions mmt,

3109: select decode(wac.class_type, 1, 0,
3110: 3, 0,
3111: 4, decode(l_exp1, 1, 1, 0))
3112: into l_exp2
3113: from mtl_material_transactions mmt,
3114: wip_discrete_jobs wdj,
3115: wip_accounting_classes wac
3116: where mmt.transaction_id = i_txn_id
3117: and mmt.organization_id = i_org_id

Line 3128: mtl_material_transactions mmt

3124: elsif (i_txn_action_id IN (2,5,28)) then
3125: select decode(asset_inventory,1,0,1)
3126: into l_exp2
3127: from mtl_secondary_inventories msi,
3128: mtl_material_transactions mmt
3129: where msi.secondary_inventory_name = mmt.transfer_subinventory
3130: and msi.organization_id = i_org_id
3131: and mmt.transaction_id = i_txn_id
3132: and mmt.organization_id = i_org_id;

Line 3372: FROM mtl_material_transactions

3368: FROM dual;
3369: l_stmt_num :=87;
3370: SELECT transaction_source_id
3371: INTO l_src_id
3372: FROM mtl_material_transactions
3373: WHERE transaction_id = i_txn_id;
3374: l_stmt_num :=88;
3375: l_src_number := CSTPLENG.GET_SOURCE_NUMBER(i_txn_id,i_txn_src_type,l_src_id);
3376: l_stmt_num :=89;

Line 3988: from mtl_material_transactions

3984: if (i_txn_action_id IN (2,5,28,55)) then
3985:
3986: select transfer_transaction_id
3987: into l_txf_txn_id
3988: from mtl_material_transactions
3989: where transaction_id = i_txn_id;
3990:
3991: l_stmt_num := 170;
3992:

Line 3993: update mtl_material_transactions mmt1

3989: where transaction_id = i_txn_id;
3990:
3991: l_stmt_num := 170;
3992:
3993: update mtl_material_transactions mmt1
3994: set (last_update_date,
3995: last_updated_by,
3996: last_update_login,
3997: request_id,

Line 4461: UPDATE mtl_material_transactions mmt

4457: l_which_cst_grp := i_cost_grp_id;
4458:
4459: if i_org_id = l_which_org then
4460: l_stmt_num := 10;
4461: UPDATE mtl_material_transactions mmt
4462: SET TRANSFER_PRIOR_COSTED_QUANTITY =
4463: (SELECT
4464: layer_quantity
4465: FROM cst_quantity_layers cql

Line 4479: update mtl_material_transactions mmt

4475: AND cql.cost_group_id = l_which_cst_grp);
4476:
4477: IF SQL%ROWCOUNT = 0 THEN
4478: l_stmt_num := 20;
4479: update mtl_material_transactions mmt
4480: set TRANSFER_PRIOR_COSTED_QUANTITY = 0
4481: where mmt.transaction_id = i_txn_id;
4482: END IF;
4483: end if;

Line 4496: FROM mtl_material_transactions

4492:
4493: l_stmt_num := 30;
4494: SELECT nvl(transportation_cost,0)
4495: INTO l_trans_cost
4496: FROM mtl_material_transactions
4497: WHERE transaction_id = i_txn_id;
4498:
4499: --
4500: -- No need for any UOM or currency conversion as it is already done

Line 4564: Update mtl_material_transactions

4560: fnd_file.put_line(fnd_file.log, 'Updating trx: ' || i_txn_id || ' with trxCost: ' || l_rcv_txn_cost);
4561: END IF;
4562:
4563: l_stmt_num := 50;
4564: Update mtl_material_transactions
4565: Set transaction_cost = l_rcv_txn_cost
4566: where transaction_id = i_txn_id;
4567:
4568:

Line 4619: Update mtl_material_transactions

4615: fnd_file.put_line(fnd_file.log, 'Updating trx: ' || i_txn_id || ' with trxCost: ' || l_rcv_txn_cost);
4616: END IF;
4617:
4618: l_stmt_num := 70;
4619: Update mtl_material_transactions
4620: Set transaction_cost = l_rcv_txn_cost
4621: where transaction_id = i_txn_id;
4622:
4623: elsif ((i_txn_action_id = 15) OR

Line 4673: Update mtl_material_transactions

4669: 0);
4670:
4671: l_stmt_num := 90;
4672: -- Update the transaction cost column if appropriate.
4673: Update mtl_material_transactions
4674: Set transaction_cost = l_rcv_txn_cost
4675: where transaction_id = i_txn_id;
4676:
4677: if (l_to_method <> 1) then