DBA Data[Home] [Help]

APPS.WMS_REPLENISHMENT_PVT dependencies on WMS_REPL_DEMAND_GTMP

Line 590: FROM wms_repl_demand_gtmp

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

Line 666: DELETE FROM wms_repl_demand_gtmp

662: END IF; -- for IF p_repl_type = g_dynamic_repl AND p_demand_type_id <> 4
663:
664:
665: -- remove all entries for that item from gtmp
666: DELETE FROM wms_repl_demand_gtmp
667: WHERE inventory_item_id = p_item_id
668: AND ORGANIZATION_ID = p_org_id;
669:
670: x_return_status := l_return_status ;

Line 817: FROM wms_repl_demand_gtmp

813: Expected_ship_date,
814: Repl_To_Subinventory_code,
815: repl_status,
816: RELEASED_STATUS
817: FROM wms_repl_demand_gtmp
818: WHERE inventory_item_id = l_item_id
819: AND organization_id = l_org_id
820: AND repl_level = P_REPL_LEVEL
821: ORDER BY repl_sequence_id;

Line 961: ,WMS_REPL_DEMAND_GTMP WRDG

957:
958: -- Get Q1
959: SELECT nvl(sum(mr.reservation_QUANTITY),0) INTO l_rsvd_demand_qty
960: from mtl_reservations mr
961: ,WMS_REPL_DEMAND_GTMP WRDG
962: WHERE mr.organization_id = wrdg.organization_id
963: and mr.inventory_item_id = wrdg.inventory_item_id
964: and MR.DEMAND_SOURCE_LINE_ID = wrdg.DEMAND_line_ID
965: and MR.DEMAND_SOURCE_HEADER_ID = wrdg.DEMAND_HEADER_ID

Line 974: from WMS_REPL_DEMAND_GTMP WRDG

970:
971:
972: -- Get Q2
973: SELECT Nvl(sum(wrdg.QUANTITY),0) INTO l_gtmp_demand_qty
974: from WMS_REPL_DEMAND_GTMP WRDG
975: WHERE Wrdg.INVENTORY_ITEM_ID = l_item_id
976: and wrdg.ORGANIZATION_ID = L_ORG_ID
977: and wrdg.demand_type_id <> 4
978: and wrdg.repl_level = nvl(p_repl_level, 1);

Line 989: FROM wms_repl_demand_gtmp wrdg

985: AND((wdd.released_status NOT IN ('R','N','B','X','C') AND wdd.replenishment_status IS NULL)
986: OR (wdd.released_status = 'B' AND wdd.replenishment_status IS NOT NULL))
987: AND NOT EXISTS
988: (SELECT 1
989: FROM wms_repl_demand_gtmp wrdg
990: WHERE wrdg.organization_id = wdd.organization_id
991: AND wrdg.inventory_item_id = wdd.inventory_item_id
992: AND wrdg.demand_line_detail_id = wdd.delivery_detail_id
993: AND wrdg.demand_header_id = inv_salesorder.get_salesorder_for_oeheader(wdd.source_header_id)

Line 998: SELECT DISTINCT demand_header_id FROM wms_repl_demand_gtmp wrdg1

994: AND wrdg.demand_line_id = wdd.source_line_id
995: )
996: AND inv_salesorder.get_salesorder_for_oeheader(wdd.source_header_id) IN
997: (
998: SELECT DISTINCT demand_header_id FROM wms_repl_demand_gtmp wrdg1
999: WHERE WRDG1.organization_id = l_org_id
1000: AND WRDG1.inventory_item_id = l_item_id
1001: );
1002:

Line 1178: UPDATE wms_repl_demand_gtmp

1174: inv_cache.item_rec.primary_uom_code,
1175: x_consol_item_repl_tbl(i).repl_uom_code )), g_conversion_precision);
1176:
1177: -- update the qty in the existing GTMP record
1178: UPDATE wms_repl_demand_gtmp
1179: SET QUANTITY = l_atr,
1180: QUANTITY_IN_REPL_UOM = l_new_qty_in_repl_uom
1181: WHERE demand_line_detail_id = l_demand_line_detail_id;
1182:

Line 1241: DELETE FROM wms_repl_demand_gtmp

1237: print_debug( 'Removing the demand from repl consideration :'||l_demand_line_detail_id);
1238: END IF;
1239: -- delete this demand line from the GTMP
1240: -- subtract the qty from the consol record
1241: DELETE FROM wms_repl_demand_gtmp
1242: WHERE demand_line_detail_id = l_demand_line_detail_id;
1243:
1244: -- we have not updated the qty l_prim_repl_qty yet
1245: -- so no need to update the consol qty for this item

Line 1268: DELETE FROM wms_repl_demand_gtmp

1264: print_debug( 'PUSH - NUMBER OF lines to be deleted :'||l_push_bkord_dd_id_tab.count);
1265: END IF;
1266:
1267: FORALL k IN 1 .. l_push_bkord_dd_id_tab.COUNT
1268: DELETE FROM wms_repl_demand_gtmp
1269: WHERE demand_line_detail_id = l_push_bkord_dd_id_tab(k)
1270: AND inventory_item_id = l_item_id
1271: AND organization_id = L_ORG_ID
1272: AND Nvl(repl_level,1) = p_repl_level;

Line 1278: DELETE FROM wms_repl_demand_gtmp

1274: IF (l_debug = 1) THEN
1275: print_debug( 'DYNAMIC - NUMBER OF lines to be deleted :'||l_dyn_bkord_dd_id_tab.count);
1276: END IF;
1277: FORALL k IN 1 .. l_dyn_bkord_dd_id_tab.COUNT
1278: DELETE FROM wms_repl_demand_gtmp
1279: WHERE demand_line_detail_id = l_dyn_bkord_dd_id_tab(k)
1280: AND inventory_item_id = l_item_id
1281: AND organization_id = L_ORG_ID
1282: AND Nvl(repl_level,1) = p_repl_level;

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

1544: -- ==========TEST CODE ends ===========
1545:
1546:
1547:
1548: -- To populate the demand table - WMS_REPL_DEMAND_GTMP - Get values in l_consol_item_repl_tbl
1549: -- Cache information about relevant items
1550: -- Call the Extensibility API to see if there is a custom logic to get the consolidate demand lines per Item.
1551: --This API will appropriately populate l_consol_item_repl_tbl .
1552:

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

1706: END IF;
1707: RAISE fnd_api.g_exc_unexpected_error;
1708: END IF;
1709:
1710: -- To populate the demand table - WMS_REPL_DEMAND_GTMP - Get values in l_consol_item_repl_tbl
1711: -- Cache information about relevant items
1712: -- Call the core replenishment processing API - PROCESS_REPLENISHMENT()
1713:
1714:

Line 2183: FROM WMS_REPL_DEMAND_GTMP

2179: FROM (SELECT inventory_item_id,
2180: sum(quantity_in_repl_uom) as total_demand_qty,
2181: MIN(expected_ship_date) as date_required,
2182: MIN(repl_sequence_id) AS order_priority -- to avoid conflicting situation
2183: FROM WMS_REPL_DEMAND_GTMP
2184: where organization_id = p_organization_id
2185: group by inventory_item_id
2186: order by decode(p_Sort_Criteria,
2187: 1,

Line 2295: insert into WMS_REPL_DEMAND_GTMP

2291:
2292: --BULK insert all demand records in the GTMP table
2293: BEGIN
2294: FORALL k IN INDICES OF l_delivery_detail_id_tb
2295: insert into WMS_REPL_DEMAND_GTMP
2296: (Repl_Sequence_id,
2297: repl_level,
2298: Inventory_item_id,
2299: Organization_id,

Line 2315: (WMS_REPL_DEMAND_GTMP_S.NEXTVAL,

2311: repl_status,
2312: repl_type,
2313: RELEASED_STATUS)
2314: values
2315: (WMS_REPL_DEMAND_GTMP_S.NEXTVAL,
2316: p_repl_level,
2317: l_item_id_tb(k),
2318: p_organization_id,
2319: l_header_id_tb(k),

Line 2347: DELETE FROM WMS_REPL_DEMAND_GTMP

2343: -- AS extra CHECK ON p_scheduled_ship_date_from value condition
2344: */
2345:
2346: IF p_scheduled_ship_date_from IS NOT NULL THEN
2347: DELETE FROM WMS_REPL_DEMAND_GTMP
2348: WHERE expected_ship_date < (SYSDATE - p_scheduled_ship_date_from);
2349: END IF;
2350:
2351:

Line 2357: DELETE FROM WMS_REPL_DEMAND_GTMP

2353: -- Delete records in the GTMP table for which total demand qty for an
2354: -- item is below the p_Min_repl_qty_threshold (Minimum threshold for Replenishment);
2355:
2356: IF p_Min_repl_qty_threshold is NOT NULL THEN
2357: DELETE FROM WMS_REPL_DEMAND_GTMP
2358: WHERE (inventory_item_id)
2359: IN (SELECT inventory_item_id
2360: from WMS_REPL_DEMAND_GTMP
2361: where organization_id = p_organization_id

Line 2360: from WMS_REPL_DEMAND_GTMP

2356: IF p_Min_repl_qty_threshold is NOT NULL THEN
2357: DELETE FROM WMS_REPL_DEMAND_GTMP
2358: WHERE (inventory_item_id)
2359: IN (SELECT inventory_item_id
2360: from WMS_REPL_DEMAND_GTMP
2361: where organization_id = p_organization_id
2362: group by inventory_item_id
2363: having sum(quantity_in_repl_uom) < p_Min_repl_qty_threshold);
2364:

Line 2371: DELETE FROM WMS_REPL_DEMAND_GTMP

2367:
2368: -- Delete records in the GTMP table for which number of order lines are below p_Min_Order_lines_threshold
2369: -- (Minimum Order lines threshold)
2370: IF p_Min_Order_lines_threshold IS NOT NULL THEN
2371: DELETE FROM WMS_REPL_DEMAND_GTMP
2372: where(inventory_item_id) in
2373: (SELECT inventory_item_id from WMS_REPL_DEMAND_GTMP
2374: where organization_id = p_organization_id group by inventory_item_id
2375: having count(1) < Nvl(p_min_order_lines_threshold,1));

Line 2373: (SELECT inventory_item_id from WMS_REPL_DEMAND_GTMP

2369: -- (Minimum Order lines threshold)
2370: IF p_Min_Order_lines_threshold IS NOT NULL THEN
2371: DELETE FROM WMS_REPL_DEMAND_GTMP
2372: where(inventory_item_id) in
2373: (SELECT inventory_item_id from WMS_REPL_DEMAND_GTMP
2374: where organization_id = p_organization_id group by inventory_item_id
2375: having count(1) < Nvl(p_min_order_lines_threshold,1));
2376:
2377: END IF;

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

2377: END IF;
2378: EXCEPTION
2379: WHEN OTHERS THEN
2380: IF (l_debug = 1) THEN
2381: print_debug('Error inserting wms_repl_demand_gtmp table');
2382: END IF;
2383: -- caller rollsback everything if error
2384: x_return_status := fnd_api.g_ret_sts_error;
2385: RETURN;

Line 2469: INSERT INTO WMS_REPL_DEMAND_GTMP

2465:
2466: --1 BULK Insert again all item records in the PL/SQL table with
2467: BEGIN
2468: FORALL k IN 1 .. l_item_id_tb.COUNT
2469: INSERT INTO WMS_REPL_DEMAND_GTMP
2470: (Repl_Sequence_id,
2471: repl_level,
2472: Inventory_item_id,
2473: Organization_id,

Line 2489: (WMS_REPL_DEMAND_GTMP_S.NEXTVAL,

2485: repl_status,
2486: repl_type,
2487: RELEASED_STATUS)
2488: VALUES
2489: (WMS_REPL_DEMAND_GTMP_S.NEXTVAL,
2490: p_repl_level,
2491: l_item_id_tb(k),
2492: p_organization_id, --for push repl, it is same though
2493: -9999,

Line 2511: DELETE FROM wms_repl_demand_gtmp

2507:
2508:
2509: --2 Delete those item records in the GTMP table whose item_ids are not same as item_id
2510: --records that correspond to Filter_item_flag columns = 'Y' records
2511: DELETE FROM wms_repl_demand_gtmp
2512: WHERE filter_item_flag IS NULL
2513: AND inventory_item_id NOT IN (SELECT inventory_item_id FROM
2514: wms_repl_demand_gtmp WHERE
2515: Nvl(filter_item_flag,'N') = 'Y');

Line 2514: wms_repl_demand_gtmp WHERE

2510: --records that correspond to Filter_item_flag columns = 'Y' records
2511: DELETE FROM wms_repl_demand_gtmp
2512: WHERE filter_item_flag IS NULL
2513: AND inventory_item_id NOT IN (SELECT inventory_item_id FROM
2514: wms_repl_demand_gtmp WHERE
2515: Nvl(filter_item_flag,'N') = 'Y');
2516:
2517:
2518: --3 Remove all records in the table that correspond to Filter_item_flag columns = 'Y'

Line 2519: DELETE FROM wms_repl_demand_gtmp

2515: Nvl(filter_item_flag,'N') = 'Y');
2516:
2517:
2518: --3 Remove all records in the table that correspond to Filter_item_flag columns = 'Y'
2519: DELETE FROM wms_repl_demand_gtmp
2520: WHERE filter_item_flag = 'Y';
2521:
2522: EXCEPTION
2523: WHEN OTHERS THEN

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

2558:
2559: --=====================TEST CODE STARTS =======
2560: -- ONLY for debugging purpose
2561: IF l_debug = 1 THEN
2562: SELECT COUNT(1) INTO l_temp_cnt FROM wms_repl_demand_gtmp;
2563: print_debug(' FINAL record count in gtmp :'||l_temp_cnt);
2564: print_debug(' number of records in consol table :'||x_consol_item_repl_tbl.COUNT());
2565: END IF;
2566: --=====================TEST CODE ENDS =======

Line 2792: FROM wms_repl_demand_gtmp

2788: l_msg_data VARCHAR2(1000);
2789:
2790: CURSOR c_distinct_org_id IS
2791: SELECT DISTINCT organization_id
2792: FROM wms_repl_demand_gtmp
2793: WHERE repl_level = p_repl_level;
2794:
2795: CURSOR c_item_repl_cur(v_org_id NUMBER) IS
2796: SELECT inventory_item_id,

Line 2800: FROM wms_repl_demand_gtmp

2796: SELECT inventory_item_id,
2797: sum(quantity_in_repl_uom) as total_demand_qty,
2798: repl_to_subinventory_code,
2799: repl_uom_code
2800: FROM wms_repl_demand_gtmp
2801: WHERE organization_id = v_org_id
2802: AND repl_level = p_repl_level
2803: GROUP BY inventory_item_id, repl_to_subinventory_code,repl_uom_code
2804: ORDER BY inventory_item_id, repl_to_subinventory_code;

Line 2821: DELETE FROM wms_repl_demand_gtmp WHERE repl_level = p_repl_level;

2817: CLOSE c_distinct_org_id;
2818: EXCEPTION
2819: WHEN OTHERS THEN
2820: x_return_status := fnd_api.g_ret_sts_error;
2821: DELETE FROM wms_repl_demand_gtmp WHERE repl_level = p_repl_level;
2822: IF (l_debug = 1) THEN
2823: print_debug('Exception getting orgs:'||p_repl_level);
2824: END IF;
2825: RETURN;

Line 2878: DELETE FROM wms_repl_demand_gtmp

2874: IF (l_debug = 1) THEN
2875: print_debug('Error performing replenishment for Multi-step');
2876: END IF;
2877: ROLLBACK TO new_org_sp;
2878: DELETE FROM wms_repl_demand_gtmp
2879: WHERE repl_level = p_repl_level
2880: AND organization_id = l_org_id_tb(j);
2881: GOTO next_org;
2882: END IF;

Line 2896: DELETE FROM wms_repl_demand_gtmp

2892: IF (l_debug = 1) THEN
2893: print_debug('Exception retrieving item repl records for Multi-step');
2894: END IF;
2895: ROLLBACK TO new_org_sp;
2896: DELETE FROM wms_repl_demand_gtmp
2897: WHERE repl_level = p_repl_level
2898: AND organization_id = l_org_id_tb(j);
2899: GOTO next_org;
2900: END;

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

2938:
2939: BEGIN
2940: x_return_status := l_return_status;
2941:
2942: -- At this point WMS_REPL_DEMAND_GTMP table should have all the correct demand records and
2943: --l_consol_item_repl_tbl should have all the consolidated quantities grouped by for Item_Id and Repl_To_Subinventory_Code.
2944: -- 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.
2945:
2946: -- it does not make sense to net off onhand/open MOs for

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

2986: END IF;
2987: END IF;
2988: END LOOP;
2989:
2990: SELECT COUNT(1) INTO l_temp_cnt FROM wms_repl_demand_gtmp;
2991: IF (l_debug = 1) THEN
2992: print_debug(' NUMBER OF RECORDS IN wms_repl_demand_gtmp l_temp_cnt :'||l_temp_cnt);
2993: END IF;
2994: END IF;

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

2988: END LOOP;
2989:
2990: SELECT COUNT(1) INTO l_temp_cnt FROM wms_repl_demand_gtmp;
2991: IF (l_debug = 1) THEN
2992: print_debug(' NUMBER OF RECORDS IN wms_repl_demand_gtmp l_temp_cnt :'||l_temp_cnt);
2993: END IF;
2994: END IF;
2995: END IF;
2996:

Line 3080: -- 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.

3076: END IF;
3077:
3078:
3079: --TODO : Satish
3080: -- 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.
3081: -- Trigger next level of replenishment IF
3082: -- Replenishment level < 4 (Ea < CS < PLT < SupPLT)
3083: -- And there are records in the GTMP for the next level. It should have been already inserted by now
3084:

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

3082: -- Replenishment level < 4 (Ea < CS < PLT < SupPLT)
3083: -- And there are records in the GTMP for the next level. It should have been already inserted by now
3084:
3085:
3086: DELETE FROM wms_repl_demand_gtmp WHERE repl_level=Nvl(p_repl_level,1);
3087:
3088:
3089: x_return_status := 'S';
3090:

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

3110: WHEN OTHERS THEN
3111: l_return_status := 'E';
3112: END;
3113: IF l_return_status <> 'S' THEN
3114: DELETE FROM wms_repl_demand_gtmp WHERE repl_level = (Nvl(p_repl_level,1)+1);
3115: END IF;
3116:
3117: END IF;
3118:

Line 3275: FROM WMS_REPL_DEMAND_GTMP

3271: quantity_in_repl_uom,
3272: repl_uom_code,
3273: Nvl(repl_level,1),
3274: repl_type
3275: FROM WMS_REPL_DEMAND_GTMP
3276: WHERE ORGANIZATION_ID = p_org_id
3277: AND inventory_item_id = p_item_id
3278: AND REPL_TO_SUBINVENTORY_CODE = P_FP_SUB
3279: order by Repl_Sequence_id;

Line 3996: FROM WMS_REPL_DEMAND_GTMP

3992: Sysdate,
3993: fnd_global.user_id,
3994: fnd_global.user_id,
3995: fnd_global.user_id
3996: FROM WMS_REPL_DEMAND_GTMP
3997: WHERE ORGANIZATION_ID = p_consol_item_repl_tbl(i).ORGANIZATION_ID
3998: AND inventory_item_id = p_consol_item_repl_tbl(i).item_id
3999: AND REPL_TO_SUBINVENTORY_CODE = p_consol_item_repl_tbl(i).repl_to_subinventory_code;
4000:

Line 4276: INSERT INTO WMS_REPL_DEMAND_GTMP

4272: -- TODO: Blocking Multi-Level Code changes
4273: -- Multi step change
4274: -- Bulk upload all eligible demand lines
4275: FORALL k IN INDICES OF l_demand_line_id_tb
4276: INSERT INTO WMS_REPL_DEMAND_GTMP
4277: (Repl_Sequence_id,
4278: repl_level,
4279: Inventory_item_id,
4280: Organization_id,

Line 4294: (WMS_REPL_DEMAND_GTMP_S.NEXTVAL,

4290: Repl_To_Subinventory_code,
4291: filter_item_flag,
4292: repl_type)
4293: VALUES
4294: (WMS_REPL_DEMAND_GTMP_S.NEXTVAL,
4295: Nvl(p_repl_level,1) + 1,
4296: l_item_id_tb(k),
4297: l_org_id_tb(k),
4298: l_demand_header_id_tb(k),

Line 4406: FROM WMS_REPL_DEMAND_GTMP

4402: expected_ship_date,
4403: Nvl(quantity_in_repl_uom,0),
4404: repl_level,
4405: repl_type
4406: FROM WMS_REPL_DEMAND_GTMP
4407: WHERE ORGANIZATION_ID = P_ORG_ID
4408: AND inventory_item_id = p_item_id
4409: AND repl_to_subinventory_code = p_fp_sub
4410: order by Repl_Sequence_id;

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

4714:
4715: IF (l_debug = 1) THEN
4716: print_debug('Remove the Demand_detail_id from the GTMP: '||l_demand_line_detail_id);
4717: END IF;
4718: -- Remove this DEMAND from the WMS_REPL_DEMAND_GTMP table
4719: -- IRRESPECTIVE OF p_create_reservation value. This demand is already consumed
4720: -- This set can be different than set inserted in the WRD table
4721: -- Store here to BULK DELETE later
4722: l_detail_id_delete_tab(l_del_index) := l_demand_line_detail_id;

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

4841:
4842: IF (l_debug = 1) THEN
4843: print_debug('BULK REMOVE ALL CONSUMED DEMANDS FROM GTMP table' );
4844: END IF;
4845: -- BULK Remove all consumed demands from WMS_REPL_DEMAND_GTMP table
4846: FORALL k in 1 .. l_detail_id_delete_tab.COUNT()
4847: DELETE From WMS_REPL_DEMAND_GTMP
4848: WHERE demand_line_detail_id = l_detail_id_delete_tab(k);
4849:

Line 4847: DELETE From WMS_REPL_DEMAND_GTMP

4843: print_debug('BULK REMOVE ALL CONSUMED DEMANDS FROM GTMP table' );
4844: END IF;
4845: -- BULK Remove all consumed demands from WMS_REPL_DEMAND_GTMP table
4846: FORALL k in 1 .. l_detail_id_delete_tab.COUNT()
4847: DELETE From WMS_REPL_DEMAND_GTMP
4848: WHERE demand_line_detail_id = l_detail_id_delete_tab(k);
4849:
4850: -- CLEAR all entries in the tables
4851: l_detail_id_delete_tab.DELETE;

Line 4939: FROM WMS_REPL_DEMAND_GTMP

4935: SELECT repl_sequence_id, demand_header_id, demand_line_id,
4936: demand_line_detail_id,
4937: demand_type_id, quantity, uom_code, expected_ship_date,
4938: quantity_in_repl_uom, repl_status
4939: FROM WMS_REPL_DEMAND_GTMP
4940: WHERE ORGANIZATION_ID = P_ORG_ID
4941: AND inventory_item_id = p_item_id
4942: AND repl_to_subinventory_code = p_fp_sub
4943: order by Repl_Sequence_id;

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

5212: GOTO next_dmd_record;
5213: END IF;
5214:
5215:
5216: -- Remove the entry from the WMS_REPL_DEMAND_GTMP table
5217: IF (l_debug = 1) THEN
5218: print_debug('Remove Entry from WRDG table');
5219: END IF;
5220: DELETE FROM wms_repl_demand_gtmp

Line 5220: DELETE FROM wms_repl_demand_gtmp

5216: -- Remove the entry from the WMS_REPL_DEMAND_GTMP table
5217: IF (l_debug = 1) THEN
5218: print_debug('Remove Entry from WRDG table');
5219: END IF;
5220: DELETE FROM wms_repl_demand_gtmp
5221: WHERE Organization_id = x_consol_item_repl_tbl(i).organization_id
5222: AND INVENTORY_ITEM_ID = x_consol_item_repl_tbl(i).item_id
5223: AND demand_type_id = l_demand_type_id
5224: AND DEMAND_LINE_DETAIL_ID = l_demand_line_detail_id

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

5278:
5279: IF (l_debug = 1) THEN
5280: print_debug('Remove the entry from the WRDG table');
5281: END IF;
5282: -- Remove the entry from the WMS_REPL_DEMAND_GTMP table
5283: DELETE FROM wms_repl_demand_gtmp
5284: WHERE Organization_id = x_consol_item_repl_tbl(i).organization_id
5285: AND INVENTORY_ITEM_ID = x_consol_item_repl_tbl(i).item_id
5286: AND demand_type_id = l_demand_type_id

Line 5283: DELETE FROM wms_repl_demand_gtmp

5279: IF (l_debug = 1) THEN
5280: print_debug('Remove the entry from the WRDG table');
5281: END IF;
5282: -- Remove the entry from the WMS_REPL_DEMAND_GTMP table
5283: DELETE FROM wms_repl_demand_gtmp
5284: WHERE Organization_id = x_consol_item_repl_tbl(i).organization_id
5285: AND INVENTORY_ITEM_ID = x_consol_item_repl_tbl(i).item_id
5286: AND demand_type_id = l_demand_type_id
5287: AND DEMAND_LINE_DETAIL_ID = l_demand_line_detail_id

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

5414:
5415: IF (l_debug = 1) THEN
5416: print_debug('Remove entry from GTMP table');
5417: END IF;
5418: -- Remove the demand entry from the WMS_REPL_DEMAND_GTMP table
5419: DELETE FROM wms_repl_demand_gtmp
5420: WHERE Organization_id = x_consol_item_repl_tbl(i).organization_id
5421: AND INVENTORY_ITEM_ID = x_consol_item_repl_tbl(i).item_id
5422: AND demand_type_id = l_demand_type_id

Line 5419: DELETE FROM wms_repl_demand_gtmp

5415: IF (l_debug = 1) THEN
5416: print_debug('Remove entry from GTMP table');
5417: END IF;
5418: -- Remove the demand entry from the WMS_REPL_DEMAND_GTMP table
5419: DELETE FROM wms_repl_demand_gtmp
5420: WHERE Organization_id = x_consol_item_repl_tbl(i).organization_id
5421: AND INVENTORY_ITEM_ID = x_consol_item_repl_tbl(i).item_id
5422: AND demand_type_id = l_demand_type_id
5423: AND DEMAND_LINE_DETAIL_ID = l_demand_line_detail_id

Line 5552: DELETE FROM wms_repl_demand_gtmp

5548:
5549: END IF;
5550:
5551:
5552: DELETE FROM wms_repl_demand_gtmp
5553: WHERE Organization_id = x_consol_item_repl_tbl(i).organization_id
5554: AND INVENTORY_ITEM_ID = x_consol_item_repl_tbl(i).item_id
5555: AND demand_type_id = l_demand_type_id
5556: AND DEMAND_LINE_DETAIL_ID = l_demand_line_detail_id

Line 6481: FROM wms_repl_demand_gtmp

6477: sum(quantity_in_repl_uom) as total_demand_qty,
6478: MIN(expected_ship_date) as date_required,
6479: repl_to_subinventory_code,
6480: repl_uom_code
6481: FROM wms_repl_demand_gtmp
6482: WHERE organization_id = p_org_id
6483: GROUP BY inventory_item_id, repl_to_subinventory_code,repl_uom_code
6484: ORDER BY inventory_item_id, repl_to_subinventory_code;
6485:

Line 6564: -- WMS_REPL_DEMAND_GTMP table

6560: END IF;
6561:
6562:
6563: -- 1- Go through all the demand lines that are marked as Replenishement requested and insert them in the
6564: -- WMS_REPL_DEMAND_GTMP table
6565:
6566: -- USE BULK INSERT FROM CURSOR TO THE TABLE AND THEN UPDATE THE TABLE FOR
6567: -- l_repl_to_sub_code, l_repl_uom_code and l_quantity in repl_uom
6568:

Line 6754: INSERT INTO WMS_REPL_DEMAND_GTMP

6750: -- Bulk upload all eligible demand lines
6751: -- since some recprds from the l_delivery_detail_id_tb has been deleted,
6752: -- use 'INDICES OF' instead of table count
6753: FORALL k IN INDICES OF l_delivery_detail_id_tb
6754: INSERT INTO WMS_REPL_DEMAND_GTMP
6755: (Repl_Sequence_id,
6756: repl_level,
6757: Inventory_item_id,
6758: Organization_id,

Line 6774: (WMS_REPL_DEMAND_GTMP_S.NEXTVAL,

6770: repl_status,
6771: repl_type,
6772: RELEASED_STATUS)
6773: VALUES
6774: (WMS_REPL_DEMAND_GTMP_S.NEXTVAL,
6775: p_repl_level,
6776: l_item_id_tb(k),
6777: p_org_id,
6778: l_header_id_tb(k),

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

6798:
6799: --=====================TEST CODE STARTS =======
6800: -- for debugging purpise only, entire code should be inside l_debug = 1
6801: IF (l_debug = 1) THEN
6802: SELECT COUNT(1) INTO l_temp_cnt FROM wms_repl_demand_gtmp;
6803: print_debug('FINAL record count in gtmp :'||l_temp_cnt);
6804: END IF;
6805: --=====================TEST CODE ENDS =======
6806: