DBA Data[Home] [Help]

APPS.WMS_REPLENISHMENT_PVT dependencies on WMS_REPL_DEMAND_GTMP

Line 593: FROM wms_repl_demand_gtmp

589: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
590:
591: CURSOR c_demand_for_items IS
592: SELECT demand_line_detail_id
593: FROM wms_repl_demand_gtmp
594: WHERE inventory_item_id = p_item_id
595: AND ORGANIZATION_ID = p_org_id
596: AND repl_level = 1
597: AND demand_type_id <> 4;

Line 671: DELETE FROM wms_repl_demand_gtmp

667: END IF; -- for IF p_repl_type = g_dynamic_repl AND p_demand_type_id <> 4
668:
669:
670: -- remove all entries for that item from gtmp
671: DELETE FROM wms_repl_demand_gtmp
672: WHERE inventory_item_id = p_item_id
673: AND ORGANIZATION_ID = p_org_id;
674:
675: x_return_status := l_return_status ;

Line 823: FROM wms_repl_demand_gtmp

819: Expected_ship_date,
820: Repl_To_Subinventory_code,
821: repl_status,
822: RELEASED_STATUS
823: FROM wms_repl_demand_gtmp
824: WHERE inventory_item_id = l_item_id
825: AND organization_id = l_org_id
826: AND repl_level = P_REPL_LEVEL
827: ORDER BY repl_sequence_id;

Line 978: from WMS_REPL_DEMAND_GTMP

974: INTO l_rsvd_demand_qty
975: FROM mtl_reservations mr ,
976: (select distinct organization_id, inventory_item_id,
977: demand_line_id, demand_header_id
978: from WMS_REPL_DEMAND_GTMP
979: where inventory_item_id = l_item_id
980: and organization_id = l_org_id
981: and demand_type_id <> 4
982: and repl_level = nvl(p_repl_level,1)) wrdg_v

Line 991: from WMS_REPL_DEMAND_GTMP WRDG

987:
988:
989: -- Get Q2
990: SELECT Nvl(sum(wrdg.QUANTITY),0) INTO l_gtmp_demand_qty
991: from WMS_REPL_DEMAND_GTMP WRDG
992: WHERE Wrdg.INVENTORY_ITEM_ID = l_item_id
993: and wrdg.ORGANIZATION_ID = L_ORG_ID
994: and wrdg.demand_type_id <> 4
995: and wrdg.repl_level = nvl(p_repl_level, 1);

Line 1006: FROM wms_repl_demand_gtmp wrdg

1002: AND((wdd.released_status NOT IN ('R','N','B','X','C') AND wdd.replenishment_status IS NULL)
1003: OR (wdd.released_status = 'B' AND wdd.replenishment_status IS NOT NULL))
1004: AND NOT EXISTS
1005: (SELECT 1
1006: FROM wms_repl_demand_gtmp wrdg
1007: WHERE wrdg.organization_id = wdd.organization_id
1008: AND wrdg.inventory_item_id = wdd.inventory_item_id
1009: AND wrdg.demand_line_detail_id = wdd.delivery_detail_id
1010: AND wrdg.demand_header_id = inv_salesorder.get_salesorder_for_oeheader(wdd.source_header_id)

Line 1015: SELECT DISTINCT demand_header_id FROM wms_repl_demand_gtmp wrdg1

1011: AND wrdg.demand_line_id = wdd.source_line_id
1012: )
1013: AND inv_salesorder.get_salesorder_for_oeheader(wdd.source_header_id) IN
1014: (
1015: SELECT DISTINCT demand_header_id FROM wms_repl_demand_gtmp wrdg1
1016: WHERE WRDG1.organization_id = l_org_id
1017: AND WRDG1.inventory_item_id = l_item_id
1018: );
1019:

Line 1211: UPDATE wms_repl_demand_gtmp

1207: inv_cache.item_rec.primary_uom_code,
1208: x_consol_item_repl_tbl(i).repl_uom_code )), g_conversion_precision);
1209:
1210: -- update the qty in the existing GTMP record
1211: UPDATE wms_repl_demand_gtmp
1212: SET QUANTITY = l_atr,
1213: QUANTITY_IN_REPL_UOM = l_new_qty_in_repl_uom
1214: WHERE demand_line_detail_id = l_demand_line_detail_id;
1215:

Line 1274: DELETE FROM wms_repl_demand_gtmp

1270: print_debug( 'Removing the demand from repl consideration :'||l_demand_line_detail_id);
1271: END IF;
1272: -- delete this demand line from the GTMP
1273: -- subtract the qty from the consol record
1274: DELETE FROM wms_repl_demand_gtmp
1275: WHERE demand_line_detail_id = l_demand_line_detail_id;
1276:
1277: -- we have not updated the qty l_prim_repl_qty yet
1278: -- so no need to update the consol qty for this item

Line 1301: DELETE FROM wms_repl_demand_gtmp

1297: print_debug( 'PUSH - NUMBER OF lines to be deleted :'||l_push_bkord_dd_id_tab.count);
1298: END IF;
1299:
1300: FORALL k IN 1 .. l_push_bkord_dd_id_tab.COUNT
1301: DELETE FROM wms_repl_demand_gtmp
1302: WHERE demand_line_detail_id = l_push_bkord_dd_id_tab(k)
1303: AND inventory_item_id = l_item_id
1304: AND organization_id = L_ORG_ID
1305: AND Nvl(repl_level,1) = p_repl_level;

Line 1327: DELETE FROM wms_repl_demand_gtmp

1323: END IF;
1324:
1325:
1326: FORALL k IN 1 .. l_dyn_bkord_dd_id_tab.COUNT
1327: DELETE FROM wms_repl_demand_gtmp
1328: WHERE demand_line_detail_id = l_dyn_bkord_dd_id_tab(k)
1329: AND inventory_item_id = l_item_id
1330: AND organization_id = L_ORG_ID
1331: AND Nvl(repl_level,1) = p_repl_level;

Line 1610: -- To populate the demand table - WMS_REPL_DEMAND_GTMP - Get values in l_consol_item_repl_tbl

1606: -- ==========TEST CODE ends ===========
1607:
1608:
1609:
1610: -- To populate the demand table - WMS_REPL_DEMAND_GTMP - Get values in l_consol_item_repl_tbl
1611: -- Cache information about relevant items
1612: -- Call the Extensibility API to see if there is a custom logic to get the consolidate demand lines per Item.
1613: --This API will appropriately populate l_consol_item_repl_tbl .
1614:

Line 1772: -- To populate the demand table - WMS_REPL_DEMAND_GTMP - Get values in l_consol_item_repl_tbl

1768: END IF;
1769: RAISE fnd_api.g_exc_unexpected_error;
1770: END IF;
1771:
1772: -- To populate the demand table - WMS_REPL_DEMAND_GTMP - Get values in l_consol_item_repl_tbl
1773: -- Cache information about relevant items
1774: -- Call the core replenishment processing API - PROCESS_REPLENISHMENT()
1775:
1776:

Line 2250: FROM WMS_REPL_DEMAND_GTMP

2246: FROM (SELECT inventory_item_id,
2247: sum(quantity_in_repl_uom) as total_demand_qty,
2248: MIN(expected_ship_date) as date_required,
2249: MIN(repl_sequence_id) AS order_priority -- to avoid conflicting situation
2250: FROM WMS_REPL_DEMAND_GTMP
2251: where organization_id = p_organization_id
2252: group by inventory_item_id
2253: order by decode(p_Sort_Criteria,
2254: 1,

Line 2362: insert into WMS_REPL_DEMAND_GTMP

2358:
2359: --BULK insert all demand records in the GTMP table
2360: BEGIN
2361: FORALL k IN INDICES OF l_delivery_detail_id_tb
2362: insert into WMS_REPL_DEMAND_GTMP
2363: (Repl_Sequence_id,
2364: repl_level,
2365: Inventory_item_id,
2366: Organization_id,

Line 2382: (WMS_REPL_DEMAND_GTMP_S.NEXTVAL,

2378: repl_status,
2379: repl_type,
2380: RELEASED_STATUS)
2381: values
2382: (WMS_REPL_DEMAND_GTMP_S.NEXTVAL,
2383: p_repl_level,
2384: l_item_id_tb(k),
2385: p_organization_id,
2386: l_header_id_tb(k),

Line 2414: DELETE FROM WMS_REPL_DEMAND_GTMP

2410: -- AS extra CHECK ON p_scheduled_ship_date_from value condition
2411: */
2412:
2413: IF p_scheduled_ship_date_from IS NOT NULL THEN
2414: DELETE FROM WMS_REPL_DEMAND_GTMP
2415: WHERE expected_ship_date < (SYSDATE - p_scheduled_ship_date_from);
2416: END IF;
2417:
2418:

Line 2424: DELETE FROM WMS_REPL_DEMAND_GTMP

2420: -- Delete records in the GTMP table for which total demand qty for an
2421: -- item is below the p_Min_repl_qty_threshold (Minimum threshold for Replenishment);
2422:
2423: IF p_Min_repl_qty_threshold is NOT NULL THEN
2424: DELETE FROM WMS_REPL_DEMAND_GTMP
2425: WHERE (inventory_item_id)
2426: IN (SELECT inventory_item_id
2427: from WMS_REPL_DEMAND_GTMP
2428: where organization_id = p_organization_id

Line 2427: from WMS_REPL_DEMAND_GTMP

2423: IF p_Min_repl_qty_threshold is NOT NULL THEN
2424: DELETE FROM WMS_REPL_DEMAND_GTMP
2425: WHERE (inventory_item_id)
2426: IN (SELECT inventory_item_id
2427: from WMS_REPL_DEMAND_GTMP
2428: where organization_id = p_organization_id
2429: group by inventory_item_id
2430: having sum(quantity_in_repl_uom) < p_Min_repl_qty_threshold);
2431:

Line 2438: DELETE FROM WMS_REPL_DEMAND_GTMP

2434:
2435: -- Delete records in the GTMP table for which number of order lines are below p_Min_Order_lines_threshold
2436: -- (Minimum Order lines threshold)
2437: IF p_Min_Order_lines_threshold IS NOT NULL THEN
2438: DELETE FROM WMS_REPL_DEMAND_GTMP
2439: where(inventory_item_id) in
2440: (SELECT inventory_item_id from WMS_REPL_DEMAND_GTMP
2441: where organization_id = p_organization_id group by inventory_item_id
2442: having count(1) < Nvl(p_min_order_lines_threshold,1));

Line 2440: (SELECT inventory_item_id from WMS_REPL_DEMAND_GTMP

2436: -- (Minimum Order lines threshold)
2437: IF p_Min_Order_lines_threshold IS NOT NULL THEN
2438: DELETE FROM WMS_REPL_DEMAND_GTMP
2439: where(inventory_item_id) in
2440: (SELECT inventory_item_id from WMS_REPL_DEMAND_GTMP
2441: where organization_id = p_organization_id group by inventory_item_id
2442: having count(1) < Nvl(p_min_order_lines_threshold,1));
2443:
2444: END IF;

Line 2448: print_debug('Error inserting wms_repl_demand_gtmp table');

2444: END IF;
2445: EXCEPTION
2446: WHEN OTHERS THEN
2447: IF (l_debug = 1) THEN
2448: print_debug('Error inserting wms_repl_demand_gtmp table');
2449: END IF;
2450: -- caller rollsback everything if error
2451: x_return_status := fnd_api.g_ret_sts_error;
2452: RETURN;

Line 2537: INSERT INTO WMS_REPL_DEMAND_GTMP

2533:
2534: --1 BULK Insert again all item records in the PL/SQL table with
2535: BEGIN
2536: FORALL k IN 1 .. l_item_id_tb.COUNT
2537: INSERT INTO WMS_REPL_DEMAND_GTMP
2538: (Repl_Sequence_id,
2539: repl_level,
2540: Inventory_item_id,
2541: Organization_id,

Line 2557: (WMS_REPL_DEMAND_GTMP_S.NEXTVAL,

2553: repl_status,
2554: repl_type,
2555: RELEASED_STATUS)
2556: VALUES
2557: (WMS_REPL_DEMAND_GTMP_S.NEXTVAL,
2558: p_repl_level,
2559: l_item_id_tb(k),
2560: p_organization_id, --for push repl, it is same though
2561: -9999,

Line 2579: DELETE FROM wms_repl_demand_gtmp

2575:
2576:
2577: --2 Delete those item records in the GTMP table whose item_ids are not same as item_id
2578: --records that correspond to Filter_item_flag columns = 'Y' records
2579: DELETE FROM wms_repl_demand_gtmp
2580: WHERE filter_item_flag IS NULL
2581: AND inventory_item_id NOT IN (SELECT inventory_item_id FROM
2582: wms_repl_demand_gtmp WHERE
2583: Nvl(filter_item_flag,'N') = 'Y');

Line 2582: wms_repl_demand_gtmp WHERE

2578: --records that correspond to Filter_item_flag columns = 'Y' records
2579: DELETE FROM wms_repl_demand_gtmp
2580: WHERE filter_item_flag IS NULL
2581: AND inventory_item_id NOT IN (SELECT inventory_item_id FROM
2582: wms_repl_demand_gtmp WHERE
2583: Nvl(filter_item_flag,'N') = 'Y');
2584:
2585:
2586: --3 Remove all records in the table that correspond to Filter_item_flag columns = 'Y'

Line 2587: DELETE FROM wms_repl_demand_gtmp

2583: Nvl(filter_item_flag,'N') = 'Y');
2584:
2585:
2586: --3 Remove all records in the table that correspond to Filter_item_flag columns = 'Y'
2587: DELETE FROM wms_repl_demand_gtmp
2588: WHERE filter_item_flag = 'Y';
2589:
2590: EXCEPTION
2591: WHEN OTHERS THEN

Line 2630: SELECT COUNT(1) INTO l_temp_cnt FROM wms_repl_demand_gtmp;

2626:
2627: --=====================TEST CODE STARTS =======
2628: -- ONLY for debugging purpose
2629: IF l_debug = 1 THEN
2630: SELECT COUNT(1) INTO l_temp_cnt FROM wms_repl_demand_gtmp;
2631: print_debug(' FINAL record count in gtmp :'||l_temp_cnt);
2632: print_debug(' number of records in consol table :'||x_consol_item_repl_tbl.COUNT());
2633: END IF;
2634: --=====================TEST CODE ENDS =======

Line 2878: FROM wms_repl_demand_gtmp

2874: l_msg_data VARCHAR2(1000);
2875:
2876: CURSOR c_distinct_org_id IS
2877: SELECT DISTINCT organization_id
2878: FROM wms_repl_demand_gtmp
2879: WHERE repl_level = p_repl_level;
2880:
2881: CURSOR c_item_repl_cur(v_org_id NUMBER) IS
2882: SELECT inventory_item_id,

Line 2886: FROM wms_repl_demand_gtmp

2882: SELECT inventory_item_id,
2883: sum(quantity_in_repl_uom) as total_demand_qty,
2884: repl_to_subinventory_code,
2885: repl_uom_code
2886: FROM wms_repl_demand_gtmp
2887: WHERE organization_id = v_org_id
2888: AND repl_level = p_repl_level
2889: GROUP BY inventory_item_id, repl_to_subinventory_code,repl_uom_code
2890: ORDER BY inventory_item_id, repl_to_subinventory_code;

Line 2907: DELETE FROM wms_repl_demand_gtmp WHERE repl_level = p_repl_level;

2903: CLOSE c_distinct_org_id;
2904: EXCEPTION
2905: WHEN OTHERS THEN
2906: x_return_status := fnd_api.g_ret_sts_error;
2907: DELETE FROM wms_repl_demand_gtmp WHERE repl_level = p_repl_level;
2908: IF (l_debug = 1) THEN
2909: print_debug('Exception getting orgs:'||p_repl_level);
2910: END IF;
2911: RETURN;

Line 2966: DELETE FROM wms_repl_demand_gtmp

2962: IF (l_debug = 1) THEN
2963: print_debug('Error performing replenishment for Multi-step');
2964: END IF;
2965: ROLLBACK TO new_org_sp;
2966: DELETE FROM wms_repl_demand_gtmp
2967: WHERE repl_level = p_repl_level
2968: AND organization_id = l_org_id_tb(j);
2969: GOTO next_org;
2970: END IF;

Line 2984: DELETE FROM wms_repl_demand_gtmp

2980: IF (l_debug = 1) THEN
2981: print_debug('Exception retrieving item repl records for Multi-step');
2982: END IF;
2983: ROLLBACK TO new_org_sp;
2984: DELETE FROM wms_repl_demand_gtmp
2985: WHERE repl_level = p_repl_level
2986: AND organization_id = l_org_id_tb(j);
2987: GOTO next_org;
2988: END;

Line 3030: -- At this point WMS_REPL_DEMAND_GTMP table should have all the correct demand records and

3026:
3027: BEGIN
3028: x_return_status := l_return_status;
3029:
3030: -- At this point WMS_REPL_DEMAND_GTMP table should have all the correct demand records and
3031: --l_consol_item_repl_tbl should have all the consolidated quantities grouped by for Item_Id and Repl_To_Subinventory_Code.
3032: -- Now for each entry in the p_consol_item_repl_tbl, get available onhand qty and update records in the p_consol_item_repl_tbl.
3033:
3034: -- it does not make sense to net off onhand/open MOs for

Line 3078: SELECT COUNT(1) INTO l_temp_cnt FROM wms_repl_demand_gtmp;

3074: END IF;
3075: END IF;
3076: END LOOP;
3077:
3078: SELECT COUNT(1) INTO l_temp_cnt FROM wms_repl_demand_gtmp;
3079: IF (l_debug = 1) THEN
3080: print_debug(' NUMBER OF RECORDS IN wms_repl_demand_gtmp l_temp_cnt :'||l_temp_cnt);
3081: END IF;
3082: END IF;

Line 3080: print_debug(' NUMBER OF RECORDS IN wms_repl_demand_gtmp l_temp_cnt :'||l_temp_cnt);

3076: END LOOP;
3077:
3078: SELECT COUNT(1) INTO l_temp_cnt FROM wms_repl_demand_gtmp;
3079: IF (l_debug = 1) THEN
3080: print_debug(' NUMBER OF RECORDS IN wms_repl_demand_gtmp l_temp_cnt :'||l_temp_cnt);
3081: END IF;
3082: END IF;
3083: END IF;
3084:

Line 3168: -- Delete from WMS_REPL_DEMAND_GTMP for current level of replenishment. There might be records remaining in this table for the mext level of replenishment.

3164: END IF;
3165:
3166:
3167: --TODO : Satish
3168: -- Delete from WMS_REPL_DEMAND_GTMP for current level of replenishment. There might be records remaining in this table for the mext level of replenishment.
3169: -- Trigger next level of replenishment IF
3170: -- Replenishment level < 4 (Ea < CS < PLT < SupPLT)
3171: -- And there are records in the GTMP for the next level. It should have been already inserted by now
3172:

Line 3174: DELETE FROM wms_repl_demand_gtmp WHERE repl_level=Nvl(p_repl_level,1);

3170: -- Replenishment level < 4 (Ea < CS < PLT < SupPLT)
3171: -- And there are records in the GTMP for the next level. It should have been already inserted by now
3172:
3173:
3174: DELETE FROM wms_repl_demand_gtmp WHERE repl_level=Nvl(p_repl_level,1);
3175:
3176:
3177: x_return_status := 'S';
3178:

Line 3202: DELETE FROM wms_repl_demand_gtmp WHERE repl_level = (Nvl(p_repl_level,1)+1);

3198: WHEN OTHERS THEN
3199: l_return_status := 'E';
3200: END;
3201: IF l_return_status <> 'S' THEN
3202: DELETE FROM wms_repl_demand_gtmp WHERE repl_level = (Nvl(p_repl_level,1)+1);
3203: END IF;
3204:
3205: END IF;
3206:

Line 3363: FROM WMS_REPL_DEMAND_GTMP

3359: quantity_in_repl_uom,
3360: repl_uom_code,
3361: Nvl(repl_level,1),
3362: repl_type
3363: FROM WMS_REPL_DEMAND_GTMP
3364: WHERE ORGANIZATION_ID = p_org_id
3365: AND inventory_item_id = p_item_id
3366: AND REPL_TO_SUBINVENTORY_CODE = P_FP_SUB
3367: order by Repl_Sequence_id;

Line 4116: FROM WMS_REPL_DEMAND_GTMP

4112: Sysdate,
4113: fnd_global.user_id,
4114: fnd_global.user_id,
4115: fnd_global.user_id
4116: FROM WMS_REPL_DEMAND_GTMP
4117: WHERE ORGANIZATION_ID = p_consol_item_repl_tbl(i).ORGANIZATION_ID
4118: AND inventory_item_id = p_consol_item_repl_tbl(i).item_id
4119: AND REPL_TO_SUBINVENTORY_CODE = p_consol_item_repl_tbl(i).repl_to_subinventory_code;
4120:

Line 4417: INSERT INTO WMS_REPL_DEMAND_GTMP

4413: -- TODO: Blocking Multi-Level Code changes
4414: -- Multi step change
4415: -- Bulk upload all eligible demand lines
4416: FORALL k IN INDICES OF l_demand_line_id_tb
4417: INSERT INTO WMS_REPL_DEMAND_GTMP
4418: (Repl_Sequence_id,
4419: repl_level,
4420: Inventory_item_id,
4421: Organization_id,

Line 4435: (WMS_REPL_DEMAND_GTMP_S.NEXTVAL,

4431: Repl_To_Subinventory_code,
4432: filter_item_flag,
4433: repl_type)
4434: VALUES
4435: (WMS_REPL_DEMAND_GTMP_S.NEXTVAL,
4436: Nvl(p_repl_level,1) + 1,
4437: l_item_id_tb(k),
4438: l_org_id_tb(k),
4439: l_demand_header_id_tb(k),

Line 4548: FROM WMS_REPL_DEMAND_GTMP

4544: expected_ship_date,
4545: Nvl(quantity_in_repl_uom,0),
4546: repl_level,
4547: repl_type
4548: FROM WMS_REPL_DEMAND_GTMP
4549: WHERE ORGANIZATION_ID = P_ORG_ID
4550: AND inventory_item_id = p_item_id
4551: AND repl_to_subinventory_code = p_fp_sub
4552: order by Repl_Sequence_id;

Line 4883: -- Remove this DEMAND from the WMS_REPL_DEMAND_GTMP table

4879:
4880: IF (l_debug = 1) THEN
4881: print_debug('Remove the Demand_detail_id from the GTMP: '||l_demand_line_detail_id);
4882: END IF;
4883: -- Remove this DEMAND from the WMS_REPL_DEMAND_GTMP table
4884: -- IRRESPECTIVE OF p_create_reservation value. This demand is already consumed
4885: -- This set can be different than set inserted in the WRD table
4886: -- Store here to BULK DELETE later
4887: l_detail_id_delete_tab(l_del_index) := l_demand_line_detail_id;

Line 5011: -- BULK Remove all consumed demands from WMS_REPL_DEMAND_GTMP table

5007:
5008: IF (l_debug = 1) THEN
5009: print_debug('BULK REMOVE ALL CONSUMED DEMANDS FROM GTMP table' );
5010: END IF;
5011: -- BULK Remove all consumed demands from WMS_REPL_DEMAND_GTMP table
5012: FORALL k in 1 .. l_detail_id_delete_tab.COUNT()
5013: DELETE From WMS_REPL_DEMAND_GTMP
5014: WHERE demand_line_detail_id = l_detail_id_delete_tab(k);
5015:

Line 5013: DELETE From WMS_REPL_DEMAND_GTMP

5009: print_debug('BULK REMOVE ALL CONSUMED DEMANDS FROM GTMP table' );
5010: END IF;
5011: -- BULK Remove all consumed demands from WMS_REPL_DEMAND_GTMP table
5012: FORALL k in 1 .. l_detail_id_delete_tab.COUNT()
5013: DELETE From WMS_REPL_DEMAND_GTMP
5014: WHERE demand_line_detail_id = l_detail_id_delete_tab(k);
5015:
5016: -- CLEAR all entries in the tables
5017: l_detail_id_delete_tab.DELETE;

Line 5105: FROM WMS_REPL_DEMAND_GTMP

5101: SELECT repl_sequence_id, demand_header_id, demand_line_id,
5102: demand_line_detail_id,
5103: demand_type_id, quantity, uom_code, expected_ship_date,
5104: quantity_in_repl_uom, repl_status
5105: FROM WMS_REPL_DEMAND_GTMP
5106: WHERE ORGANIZATION_ID = P_ORG_ID
5107: AND inventory_item_id = p_item_id
5108: AND repl_to_subinventory_code = p_fp_sub
5109: order by Repl_Sequence_id;

Line 5385: -- Remove the entry from the WMS_REPL_DEMAND_GTMP table

5381: GOTO next_dmd_record;
5382: END IF;
5383:
5384:
5385: -- Remove the entry from the WMS_REPL_DEMAND_GTMP table
5386: IF (l_debug = 1) THEN
5387: print_debug('Remove Entry from WRDG table');
5388: END IF;
5389: DELETE FROM wms_repl_demand_gtmp

Line 5389: DELETE FROM wms_repl_demand_gtmp

5385: -- Remove the entry from the WMS_REPL_DEMAND_GTMP table
5386: IF (l_debug = 1) THEN
5387: print_debug('Remove Entry from WRDG table');
5388: END IF;
5389: DELETE FROM wms_repl_demand_gtmp
5390: WHERE Organization_id = x_consol_item_repl_tbl(i).organization_id
5391: AND INVENTORY_ITEM_ID = x_consol_item_repl_tbl(i).item_id
5392: AND demand_type_id = l_demand_type_id
5393: AND DEMAND_LINE_DETAIL_ID = l_demand_line_detail_id

Line 5451: -- Remove the entry from the WMS_REPL_DEMAND_GTMP table

5447:
5448: IF (l_debug = 1) THEN
5449: print_debug('Remove the entry from the WRDG table');
5450: END IF;
5451: -- Remove the entry from the WMS_REPL_DEMAND_GTMP table
5452: DELETE FROM wms_repl_demand_gtmp
5453: WHERE Organization_id = x_consol_item_repl_tbl(i).organization_id
5454: AND INVENTORY_ITEM_ID = x_consol_item_repl_tbl(i).item_id
5455: AND demand_type_id = l_demand_type_id

Line 5452: DELETE FROM wms_repl_demand_gtmp

5448: IF (l_debug = 1) THEN
5449: print_debug('Remove the entry from the WRDG table');
5450: END IF;
5451: -- Remove the entry from the WMS_REPL_DEMAND_GTMP table
5452: DELETE FROM wms_repl_demand_gtmp
5453: WHERE Organization_id = x_consol_item_repl_tbl(i).organization_id
5454: AND INVENTORY_ITEM_ID = x_consol_item_repl_tbl(i).item_id
5455: AND demand_type_id = l_demand_type_id
5456: AND DEMAND_LINE_DETAIL_ID = l_demand_line_detail_id

Line 5587: -- Remove the demand entry from the WMS_REPL_DEMAND_GTMP table

5583:
5584: IF (l_debug = 1) THEN
5585: print_debug('Remove entry from GTMP table');
5586: END IF;
5587: -- Remove the demand entry from the WMS_REPL_DEMAND_GTMP table
5588: DELETE FROM wms_repl_demand_gtmp
5589: WHERE Organization_id = x_consol_item_repl_tbl(i).organization_id
5590: AND INVENTORY_ITEM_ID = x_consol_item_repl_tbl(i).item_id
5591: AND demand_type_id = l_demand_type_id

Line 5588: DELETE FROM wms_repl_demand_gtmp

5584: IF (l_debug = 1) THEN
5585: print_debug('Remove entry from GTMP table');
5586: END IF;
5587: -- Remove the demand entry from the WMS_REPL_DEMAND_GTMP table
5588: DELETE FROM wms_repl_demand_gtmp
5589: WHERE Organization_id = x_consol_item_repl_tbl(i).organization_id
5590: AND INVENTORY_ITEM_ID = x_consol_item_repl_tbl(i).item_id
5591: AND demand_type_id = l_demand_type_id
5592: AND DEMAND_LINE_DETAIL_ID = l_demand_line_detail_id

Line 5721: DELETE FROM wms_repl_demand_gtmp

5717:
5718: END IF;
5719:
5720:
5721: DELETE FROM wms_repl_demand_gtmp
5722: WHERE Organization_id = x_consol_item_repl_tbl(i).organization_id
5723: AND INVENTORY_ITEM_ID = x_consol_item_repl_tbl(i).item_id
5724: AND demand_type_id = l_demand_type_id
5725: AND DEMAND_LINE_DETAIL_ID = l_demand_line_detail_id

Line 6653: FROM wms_repl_demand_gtmp

6649: sum(quantity_in_repl_uom) as total_demand_qty,
6650: MIN(expected_ship_date) as date_required,
6651: repl_to_subinventory_code,
6652: repl_uom_code
6653: FROM wms_repl_demand_gtmp
6654: WHERE organization_id = p_org_id
6655: GROUP BY inventory_item_id, repl_to_subinventory_code,repl_uom_code
6656: ORDER BY inventory_item_id, repl_to_subinventory_code;
6657:

Line 6736: -- WMS_REPL_DEMAND_GTMP table

6732: END IF;
6733:
6734:
6735: -- 1- Go through all the demand lines that are marked as Replenishement requested and insert them in the
6736: -- WMS_REPL_DEMAND_GTMP table
6737:
6738: -- USE BULK INSERT FROM CURSOR TO THE TABLE AND THEN UPDATE THE TABLE FOR
6739: -- l_repl_to_sub_code, l_repl_uom_code and l_quantity in repl_uom
6740:

Line 6929: INSERT INTO WMS_REPL_DEMAND_GTMP

6925: -- Bulk upload all eligible demand lines
6926: -- since some recprds from the l_delivery_detail_id_tb has been deleted,
6927: -- use 'INDICES OF' instead of table count
6928: FORALL k IN INDICES OF l_delivery_detail_id_tb
6929: INSERT INTO WMS_REPL_DEMAND_GTMP
6930: (Repl_Sequence_id,
6931: repl_level,
6932: Inventory_item_id,
6933: Organization_id,

Line 6949: (WMS_REPL_DEMAND_GTMP_S.NEXTVAL,

6945: repl_status,
6946: repl_type,
6947: RELEASED_STATUS)
6948: VALUES
6949: (WMS_REPL_DEMAND_GTMP_S.NEXTVAL,
6950: p_repl_level,
6951: l_item_id_tb(k),
6952: p_org_id,
6953: l_header_id_tb(k),

Line 6977: SELECT COUNT(1) INTO l_temp_cnt FROM wms_repl_demand_gtmp;

6973:
6974: --=====================TEST CODE STARTS =======
6975: -- for debugging purpise only, entire code should be inside l_debug = 1
6976: IF (l_debug = 1) THEN
6977: SELECT COUNT(1) INTO l_temp_cnt FROM wms_repl_demand_gtmp;
6978: print_debug('FINAL record count in gtmp :'||l_temp_cnt);
6979: END IF;
6980: --=====================TEST CODE ENDS =======
6981: