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 1158: INSERT INTO mtl_supply(supply_type_code,

1154:
1155: -- Create PO Supply
1156: /*Bug 4537860:Hit the _all tables instead of the striped views.*/
1157:
1158: INSERT INTO mtl_supply(supply_type_code,
1159: supply_source_id,
1160: last_updated_by,
1161: last_update_date,
1162: last_update_login,

Line 1218: FROM mtl_supply ms1

1214: AND pll.quantity IS NOT NULL --
1215: AND not exists
1216: (
1217: SELECT 'Supply Exists'
1218: FROM mtl_supply ms1
1219: WHERE ms1.supply_type_code = 'PO'
1220: AND ms1.supply_source_id = pd.po_distribution_id
1221: );
1222:

Line 1321: DELETE FROM mtl_supply

1317: d_progress := 10;
1318:
1319: IF (p_entity_type = 'PO') THEN
1320:
1321: DELETE FROM mtl_supply
1322: WHERE supply_type_code = 'PO'
1323: AND po_header_id = p_entity_id
1324: AND po_release_id IS NULL; -- : From Pro*C
1325:

Line 1328: DELETE FROM mtl_supply

1324: AND po_release_id IS NULL; -- : From Pro*C
1325:
1326: ELSIF (p_entity_type = 'RELEASE') THEN
1327:
1328: DELETE FROM mtl_supply
1329: WHERE supply_type_code = 'PO'
1330: AND po_release_id = p_entity_id;
1331:
1332: ELSIF (p_entity_type = 'PO LINE') THEN

Line 1334: DELETE FROM mtl_supply

1330: AND po_release_id = p_entity_id;
1331:
1332: ELSIF (p_entity_type = 'PO LINE') THEN
1333:
1334: DELETE FROM mtl_supply
1335: WHERE supply_type_code = 'PO'
1336: AND po_line_id = p_entity_id
1337: AND po_release_id IS NULL; -- : From Pro*C
1338:

Line 1341: DELETE FROM mtl_supply

1337: AND po_release_id IS NULL; -- : From Pro*C
1338:
1339: ELSIF (p_entity_type in ('PO SHIPMENT', 'RELEASE SHIPMENT')) THEN
1340:
1341: DELETE FROM mtl_supply
1342: WHERE supply_type_code = 'PO'
1343: AND po_line_location_id = p_entity_id;
1344:
1345: END IF;

Line 1416: UPDATE mtl_supply

1412: d_progress := 10;
1413:
1414: IF (p_entity_type = 'PO LINE') THEN
1415:
1416: UPDATE mtl_supply
1417: SET quantity = 0
1418: , change_flag = 'Y'
1419: WHERE supply_type_code = 'PO'
1420: AND po_line_id = p_entity_id

Line 1425: UPDATE mtl_supply

1421: AND po_release_id IS NULL; --
1422:
1423: ELSIF (p_entity_type = 'PO SHIPMENT') THEN
1424:
1425: UPDATE mtl_supply
1426: SET quantity = 0
1427: , change_flag = 'Y'
1428: WHERE supply_type_code = 'PO'
1429: AND po_line_location_id = p_entity_id;

Line 1433: UPDATE mtl_supply

1429: AND po_line_location_id = p_entity_id;
1430:
1431: ELSIF (p_entity_type = 'RELEASE SHIPMENT') THEN
1432:
1433: UPDATE mtl_supply
1434: SET quantity = 0
1435: , change_flag = 'Y'
1436: WHERE supply_type_code = 'PO'
1437: AND po_release_id = p_entity_id

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

1572: /* ----------------------------------------------------------------------- */
1573: /* */
1574: /* Cancel Planned Release or Planned Shipment */
1575: /* */
1576: /* Update mtl_supply for Cancel Planned Release or Cancel Planned */
1577: /* Release Shipment Action */
1578: /* */
1579: /* Cancellation of Planned Release and Planned Shipment is based on */
1580: /* Entity Type */

Line 1796: /* Maintain mtl_supply */

1792:
1793:
1794: /* ----------------------------------------------------------------------- */
1795: /* */
1796: /* Maintain mtl_supply */
1797: /* */
1798: /* ----------------------------------------------------------------------- */
1799:
1800: FUNCTION maintain_mtl_supply RETURN BOOLEAN IS

Line 1800: FUNCTION maintain_mtl_supply RETURN BOOLEAN IS

1796: /* Maintain mtl_supply */
1797: /* */
1798: /* ----------------------------------------------------------------------- */
1799:
1800: FUNCTION maintain_mtl_supply RETURN BOOLEAN IS
1801:
1802: l_uom mtl_system_items.primary_unit_of_measure%TYPE;
1803: l_lead_time mtl_system_items.postprocessing_lead_time%TYPE;
1804: l_pri_qty mtl_supply.to_org_primary_quantity%TYPE;

Line 1804: l_pri_qty mtl_supply.to_org_primary_quantity%TYPE;

1800: FUNCTION maintain_mtl_supply RETURN BOOLEAN IS
1801:
1802: l_uom mtl_system_items.primary_unit_of_measure%TYPE;
1803: l_lead_time mtl_system_items.postprocessing_lead_time%TYPE;
1804: l_pri_qty mtl_supply.to_org_primary_quantity%TYPE;
1805:
1806:
1807: -- : Brought in from Pro*C to cursor sup2:
1808: -- 1. index hint

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

1814: */
1815:
1816: CURSOR sup2
1817: IS
1818: SELECT /*+ index(mtl_supply MTL_SUPPLY_N10) */
1819: quantity
1820: , unit_of_measure
1821: , nvl(item_id, -1) item_id
1822: , from_organization_id

Line 1826: FROM mtl_supply

1822: , from_organization_id
1823: , to_organization_id
1824: , receipt_date
1825: , rowid
1826: FROM mtl_supply
1827: WHERE change_flag = 'Y'
1828: ORDER BY DECODE (supply_type_code,
1829: 'REQ', 1,
1830: 'PO', 2,

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

1850: FROM mtl_system_items
1851: WHERE inventory_item_id = item_id
1852: AND organization_id = to_org;
1853:
1854: d_module VARCHAR2(70) := 'po.plsql.PO_SUPPLY.maintain_mtl_supply';
1855: d_progress NUMBER;
1856:
1857: BEGIN
1858:

Line 1872: DELETE FROM mtl_supply

1868: IF (c_sup2.quantity = 0) THEN
1869:
1870: d_progress := 20;
1871:
1872: DELETE FROM mtl_supply
1873: WHERE rowid = c_sup2.rowid;
1874:
1875: d_progress := 25;
1876: IF (PO_LOG.d_stmt) THEN

Line 1929: UPDATE mtl_supply

1925: PO_LOG.stmt(d_module, d_progress, 'l_pri_qty', l_pri_qty);
1926: END IF;
1927:
1928:
1929: UPDATE mtl_supply
1930: SET to_org_primary_quantity = l_pri_qty
1931: , to_org_primary_uom = l_uom
1932: , change_flag = null
1933: , change_type = null

Line 1973: END maintain_mtl_supply;

1969: END IF;
1970:
1971: return(FALSE);
1972:
1973: END maintain_mtl_supply;
1974:
1975:
1976: /* ----------------------------------------------------------------------- */
1977:

Line 2081: UPDATE mtl_supply

2077: IF (p_entity_type = 'REQ HDR') THEN
2078:
2079: d_progress := 20;
2080:
2081: UPDATE mtl_supply
2082: SET quantity = 0
2083: , change_flag = 'Y'
2084: WHERE supply_type_code = 'REQ'
2085: AND req_header_id = p_entity_id;

Line 2091: UPDATE mtl_supply

2087: ELSIF (p_entity_type = 'REQ LINE') THEN
2088:
2089: d_progress := 30;
2090:
2091: UPDATE mtl_supply
2092: SET quantity = 0
2093: , change_flag = 'Y'
2094: WHERE supply_type_code = 'REQ'
2095: AND req_line_id = p_entity_id;

Line 2145: UPDATE mtl_supply ms

2141: d_progress := 10;
2142:
2143: /*Bug 4537860:Hit the _all tables instead of the striped views.*/
2144:
2145: UPDATE mtl_supply ms
2146: SET ms.quantity = 0
2147: , ms.change_flag = 'Y'
2148: WHERE ms.supply_type_code = 'REQ'
2149: AND ms.req_header_id = p_docid

Line 2219: DELETE FROM mtl_supply ms1

2215: -- : From Pro*C
2216:
2217: /*Bug 4537860:Hit the _all tables instead of the striped views.*/
2218:
2219: DELETE FROM mtl_supply ms1
2220: WHERE ms1.supply_source_id IN
2221: (
2222: SELECT pl.requisition_line_id
2223: FROM po_requisition_lines_all pl

Line 2242: INSERT INTO mtl_supply

2238: d_progress := 30;
2239:
2240: /*Bug 4537860:Hit the _all tables instead of the striped views.*/
2241:
2242: INSERT INTO mtl_supply
2243: (supply_type_code,
2244: supply_source_id,
2245: last_updated_by,
2246: last_update_date,

Line 2299: FROM mtl_supply ms

2295: AND prl.matching_basis <> 'AMOUNT'
2296: AND prl.line_location_id is null
2297: AND not exists
2298: (SELECT 'supply exists'
2299: FROM mtl_supply ms
2300: WHERE ms.supply_type_code = 'REQ'
2301: AND ms.supply_source_id = prl.requisition_line_id);
2302:
2303: ELSIF (p_entity_type = 'REQ LINE') THEN

Line 2307: INSERT INTO mtl_supply

2303: ELSIF (p_entity_type = 'REQ LINE') THEN
2304:
2305: d_progress := 40;
2306:
2307: INSERT INTO mtl_supply
2308: (supply_type_code,
2309: supply_source_id,
2310: last_updated_by,
2311: last_update_date,

Line 2365: FROM mtl_supply

2361: AND prl.matching_basis <> 'AMOUNT'
2362: AND NOT EXISTS
2363: (
2364: SELECT 'supply exists'
2365: FROM mtl_supply
2366: WHERE supply_type_code = 'REQ'
2367: AND supply_source_id = prl.requisition_line_id
2368: );
2369: --

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

2402:
2403:
2404: /* ----------------------------------------------------------------------- */
2405:
2406: -- Maintain mtl_supply for Explode or Multisource Action
2407:
2408: /* ----------------------------------------------------------------------- */
2409:
2410: FUNCTION explode(p_lineid IN NUMBER) RETURN BOOLEAN IS

Line 2450: insert into mtl_supply(supply_type_code,

2446: -- Multisource Action
2447:
2448: /*Bug 4537860:Hit the _all tables instead of the striped views.*/
2449:
2450: insert into mtl_supply(supply_type_code,
2451: supply_source_id,
2452: last_updated_by,
2453: last_update_date,
2454: last_update_login,

Line 2510: from mtl_supply

2506: and nvl(prl.cancel_flag, 'N') = 'N'
2507: and prl.line_location_id is null
2508: and not exists
2509: (select 'Supply Exists'
2510: from mtl_supply
2511: where supply_type_code = 'REQ'
2512: and supply_source_id = prl.requisition_line_id);
2513:
2514:

Line 2547: -- Updates Requisition Quantity in mtl_supply

2543: END explode;
2544:
2545: /* ----------------------------------------------------------------------- */
2546:
2547: -- Updates Requisition Quantity in mtl_supply
2548:
2549: /* ----------------------------------------------------------------------- */
2550:
2551:

Line 2571: UPDATE mtl_supply

2567: END IF;
2568:
2569: d_progress := 10;
2570:
2571: UPDATE mtl_supply
2572: SET quantity = p_qty
2573: , change_flag = 'Y'
2574: WHERE supply_type_code = 'REQ'
2575: AND req_line_id = p_lineid;

Line 2603: -- Updates Receipt Date in mtl_supply

2599: END update_req_line_qty;
2600:
2601: /* ----------------------------------------------------------------------- */
2602:
2603: -- Updates Receipt Date in mtl_supply
2604:
2605: /* ----------------------------------------------------------------------- */
2606:
2607: FUNCTION update_req_line_date(

Line 2626: UPDATE mtl_supply

2622: END IF;
2623:
2624: d_progress := 10;
2625:
2626: UPDATE mtl_supply
2627: SET receipt_date = p_receipt_date
2628: , need_by_date = p_receipt_date -- Bug 3443313
2629: , change_flag = 'Y'
2630: WHERE supply_type_code = 'REQ'

Line 2669: -- UPDATE PLANNED Update Quantity in mtl_supply

2665: -- Entity Type Action
2666: -- ----------- ------------------------------------------
2667: -- : REMOVE PLANNED is not used anywhere; removed
2668: --
2669: -- UPDATE PLANNED Update Quantity in mtl_supply
2670: --
2671: -- ADD PLANNED Update Quantity in mtl_supply
2672: --
2673:

Line 2671: -- ADD PLANNED Update Quantity in mtl_supply

2667: -- : REMOVE PLANNED is not used anywhere; removed
2668: --
2669: -- UPDATE PLANNED Update Quantity in mtl_supply
2670: --
2671: -- ADD PLANNED Update Quantity in mtl_supply
2672: --
2673:
2674: /* ----------------------------------------------------------------------- */
2675:

Line 2710: UPDATE mtl_supply ms

2706:
2707: -- : Use logic from Pro*C
2708: /*Bug 4537860:Hit the _all tables instead of the striped views.*/
2709:
2710: UPDATE mtl_supply ms
2711: SET ms.quantity =
2712: (
2713: SELECT ms.quantity +
2714: NVL( sum(nvl(pd.quantity_cancelled,0)),0)

Line 2753: UPDATE mtl_supply mts

2749:
2750: d_progress := 40;
2751:
2752: FORALL i IN 1..l_ppo_dist_id_tbl.COUNT
2753: UPDATE mtl_supply mts
2754: SET mts.quantity = l_ppo_dist_qty_tbl(i) -
2755: (
2756: SELECT NVL(sum(pod.quantity_ordered -
2757: NVL(pod.quantity_cancelled, 0)), 0)