DBA Data[Home] [Help]

APPS.PO_SUPPLY dependencies on MTL_SUPPLY

Line 337: l_return_value := maintain_mtl_supply;

333:
334:
335: d_progress := 600;
336:
337: l_return_value := maintain_mtl_supply;
338:
339: IF (NOT l_return_value) THEN
340:
341: IF (PO_LOG.d_stmt) THEN

Line 342: PO_LOG.stmt(d_module, d_progress, 'maintain_mtl_supply not successful.');

338:
339: IF (NOT l_return_value) THEN
340:
341: IF (PO_LOG.d_stmt) THEN
342: PO_LOG.stmt(d_module, d_progress, 'maintain_mtl_supply not successful.');
343: END IF;
344:
345: RAISE PO_CORE_S.g_early_return_exc;
346:

Line 481: /* Update mtl_supply for an Approve PO Action */

477:
478:
479: /* ----------------------------------------------------------------------- */
480: /* */
481: /* Update mtl_supply for an Approve PO Action */
482: /* */
483: /* ----------------------------------------------------------------------- */
484:
485:

Line 549: UPDATE mtl_supply ms

545:
546: -- Remove Old Requisition Supply
547: /*Bug 4537860:Hit the _all tables instead of the striped views.*/
548:
549: UPDATE mtl_supply ms
550: SET ms.quantity = 0
551: , ms.change_flag = 'Y'
552: WHERE ms.supply_type_code = 'REQ'
553: AND ms.supply_source_id IN

Line 603: /* Update mtl_supply for an Approve Blanket Release Action */

599:
600:
601: /* ----------------------------------------------------------------------- */
602: /* */
603: /* Update mtl_supply for an Approve Blanket Release Action */
604: /* */
605: /* ----------------------------------------------------------------------- */
606:
607:

Line 669: UPDATE mtl_supply ms

665:
666:
667: -- Remove Old Requisition Supply
668: --Bugfix5219471: Removed POD and used '_ALL' tables for share memory issue.
669: UPDATE mtl_supply ms
670: SET ms.quantity = 0
671: , ms.change_flag = 'Y'
672: WHERE ms.supply_type_code = 'REQ'
673: AND ms.supply_source_id IN

Line 722: /* Update mtl_supply for an Approve Planned Release Action */

718:
719:
720: /* ----------------------------------------------------------------------- */
721: /* */
722: /* Update mtl_supply for an Approve Planned Release Action */
723: /* */
724: /* ----------------------------------------------------------------------- */
725:
726: FUNCTION approve_planned_supply(p_docid IN NUMBER)

Line 850: /* Insert new PO Supply into mtl_supply for Standard or Planned PO */

846: /* ----------------------------------------------------------------------- */
847: /* */
848: /* Create PO Supply */
849: /* */
850: /* Insert new PO Supply into mtl_supply for Standard or Planned PO */
851: /* Approval, Blanket or Planned Release Approval, Standard or Planned */
852: /* PO Line Approval, Standard or Planned PO Shipment Approval, Blanket */
853: /* or Planned Release Shipment */
854: /* */

Line 893: l_supply_qty mtl_supply.quantity%TYPE := 0;

889: l_line_loc_id po_distributions.line_location_id%TYPE;
890:
891: l_supply_qty_in_pouom po_distributions.quantity_ordered%TYPE := 0;
892: l_uom po_lines.unit_meas_lookup_code%TYPE;
893: l_supply_qty mtl_supply.quantity%TYPE := 0;
894: l_supply_uom mtl_supply.unit_of_measure%TYPE;
895: l_supply_itemid mtl_supply.item_id%TYPE;
896:
897: l_message VARCHAR2(50);

Line 894: l_supply_uom mtl_supply.unit_of_measure%TYPE;

890:
891: l_supply_qty_in_pouom po_distributions.quantity_ordered%TYPE := 0;
892: l_uom po_lines.unit_meas_lookup_code%TYPE;
893: l_supply_qty mtl_supply.quantity%TYPE := 0;
894: l_supply_uom mtl_supply.unit_of_measure%TYPE;
895: l_supply_itemid mtl_supply.item_id%TYPE;
896:
897: l_message VARCHAR2(50);
898:

Line 895: l_supply_itemid mtl_supply.item_id%TYPE;

891: l_supply_qty_in_pouom po_distributions.quantity_ordered%TYPE := 0;
892: l_uom po_lines.unit_meas_lookup_code%TYPE;
893: l_supply_qty mtl_supply.quantity%TYPE := 0;
894: l_supply_uom mtl_supply.unit_of_measure%TYPE;
895: l_supply_itemid mtl_supply.item_id%TYPE;
896:
897: l_message VARCHAR2(50);
898:
899: sql_dist VARCHAR2(800);

Line 909: FROM mtl_supply

905: IS
906: SELECT SUM(to_org_primary_quantity),
907: to_org_primary_uom,
908: NVL(item_id, -1)
909: FROM mtl_supply
910: WHERE supply_type_code IN ('RECEIVING', 'SHIPMENT')
911: AND po_line_location_id = p_line_loc_id
912: GROUP BY to_org_primary_uom, nvl(item_id, -1);
913:

Line 1229: FROM mtl_supply

1225: SELECT SUM(to_org_primary_quantity),
1226: to_org_primary_uom,
1227: NVL(item_id, -1)
1228: INTO l_supply_qty, l_supply_uom, l_supply_itemid
1229: FROM mtl_supply
1230: WHERE supply_type_code IN ('RECEIVING', 'SHIPMENT')
1231: AND po_distribution_id = l_distid
1232: GROUP BY to_org_primary_uom, NVL(item_id, -1);
1233: EXCEPTION

Line 1272: INSERT INTO mtl_supply(supply_type_code,

1268:
1269: -- Create PO Supply
1270: /*Bug 4537860:Hit the _all tables instead of the striped views.*/
1271:
1272: INSERT INTO mtl_supply(supply_type_code,
1273: supply_source_id,
1274: last_updated_by,
1275: last_update_date,
1276: last_update_login,

Line 1332: FROM mtl_supply ms1

1328: AND pll.quantity IS NOT NULL --
1329: AND not exists
1330: (
1331: SELECT 'Supply Exists'
1332: FROM mtl_supply ms1
1333: WHERE ms1.supply_type_code = 'PO'
1334: AND ms1.supply_source_id = pd.po_distribution_id
1335: );
1336:

Line 1435: DELETE FROM mtl_supply

1431: d_progress := 10;
1432:
1433: IF (p_entity_type = 'PO') THEN
1434:
1435: DELETE FROM mtl_supply
1436: WHERE supply_type_code = 'PO'
1437: AND po_header_id = p_entity_id
1438: AND po_release_id IS NULL; -- : From Pro*C
1439:

Line 1442: DELETE FROM mtl_supply

1438: AND po_release_id IS NULL; -- : From Pro*C
1439:
1440: ELSIF (p_entity_type = 'RELEASE') THEN
1441:
1442: DELETE FROM mtl_supply
1443: WHERE supply_type_code = 'PO'
1444: AND po_release_id = p_entity_id;
1445:
1446: ELSIF (p_entity_type = 'PO LINE') THEN

Line 1448: DELETE FROM mtl_supply

1444: AND po_release_id = p_entity_id;
1445:
1446: ELSIF (p_entity_type = 'PO LINE') THEN
1447:
1448: DELETE FROM mtl_supply
1449: WHERE supply_type_code = 'PO'
1450: AND po_line_id = p_entity_id
1451: AND po_release_id IS NULL; -- : From Pro*C
1452:

Line 1455: DELETE FROM mtl_supply

1451: AND po_release_id IS NULL; -- : From Pro*C
1452:
1453: ELSIF (p_entity_type in ('PO SHIPMENT', 'RELEASE SHIPMENT')) THEN
1454:
1455: DELETE FROM mtl_supply
1456: WHERE supply_type_code = 'PO'
1457: AND po_line_location_id = p_entity_id;
1458:
1459: END IF;

Line 1530: UPDATE mtl_supply

1526: d_progress := 10;
1527:
1528: IF (p_entity_type = 'PO LINE') THEN
1529:
1530: UPDATE mtl_supply
1531: SET quantity = 0
1532: , change_flag = 'Y'
1533: WHERE supply_type_code = 'PO'
1534: AND po_line_id = p_entity_id

Line 1539: UPDATE mtl_supply

1535: AND po_release_id IS NULL; --
1536:
1537: ELSIF (p_entity_type = 'PO SHIPMENT') THEN
1538:
1539: UPDATE mtl_supply
1540: SET quantity = 0
1541: , change_flag = 'Y'
1542: WHERE supply_type_code = 'PO'
1543: AND po_line_location_id = p_entity_id;

Line 1547: UPDATE mtl_supply

1543: AND po_line_location_id = p_entity_id;
1544:
1545: ELSIF (p_entity_type = 'RELEASE SHIPMENT') THEN
1546:
1547: UPDATE mtl_supply
1548: SET quantity = 0
1549: , change_flag = 'Y'
1550: WHERE supply_type_code = 'PO'
1551: AND po_release_id = p_entity_id

Line 1690: /* Update mtl_supply for Cancel Planned Release or Cancel Planned */

1686: /* ----------------------------------------------------------------------- */
1687: /* */
1688: /* Cancel Planned Release or Planned Shipment */
1689: /* */
1690: /* Update mtl_supply for Cancel Planned Release or Cancel Planned */
1691: /* Release Shipment Action */
1692: /* */
1693: /* Cancellation of Planned Release and Planned Shipment is based on */
1694: /* Entity Type */

Line 1910: /* Maintain mtl_supply */

1906:
1907:
1908: /* ----------------------------------------------------------------------- */
1909: /* */
1910: /* Maintain mtl_supply */
1911: /* */
1912: /* ----------------------------------------------------------------------- */
1913:
1914: FUNCTION maintain_mtl_supply RETURN BOOLEAN IS

Line 1914: FUNCTION maintain_mtl_supply RETURN BOOLEAN IS

1910: /* Maintain mtl_supply */
1911: /* */
1912: /* ----------------------------------------------------------------------- */
1913:
1914: FUNCTION maintain_mtl_supply RETURN BOOLEAN IS
1915:
1916: l_uom mtl_system_items.primary_unit_of_measure%TYPE;
1917: l_lead_time mtl_system_items.postprocessing_lead_time%TYPE;
1918: l_pri_qty mtl_supply.to_org_primary_quantity%TYPE;

Line 1918: l_pri_qty mtl_supply.to_org_primary_quantity%TYPE;

1914: FUNCTION maintain_mtl_supply RETURN BOOLEAN IS
1915:
1916: l_uom mtl_system_items.primary_unit_of_measure%TYPE;
1917: l_lead_time mtl_system_items.postprocessing_lead_time%TYPE;
1918: l_pri_qty mtl_supply.to_org_primary_quantity%TYPE;
1919: l_exclude_from_planning mtl_supply.exclude_from_planning%TYPE; --
1920:
1921: -- : Brought in from Pro*C to cursor sup2:
1922: -- 1. index hint

Line 1919: l_exclude_from_planning mtl_supply.exclude_from_planning%TYPE; --

1915:
1916: l_uom mtl_system_items.primary_unit_of_measure%TYPE;
1917: l_lead_time mtl_system_items.postprocessing_lead_time%TYPE;
1918: l_pri_qty mtl_supply.to_org_primary_quantity%TYPE;
1919: l_exclude_from_planning mtl_supply.exclude_from_planning%TYPE; --
1920:
1921: -- : Brought in from Pro*C to cursor sup2:
1922: -- 1. index hint
1923: -- 2. order by

Line 1935: SELECT /*+ index(mtl_supply MTL_SUPPLY_N10) */

1931: Adding po_header_id, req_header_id and exclude_from_planning for clm integration with planning
1932: */
1933: CURSOR sup2
1934: IS
1935: SELECT /*+ index(mtl_supply MTL_SUPPLY_N10) */
1936: quantity
1937: , unit_of_measure
1938: , nvl(item_id, -1) item_id
1939: , from_organization_id

Line 1946: FROM mtl_supply

1942: , po_header_id
1943: , req_header_id
1944: , exclude_from_planning
1945: , rowid
1946: FROM mtl_supply
1947: WHERE change_flag = 'Y'
1948: ORDER BY DECODE (supply_type_code,
1949: 'REQ', 1,
1950: 'PO', 2,

Line 1983: d_module VARCHAR2(70) := 'po.plsql.PO_SUPPLY.maintain_mtl_supply';

1979: FROM mtl_system_items
1980: WHERE inventory_item_id = item_id
1981: AND organization_id = to_org;
1982:
1983: d_module VARCHAR2(70) := 'po.plsql.PO_SUPPLY.maintain_mtl_supply';
1984: d_progress NUMBER;
1985:
1986: BEGIN
1987:

Line 2001: DELETE FROM mtl_supply

1997: IF (c_sup2.quantity = 0) THEN
1998:
1999: d_progress := 20;
2000:
2001: DELETE FROM mtl_supply
2002: WHERE rowid = c_sup2.rowid;
2003:
2004: d_progress := 25;
2005: IF (PO_LOG.d_stmt) THEN

Line 2100: UPDATE mtl_supply

2096: NULL;
2097: END;
2098: --
2099: /* Bug 9611148: For non-CLM documents, exclude_from_planning should be NULL, not N. */
2100: UPDATE mtl_supply
2101: SET to_org_primary_quantity = l_pri_qty
2102: , to_org_primary_uom = l_uom
2103: , change_flag = null
2104: , change_type = null

Line 2145: END maintain_mtl_supply;

2141: END IF;
2142:
2143: return(FALSE);
2144:
2145: END maintain_mtl_supply;
2146:
2147:
2148: /* ----------------------------------------------------------------------- */
2149:

Line 2253: UPDATE mtl_supply

2249: IF (p_entity_type = 'REQ HDR') THEN
2250:
2251: d_progress := 20;
2252:
2253: UPDATE mtl_supply
2254: SET quantity = 0
2255: , change_flag = 'Y'
2256: WHERE supply_type_code = 'REQ'
2257: AND req_header_id = p_entity_id;

Line 2263: UPDATE mtl_supply

2259: ELSIF (p_entity_type = 'REQ LINE') THEN
2260:
2261: d_progress := 30;
2262:
2263: UPDATE mtl_supply
2264: SET quantity = 0
2265: , change_flag = 'Y'
2266: WHERE supply_type_code = 'REQ'
2267: AND req_line_id = p_entity_id;

Line 2317: UPDATE mtl_supply ms

2313: d_progress := 10;
2314:
2315: /*Bug 4537860:Hit the _all tables instead of the striped views.*/
2316:
2317: UPDATE mtl_supply ms
2318: SET ms.quantity = 0
2319: , ms.change_flag = 'Y'
2320: WHERE ms.supply_type_code = 'REQ'
2321: AND ms.req_header_id = p_docid

Line 2402: DELETE FROM mtl_supply ms1

2398: IF l_conformed_id IS NOT NULL THEN
2399: RETURN TRUE;
2400: END IF;
2401:
2402: DELETE FROM mtl_supply ms1
2403: WHERE ms1.supply_source_id IN
2404: (
2405: SELECT pl.requisition_line_id
2406: FROM po_requisition_lines_clm_v pl

Line 2425: INSERT INTO mtl_supply

2421: d_progress := 30;
2422:
2423: /*Bug 4537860:Hit the _all tables instead of the striped views.*/
2424:
2425: INSERT INTO mtl_supply
2426: (supply_type_code,
2427: supply_source_id,
2428: last_updated_by,
2429: last_update_date,

Line 2482: FROM mtl_supply ms

2478: AND prl.matching_basis <> 'AMOUNT'
2479: AND prl.line_location_id is null
2480: AND not exists
2481: (SELECT 'supply exists'
2482: FROM mtl_supply ms
2483: WHERE ms.supply_type_code = 'REQ'
2484: AND ms.supply_source_id = prl.requisition_line_id);
2485:
2486: ELSIF (p_entity_type = 'REQ LINE') THEN

Line 2504: INSERT INTO mtl_supply

2500: RETURN TRUE;
2501: END IF;
2502:
2503:
2504: INSERT INTO mtl_supply
2505: (supply_type_code,
2506: supply_source_id,
2507: last_updated_by,
2508: last_update_date,

Line 2562: FROM mtl_supply

2558: AND prl.matching_basis <> 'AMOUNT'
2559: AND NOT EXISTS
2560: (
2561: SELECT 'supply exists'
2562: FROM mtl_supply
2563: WHERE supply_type_code = 'REQ'
2564: AND supply_source_id = prl.requisition_line_id
2565: );
2566: --

Line 2604: -- Maintain mtl_supply for Explode or Multisource Action

2600:
2601:
2602: /* ----------------------------------------------------------------------- */
2603:
2604: -- Maintain mtl_supply for Explode or Multisource Action
2605:
2606: /* ----------------------------------------------------------------------- */
2607:
2608: FUNCTION explode(p_lineid IN NUMBER) RETURN BOOLEAN IS

Line 2648: insert into mtl_supply(supply_type_code,

2644: -- Multisource Action
2645:
2646: /*Bug 4537860:Hit the _all tables instead of the striped views.*/
2647:
2648: insert into mtl_supply(supply_type_code,
2649: supply_source_id,
2650: last_updated_by,
2651: last_update_date,
2652: last_update_login,

Line 2708: from mtl_supply

2704: and nvl(prl.cancel_flag, 'N') = 'N'
2705: and prl.line_location_id is null
2706: and not exists
2707: (select 'Supply Exists'
2708: from mtl_supply
2709: where supply_type_code = 'REQ'
2710: and supply_source_id = prl.requisition_line_id);
2711:
2712:

Line 2745: -- Updates Requisition Quantity in mtl_supply

2741: END explode;
2742:
2743: /* ----------------------------------------------------------------------- */
2744:
2745: -- Updates Requisition Quantity in mtl_supply
2746:
2747: /* ----------------------------------------------------------------------- */
2748:
2749:

Line 2769: UPDATE mtl_supply

2765: END IF;
2766:
2767: d_progress := 10;
2768:
2769: UPDATE mtl_supply
2770: SET quantity = p_qty
2771: , change_flag = 'Y'
2772: WHERE supply_type_code = 'REQ'
2773: AND req_line_id = p_lineid;

Line 2801: -- Updates Receipt Date in mtl_supply

2797: END update_req_line_qty;
2798:
2799: /* ----------------------------------------------------------------------- */
2800:
2801: -- Updates Receipt Date in mtl_supply
2802:
2803: /* ----------------------------------------------------------------------- */
2804:
2805: FUNCTION update_req_line_date(

Line 2824: UPDATE mtl_supply

2820: END IF;
2821:
2822: d_progress := 10;
2823:
2824: UPDATE mtl_supply
2825: SET receipt_date = p_receipt_date
2826: , need_by_date = p_receipt_date -- Bug 3443313
2827: , change_flag = 'Y'
2828: WHERE supply_type_code = 'REQ'

Line 2867: -- UPDATE PLANNED Update Quantity in mtl_supply

2863: -- Entity Type Action
2864: -- ----------- ------------------------------------------
2865: -- : REMOVE PLANNED is not used anywhere; removed
2866: --
2867: -- UPDATE PLANNED Update Quantity in mtl_supply
2868: --
2869: -- ADD PLANNED Update Quantity in mtl_supply
2870: --
2871:

Line 2869: -- ADD PLANNED Update Quantity in mtl_supply

2865: -- : REMOVE PLANNED is not used anywhere; removed
2866: --
2867: -- UPDATE PLANNED Update Quantity in mtl_supply
2868: --
2869: -- ADD PLANNED Update Quantity in mtl_supply
2870: --
2871:
2872: /* ----------------------------------------------------------------------- */
2873:

Line 2908: UPDATE mtl_supply ms

2904:
2905: -- : Use logic from Pro*C
2906: /*Bug 4537860:Hit the _all tables instead of the striped views.*/
2907:
2908: UPDATE mtl_supply ms
2909: SET ms.quantity =
2910: (
2911: SELECT ms.quantity +
2912: NVL( sum(nvl(pd.quantity_cancelled,0)),0)

Line 2951: UPDATE mtl_supply mts

2947:
2948: d_progress := 40;
2949:
2950: FORALL i IN 1..l_ppo_dist_id_tbl.COUNT
2951: UPDATE mtl_supply mts
2952: SET mts.quantity = l_ppo_dist_qty_tbl(i) -
2953: (
2954: SELECT NVL(sum(pod.quantity_ordered -
2955: NVL(pod.quantity_cancelled, 0)), 0)