DBA Data[Home] [Help]

APPS.INV_RESERVATION_PVT dependencies on INV_RESERVATION_GLOBAL

Line 28: PROCEDURE print_rsv_rec(p_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type) IS

24: inv_log_util.TRACE(p_message, 'INV_RESERVATION_PVT', p_level);
25: END debug_print;
26:
27: --
28: PROCEDURE print_rsv_rec(p_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type) IS
29: l_debug number;
30: BEGIN
31: -- Bug 2944896 -- Commenting out the parameters which may have
32: -- g_miss_char as the default value. This leads to truncation of the

Line 294: IF (p_to_supply_source_type_id = inv_reservation_global.g_source_type_rcv) THEN

290:
291: ELSE
292: -- if transfer reservation from other supply to receiving, the total qty in rcv
293: -- will increase, so we need to add the qty from orig record to the reservable qty
294: IF (p_to_supply_source_type_id = inv_reservation_global.g_source_type_rcv) THEN
295: l_reservable_qty := nvl(l_qty_available_to_reserve,0) + p_fm_primary_reservation_qty;
296: ELSE
297: l_reservable_qty := nvl(l_qty_available_to_reserve,0);
298: END IF;

Line 432: IF (p_to_demand_source_type_id in (inv_reservation_global.g_source_type_oe,

428: ELSE
429:
430: --for sales order or internal order, the reservable qty is the minimum of
431: --requested qty of the line detail/line and the reservable qty of the sales order line
432: IF (p_to_demand_source_type_id in (inv_reservation_global.g_source_type_oe,
433: inv_reservation_global.g_source_type_internal_ord,
434: inv_reservation_global.g_source_type_rma) AND
435: p_fm_demand_source_type_id = p_to_demand_source_type_id AND
436: p_fm_demand_source_header_id = p_to_demand_source_header_id AND

Line 433: inv_reservation_global.g_source_type_internal_ord,

429:
430: --for sales order or internal order, the reservable qty is the minimum of
431: --requested qty of the line detail/line and the reservable qty of the sales order line
432: IF (p_to_demand_source_type_id in (inv_reservation_global.g_source_type_oe,
433: inv_reservation_global.g_source_type_internal_ord,
434: inv_reservation_global.g_source_type_rma) AND
435: p_fm_demand_source_type_id = p_to_demand_source_type_id AND
436: p_fm_demand_source_header_id = p_to_demand_source_header_id AND
437: nvl(p_fm_demand_source_line_id, -1) = nvl(p_to_demand_source_line_id, -1) AND

Line 434: inv_reservation_global.g_source_type_rma) AND

430: --for sales order or internal order, the reservable qty is the minimum of
431: --requested qty of the line detail/line and the reservable qty of the sales order line
432: IF (p_to_demand_source_type_id in (inv_reservation_global.g_source_type_oe,
433: inv_reservation_global.g_source_type_internal_ord,
434: inv_reservation_global.g_source_type_rma) AND
435: p_fm_demand_source_type_id = p_to_demand_source_type_id AND
436: p_fm_demand_source_header_id = p_to_demand_source_header_id AND
437: nvl(p_fm_demand_source_line_id, -1) = nvl(p_to_demand_source_line_id, -1) AND
438: nvl(p_fm_demand_source_line_detail, -1) <> nvl(p_to_demand_source_line_detail, -1)) THEN

Line 469: IF (p_to_demand_source_type_id in (inv_reservation_global.g_source_type_oe,

465: END IF;
466:
467: END IF;
468:
469: IF (p_to_demand_source_type_id in (inv_reservation_global.g_source_type_oe,
470: inv_reservation_global.g_source_type_internal_ord,
471: inv_reservation_global.g_source_type_rma)) THEN
472:
473: IF NOT (lot_divisible

Line 470: inv_reservation_global.g_source_type_internal_ord,

466:
467: END IF;
468:
469: IF (p_to_demand_source_type_id in (inv_reservation_global.g_source_type_oe,
470: inv_reservation_global.g_source_type_internal_ord,
471: inv_reservation_global.g_source_type_rma)) THEN
472:
473: IF NOT (lot_divisible
474: (p_inventory_item_id => p_to_inventory_item_id,

Line 471: inv_reservation_global.g_source_type_rma)) THEN

467: END IF;
468:
469: IF (p_to_demand_source_type_id in (inv_reservation_global.g_source_type_oe,
470: inv_reservation_global.g_source_type_internal_ord,
471: inv_reservation_global.g_source_type_rma)) THEN
472:
473: IF NOT (lot_divisible
474: (p_inventory_item_id => p_to_inventory_item_id,
475: p_organization_id => p_to_organization_id)) THEN

Line 587: IF p_demand_type_id IN (inv_reservation_global.g_source_type_oe,

583: IF fnd_api.to_boolean(p_init_msg_lst) THEN
584: fnd_msg_pub.initialize;
585: END IF;
586:
587: IF p_demand_type_id IN (inv_reservation_global.g_source_type_oe,
588: inv_reservation_global.g_source_type_internal_ord,
589: inv_reservation_global.g_source_type_rma) then
590:
591: --INVCONV - Retrieve ship tolerance above for lot indivisible scenarios

Line 588: inv_reservation_global.g_source_type_internal_ord,

584: fnd_msg_pub.initialize;
585: END IF;
586:
587: IF p_demand_type_id IN (inv_reservation_global.g_source_type_oe,
588: inv_reservation_global.g_source_type_internal_ord,
589: inv_reservation_global.g_source_type_rma) then
590:
591: --INVCONV - Retrieve ship tolerance above for lot indivisible scenarios
592: BEGIN

Line 589: inv_reservation_global.g_source_type_rma) then

585: END IF;
586:
587: IF p_demand_type_id IN (inv_reservation_global.g_source_type_oe,
588: inv_reservation_global.g_source_type_internal_ord,
589: inv_reservation_global.g_source_type_rma) then
590:
591: --INVCONV - Retrieve ship tolerance above for lot indivisible scenarios
592: BEGIN
593: SELECT inventory_item_id, ordered_quantity, order_quantity_uom, ship_from_org_id,

Line 710: PROCEDURE convert_quantity(x_return_status OUT NOCOPY VARCHAR2, px_rsv_rec IN OUT NOCOPY inv_reservation_global.mtl_reservation_rec_type) IS

706: -- Requirement
707: -- In px_rsv_rec, inventory_item_id must be valid;
708: -- either primary_uom_code, primary_reservation_quantity
709: -- or reservation_uom_code, reservation_quantity must be not null and valid
710: PROCEDURE convert_quantity(x_return_status OUT NOCOPY VARCHAR2, px_rsv_rec IN OUT NOCOPY inv_reservation_global.mtl_reservation_rec_type) IS
711: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
712: --l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
713: l_primary_uom_code VARCHAR2(3);
714: l_tmp_secondary_quantity NUMBER := NULL; -- INVCONV

Line 712: --l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

708: -- either primary_uom_code, primary_reservation_quantity
709: -- or reservation_uom_code, reservation_quantity must be not null and valid
710: PROCEDURE convert_quantity(x_return_status OUT NOCOPY VARCHAR2, px_rsv_rec IN OUT NOCOPY inv_reservation_global.mtl_reservation_rec_type) IS
711: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
712: --l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
713: l_primary_uom_code VARCHAR2(3);
714: l_tmp_secondary_quantity NUMBER := NULL; -- INVCONV
715: l_tmp_quantity NUMBER := NULL;
716: l_tracking_quantity_ind VARCHAR2(30); --INVCONV

Line 891: PROCEDURE convert_missing_to_null(p_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type, x_rsv_rec OUT NOCOPY inv_reservation_global.mtl_reservation_rec_type) IS

887: -- convert missing value in the input record
888: -- to null in the output record. if the value of
889: -- field in the input record is not missing, it
890: -- would be copied to the output record
891: PROCEDURE convert_missing_to_null(p_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type, x_rsv_rec OUT NOCOPY inv_reservation_global.mtl_reservation_rec_type) IS
892: BEGIN
893: IF p_rsv_rec.reservation_id <> fnd_api.g_miss_num THEN
894: x_rsv_rec.reservation_id := p_rsv_rec.reservation_id;
895: ELSE

Line 1313: FUNCTION check_missing(p_rsv_rec IN OUT NOCOPY inv_reservation_global.mtl_reservation_rec_type, x_what_field OUT NOCOPY VARCHAR2)

1309: --
1310: -- Description
1311: -- return true if any attribute in the input record is missing
1312: -- else return false
1313: FUNCTION check_missing(p_rsv_rec IN OUT NOCOPY inv_reservation_global.mtl_reservation_rec_type, x_what_field OUT NOCOPY VARCHAR2)
1314: RETURN BOOLEAN IS
1315: BEGIN
1316: x_what_field := NULL;
1317:

Line 1594: p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type

1590: -- in x_to_rsv_rec
1591: -- 2. else, copy the value of in the corresponding field in
1592: -- p_original_rsv_rec to the corresponding field in x_to_rsv_rec
1593: PROCEDURE construct_to_reservation_row(
1594: p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
1595: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
1596: , x_to_rsv_rec OUT NOCOPY inv_reservation_global.mtl_reservation_rec_type
1597: ) IS
1598: BEGIN

Line 1595: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type

1591: -- 2. else, copy the value of in the corresponding field in
1592: -- p_original_rsv_rec to the corresponding field in x_to_rsv_rec
1593: PROCEDURE construct_to_reservation_row(
1594: p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
1595: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
1596: , x_to_rsv_rec OUT NOCOPY inv_reservation_global.mtl_reservation_rec_type
1597: ) IS
1598: BEGIN
1599: IF p_to_rsv_rec.reservation_id <> fnd_api.g_miss_num

Line 1596: , x_to_rsv_rec OUT NOCOPY inv_reservation_global.mtl_reservation_rec_type

1592: -- p_original_rsv_rec to the corresponding field in x_to_rsv_rec
1593: PROCEDURE construct_to_reservation_row(
1594: p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
1595: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
1596: , x_to_rsv_rec OUT NOCOPY inv_reservation_global.mtl_reservation_rec_type
1597: ) IS
1598: BEGIN
1599: IF p_to_rsv_rec.reservation_id <> fnd_api.g_miss_num
1600: OR p_to_rsv_rec.reservation_id IS NULL THEN

Line 2090: IF inv_reservation_global.g_item_record_cache(p_item_cache_index).revision_qty_control_code = inv_reservation_global.g_revision_control_yes THEN

2086: -- in the cache which has a revision control code as yes
2087: FUNCTION is_revision_control(p_item_cache_index IN INTEGER)
2088: RETURN BOOLEAN IS
2089: BEGIN
2090: IF inv_reservation_global.g_item_record_cache(p_item_cache_index).revision_qty_control_code = inv_reservation_global.g_revision_control_yes THEN
2091: RETURN TRUE;
2092: ELSE
2093: RETURN FALSE;
2094: END IF;

Line 2104: IF inv_reservation_global.g_item_record_cache(p_item_cache_index).lot_control_code = inv_reservation_global.g_lot_control_yes THEN

2100: -- in the cache which has a lot control code as yes
2101: FUNCTION is_lot_control(p_item_cache_index IN INTEGER)
2102: RETURN BOOLEAN IS
2103: BEGIN
2104: IF inv_reservation_global.g_item_record_cache(p_item_cache_index).lot_control_code = inv_reservation_global.g_lot_control_yes THEN
2105: RETURN TRUE;
2106: ELSE
2107: RETURN FALSE;
2108: END IF;

Line 2118: IF inv_reservation_global.g_item_record_cache(p_item_cache_index).serial_number_control_code <> inv_reservation_global.g_serial_control_predefined THEN

2114: -- in the cache which has a serial control code as yes
2115: FUNCTION is_serial_control(p_item_cache_index IN INTEGER)
2116: RETURN BOOLEAN IS
2117: BEGIN
2118: IF inv_reservation_global.g_item_record_cache(p_item_cache_index).serial_number_control_code <> inv_reservation_global.g_serial_control_predefined THEN
2119: RETURN FALSE;
2120: ELSE
2121: RETURN TRUE;
2122: END IF;

Line 2135: IF inv_reservation_global.g_item_record_cache(p_item_cache_index).tracking_quantity_ind <> 'PS' THEN

2131: FUNCTION is_dual_control(p_item_cache_index IN INTEGER)
2132: RETURN BOOLEAN IS
2133: --l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
2134: BEGIN
2135: IF inv_reservation_global.g_item_record_cache(p_item_cache_index).tracking_quantity_ind <> 'PS' THEN
2136: RETURN FALSE;
2137: ELSE
2138: RETURN TRUE;
2139: END IF;

Line 2156: IF inv_reservation_global.g_item_record_cache(p_item_cache_index).lot_control_code

2152: END IF;
2153:
2154: l_debug := g_debug;
2155:
2156: IF inv_reservation_global.g_item_record_cache(p_item_cache_index).lot_control_code
2157: = inv_reservation_global.g_lot_control_yes AND
2158: inv_reservation_global.g_item_record_cache(p_item_cache_index).lot_divisible_flag <> 'Y' THEN
2159: IF (l_debug = 1) THEN
2160: debug_print('Lot divisible is FALSE ');

Line 2157: = inv_reservation_global.g_lot_control_yes AND

2153:
2154: l_debug := g_debug;
2155:
2156: IF inv_reservation_global.g_item_record_cache(p_item_cache_index).lot_control_code
2157: = inv_reservation_global.g_lot_control_yes AND
2158: inv_reservation_global.g_item_record_cache(p_item_cache_index).lot_divisible_flag <> 'Y' THEN
2159: IF (l_debug = 1) THEN
2160: debug_print('Lot divisible is FALSE ');
2161: END IF;

Line 2158: inv_reservation_global.g_item_record_cache(p_item_cache_index).lot_divisible_flag <> 'Y' THEN

2154: l_debug := g_debug;
2155:
2156: IF inv_reservation_global.g_item_record_cache(p_item_cache_index).lot_control_code
2157: = inv_reservation_global.g_lot_control_yes AND
2158: inv_reservation_global.g_item_record_cache(p_item_cache_index).lot_divisible_flag <> 'Y' THEN
2159: IF (l_debug = 1) THEN
2160: debug_print('Lot divisible is FALSE ');
2161: END IF;
2162: RETURN FALSE;

Line 2230: , p_source_type_id IN NUMBER DEFAULT INV_RESERVATION_GLOBAL.G_SOURCE_TYPE_WIP

2226: , x_msg_count OUT NOCOPY NUMBER
2227: , x_msg_data OUT NOCOPY VARCHAR2
2228: , p_organization_id IN NUMBER DEFAULT null
2229: , p_item_id IN NUMBER DEFAULT null
2230: , p_source_type_id IN NUMBER DEFAULT INV_RESERVATION_GLOBAL.G_SOURCE_TYPE_WIP
2231: , p_source_header_id IN NUMBER
2232: , p_source_line_id IN NUMBER
2233: , p_source_line_detail IN NUMBER
2234: , x_wip_entity_type OUT NOCOPY NUMBER

Line 2252: IF (p_source_type_id <> INV_RESERVATION_GLOBAL.g_source_type_wip) THEN

2248: END IF;
2249:
2250: l_debug := g_debug;
2251:
2252: IF (p_source_type_id <> INV_RESERVATION_GLOBAL.g_source_type_wip) THEN
2253: fnd_message.set_name('INV', 'INV_INVALID_SUPPLY_SOURCE');
2254: fnd_msg_pub.add;
2255: RAISE fnd_api.g_exc_error;
2256: END IF;

Line 2273: IF l_wip_entity_id = inv_reservation_global.g_wip_source_type_discrete then

2269: fnd_msg_pub.add;
2270: RAISE fnd_api.g_exc_error;
2271: END ;
2272:
2273: IF l_wip_entity_id = inv_reservation_global.g_wip_source_type_discrete then
2274: l_wip_entity_type := inv_reservation_global.g_wip_source_type_discrete;
2275: l_wip_job_type := 'DISCRETE';
2276: ELSIF l_wip_entity_id = 2 then
2277: l_wip_entity_type := inv_reservation_global.g_wip_source_type_repetitive;

Line 2274: l_wip_entity_type := inv_reservation_global.g_wip_source_type_discrete;

2270: RAISE fnd_api.g_exc_error;
2271: END ;
2272:
2273: IF l_wip_entity_id = inv_reservation_global.g_wip_source_type_discrete then
2274: l_wip_entity_type := inv_reservation_global.g_wip_source_type_discrete;
2275: l_wip_job_type := 'DISCRETE';
2276: ELSIF l_wip_entity_id = 2 then
2277: l_wip_entity_type := inv_reservation_global.g_wip_source_type_repetitive;
2278: l_wip_job_type := 'REPETITIVE';

Line 2277: l_wip_entity_type := inv_reservation_global.g_wip_source_type_repetitive;

2273: IF l_wip_entity_id = inv_reservation_global.g_wip_source_type_discrete then
2274: l_wip_entity_type := inv_reservation_global.g_wip_source_type_discrete;
2275: l_wip_job_type := 'DISCRETE';
2276: ELSIF l_wip_entity_id = 2 then
2277: l_wip_entity_type := inv_reservation_global.g_wip_source_type_repetitive;
2278: l_wip_job_type := 'REPETITIVE';
2279: ELSIF l_wip_entity_id = 4 then
2280: l_wip_entity_type := inv_reservation_global.g_wip_source_type_flow;
2281: l_wip_job_type := 'FLOW';

Line 2280: l_wip_entity_type := inv_reservation_global.g_wip_source_type_flow;

2276: ELSIF l_wip_entity_id = 2 then
2277: l_wip_entity_type := inv_reservation_global.g_wip_source_type_repetitive;
2278: l_wip_job_type := 'REPETITIVE';
2279: ELSIF l_wip_entity_id = 4 then
2280: l_wip_entity_type := inv_reservation_global.g_wip_source_type_flow;
2281: l_wip_job_type := 'FLOW';
2282: ELSIF l_wip_entity_id = 5 then
2283: l_wip_entity_type := inv_reservation_global.g_wip_source_type_osfm;
2284: l_wip_job_type := 'OSFM';

Line 2283: l_wip_entity_type := inv_reservation_global.g_wip_source_type_osfm;

2279: ELSIF l_wip_entity_id = 4 then
2280: l_wip_entity_type := inv_reservation_global.g_wip_source_type_flow;
2281: l_wip_job_type := 'FLOW';
2282: ELSIF l_wip_entity_id = 5 then
2283: l_wip_entity_type := inv_reservation_global.g_wip_source_type_osfm;
2284: l_wip_job_type := 'OSFM';
2285: ELSIF l_wip_entity_id = 6 and l_maintenance_object_source = 1 then
2286: l_wip_entity_type := inv_reservation_global.g_wip_source_type_eam;
2287: l_wip_job_type := 'EAM';

Line 2286: l_wip_entity_type := inv_reservation_global.g_wip_source_type_eam;

2282: ELSIF l_wip_entity_id = 5 then
2283: l_wip_entity_type := inv_reservation_global.g_wip_source_type_osfm;
2284: l_wip_job_type := 'OSFM';
2285: ELSIF l_wip_entity_id = 6 and l_maintenance_object_source = 1 then
2286: l_wip_entity_type := inv_reservation_global.g_wip_source_type_eam;
2287: l_wip_job_type := 'EAM';
2288: ELSIF l_wip_entity_id = 6 and l_maintenance_object_source = 2 then
2289: l_wip_entity_type := inv_reservation_global.g_wip_source_type_cmro;
2290: l_wip_job_type := 'CMRO'; -- AHL

Line 2289: l_wip_entity_type := inv_reservation_global.g_wip_source_type_cmro;

2285: ELSIF l_wip_entity_id = 6 and l_maintenance_object_source = 1 then
2286: l_wip_entity_type := inv_reservation_global.g_wip_source_type_eam;
2287: l_wip_job_type := 'EAM';
2288: ELSIF l_wip_entity_id = 6 and l_maintenance_object_source = 2 then
2289: l_wip_entity_type := inv_reservation_global.g_wip_source_type_cmro;
2290: l_wip_job_type := 'CMRO'; -- AHL
2291: ELSIF l_wip_entity_id = 9 then
2292: l_wip_entity_type := inv_reservation_global.g_wip_source_type_fpo;
2293: l_wip_job_type := 'FPO';

Line 2292: l_wip_entity_type := inv_reservation_global.g_wip_source_type_fpo;

2288: ELSIF l_wip_entity_id = 6 and l_maintenance_object_source = 2 then
2289: l_wip_entity_type := inv_reservation_global.g_wip_source_type_cmro;
2290: l_wip_job_type := 'CMRO'; -- AHL
2291: ELSIF l_wip_entity_id = 9 then
2292: l_wip_entity_type := inv_reservation_global.g_wip_source_type_fpo;
2293: l_wip_job_type := 'FPO';
2294: ELSIF l_wip_entity_id = 10 then
2295: l_wip_entity_type := inv_reservation_global.g_wip_source_type_batch;
2296: l_wip_job_type := 'BATCH';

Line 2295: l_wip_entity_type := inv_reservation_global.g_wip_source_type_batch;

2291: ELSIF l_wip_entity_id = 9 then
2292: l_wip_entity_type := inv_reservation_global.g_wip_source_type_fpo;
2293: l_wip_job_type := 'FPO';
2294: ELSIF l_wip_entity_id = 10 then
2295: l_wip_entity_type := inv_reservation_global.g_wip_source_type_batch;
2296: l_wip_job_type := 'BATCH';
2297: ELSIF l_wip_entity_id = 16 THEN
2298: l_wip_entity_type := inv_reservation_global.g_wip_source_type_depot;
2299: l_wip_job_type := 'DEPOT';

Line 2298: l_wip_entity_type := inv_reservation_global.g_wip_source_type_depot;

2294: ELSIF l_wip_entity_id = 10 then
2295: l_wip_entity_type := inv_reservation_global.g_wip_source_type_batch;
2296: l_wip_job_type := 'BATCH';
2297: ELSIF l_wip_entity_id = 16 THEN
2298: l_wip_entity_type := inv_reservation_global.g_wip_source_type_depot;
2299: l_wip_job_type := 'DEPOT';
2300: END IF;
2301:
2302: x_wip_entity_type := l_wip_entity_type;

Line 2386: , p_serial_number_tbl IN inv_reservation_global.serial_number_tbl_type

2382: , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
2383: , x_return_status OUT NOCOPY VARCHAR2
2384: , x_msg_count OUT NOCOPY NUMBER
2385: , x_msg_data OUT NOCOPY VARCHAR2
2386: , p_serial_number_tbl IN inv_reservation_global.serial_number_tbl_type
2387: , x_serial_number_tbl OUT NOCOPY inv_reservation_global.rsv_serial_number_table)
2388: IS
2389: l_api_name CONSTANT VARCHAR2(30) := 'is_serial_number_reserved';
2390: l_debug NUMBER;

Line 2387: , x_serial_number_tbl OUT NOCOPY inv_reservation_global.rsv_serial_number_table)

2383: , x_return_status OUT NOCOPY VARCHAR2
2384: , x_msg_count OUT NOCOPY NUMBER
2385: , x_msg_data OUT NOCOPY VARCHAR2
2386: , p_serial_number_tbl IN inv_reservation_global.serial_number_tbl_type
2387: , x_serial_number_tbl OUT NOCOPY inv_reservation_global.rsv_serial_number_table)
2388: IS
2389: l_api_name CONSTANT VARCHAR2(30) := 'is_serial_number_reserved';
2390: l_debug NUMBER;
2391: l_index NUMBER := 0;

Line 2460: , p_serial_number_tbl IN inv_reservation_global.serial_number_tbl_type

2456: , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
2457: , x_return_status OUT NOCOPY VARCHAR2
2458: , x_msg_count OUT NOCOPY NUMBER
2459: , x_msg_data OUT NOCOPY VARCHAR2
2460: , p_serial_number_tbl IN inv_reservation_global.serial_number_tbl_type
2461: , x_serial_number_tbl OUT NOCOPY inv_reservation_global.rsv_serial_number_table
2462: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type)
2463: IS
2464: l_api_name CONSTANT VARCHAR2(30) := 'is_serial_number_reserved';

Line 2461: , x_serial_number_tbl OUT NOCOPY inv_reservation_global.rsv_serial_number_table

2457: , x_return_status OUT NOCOPY VARCHAR2
2458: , x_msg_count OUT NOCOPY NUMBER
2459: , x_msg_data OUT NOCOPY VARCHAR2
2460: , p_serial_number_tbl IN inv_reservation_global.serial_number_tbl_type
2461: , x_serial_number_tbl OUT NOCOPY inv_reservation_global.rsv_serial_number_table
2462: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type)
2463: IS
2464: l_api_name CONSTANT VARCHAR2(30) := 'is_serial_number_reserved';
2465: l_debug NUMBER;

Line 2462: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type)

2458: , x_msg_count OUT NOCOPY NUMBER
2459: , x_msg_data OUT NOCOPY VARCHAR2
2460: , p_serial_number_tbl IN inv_reservation_global.serial_number_tbl_type
2461: , x_serial_number_tbl OUT NOCOPY inv_reservation_global.rsv_serial_number_table
2462: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type)
2463: IS
2464: l_api_name CONSTANT VARCHAR2(30) := 'is_serial_number_reserved';
2465: l_debug NUMBER;
2466: l_index NUMBER := 0;

Line 2969: IF p_from_supply_source_type_id = inv_reservation_global.g_source_type_inv THEN

2965: IF l_dual_control THEN -- INVCONV
2966: l_secondary_net_qty2 := p_to_second_rsv_quantity - NVL(p_to_second_detailed_quantity, 0); -- INVCONV
2967: END IF; -- INVCONV
2968: --
2969: IF p_from_supply_source_type_id = inv_reservation_global.g_source_type_inv THEN
2970: -- INVCONV - Incorporate secondaries
2971: inv_quantity_tree_pvt.update_quantities(
2972: p_api_version_number => 1.0
2973: , p_init_msg_lst => fnd_api.g_true

Line 3019: IF p_to_supply_source_type_id = inv_reservation_global.g_source_type_inv

3015:
3016: --
3017: l_modify_tree2 := FALSE;
3018:
3019: IF p_to_supply_source_type_id = inv_reservation_global.g_source_type_inv
3020: AND l_modify_tree1
3021: AND p_to_tree_id IS NOT NULL
3022: AND p_from_tree_id <> p_to_tree_id THEN
3023: l_modify_tree2 := TRUE;

Line 3131: IF p_action='UPDATE' AND p_from_supply_source_type_id = inv_reservation_global.g_source_type_inv then

3127: END IF;
3128: --Start changes for Bug Number#3336837
3129: -- Bug Number 3447373 Removed the qty validation for transfers
3130:
3131: IF p_action='UPDATE' AND p_from_supply_source_type_id = inv_reservation_global.g_source_type_inv then
3132: IF (l_debug = 1) THEN
3133: debug_print('Validate Qty :Action Update');
3134: END IF;
3135:

Line 3466: , p_query_input IN inv_reservation_global.mtl_reservation_rec_type

3462: , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
3463: , x_return_status OUT NOCOPY VARCHAR2
3464: , x_msg_count OUT NOCOPY NUMBER
3465: , x_msg_data OUT NOCOPY VARCHAR2
3466: , p_query_input IN inv_reservation_global.mtl_reservation_rec_type
3467: , p_lock_records IN VARCHAR2 DEFAULT fnd_api.g_false
3468: , p_sort_by_req_date IN NUMBER DEFAULT inv_reservation_global.g_query_no_sort
3469: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no
3470: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type

Line 3468: , p_sort_by_req_date IN NUMBER DEFAULT inv_reservation_global.g_query_no_sort

3464: , x_msg_count OUT NOCOPY NUMBER
3465: , x_msg_data OUT NOCOPY VARCHAR2
3466: , p_query_input IN inv_reservation_global.mtl_reservation_rec_type
3467: , p_lock_records IN VARCHAR2 DEFAULT fnd_api.g_false
3468: , p_sort_by_req_date IN NUMBER DEFAULT inv_reservation_global.g_query_no_sort
3469: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no
3470: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type
3471: , x_mtl_reservation_tbl_count OUT NOCOPY NUMBER
3472: , x_error_code OUT NOCOPY NUMBER

Line 3469: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no

3465: , x_msg_data OUT NOCOPY VARCHAR2
3466: , p_query_input IN inv_reservation_global.mtl_reservation_rec_type
3467: , p_lock_records IN VARCHAR2 DEFAULT fnd_api.g_false
3468: , p_sort_by_req_date IN NUMBER DEFAULT inv_reservation_global.g_query_no_sort
3469: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no
3470: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type
3471: , x_mtl_reservation_tbl_count OUT NOCOPY NUMBER
3472: , x_error_code OUT NOCOPY NUMBER
3473: ) IS

Line 3470: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type

3466: , p_query_input IN inv_reservation_global.mtl_reservation_rec_type
3467: , p_lock_records IN VARCHAR2 DEFAULT fnd_api.g_false
3468: , p_sort_by_req_date IN NUMBER DEFAULT inv_reservation_global.g_query_no_sort
3469: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no
3470: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type
3471: , x_mtl_reservation_tbl_count OUT NOCOPY NUMBER
3472: , x_error_code OUT NOCOPY NUMBER
3473: ) IS
3474: l_api_version_number CONSTANT NUMBER := 1.0;

Line 3478: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

3474: l_api_version_number CONSTANT NUMBER := 1.0;
3475: l_api_name CONSTANT VARCHAR2(30) := 'Query_Reservation';
3476: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
3477: l_counter INTEGER;
3478: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
3479: l_sort_stmt VARCHAR2(2000);
3480: l_lock_stmt VARCHAR2(60);
3481: -- Bug 4881317
3482: l_qry_stmt VARCHAR2(15000);

Line 4359: x_error_code := inv_reservation_global.g_err_unexpected;

4355:
4356:
4357: ORDER BY NVL(revision, ' '), NVL(lot_number, ' '), NVL(subinventory_code, ' '), NVL(locator_id, 0);
4358: BEGIN
4359: x_error_code := inv_reservation_global.g_err_unexpected;
4360:
4361: -- Use cache to get value for l_debug
4362: IF g_is_pickrelease_set IS NULL THEN
4363: g_is_pickrelease_set := 2;

Line 4408: IF p_sort_by_req_date = inv_reservation_global.g_query_req_date_asc THEN

4404: -- 1. By requirement_date - asc or desc (For WIP)
4405: -- 2. By ship_ready_flag, detailed quantity (For OE/OM)
4406: -- 3. By revision,lot,sub,locator - high level reservations 1st(For default)
4407: --
4408: IF p_sort_by_req_date = inv_reservation_global.g_query_req_date_asc THEN
4409: l_sort_stmt := ' ORDER BY REQUIREMENT_DATE ASC ';
4410: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_req_date_desc THEN
4411: l_sort_stmt := ' ORDER BY REQUIREMENT_DATE DESC ';
4412: /**** {{ R12 Enhanced reservations code changes. Adding new sort by conditions }}****/

Line 4410: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_req_date_desc THEN

4406: -- 3. By revision,lot,sub,locator - high level reservations 1st(For default)
4407: --
4408: IF p_sort_by_req_date = inv_reservation_global.g_query_req_date_asc THEN
4409: l_sort_stmt := ' ORDER BY REQUIREMENT_DATE ASC ';
4410: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_req_date_desc THEN
4411: l_sort_stmt := ' ORDER BY REQUIREMENT_DATE DESC ';
4412: /**** {{ R12 Enhanced reservations code changes. Adding new sort by conditions }}****/
4413: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_demand_ship_date_asc THEN
4414: l_sort_stmt := ' ORDER BY NVL(DEMAND_SHIP_DATE,REQUIREMENT_DATE) ASC ';

Line 4413: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_demand_ship_date_asc THEN

4409: l_sort_stmt := ' ORDER BY REQUIREMENT_DATE ASC ';
4410: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_req_date_desc THEN
4411: l_sort_stmt := ' ORDER BY REQUIREMENT_DATE DESC ';
4412: /**** {{ R12 Enhanced reservations code changes. Adding new sort by conditions }}****/
4413: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_demand_ship_date_asc THEN
4414: l_sort_stmt := ' ORDER BY NVL(DEMAND_SHIP_DATE,REQUIREMENT_DATE) ASC ';
4415: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_demand_ship_date_desc THEN
4416: l_sort_stmt := ' ORDER BY NVL(DEMAND_SHIP_DATE,REQUIREMENT_DATE) DESC ';
4417: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_supply_rcpt_date_asc THEN

Line 4415: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_demand_ship_date_desc THEN

4411: l_sort_stmt := ' ORDER BY REQUIREMENT_DATE DESC ';
4412: /**** {{ R12 Enhanced reservations code changes. Adding new sort by conditions }}****/
4413: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_demand_ship_date_asc THEN
4414: l_sort_stmt := ' ORDER BY NVL(DEMAND_SHIP_DATE,REQUIREMENT_DATE) ASC ';
4415: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_demand_ship_date_desc THEN
4416: l_sort_stmt := ' ORDER BY NVL(DEMAND_SHIP_DATE,REQUIREMENT_DATE) DESC ';
4417: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_supply_rcpt_date_asc THEN
4418: l_sort_stmt := ' ORDER BY NVL(SUPPLY_SHIP_DATE,REQUIREMENT_DATE) ASC ';
4419: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_supply_rcpt_date_asc THEN

Line 4417: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_supply_rcpt_date_asc THEN

4413: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_demand_ship_date_asc THEN
4414: l_sort_stmt := ' ORDER BY NVL(DEMAND_SHIP_DATE,REQUIREMENT_DATE) ASC ';
4415: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_demand_ship_date_desc THEN
4416: l_sort_stmt := ' ORDER BY NVL(DEMAND_SHIP_DATE,REQUIREMENT_DATE) DESC ';
4417: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_supply_rcpt_date_asc THEN
4418: l_sort_stmt := ' ORDER BY NVL(SUPPLY_SHIP_DATE,REQUIREMENT_DATE) ASC ';
4419: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_supply_rcpt_date_asc THEN
4420: l_sort_stmt := ' ORDER BY NVL(SUPPLY_SHIP_DATE,REQUIREMENT_DATE) DESC ';
4421: /*** End R12 ***/

Line 4419: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_supply_rcpt_date_asc THEN

4415: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_demand_ship_date_desc THEN
4416: l_sort_stmt := ' ORDER BY NVL(DEMAND_SHIP_DATE,REQUIREMENT_DATE) DESC ';
4417: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_supply_rcpt_date_asc THEN
4418: l_sort_stmt := ' ORDER BY NVL(SUPPLY_SHIP_DATE,REQUIREMENT_DATE) ASC ';
4419: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_supply_rcpt_date_asc THEN
4420: l_sort_stmt := ' ORDER BY NVL(SUPPLY_SHIP_DATE,REQUIREMENT_DATE) DESC ';
4421: /*** End R12 ***/
4422:
4423: ELSIF p_cancel_order_mode = inv_reservation_global.g_cancel_order_yes THEN

Line 4423: ELSIF p_cancel_order_mode = inv_reservation_global.g_cancel_order_yes THEN

4419: ELSIF p_sort_by_req_date = inv_reservation_global.g_query_supply_rcpt_date_asc THEN
4420: l_sort_stmt := ' ORDER BY NVL(SUPPLY_SHIP_DATE,REQUIREMENT_DATE) DESC ';
4421: /*** End R12 ***/
4422:
4423: ELSIF p_cancel_order_mode = inv_reservation_global.g_cancel_order_yes THEN
4424: l_sort_stmt := ' ORDER BY NVL(SHIP_READY_FLAG,2) DESC, ' || 'NVL(DETAILED_QUANTITY,0) ';
4425: ELSE
4426: -- Default order by - High level followed by detail
4427: l_sort_default := TRUE;

Line 7404: debug_print('error code' || inv_reservation_global.g_err_no_error);

7400:
7401: IF (l_debug = 1) then
7402: debug_print(' Counter: ' || l_counter);
7403: debug_print(' return status: ' || l_return_status);
7404: debug_print('error code' || inv_reservation_global.g_err_no_error);
7405: END IF;
7406: --
7407: x_mtl_reservation_tbl_count := l_counter;
7408: x_return_status := l_return_status;

Line 7409: x_error_code := inv_reservation_global.g_err_no_error;

7405: END IF;
7406: --
7407: x_mtl_reservation_tbl_count := l_counter;
7408: x_return_status := l_return_status;
7409: x_error_code := inv_reservation_global.g_err_no_error;
7410: --
7411: EXCEPTION
7412: WHEN fnd_api.g_exc_error THEN
7413: x_return_status := fnd_api.g_ret_sts_error;

Line 7423: x_error_code := inv_reservation_global.g_err_fail_to_lock_rec;

7419: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
7420: WHEN OTHERS THEN
7421: IF SQLCODE = -54 THEN -- failed to lock
7422: x_return_status := fnd_api.g_ret_sts_error;
7423: x_error_code := inv_reservation_global.g_err_fail_to_lock_rec;
7424: ELSE
7425: x_return_status := fnd_api.g_ret_sts_unexp_error;
7426:
7427: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN

Line 7447: , p_query_input IN inv_reservation_global.mtl_reservation_rec_type

7443: , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
7444: , x_return_status OUT NOCOPY VARCHAR2
7445: , x_msg_count OUT NOCOPY NUMBER
7446: , x_msg_data OUT NOCOPY VARCHAR2
7447: , p_query_input IN inv_reservation_global.mtl_reservation_rec_type
7448: , p_lock_records IN VARCHAR2 DEFAULT fnd_api.g_false
7449: , p_sort_by_req_date IN NUMBER DEFAULT inv_reservation_global.g_query_no_sort
7450: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no
7451: , p_serial_number_table IN inv_reservation_global.rsv_serial_number_table

Line 7449: , p_sort_by_req_date IN NUMBER DEFAULT inv_reservation_global.g_query_no_sort

7445: , x_msg_count OUT NOCOPY NUMBER
7446: , x_msg_data OUT NOCOPY VARCHAR2
7447: , p_query_input IN inv_reservation_global.mtl_reservation_rec_type
7448: , p_lock_records IN VARCHAR2 DEFAULT fnd_api.g_false
7449: , p_sort_by_req_date IN NUMBER DEFAULT inv_reservation_global.g_query_no_sort
7450: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no
7451: , p_serial_number_table IN inv_reservation_global.rsv_serial_number_table
7452: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type
7453: , x_mtl_reservation_tbl_count OUT NOCOPY NUMBER

Line 7450: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no

7446: , x_msg_data OUT NOCOPY VARCHAR2
7447: , p_query_input IN inv_reservation_global.mtl_reservation_rec_type
7448: , p_lock_records IN VARCHAR2 DEFAULT fnd_api.g_false
7449: , p_sort_by_req_date IN NUMBER DEFAULT inv_reservation_global.g_query_no_sort
7450: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no
7451: , p_serial_number_table IN inv_reservation_global.rsv_serial_number_table
7452: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type
7453: , x_mtl_reservation_tbl_count OUT NOCOPY NUMBER
7454: , x_serial_number_table OUT NOCOPY inv_reservation_global.rsv_serial_number_table

Line 7451: , p_serial_number_table IN inv_reservation_global.rsv_serial_number_table

7447: , p_query_input IN inv_reservation_global.mtl_reservation_rec_type
7448: , p_lock_records IN VARCHAR2 DEFAULT fnd_api.g_false
7449: , p_sort_by_req_date IN NUMBER DEFAULT inv_reservation_global.g_query_no_sort
7450: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no
7451: , p_serial_number_table IN inv_reservation_global.rsv_serial_number_table
7452: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type
7453: , x_mtl_reservation_tbl_count OUT NOCOPY NUMBER
7454: , x_serial_number_table OUT NOCOPY inv_reservation_global.rsv_serial_number_table
7455: , x_serial_number_table_count OUT NOCOPY NUMBER

Line 7452: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type

7448: , p_lock_records IN VARCHAR2 DEFAULT fnd_api.g_false
7449: , p_sort_by_req_date IN NUMBER DEFAULT inv_reservation_global.g_query_no_sort
7450: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no
7451: , p_serial_number_table IN inv_reservation_global.rsv_serial_number_table
7452: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type
7453: , x_mtl_reservation_tbl_count OUT NOCOPY NUMBER
7454: , x_serial_number_table OUT NOCOPY inv_reservation_global.rsv_serial_number_table
7455: , x_serial_number_table_count OUT NOCOPY NUMBER
7456: , x_error_code OUT NOCOPY NUMBER

Line 7454: , x_serial_number_table OUT NOCOPY inv_reservation_global.rsv_serial_number_table

7450: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no
7451: , p_serial_number_table IN inv_reservation_global.rsv_serial_number_table
7452: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type
7453: , x_mtl_reservation_tbl_count OUT NOCOPY NUMBER
7454: , x_serial_number_table OUT NOCOPY inv_reservation_global.rsv_serial_number_table
7455: , x_serial_number_table_count OUT NOCOPY NUMBER
7456: , x_error_code OUT NOCOPY NUMBER
7457: ) IS
7458:

Line 7460: l_serial_number_table inv_reservation_global.rsv_serial_number_table;

7456: , x_error_code OUT NOCOPY NUMBER
7457: ) IS
7458:
7459: l_api_name CONSTANT VARCHAR2(30) := 'Query_Reservation';
7460: l_serial_number_table inv_reservation_global.rsv_serial_number_table;
7461: l_serial_table_index BINARY_INTEGER;
7462: l_output_index BINARY_INTEGER;
7463: l_reservation_index BINARY_INTEGER;
7464: l_reservation_id NUMBER;

Line 7469: inv_reservation_global.mtl_reservation_tbl_type;

7465: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
7466: l_debug NUMBER;
7467: l_serial_number varchar2(30);
7468: l_mtl_reservation_tbl
7469: inv_reservation_global.mtl_reservation_tbl_type;
7470: l_progress NUMBER;
7471: l_mtl_reservation_tbl_count NUMBER;
7472: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
7473: l_error_code NUMBER;

Line 7472: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

7468: l_mtl_reservation_tbl
7469: inv_reservation_global.mtl_reservation_tbl_type;
7470: l_progress NUMBER;
7471: l_mtl_reservation_tbl_count NUMBER;
7472: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
7473: l_error_code NUMBER;
7474:
7475:
7476: BEGIN

Line 7611: x_error_code := inv_reservation_global.g_err_no_error;

7607:
7608: x_mtl_reservation_tbl := l_mtl_reservation_tbl;
7609: x_mtl_reservation_tbl_count := l_mtl_reservation_tbl_count;
7610: x_return_status := l_return_status;
7611: x_error_code := inv_reservation_global.g_err_no_error;
7612: x_serial_number_table := l_serial_number_table;
7613: x_serial_number_table_count := l_serial_number_table.COUNT;
7614:
7615: EXCEPTION

Line 7627: x_error_code := inv_reservation_global.g_err_fail_to_lock_rec;

7623: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
7624: WHEN OTHERS THEN
7625: IF SQLCODE = -54 THEN -- failed to lock
7626: x_return_status := fnd_api.g_ret_sts_error;
7627: x_error_code := inv_reservation_global.g_err_fail_to_lock_rec;
7628: ELSE
7629: x_return_status := fnd_api.g_ret_sts_unexp_error;
7630:
7631: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN

Line 7649: , p_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type

7645: , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
7646: , x_return_status OUT NOCOPY VARCHAR2
7647: , x_msg_count OUT NOCOPY NUMBER
7648: , x_msg_data OUT NOCOPY VARCHAR2
7649: , p_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
7650: , p_serial_number IN inv_reservation_global.serial_number_tbl_type
7651: , x_serial_number OUT NOCOPY inv_reservation_global.serial_number_tbl_type
7652: , p_partial_reservation_flag IN VARCHAR2 DEFAULT fnd_api.g_false
7653: , p_force_reservation_flag IN VARCHAR2 DEFAULT fnd_api.g_false

Line 7650: , p_serial_number IN inv_reservation_global.serial_number_tbl_type

7646: , x_return_status OUT NOCOPY VARCHAR2
7647: , x_msg_count OUT NOCOPY NUMBER
7648: , x_msg_data OUT NOCOPY VARCHAR2
7649: , p_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
7650: , p_serial_number IN inv_reservation_global.serial_number_tbl_type
7651: , x_serial_number OUT NOCOPY inv_reservation_global.serial_number_tbl_type
7652: , p_partial_reservation_flag IN VARCHAR2 DEFAULT fnd_api.g_false
7653: , p_force_reservation_flag IN VARCHAR2 DEFAULT fnd_api.g_false
7654: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true

Line 7651: , x_serial_number OUT NOCOPY inv_reservation_global.serial_number_tbl_type

7647: , x_msg_count OUT NOCOPY NUMBER
7648: , x_msg_data OUT NOCOPY VARCHAR2
7649: , p_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
7650: , p_serial_number IN inv_reservation_global.serial_number_tbl_type
7651: , x_serial_number OUT NOCOPY inv_reservation_global.serial_number_tbl_type
7652: , p_partial_reservation_flag IN VARCHAR2 DEFAULT fnd_api.g_false
7653: , p_force_reservation_flag IN VARCHAR2 DEFAULT fnd_api.g_false
7654: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true
7655: , p_over_reservation_flag IN NUMBER DEFAULT 0

Line 7668: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

7664: ) IS
7665: l_api_version_number CONSTANT NUMBER := 1.0;
7666: l_api_name CONSTANT VARCHAR2(30) := 'Create_Reservation';
7667: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
7668: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
7669: l_actual_primary_quantity NUMBER := NULL;
7670: l_tmp_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
7671: l_tmp_rsv_tbl_count NUMBER;
7672: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

Line 7670: l_tmp_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;

7666: l_api_name CONSTANT VARCHAR2(30) := 'Create_Reservation';
7667: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
7668: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
7669: l_actual_primary_quantity NUMBER := NULL;
7670: l_tmp_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
7671: l_tmp_rsv_tbl_count NUMBER;
7672: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
7673: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;
7674: l_tree_id INTEGER;

Line 7672: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

7668: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
7669: l_actual_primary_quantity NUMBER := NULL;
7670: l_tmp_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
7671: l_tmp_rsv_tbl_count NUMBER;
7672: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
7673: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;
7674: l_tree_id INTEGER;
7675: l_orig_item_cache_index INTEGER := NULL;
7676: l_orig_org_cache_index INTEGER := NULL;

Line 7673: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;

7669: l_actual_primary_quantity NUMBER := NULL;
7670: l_tmp_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
7671: l_tmp_rsv_tbl_count NUMBER;
7672: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
7673: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;
7674: l_tree_id INTEGER;
7675: l_orig_item_cache_index INTEGER := NULL;
7676: l_orig_org_cache_index INTEGER := NULL;
7677: l_orig_demand_cache_index INTEGER := NULL;

Line 7704: -- l_from_rsv_rec inv_reservation_global.mtl_reservation_rec_type

7700: :='N'; -- INVCONV
7701: /**** {{ R12 Enhanced reservations code changes }}****/
7702: l_rsv_updated BOOLEAN :=FALSE;
7703: l_progress NUMBER;
7704: -- l_from_rsv_rec inv_reservation_global.mtl_reservation_rec_type
7705: -- := p_rsv_rec;
7706: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
7707: l_mtl_reservation_tbl inv_reservation_global.mtl_reservation_tbl_type;
7708: l_mtl_reservation_tbl_count NUMBER;

Line 7706: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

7702: l_rsv_updated BOOLEAN :=FALSE;
7703: l_progress NUMBER;
7704: -- l_from_rsv_rec inv_reservation_global.mtl_reservation_rec_type
7705: -- := p_rsv_rec;
7706: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
7707: l_mtl_reservation_tbl inv_reservation_global.mtl_reservation_tbl_type;
7708: l_mtl_reservation_tbl_count NUMBER;
7709: l_quantity_reserved NUMBER;
7710: l_secondary_quantity_reserved NUMBER;

Line 7707: l_mtl_reservation_tbl inv_reservation_global.mtl_reservation_tbl_type;

7703: l_progress NUMBER;
7704: -- l_from_rsv_rec inv_reservation_global.mtl_reservation_rec_type
7705: -- := p_rsv_rec;
7706: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
7707: l_mtl_reservation_tbl inv_reservation_global.mtl_reservation_tbl_type;
7708: l_mtl_reservation_tbl_count NUMBER;
7709: l_quantity_reserved NUMBER;
7710: l_secondary_quantity_reserved NUMBER;
7711: l_qty_available NUMBER;

Line 7713: l_serial_number inv_reservation_global.serial_number_tbl_type;

7709: l_quantity_reserved NUMBER;
7710: l_secondary_quantity_reserved NUMBER;
7711: l_qty_available NUMBER;
7712: l_serial_index NUMBER;
7713: l_serial_number inv_reservation_global.serial_number_tbl_type;
7714: l_item_rec inv_reservation_global.item_record;
7715: l_supply_lock_handle varchar2(128);
7716: l_demand_lock_handle varchar2(128);
7717: l_lock_status NUMBER;

Line 7714: l_item_rec inv_reservation_global.item_record;

7710: l_secondary_quantity_reserved NUMBER;
7711: l_qty_available NUMBER;
7712: l_serial_index NUMBER;
7713: l_serial_number inv_reservation_global.serial_number_tbl_type;
7714: l_item_rec inv_reservation_global.item_record;
7715: l_supply_lock_handle varchar2(128);
7716: l_demand_lock_handle varchar2(128);
7717: l_lock_status NUMBER;
7718: l_group_mark_id NUMBER := NULL;

Line 8048: inv_reservation_global.g_source_type_asn) THEN

8044: -- the line level. Also, for ASN, pass the source type as PO so that the
8045: -- the lock name would be the same as the PO's
8046:
8047: IF (l_rsv_rec.supply_source_type_id =
8048: inv_reservation_global.g_source_type_asn) THEN
8049: l_supply_source_type_id :=
8050: inv_reservation_global.g_source_type_po;
8051: ELSE
8052: l_supply_source_type_id := l_rsv_rec.supply_source_type_id;

Line 8050: inv_reservation_global.g_source_type_po;

8046:
8047: IF (l_rsv_rec.supply_source_type_id =
8048: inv_reservation_global.g_source_type_asn) THEN
8049: l_supply_source_type_id :=
8050: inv_reservation_global.g_source_type_po;
8051: ELSE
8052: l_supply_source_type_id := l_rsv_rec.supply_source_type_id;
8053: END IF;
8054:

Line 8055: IF (l_rsv_rec.supply_source_type_id <> inv_reservation_global.g_source_type_inv) THEN

8051: ELSE
8052: l_supply_source_type_id := l_rsv_rec.supply_source_type_id;
8053: END IF;
8054:
8055: IF (l_rsv_rec.supply_source_type_id <> inv_reservation_global.g_source_type_inv) THEN
8056: inv_reservation_lock_pvt.lock_supply_demand_record
8057: (p_organization_id => l_rsv_rec.organization_id
8058: ,p_inventory_item_id => l_rsv_rec.inventory_item_id
8059: ,p_source_type_id => l_supply_source_type_id

Line 8277: (inv_reservation_global.g_source_type_oe,

8273: END IF;
8274: END;
8275: END IF;
8276: IF (l_rsv_rec.demand_source_type_id IN
8277: (inv_reservation_global.g_source_type_oe,
8278: inv_reservation_global.g_source_type_internal_ord,
8279: inv_reservation_global.g_source_type_rma)) AND
8280: (l_pjm_enabled = 1) THEN
8281:

Line 8278: inv_reservation_global.g_source_type_internal_ord,

8274: END;
8275: END IF;
8276: IF (l_rsv_rec.demand_source_type_id IN
8277: (inv_reservation_global.g_source_type_oe,
8278: inv_reservation_global.g_source_type_internal_ord,
8279: inv_reservation_global.g_source_type_rma)) AND
8280: (l_pjm_enabled = 1) THEN
8281:
8282: IF (l_rsv_rec.demand_source_line_id IS NOT NULL) AND

Line 8279: inv_reservation_global.g_source_type_rma)) AND

8275: END IF;
8276: IF (l_rsv_rec.demand_source_type_id IN
8277: (inv_reservation_global.g_source_type_oe,
8278: inv_reservation_global.g_source_type_internal_ord,
8279: inv_reservation_global.g_source_type_rma)) AND
8280: (l_pjm_enabled = 1) THEN
8281:
8282: IF (l_rsv_rec.demand_source_line_id IS NOT NULL) AND
8283: (l_rsv_rec.demand_source_line_id <> fnd_api.g_miss_num)

Line 8376: IF l_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN

8372: END IF;
8373:
8374: --
8375: -- Pre Insert CTO Validation
8376: IF l_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
8377: --
8378: cto_workflow_api_pk.inventory_reservation_check(p_order_line_id => l_rsv_rec.demand_source_line_id, x_return_status => l_return_status, x_msg_count => x_msg_count, x_msg_data => x_msg_data);
8379:
8380: IF (l_debug = 1) THEN

Line 8410: AND l_rsv_rec.supply_source_type_id = inv_reservation_global.g_source_type_inv THEN

8406: -- will call quantity validation for other supply sources in the future
8407: -- Bug 2354735: Proceed with Trees only if p_validation_flag = 'T'
8408: IF p_force_reservation_flag <> fnd_api.g_true
8409: AND p_validation_flag = fnd_api.g_true
8410: AND l_rsv_rec.supply_source_type_id = inv_reservation_global.g_source_type_inv THEN
8411: inv_quantity_tree_pvt.create_tree
8412: (
8413: p_api_version_number => 1.0
8414: , p_init_msg_lst => fnd_api.g_true

Line 8555: (inv_reservation_global.g_source_type_wip,

8551: /*** End R12 ***/
8552:
8553: /**** {{ R12 Enhanced reservations code changes }}****/
8554: ELSIF (l_rsv_rec.supply_source_type_id IN
8555: (inv_reservation_global.g_source_type_wip,
8556: inv_reservation_global.g_source_type_po,
8557: inv_reservation_global.g_source_type_asn,
8558: inv_reservation_global.g_source_type_intransit,
8559: inv_reservation_global.g_source_type_internal_req,

Line 8556: inv_reservation_global.g_source_type_po,

8552:
8553: /**** {{ R12 Enhanced reservations code changes }}****/
8554: ELSIF (l_rsv_rec.supply_source_type_id IN
8555: (inv_reservation_global.g_source_type_wip,
8556: inv_reservation_global.g_source_type_po,
8557: inv_reservation_global.g_source_type_asn,
8558: inv_reservation_global.g_source_type_intransit,
8559: inv_reservation_global.g_source_type_internal_req,
8560: inv_reservation_global.g_source_type_rcv)) AND

Line 8557: inv_reservation_global.g_source_type_asn,

8553: /**** {{ R12 Enhanced reservations code changes }}****/
8554: ELSIF (l_rsv_rec.supply_source_type_id IN
8555: (inv_reservation_global.g_source_type_wip,
8556: inv_reservation_global.g_source_type_po,
8557: inv_reservation_global.g_source_type_asn,
8558: inv_reservation_global.g_source_type_intransit,
8559: inv_reservation_global.g_source_type_internal_req,
8560: inv_reservation_global.g_source_type_rcv)) AND
8561: p_over_reservation_flag NOT IN (1,3) THEN

Line 8558: inv_reservation_global.g_source_type_intransit,

8554: ELSIF (l_rsv_rec.supply_source_type_id IN
8555: (inv_reservation_global.g_source_type_wip,
8556: inv_reservation_global.g_source_type_po,
8557: inv_reservation_global.g_source_type_asn,
8558: inv_reservation_global.g_source_type_intransit,
8559: inv_reservation_global.g_source_type_internal_req,
8560: inv_reservation_global.g_source_type_rcv)) AND
8561: p_over_reservation_flag NOT IN (1,3) THEN
8562: -- call the available to reserve API to get the supply and

Line 8559: inv_reservation_global.g_source_type_internal_req,

8555: (inv_reservation_global.g_source_type_wip,
8556: inv_reservation_global.g_source_type_po,
8557: inv_reservation_global.g_source_type_asn,
8558: inv_reservation_global.g_source_type_intransit,
8559: inv_reservation_global.g_source_type_internal_req,
8560: inv_reservation_global.g_source_type_rcv)) AND
8561: p_over_reservation_flag NOT IN (1,3) THEN
8562: -- call the available to reserve API to get the supply and
8563: -- demand availability

Line 8560: inv_reservation_global.g_source_type_rcv)) AND

8556: inv_reservation_global.g_source_type_po,
8557: inv_reservation_global.g_source_type_asn,
8558: inv_reservation_global.g_source_type_intransit,
8559: inv_reservation_global.g_source_type_internal_req,
8560: inv_reservation_global.g_source_type_rcv)) AND
8561: p_over_reservation_flag NOT IN (1,3) THEN
8562: -- call the available to reserve API to get the supply and
8563: -- demand availability
8564: -- Bug 5199672: Should pass g_miss_num as default for supply

Line 8652: (inv_reservation_global.g_source_type_wip,

8648: END IF;
8649: END IF;
8650:
8651: IF (l_rsv_rec.demand_source_type_id IN
8652: (inv_reservation_global.g_source_type_wip,
8653: inv_reservation_global.g_source_type_oe,
8654: inv_reservation_global.g_source_type_internal_ord,
8655: inv_reservation_global.g_source_type_rma)) AND
8656: p_over_reservation_flag NOT IN (2,3) THEN

Line 8653: inv_reservation_global.g_source_type_oe,

8649: END IF;
8650:
8651: IF (l_rsv_rec.demand_source_type_id IN
8652: (inv_reservation_global.g_source_type_wip,
8653: inv_reservation_global.g_source_type_oe,
8654: inv_reservation_global.g_source_type_internal_ord,
8655: inv_reservation_global.g_source_type_rma)) AND
8656: p_over_reservation_flag NOT IN (2,3) THEN
8657:

Line 8654: inv_reservation_global.g_source_type_internal_ord,

8650:
8651: IF (l_rsv_rec.demand_source_type_id IN
8652: (inv_reservation_global.g_source_type_wip,
8653: inv_reservation_global.g_source_type_oe,
8654: inv_reservation_global.g_source_type_internal_ord,
8655: inv_reservation_global.g_source_type_rma)) AND
8656: p_over_reservation_flag NOT IN (2,3) THEN
8657:
8658: -- Bug 5199672: Should pass g_miss_num as default for demand

Line 8655: inv_reservation_global.g_source_type_rma)) AND

8651: IF (l_rsv_rec.demand_source_type_id IN
8652: (inv_reservation_global.g_source_type_wip,
8653: inv_reservation_global.g_source_type_oe,
8654: inv_reservation_global.g_source_type_internal_ord,
8655: inv_reservation_global.g_source_type_rma)) AND
8656: p_over_reservation_flag NOT IN (2,3) THEN
8657:
8658: -- Bug 5199672: Should pass g_miss_num as default for demand
8659: -- source line detail. Otherwise, high level reservations

Line 8699: IF (l_rsv_rec.demand_source_type_id in (inv_reservation_global.g_source_type_oe,

8695: RAISE fnd_api.g_exc_unexpected_error;
8696: END IF;
8697:
8698:
8699: IF (l_rsv_rec.demand_source_type_id in (inv_reservation_global.g_source_type_oe,
8700: inv_reservation_global.g_source_type_internal_ord,
8701: inv_reservation_global.g_source_type_rma)) THEN
8702:
8703: IF NOT

Line 8700: inv_reservation_global.g_source_type_internal_ord,

8696: END IF;
8697:
8698:
8699: IF (l_rsv_rec.demand_source_type_id in (inv_reservation_global.g_source_type_oe,
8700: inv_reservation_global.g_source_type_internal_ord,
8701: inv_reservation_global.g_source_type_rma)) THEN
8702:
8703: IF NOT
8704: (lot_divisible

Line 8701: inv_reservation_global.g_source_type_rma)) THEN

8697:
8698:
8699: IF (l_rsv_rec.demand_source_type_id in (inv_reservation_global.g_source_type_oe,
8700: inv_reservation_global.g_source_type_internal_ord,
8701: inv_reservation_global.g_source_type_rma)) THEN
8702:
8703: IF NOT
8704: (lot_divisible
8705: (p_inventory_item_id => l_rsv_rec.inventory_item_id,

Line 9077: IF l_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN

9073:
9074: /*** End R12 ***/
9075: --
9076: -- Post Insert CTO Validation
9077: IF l_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
9078: --
9079: cto_workflow_api_pk.wf_update_after_inv_reserv(p_order_line_id => l_rsv_rec.demand_source_line_id, x_return_status => l_return_status, x_msg_count => x_msg_count, x_msg_data => x_msg_data);
9080:
9081: IF (l_debug = 1) THEN

Line 9223: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type

9219: , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
9220: , x_return_status OUT NOCOPY VARCHAR2
9221: , x_msg_count OUT NOCOPY NUMBER
9222: , x_msg_data OUT NOCOPY VARCHAR2
9223: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
9224: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
9225: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
9226: , p_to_serial_number IN inv_reservation_global.serial_number_tbl_type
9227: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true

Line 9224: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type

9220: , x_return_status OUT NOCOPY VARCHAR2
9221: , x_msg_count OUT NOCOPY NUMBER
9222: , x_msg_data OUT NOCOPY VARCHAR2
9223: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
9224: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
9225: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
9226: , p_to_serial_number IN inv_reservation_global.serial_number_tbl_type
9227: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true
9228: , p_check_availability IN VARCHAR2 DEFAULT fnd_api.g_false

Line 9225: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type

9221: , x_msg_count OUT NOCOPY NUMBER
9222: , x_msg_data OUT NOCOPY VARCHAR2
9223: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
9224: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
9225: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
9226: , p_to_serial_number IN inv_reservation_global.serial_number_tbl_type
9227: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true
9228: , p_check_availability IN VARCHAR2 DEFAULT fnd_api.g_false
9229: , p_over_reservation_flag IN NUMBER DEFAULT 0

Line 9226: , p_to_serial_number IN inv_reservation_global.serial_number_tbl_type

9222: , x_msg_data OUT NOCOPY VARCHAR2
9223: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
9224: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
9225: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
9226: , p_to_serial_number IN inv_reservation_global.serial_number_tbl_type
9227: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true
9228: , p_check_availability IN VARCHAR2 DEFAULT fnd_api.g_false
9229: , p_over_reservation_flag IN NUMBER DEFAULT 0
9230: ) IS

Line 9367: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type

9363: , x_msg_count OUT NOCOPY NUMBER
9364: , x_msg_data OUT NOCOPY VARCHAR2
9365: , x_quantity_reserved OUT NOCOPY NUMBER
9366: , x_secondary_quantity_reserved OUT NOCOPY NUMBER
9367: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
9368: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
9369: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
9370: , p_to_serial_number IN inv_reservation_global.serial_number_tbl_type
9371: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true

Line 9368: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type

9364: , x_msg_data OUT NOCOPY VARCHAR2
9365: , x_quantity_reserved OUT NOCOPY NUMBER
9366: , x_secondary_quantity_reserved OUT NOCOPY NUMBER
9367: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
9368: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
9369: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
9370: , p_to_serial_number IN inv_reservation_global.serial_number_tbl_type
9371: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true
9372: , p_partial_reservation_flag IN VARCHAR2 DEFAULT fnd_api.g_false

Line 9369: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type

9365: , x_quantity_reserved OUT NOCOPY NUMBER
9366: , x_secondary_quantity_reserved OUT NOCOPY NUMBER
9367: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
9368: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
9369: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
9370: , p_to_serial_number IN inv_reservation_global.serial_number_tbl_type
9371: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true
9372: , p_partial_reservation_flag IN VARCHAR2 DEFAULT fnd_api.g_false
9373: , p_check_availability IN VARCHAR2 DEFAULT fnd_api.g_false

Line 9370: , p_to_serial_number IN inv_reservation_global.serial_number_tbl_type

9366: , x_secondary_quantity_reserved OUT NOCOPY NUMBER
9367: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
9368: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
9369: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
9370: , p_to_serial_number IN inv_reservation_global.serial_number_tbl_type
9371: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true
9372: , p_partial_reservation_flag IN VARCHAR2 DEFAULT fnd_api.g_false
9373: , p_check_availability IN VARCHAR2 DEFAULT fnd_api.g_false
9374: , p_over_reservation_flag IN NUMBER DEFAULT 0

Line 9381: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

9377: l_api_name CONSTANT VARCHAR2(30) := 'Update_Reservation';
9378: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
9379: l_miss_num NUMBER := fnd_api.g_miss_num;
9380: l_miss_char VARCHAR2(1) := fnd_api.g_miss_char;
9381: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
9382: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
9383: l_orig_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
9384: l_orig_rsv_tbl_count NUMBER;
9385: l_to_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;

Line 9382: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

9378: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
9379: l_miss_num NUMBER := fnd_api.g_miss_num;
9380: l_miss_char VARCHAR2(1) := fnd_api.g_miss_char;
9381: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
9382: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
9383: l_orig_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
9384: l_orig_rsv_tbl_count NUMBER;
9385: l_to_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
9386: --

Line 9383: l_orig_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;

9379: l_miss_num NUMBER := fnd_api.g_miss_num;
9380: l_miss_char VARCHAR2(1) := fnd_api.g_miss_char;
9381: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
9382: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
9383: l_orig_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
9384: l_orig_rsv_tbl_count NUMBER;
9385: l_to_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
9386: --
9387: l_to_rsv_tbl_count NUMBER;

Line 9385: l_to_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;

9381: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
9382: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
9383: l_orig_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
9384: l_orig_rsv_tbl_count NUMBER;
9385: l_to_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
9386: --
9387: l_to_rsv_tbl_count NUMBER;
9388: l_tree_id1 INTEGER;
9389: l_tree_id2 INTEGER;

Line 9416: l_original_serial_number inv_reservation_global.serial_number_tbl_type;

9412: l_lot_divisible_flag VARCHAR2(1) := 'Y' ; -- INVCONV
9413: l_dual_control_flag VARCHAR2(1) := 'N' ;
9414: -- INVCONV
9415: /**** {{ R12 Enhanced reservations code changes }}****/
9416: l_original_serial_number inv_reservation_global.serial_number_tbl_type;
9417: l_to_serial_number inv_reservation_global.serial_number_tbl_type;
9418: l_qty_available NUMBER := 0;
9419: l_serial_number_table inv_reservation_global.serial_number_tbl_type;
9420: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;

Line 9417: l_to_serial_number inv_reservation_global.serial_number_tbl_type;

9413: l_dual_control_flag VARCHAR2(1) := 'N' ;
9414: -- INVCONV
9415: /**** {{ R12 Enhanced reservations code changes }}****/
9416: l_original_serial_number inv_reservation_global.serial_number_tbl_type;
9417: l_to_serial_number inv_reservation_global.serial_number_tbl_type;
9418: l_qty_available NUMBER := 0;
9419: l_serial_number_table inv_reservation_global.serial_number_tbl_type;
9420: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;
9421: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

Line 9419: l_serial_number_table inv_reservation_global.serial_number_tbl_type;

9415: /**** {{ R12 Enhanced reservations code changes }}****/
9416: l_original_serial_number inv_reservation_global.serial_number_tbl_type;
9417: l_to_serial_number inv_reservation_global.serial_number_tbl_type;
9418: l_qty_available NUMBER := 0;
9419: l_serial_number_table inv_reservation_global.serial_number_tbl_type;
9420: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;
9421: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
9422: l_serials_tobe_unreserved NUMBER;
9423: l_total_serials_reserved NUMBER;

Line 9420: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;

9416: l_original_serial_number inv_reservation_global.serial_number_tbl_type;
9417: l_to_serial_number inv_reservation_global.serial_number_tbl_type;
9418: l_qty_available NUMBER := 0;
9419: l_serial_number_table inv_reservation_global.serial_number_tbl_type;
9420: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;
9421: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
9422: l_serials_tobe_unreserved NUMBER;
9423: l_total_serials_reserved NUMBER;
9424: l_reservation_id NUMBER;

Line 9421: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

9417: l_to_serial_number inv_reservation_global.serial_number_tbl_type;
9418: l_qty_available NUMBER := 0;
9419: l_serial_number_table inv_reservation_global.serial_number_tbl_type;
9420: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;
9421: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
9422: l_serials_tobe_unreserved NUMBER;
9423: l_total_serials_reserved NUMBER;
9424: l_reservation_id NUMBER;
9425: l_original_serial_count NUMBER;

Line 9641: inv_reservation_global.g_source_type_asn) THEN

9637: -- the line level. Also, for ASN, pass the source type as PO so that the
9638: -- the lock name would be the same as the PO's
9639:
9640: IF (l_to_rsv_rec.supply_source_type_id =
9641: inv_reservation_global.g_source_type_asn) THEN
9642: l_supply_source_type_id :=
9643: inv_reservation_global.g_source_type_po;
9644: ELSE
9645: l_supply_source_type_id := l_to_rsv_rec.supply_source_type_id;

Line 9643: inv_reservation_global.g_source_type_po;

9639:
9640: IF (l_to_rsv_rec.supply_source_type_id =
9641: inv_reservation_global.g_source_type_asn) THEN
9642: l_supply_source_type_id :=
9643: inv_reservation_global.g_source_type_po;
9644: ELSE
9645: l_supply_source_type_id := l_to_rsv_rec.supply_source_type_id;
9646: END IF;
9647:

Line 9648: IF (l_to_rsv_rec.supply_source_type_id <> inv_reservation_global.g_source_type_inv) THEN

9644: ELSE
9645: l_supply_source_type_id := l_to_rsv_rec.supply_source_type_id;
9646: END IF;
9647:
9648: IF (l_to_rsv_rec.supply_source_type_id <> inv_reservation_global.g_source_type_inv) THEN
9649: inv_reservation_lock_pvt.lock_supply_demand_record
9650: (p_organization_id => l_to_rsv_rec.organization_id
9651: ,p_inventory_item_id => l_to_rsv_rec.inventory_item_id
9652: ,p_source_type_id => l_supply_source_type_id

Line 9830: (inv_reservation_global.g_source_type_oe,

9826: END IF;
9827: END;
9828:
9829: IF (l_to_rsv_rec.demand_source_type_id IN
9830: (inv_reservation_global.g_source_type_oe,
9831: inv_reservation_global.g_source_type_internal_ord,
9832: inv_reservation_global.g_source_type_rma)) AND
9833: (l_pjm_enabled = 1) THEN
9834:

Line 9831: inv_reservation_global.g_source_type_internal_ord,

9827: END;
9828:
9829: IF (l_to_rsv_rec.demand_source_type_id IN
9830: (inv_reservation_global.g_source_type_oe,
9831: inv_reservation_global.g_source_type_internal_ord,
9832: inv_reservation_global.g_source_type_rma)) AND
9833: (l_pjm_enabled = 1) THEN
9834:
9835: IF (l_to_rsv_rec.demand_source_line_id IS NOT NULL) AND

Line 9832: inv_reservation_global.g_source_type_rma)) AND

9828:
9829: IF (l_to_rsv_rec.demand_source_type_id IN
9830: (inv_reservation_global.g_source_type_oe,
9831: inv_reservation_global.g_source_type_internal_ord,
9832: inv_reservation_global.g_source_type_rma)) AND
9833: (l_pjm_enabled = 1) THEN
9834:
9835: IF (l_to_rsv_rec.demand_source_line_id IS NOT NULL) AND
9836: (l_to_rsv_rec.demand_source_line_id <> fnd_api.g_miss_num)

Line 9965: (p_validation_flag = 'Q')) AND l_to_rsv_rec.supply_source_type_id = inv_reservation_global.g_source_type_inv)

9961: -- Pick Releaser Performance - Added validation_flag = 'Q' to distinguish
9962: -- between validation above and the qty tree processing below.
9963: /**** {{ R12 Enhanced reservations code changes }}****/
9964: IF (((p_validation_flag = fnd_api.g_true) OR (p_validation_flag = 'T') OR
9965: (p_validation_flag = 'Q')) AND l_to_rsv_rec.supply_source_type_id = inv_reservation_global.g_source_type_inv)
9966: THEN
9967: /*** End R12 ***/
9968:
9969: inv_quantity_tree_pvt.create_tree

Line 10154: (inv_reservation_global.g_source_type_wip, inv_reservation_global.g_source_type_po,

10150:
10151:
10152: /**** {{ R12 Enhanced reservations code changes }}****/
10153: ELSIF (l_to_rsv_rec.supply_source_type_id IN
10154: (inv_reservation_global.g_source_type_wip, inv_reservation_global.g_source_type_po,
10155: inv_reservation_global.g_source_type_asn,
10156: inv_reservation_global.g_source_type_intransit,
10157: inv_reservation_global.g_source_type_internal_req,
10158: inv_reservation_global.g_source_type_rcv)) AND

Line 10155: inv_reservation_global.g_source_type_asn,

10151:
10152: /**** {{ R12 Enhanced reservations code changes }}****/
10153: ELSIF (l_to_rsv_rec.supply_source_type_id IN
10154: (inv_reservation_global.g_source_type_wip, inv_reservation_global.g_source_type_po,
10155: inv_reservation_global.g_source_type_asn,
10156: inv_reservation_global.g_source_type_intransit,
10157: inv_reservation_global.g_source_type_internal_req,
10158: inv_reservation_global.g_source_type_rcv)) AND
10159: p_over_reservation_flag NOT IN (1,3) THEN

Line 10156: inv_reservation_global.g_source_type_intransit,

10152: /**** {{ R12 Enhanced reservations code changes }}****/
10153: ELSIF (l_to_rsv_rec.supply_source_type_id IN
10154: (inv_reservation_global.g_source_type_wip, inv_reservation_global.g_source_type_po,
10155: inv_reservation_global.g_source_type_asn,
10156: inv_reservation_global.g_source_type_intransit,
10157: inv_reservation_global.g_source_type_internal_req,
10158: inv_reservation_global.g_source_type_rcv)) AND
10159: p_over_reservation_flag NOT IN (1,3) THEN
10160: -- call the helper procedure to get the reservable qty of the supply

Line 10157: inv_reservation_global.g_source_type_internal_req,

10153: ELSIF (l_to_rsv_rec.supply_source_type_id IN
10154: (inv_reservation_global.g_source_type_wip, inv_reservation_global.g_source_type_po,
10155: inv_reservation_global.g_source_type_asn,
10156: inv_reservation_global.g_source_type_intransit,
10157: inv_reservation_global.g_source_type_internal_req,
10158: inv_reservation_global.g_source_type_rcv)) AND
10159: p_over_reservation_flag NOT IN (1,3) THEN
10160: -- call the helper procedure to get the reservable qty of the supply
10161: -- Bug 5199672: Should pass g_miss_num as default for supply

Line 10158: inv_reservation_global.g_source_type_rcv)) AND

10154: (inv_reservation_global.g_source_type_wip, inv_reservation_global.g_source_type_po,
10155: inv_reservation_global.g_source_type_asn,
10156: inv_reservation_global.g_source_type_intransit,
10157: inv_reservation_global.g_source_type_internal_req,
10158: inv_reservation_global.g_source_type_rcv)) AND
10159: p_over_reservation_flag NOT IN (1,3) THEN
10160: -- call the helper procedure to get the reservable qty of the supply
10161: -- Bug 5199672: Should pass g_miss_num as default for supply
10162: -- source line detail. Otherwise, high level reservations

Line 10258: (inv_reservation_global.g_source_type_oe,

10254: debug_print('demand_source_line_detail = ' || l_to_rsv_rec.demand_source_line_detail);
10255: END IF;
10256:
10257: IF (l_to_rsv_rec.demand_source_type_id IN
10258: (inv_reservation_global.g_source_type_oe,
10259: inv_reservation_global.g_source_type_internal_ord,inv_reservation_global.g_source_type_rma)) THEN
10260: BEGIN
10261: SELECT open_flag, booked_flag
10262: INTO l_open_flag,

Line 10259: inv_reservation_global.g_source_type_internal_ord,inv_reservation_global.g_source_type_rma)) THEN

10255: END IF;
10256:
10257: IF (l_to_rsv_rec.demand_source_type_id IN
10258: (inv_reservation_global.g_source_type_oe,
10259: inv_reservation_global.g_source_type_internal_ord,inv_reservation_global.g_source_type_rma)) THEN
10260: BEGIN
10261: SELECT open_flag, booked_flag
10262: INTO l_open_flag,
10263: l_booked_flag

Line 10279: (inv_reservation_global.g_source_type_oe,

10275: debug_print('booked flag :' || l_booked_flag);
10276: END IF;
10277:
10278: IF (((l_to_rsv_rec.demand_source_type_id IN
10279: (inv_reservation_global.g_source_type_oe,
10280: inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma)) AND
10281:
10282: (NOT((Nvl(l_orig_rsv_tbl(1).demand_source_type_id,-99) = Nvl(l_to_rsv_rec.demand_source_type_id,-99)) AND
10283: (Nvl(l_orig_rsv_tbl(1).demand_source_header_id,-99) = Nvl(l_to_rsv_rec.demand_source_header_id,-99)) AND

Line 10280: inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma)) AND

10276: END IF;
10277:
10278: IF (((l_to_rsv_rec.demand_source_type_id IN
10279: (inv_reservation_global.g_source_type_oe,
10280: inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma)) AND
10281:
10282: (NOT((Nvl(l_orig_rsv_tbl(1).demand_source_type_id,-99) = Nvl(l_to_rsv_rec.demand_source_type_id,-99)) AND
10283: (Nvl(l_orig_rsv_tbl(1).demand_source_header_id,-99) = Nvl(l_to_rsv_rec.demand_source_header_id,-99)) AND
10284: (Nvl(l_orig_rsv_tbl(1).demand_source_line_id,-99) = Nvl(l_to_rsv_rec.demand_source_line_id,-99)) AND

Line 10287: inv_reservation_global.g_source_type_wip)) AND

10283: (Nvl(l_orig_rsv_tbl(1).demand_source_header_id,-99) = Nvl(l_to_rsv_rec.demand_source_header_id,-99)) AND
10284: (Nvl(l_orig_rsv_tbl(1).demand_source_line_id,-99) = Nvl(l_to_rsv_rec.demand_source_line_id,-99)) AND
10285: nvl(l_open_flag, 'N') = 'N'))) OR
10286: (l_to_rsv_rec.demand_source_type_id =
10287: inv_reservation_global.g_source_type_wip)) AND
10288: p_over_reservation_flag NOT IN (2,3) THEN
10289:
10290: -- call the helper procedure to get the reservable qty of the demand
10291: IF (l_debug = 1) THEN

Line 10356: IF l_to_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN

10352: /*** End R12 ***/
10353:
10354: --
10355: -- Pre Update CTO Validation
10356: IF l_to_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
10357: --
10358: IF (l_debug = 1) THEN
10359: debug_print('Pre Update CTO validation');
10360: END IF;

Line 10913: IF l_to_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN

10909: END IF;
10910:
10911: --
10912: -- Post Update CTO Validation
10913: IF l_to_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
10914: --
10915: IF l_orig_rsv_tbl(1).primary_reservation_quantity > l_to_rsv_rec.primary_reservation_quantity THEN
10916: IF (l_debug = 1) THEN
10917: debug_print('Calling cto_workflow_api_pk.wf_update_after_inv_unreserv');

Line 11032: , p_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type

11028: , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
11029: , x_return_status OUT NOCOPY VARCHAR2
11030: , x_msg_count OUT NOCOPY NUMBER
11031: , x_msg_data OUT NOCOPY VARCHAR2
11032: , p_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
11033: , p_primary_relieved_quantity IN NUMBER
11034: , p_secondary_relieved_quantity IN NUMBER -- INVCONV
11035: , p_relieve_all IN VARCHAR2 DEFAULT fnd_api.g_true
11036: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type

Line 11036: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type

11032: , p_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
11033: , p_primary_relieved_quantity IN NUMBER
11034: , p_secondary_relieved_quantity IN NUMBER -- INVCONV
11035: , p_relieve_all IN VARCHAR2 DEFAULT fnd_api.g_true
11036: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
11037: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true
11038: , x_primary_relieved_quantity OUT NOCOPY NUMBER
11039: , x_secondary_relieved_quantity OUT NOCOPY NUMBER -- INVCONV
11040: , x_primary_remain_quantity OUT NOCOPY NUMBER

Line 11046: l_tmp_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;

11042: ) IS
11043: l_api_version_number CONSTANT NUMBER := 1.0;
11044: l_api_name CONSTANT VARCHAR2(30) := 'Relieve_Reservation';
11045: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
11046: l_tmp_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
11047: l_tmp_rsv_tbl_count NUMBER;
11048: l_reservation_id NUMBER;
11049: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
11050: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;

Line 11049: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

11045: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
11046: l_tmp_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
11047: l_tmp_rsv_tbl_count NUMBER;
11048: l_reservation_id NUMBER;
11049: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
11050: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;
11051: --
11052: l_orig_item_cache_index INTEGER := NULL;
11053: l_orig_org_cache_index INTEGER := NULL;

Line 11050: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;

11046: l_tmp_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
11047: l_tmp_rsv_tbl_count NUMBER;
11048: l_reservation_id NUMBER;
11049: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
11050: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;
11051: --
11052: l_orig_item_cache_index INTEGER := NULL;
11053: l_orig_org_cache_index INTEGER := NULL;
11054: l_orig_demand_cache_index INTEGER := NULL;

Line 11082: l_serial_number_table inv_reservation_global.serial_number_tbl_type;

11078: l_dual_control_flag VARCHAR2(1) := 'N'; -- INVCONV
11079: /*** {{ R12 Enhanced reservations code changes ***/
11080: l_count NUMBER;
11081: l_count_to_unrsv_serials NUMBER :=0;
11082: l_serial_number_table inv_reservation_global.serial_number_tbl_type;
11083: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
11084: /*** End R12 }} ***/
11085: BEGIN
11086: -- Standard call to check for call compatibility

Line 11083: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

11079: /*** {{ R12 Enhanced reservations code changes ***/
11080: l_count NUMBER;
11081: l_count_to_unrsv_serials NUMBER :=0;
11082: l_serial_number_table inv_reservation_global.serial_number_tbl_type;
11083: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
11084: /*** End R12 }} ***/
11085: BEGIN
11086: -- Standard call to check for call compatibility
11087: IF NOT fnd_api.compatible_api_call(l_api_version_number, p_api_version_number, l_api_name, g_pkg_name) THEN

Line 11315: IF l_tmp_rsv_tbl(1).supply_source_type_id = inv_reservation_global.g_source_type_inv THEN

11311: END IF;
11312: -- INVCONV END
11313: END IF;
11314:
11315: IF l_tmp_rsv_tbl(1).supply_source_type_id = inv_reservation_global.g_source_type_inv THEN
11316: -- call quantity processor to
11317: -- modify the tree so that the quantity tree
11318: -- reflect the deletion
11319: IF (l_debug = 1) THEN

Line 11825: , p_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type

11821: , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
11822: , x_return_status OUT NOCOPY VARCHAR2
11823: , x_msg_count OUT NOCOPY NUMBER
11824: , x_msg_data OUT NOCOPY VARCHAR2
11825: , p_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
11826: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
11827: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true
11828: ) IS
11829: l_api_version_number CONSTANT NUMBER := 1.0;

Line 11826: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type

11822: , x_return_status OUT NOCOPY VARCHAR2
11823: , x_msg_count OUT NOCOPY NUMBER
11824: , x_msg_data OUT NOCOPY VARCHAR2
11825: , p_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
11826: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
11827: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true
11828: ) IS
11829: l_api_version_number CONSTANT NUMBER := 1.0;
11830: l_api_name CONSTANT VARCHAR2(30) := 'Delete_Reservation';

Line 11832: l_tmp_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;

11828: ) IS
11829: l_api_version_number CONSTANT NUMBER := 1.0;
11830: l_api_name CONSTANT VARCHAR2(30) := 'Delete_Reservation';
11831: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
11832: l_tmp_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
11833: l_tmp_rsv_tbl_count NUMBER;
11834: l_reservation_id NUMBER;
11835: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
11836: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;

Line 11835: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

11831: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
11832: l_tmp_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
11833: l_tmp_rsv_tbl_count NUMBER;
11834: l_reservation_id NUMBER;
11835: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
11836: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;
11837: --
11838: l_orig_item_cache_index INTEGER := NULL;
11839: l_orig_org_cache_index INTEGER := NULL;

Line 11836: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;

11832: l_tmp_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
11833: l_tmp_rsv_tbl_count NUMBER;
11834: l_reservation_id NUMBER;
11835: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
11836: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;
11837: --
11838: l_orig_item_cache_index INTEGER := NULL;
11839: l_orig_org_cache_index INTEGER := NULL;
11840: l_orig_demand_cache_index INTEGER := NULL;

Line 11856: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

11852: l_debug number;
11853: l_lot_divisible_flag VARCHAR2(1) :='Y'; -- INVCONV
11854:
11855: /*** {{ R12 Enhanced reservations code changes ***/
11856: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
11857: /*** End R12 }} ***/
11858: BEGIN
11859: -- Use cache to get value for l_debug
11860: IF g_is_pickrelease_set IS NULL THEN

Line 11995: IF l_tmp_rsv_tbl(1).supply_source_type_id = inv_reservation_global.g_source_type_inv

11991: END IF;
11992: -- INVCONV END
11993:
11994: -- Bug 2354735: Proceed with Trees only if p_validation_flag = 'T'
11995: IF l_tmp_rsv_tbl(1).supply_source_type_id = inv_reservation_global.g_source_type_inv
11996: AND p_validation_flag = fnd_api.g_true THEN
11997: -- call quantity processor to
11998: -- modify the tree so that the quantity tree
11999: -- reflect the deletion

Line 12075: IF l_tmp_rsv_tbl(1).demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN

12071: END IF;
12072:
12073:
12074: -- Pre Delete CTO Validation
12075: IF l_tmp_rsv_tbl(1).demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
12076: --
12077: cto_workflow_api_pk.inventory_unreservation_check(
12078: p_order_line_id => l_tmp_rsv_tbl(1).demand_source_line_id
12079: , p_rsv_quantity => l_tmp_rsv_tbl(1).primary_reservation_quantity

Line 12138: IF l_tmp_rsv_tbl(1).demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN

12134: -- delete the reservation from the db table
12135: mtl_reservations_pkg.delete_row(x_reservation_id => l_reservation_id);
12136:
12137: -- Post Delete CTO Validation
12138: IF l_tmp_rsv_tbl(1).demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
12139: --
12140: cto_workflow_api_pk.wf_update_after_inv_unreserv(
12141: p_order_line_id => l_tmp_rsv_tbl(1).demand_source_line_id
12142: , x_return_status => l_return_status

Line 12197: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type

12193: , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
12194: , x_return_status OUT NOCOPY VARCHAR2
12195: , x_msg_count OUT NOCOPY NUMBER
12196: , x_msg_data OUT NOCOPY VARCHAR2
12197: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
12198: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
12199: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
12200: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true
12201: , p_over_reservation_flag IN NUMBER DEFAULT 0

Line 12198: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type

12194: , x_return_status OUT NOCOPY VARCHAR2
12195: , x_msg_count OUT NOCOPY NUMBER
12196: , x_msg_data OUT NOCOPY VARCHAR2
12197: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
12198: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
12199: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
12200: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true
12201: , p_over_reservation_flag IN NUMBER DEFAULT 0
12202: , x_reservation_id OUT NOCOPY NUMBER

Line 12199: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type

12195: , x_msg_count OUT NOCOPY NUMBER
12196: , x_msg_data OUT NOCOPY VARCHAR2
12197: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
12198: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
12199: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
12200: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true
12201: , p_over_reservation_flag IN NUMBER DEFAULT 0
12202: , x_reservation_id OUT NOCOPY NUMBER
12203: ) IS

Line 12211: l_dummy_serial_number inv_reservation_global.serial_number_tbl_type;

12207: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
12208: l_quantity_reserved NUMBER;
12209: l_secondary_quantity_reserved NUMBER; -- INVCONV
12210: l_debug NUMBER;
12211: l_dummy_serial_number inv_reservation_global.serial_number_tbl_type;
12212: l_reservation_id NUMBER;
12213:
12214: BEGIN
12215: -- Standard call to check for call compatibility

Line 12338: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type

12334: , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
12335: , x_return_status OUT NOCOPY VARCHAR2
12336: , x_msg_count OUT NOCOPY NUMBER
12337: , x_msg_data OUT NOCOPY VARCHAR2
12338: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
12339: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
12340: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
12341: /**** {{ R12 Enhanced reservations code changes }}****/
12342: , p_to_serial_number IN inv_reservation_global.serial_number_tbl_type

Line 12339: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type

12335: , x_return_status OUT NOCOPY VARCHAR2
12336: , x_msg_count OUT NOCOPY NUMBER
12337: , x_msg_data OUT NOCOPY VARCHAR2
12338: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
12339: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
12340: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
12341: /**** {{ R12 Enhanced reservations code changes }}****/
12342: , p_to_serial_number IN inv_reservation_global.serial_number_tbl_type
12343: /*** End R12 ***/

Line 12340: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type

12336: , x_msg_count OUT NOCOPY NUMBER
12337: , x_msg_data OUT NOCOPY VARCHAR2
12338: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
12339: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
12340: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
12341: /**** {{ R12 Enhanced reservations code changes }}****/
12342: , p_to_serial_number IN inv_reservation_global.serial_number_tbl_type
12343: /*** End R12 ***/
12344: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true

Line 12342: , p_to_serial_number IN inv_reservation_global.serial_number_tbl_type

12338: , p_original_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
12339: , p_to_rsv_rec IN inv_reservation_global.mtl_reservation_rec_type
12340: , p_original_serial_number IN inv_reservation_global.serial_number_tbl_type
12341: /**** {{ R12 Enhanced reservations code changes }}****/
12342: , p_to_serial_number IN inv_reservation_global.serial_number_tbl_type
12343: /*** End R12 ***/
12344: , p_validation_flag IN VARCHAR2 DEFAULT fnd_api.g_true
12345: , p_over_reservation_flag IN NUMBER DEFAULT 0
12346: , x_reservation_id OUT NOCOPY NUMBER

Line 12351: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

12347: ) IS
12348: l_api_version_number CONSTANT NUMBER := 1.0;
12349: l_api_name CONSTANT VARCHAR2(30) := 'Transfer_Reservation';
12350: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
12351: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
12352: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
12353: l_orig_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
12354: l_orig_rsv_tbl_count NUMBER;
12355: l_to_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;

Line 12352: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

12348: l_api_version_number CONSTANT NUMBER := 1.0;
12349: l_api_name CONSTANT VARCHAR2(30) := 'Transfer_Reservation';
12350: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
12351: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
12352: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
12353: l_orig_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
12354: l_orig_rsv_tbl_count NUMBER;
12355: l_to_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
12356: --

Line 12353: l_orig_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;

12349: l_api_name CONSTANT VARCHAR2(30) := 'Transfer_Reservation';
12350: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
12351: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
12352: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
12353: l_orig_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
12354: l_orig_rsv_tbl_count NUMBER;
12355: l_to_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
12356: --
12357: l_to_rsv_tbl_count NUMBER;

Line 12355: l_to_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;

12351: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
12352: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
12353: l_orig_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
12354: l_orig_rsv_tbl_count NUMBER;
12355: l_to_rsv_tbl inv_reservation_global.mtl_reservation_tbl_type;
12356: --
12357: l_to_rsv_tbl_count NUMBER;
12358: l_transfer_all BOOLEAN;
12359: l_to_row_exist BOOLEAN;

Line 12401: l_original_serial_number inv_reservation_global.serial_number_tbl_type;

12397: l_lot_divisible_flag VARCHAR2(1) :='Y'; -- INVCONV
12398: l_dual_tracking BOOLEAN := FALSE; -- INVCONV
12399:
12400: /**** {{ R12 Enhanced reservations code changes }}****/
12401: l_original_serial_number inv_reservation_global.serial_number_tbl_type;
12402: l_to_serial_number inv_reservation_global.serial_number_tbl_type;
12403: l_serial_number_table inv_reservation_global.serial_number_tbl_type;
12404: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
12405: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;

Line 12402: l_to_serial_number inv_reservation_global.serial_number_tbl_type;

12398: l_dual_tracking BOOLEAN := FALSE; -- INVCONV
12399:
12400: /**** {{ R12 Enhanced reservations code changes }}****/
12401: l_original_serial_number inv_reservation_global.serial_number_tbl_type;
12402: l_to_serial_number inv_reservation_global.serial_number_tbl_type;
12403: l_serial_number_table inv_reservation_global.serial_number_tbl_type;
12404: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
12405: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;
12406: l_qty_available NUMBER := 0;

Line 12403: l_serial_number_table inv_reservation_global.serial_number_tbl_type;

12399:
12400: /**** {{ R12 Enhanced reservations code changes }}****/
12401: l_original_serial_number inv_reservation_global.serial_number_tbl_type;
12402: l_to_serial_number inv_reservation_global.serial_number_tbl_type;
12403: l_serial_number_table inv_reservation_global.serial_number_tbl_type;
12404: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
12405: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;
12406: l_qty_available NUMBER := 0;
12407: l_original_serial_count NUMBER;

Line 12404: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

12400: /**** {{ R12 Enhanced reservations code changes }}****/
12401: l_original_serial_number inv_reservation_global.serial_number_tbl_type;
12402: l_to_serial_number inv_reservation_global.serial_number_tbl_type;
12403: l_serial_number_table inv_reservation_global.serial_number_tbl_type;
12404: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
12405: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;
12406: l_qty_available NUMBER := 0;
12407: l_original_serial_count NUMBER;
12408: l_to_serial_count NUMBER;

Line 12405: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;

12401: l_original_serial_number inv_reservation_global.serial_number_tbl_type;
12402: l_to_serial_number inv_reservation_global.serial_number_tbl_type;
12403: l_serial_number_table inv_reservation_global.serial_number_tbl_type;
12404: l_dummy_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
12405: l_dummy_serial_array inv_reservation_global.serial_number_tbl_type;
12406: l_qty_available NUMBER := 0;
12407: l_original_serial_count NUMBER;
12408: l_to_serial_count NUMBER;
12409: l_serial_param NUMBER;

Line 12415: l_validate_serial_number_table inv_reservation_global.serial_number_tbl_type;

12411: l_total_serials_reserved NUMBER;
12412: l_total_to_serials_reserved NUMBER;
12413: l_from_reservation_id NUMBER;
12414: l_validate_serials_reserved NUMBER;
12415: l_validate_serial_number_table inv_reservation_global.serial_number_tbl_type;
12416: l_serials_unreserved NUMBER;
12417: l_to_reservation_id NUMBER;
12418: l_total_from_serials_reserved NUMBER;
12419: l_from_primary_reservation_qty NUMBER;

Line 12689: inv_reservation_global.g_source_type_asn) THEN

12685: -- the line level. Also, for ASN, pass the source type as PO so that the
12686: -- the lock name would be the same as the PO's
12687:
12688: IF (l_to_rsv_rec.supply_source_type_id =
12689: inv_reservation_global.g_source_type_asn) THEN
12690: l_supply_source_type_id :=
12691: inv_reservation_global.g_source_type_po;
12692: ELSE
12693: l_supply_source_type_id := l_to_rsv_rec.supply_source_type_id;

Line 12691: inv_reservation_global.g_source_type_po;

12687:
12688: IF (l_to_rsv_rec.supply_source_type_id =
12689: inv_reservation_global.g_source_type_asn) THEN
12690: l_supply_source_type_id :=
12691: inv_reservation_global.g_source_type_po;
12692: ELSE
12693: l_supply_source_type_id := l_to_rsv_rec.supply_source_type_id;
12694: END IF;
12695:

Line 12696: IF (l_to_rsv_rec.supply_source_type_id <> inv_reservation_global.g_source_type_inv) THEN

12692: ELSE
12693: l_supply_source_type_id := l_to_rsv_rec.supply_source_type_id;
12694: END IF;
12695:
12696: IF (l_to_rsv_rec.supply_source_type_id <> inv_reservation_global.g_source_type_inv) THEN
12697: inv_reservation_lock_pvt.lock_supply_demand_record
12698: (p_organization_id => l_to_rsv_rec.organization_id
12699: ,p_inventory_item_id => l_to_rsv_rec.inventory_item_id
12700: ,p_source_type_id => l_supply_source_type_id

Line 12766: (inv_reservation_global.g_source_type_oe,

12762: END IF;
12763: END;
12764: END IF;
12765: IF (l_to_rsv_rec.demand_source_type_id IN
12766: (inv_reservation_global.g_source_type_oe,
12767: inv_reservation_global.g_source_type_internal_ord,
12768: inv_reservation_global.g_source_type_rma)) AND
12769: (l_pjm_enabled = 1) THEN
12770:

Line 12767: inv_reservation_global.g_source_type_internal_ord,

12763: END;
12764: END IF;
12765: IF (l_to_rsv_rec.demand_source_type_id IN
12766: (inv_reservation_global.g_source_type_oe,
12767: inv_reservation_global.g_source_type_internal_ord,
12768: inv_reservation_global.g_source_type_rma)) AND
12769: (l_pjm_enabled = 1) THEN
12770:
12771: IF (l_to_rsv_rec.demand_source_line_id IS NOT NULL) AND

Line 12768: inv_reservation_global.g_source_type_rma)) AND

12764: END IF;
12765: IF (l_to_rsv_rec.demand_source_type_id IN
12766: (inv_reservation_global.g_source_type_oe,
12767: inv_reservation_global.g_source_type_internal_ord,
12768: inv_reservation_global.g_source_type_rma)) AND
12769: (l_pjm_enabled = 1) THEN
12770:
12771: IF (l_to_rsv_rec.demand_source_line_id IS NOT NULL) AND
12772: (l_to_rsv_rec.demand_source_line_id <> fnd_api.g_miss_num)

Line 12916: (l_to_rsv_rec.supply_source_type_id = inv_reservation_global.g_source_type_inv) THEN

12912: /**** {{ R12 Enhanced reservations code changes }}****/
12913: END IF;
12914:
12915: IF p_validation_flag = fnd_api.g_true AND
12916: (l_to_rsv_rec.supply_source_type_id = inv_reservation_global.g_source_type_inv) THEN
12917:
12918: /*** End R12 ***/
12919: -- INVCONV BEGIN
12920: IF NOT is_lot_divisible(l_orig_item_cache_index) THEN

Line 13046: (inv_reservation_global.g_source_type_wip, inv_reservation_global.g_source_type_po,

13042: END IF;
13043:
13044: /**** {{ R12 Enhanced reservations code changes }}****/
13045: ELSIF (l_to_rsv_rec.supply_source_type_id IN
13046: (inv_reservation_global.g_source_type_wip, inv_reservation_global.g_source_type_po,
13047: inv_reservation_global.g_source_type_asn,
13048: inv_reservation_global.g_source_type_intransit,
13049: inv_reservation_global.g_source_type_internal_req,
13050: inv_reservation_global.g_source_type_rcv)) AND

Line 13047: inv_reservation_global.g_source_type_asn,

13043:
13044: /**** {{ R12 Enhanced reservations code changes }}****/
13045: ELSIF (l_to_rsv_rec.supply_source_type_id IN
13046: (inv_reservation_global.g_source_type_wip, inv_reservation_global.g_source_type_po,
13047: inv_reservation_global.g_source_type_asn,
13048: inv_reservation_global.g_source_type_intransit,
13049: inv_reservation_global.g_source_type_internal_req,
13050: inv_reservation_global.g_source_type_rcv)) AND
13051: p_over_reservation_flag NOT IN (1,3) THEN

Line 13048: inv_reservation_global.g_source_type_intransit,

13044: /**** {{ R12 Enhanced reservations code changes }}****/
13045: ELSIF (l_to_rsv_rec.supply_source_type_id IN
13046: (inv_reservation_global.g_source_type_wip, inv_reservation_global.g_source_type_po,
13047: inv_reservation_global.g_source_type_asn,
13048: inv_reservation_global.g_source_type_intransit,
13049: inv_reservation_global.g_source_type_internal_req,
13050: inv_reservation_global.g_source_type_rcv)) AND
13051: p_over_reservation_flag NOT IN (1,3) THEN
13052: -- call the helper procedure to get the reservable qty of the supply

Line 13049: inv_reservation_global.g_source_type_internal_req,

13045: ELSIF (l_to_rsv_rec.supply_source_type_id IN
13046: (inv_reservation_global.g_source_type_wip, inv_reservation_global.g_source_type_po,
13047: inv_reservation_global.g_source_type_asn,
13048: inv_reservation_global.g_source_type_intransit,
13049: inv_reservation_global.g_source_type_internal_req,
13050: inv_reservation_global.g_source_type_rcv)) AND
13051: p_over_reservation_flag NOT IN (1,3) THEN
13052: -- call the helper procedure to get the reservable qty of the supply
13053: -- Bug 5199672: Should pass g_miss_num as default for supply

Line 13050: inv_reservation_global.g_source_type_rcv)) AND

13046: (inv_reservation_global.g_source_type_wip, inv_reservation_global.g_source_type_po,
13047: inv_reservation_global.g_source_type_asn,
13048: inv_reservation_global.g_source_type_intransit,
13049: inv_reservation_global.g_source_type_internal_req,
13050: inv_reservation_global.g_source_type_rcv)) AND
13051: p_over_reservation_flag NOT IN (1,3) THEN
13052: -- call the helper procedure to get the reservable qty of the supply
13053: -- Bug 5199672: Should pass g_miss_num as default for supply
13054: -- source line detail. Otherwise, high level reservations

Line 13127: (inv_reservation_global.g_source_type_wip,

13123: debug_print('demand_source_line_detail = ' || l_to_rsv_rec.demand_source_line_detail);
13124: END IF;
13125:
13126: IF (l_to_rsv_rec.demand_source_type_id IN
13127: (inv_reservation_global.g_source_type_wip,
13128: inv_reservation_global.g_source_type_oe,
13129: inv_reservation_global.g_source_type_internal_ord,
13130: inv_reservation_global.g_source_type_rma)) AND
13131: p_over_reservation_flag NOT IN (2,3) THEN

Line 13128: inv_reservation_global.g_source_type_oe,

13124: END IF;
13125:
13126: IF (l_to_rsv_rec.demand_source_type_id IN
13127: (inv_reservation_global.g_source_type_wip,
13128: inv_reservation_global.g_source_type_oe,
13129: inv_reservation_global.g_source_type_internal_ord,
13130: inv_reservation_global.g_source_type_rma)) AND
13131: p_over_reservation_flag NOT IN (2,3) THEN
13132: -- call the helper procedure to get the reservable qty of the demand

Line 13129: inv_reservation_global.g_source_type_internal_ord,

13125:
13126: IF (l_to_rsv_rec.demand_source_type_id IN
13127: (inv_reservation_global.g_source_type_wip,
13128: inv_reservation_global.g_source_type_oe,
13129: inv_reservation_global.g_source_type_internal_ord,
13130: inv_reservation_global.g_source_type_rma)) AND
13131: p_over_reservation_flag NOT IN (2,3) THEN
13132: -- call the helper procedure to get the reservable qty of the demand
13133: -- Bug 5199672: Should pass g_miss_num as default for demand

Line 13130: inv_reservation_global.g_source_type_rma)) AND

13126: IF (l_to_rsv_rec.demand_source_type_id IN
13127: (inv_reservation_global.g_source_type_wip,
13128: inv_reservation_global.g_source_type_oe,
13129: inv_reservation_global.g_source_type_internal_ord,
13130: inv_reservation_global.g_source_type_rma)) AND
13131: p_over_reservation_flag NOT IN (2,3) THEN
13132: -- call the helper procedure to get the reservable qty of the demand
13133: -- Bug 5199672: Should pass g_miss_num as default for demand
13134: -- source line detail. Otherwise, high level reservations

Line 13224: IF l_orig_rsv_tbl(1).demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN

13220: IF (l_debug = 1) THEN
13221: debug_print('Transfer all is false');
13222: END IF;
13223: -- Pre Update CTO Validation
13224: IF l_orig_rsv_tbl(1).demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
13225: --
13226: IF (l_debug = 1) THEN
13227: debug_print('Before calling cto work flow unresv check');
13228: END IF;

Line 13422: * inv_reservation_global.g_source_type_oe

13418: * No longer call the wf_update_after_inv_unreserv api from
13419: * transfer_reservation
13420: *-- Post Update CTO Validation
13421: * IF l_orig_rsv_tbl(1).demand_source_type_id in (
13422: * inv_reservation_global.g_source_type_oe
13423: * ,inv_reservation_global.g_source_type_internal_ord
13424: * ,inv_reservation_global.g_source_type_rma) THEN
13425: * --
13426: * cto_workflow_api_pk.wf_update_after_inv_unreserv(

Line 13423: * ,inv_reservation_global.g_source_type_internal_ord

13419: * transfer_reservation
13420: *-- Post Update CTO Validation
13421: * IF l_orig_rsv_tbl(1).demand_source_type_id in (
13422: * inv_reservation_global.g_source_type_oe
13423: * ,inv_reservation_global.g_source_type_internal_ord
13424: * ,inv_reservation_global.g_source_type_rma) THEN
13425: * --
13426: * cto_workflow_api_pk.wf_update_after_inv_unreserv(
13427: * p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id

Line 13424: * ,inv_reservation_global.g_source_type_rma) THEN

13420: *-- Post Update CTO Validation
13421: * IF l_orig_rsv_tbl(1).demand_source_type_id in (
13422: * inv_reservation_global.g_source_type_oe
13423: * ,inv_reservation_global.g_source_type_internal_ord
13424: * ,inv_reservation_global.g_source_type_rma) THEN
13425: * --
13426: * cto_workflow_api_pk.wf_update_after_inv_unreserv(
13427: * p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id
13428: * , x_return_status => l_return_status

Line 13448: IF l_orig_rsv_tbl(1).demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN

13444: IF (l_debug = 1) THEN
13445: debug_print('To row exists and transfer all is true');
13446: END IF;
13447: -- Pre Delete CTO Validation
13448: IF l_orig_rsv_tbl(1).demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
13449: --
13450: cto_workflow_api_pk.inventory_unreservation_check(
13451: p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id
13452: , p_rsv_quantity => l_to_rsv_rec.primary_reservation_quantity

Line 13494: * inv_reservation_global.g_source_type_oe

13490: * No longer call the wf_update_after_inv_unreserv api from
13491: * transfer_reservation
13492: *-- Post Delete CTO Validation
13493: * IF l_orig_rsv_tbl(1).demand_source_type_id in (
13494: * inv_reservation_global.g_source_type_oe
13495: * ,inv_reservation_global.g_source_type_internal_ord
13496: * ,inv_reservation_global.g_source_type_rma) THEN
13497: * --
13498: * cto_workflow_api_pk.wf_update_after_inv_unreserv(

Line 13495: * ,inv_reservation_global.g_source_type_internal_ord

13491: * transfer_reservation
13492: *-- Post Delete CTO Validation
13493: * IF l_orig_rsv_tbl(1).demand_source_type_id in (
13494: * inv_reservation_global.g_source_type_oe
13495: * ,inv_reservation_global.g_source_type_internal_ord
13496: * ,inv_reservation_global.g_source_type_rma) THEN
13497: * --
13498: * cto_workflow_api_pk.wf_update_after_inv_unreserv(
13499: * p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id

Line 13496: * ,inv_reservation_global.g_source_type_rma) THEN

13492: *-- Post Delete CTO Validation
13493: * IF l_orig_rsv_tbl(1).demand_source_type_id in (
13494: * inv_reservation_global.g_source_type_oe
13495: * ,inv_reservation_global.g_source_type_internal_ord
13496: * ,inv_reservation_global.g_source_type_rma) THEN
13497: * --
13498: * cto_workflow_api_pk.wf_update_after_inv_unreserv(
13499: * p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id
13500: * , x_return_status => l_return_status

Line 13520: IF l_orig_rsv_tbl(1).demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN

13516: IF (l_debug = 1) THEN
13517: debug_print('To row does not exist and transfer all is true');
13518: END IF;
13519: -- Pre Update CTO Validation
13520: IF l_orig_rsv_tbl(1).demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
13521: --
13522: cto_workflow_api_pk.inventory_unreservation_check(
13523: p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id
13524: , p_rsv_quantity => l_orig_rsv_tbl(1).primary_reservation_quantity

Line 13545: (inv_reservation_global.g_source_type_oe,

13541:
13542: -- Added for bug 2458523
13543: -- Pre Insert CTO Validation
13544: IF l_to_rsv_rec.demand_source_type_id IN
13545: (inv_reservation_global.g_source_type_oe,
13546: inv_reservation_global.g_source_type_internal_ord,
13547: inv_reservation_global.g_source_type_rma) THEN
13548:
13549: --

Line 13546: inv_reservation_global.g_source_type_internal_ord,

13542: -- Added for bug 2458523
13543: -- Pre Insert CTO Validation
13544: IF l_to_rsv_rec.demand_source_type_id IN
13545: (inv_reservation_global.g_source_type_oe,
13546: inv_reservation_global.g_source_type_internal_ord,
13547: inv_reservation_global.g_source_type_rma) THEN
13548:
13549: --
13550: cto_workflow_api_pk.inventory_reservation_check(

Line 13547: inv_reservation_global.g_source_type_rma) THEN

13543: -- Pre Insert CTO Validation
13544: IF l_to_rsv_rec.demand_source_type_id IN
13545: (inv_reservation_global.g_source_type_oe,
13546: inv_reservation_global.g_source_type_internal_ord,
13547: inv_reservation_global.g_source_type_rma) THEN
13548:
13549: --
13550: cto_workflow_api_pk.inventory_reservation_check(
13551: p_order_line_id => l_to_rsv_rec.demand_source_line_id

Line 13741: * inv_reservation_global.g_source_type_oe

13737: * No longer call the wf_update_after_inv_unreserv api from
13738: * transfer_reservation
13739: *-- Post Update CTO Validation
13740: * IF l_orig_rsv_tbl(1).demand_source_type_id in (
13741: * inv_reservation_global.g_source_type_oe
13742: * ,inv_reservation_global.g_source_type_internal_ord
13743: * ,inv_reservation_global.g_source_type_rma) THEN
13744: * --
13745: * cto_workflow_api_pk.wf_update_after_inv_unreserv(

Line 13742: * ,inv_reservation_global.g_source_type_internal_ord

13738: * transfer_reservation
13739: *-- Post Update CTO Validation
13740: * IF l_orig_rsv_tbl(1).demand_source_type_id in (
13741: * inv_reservation_global.g_source_type_oe
13742: * ,inv_reservation_global.g_source_type_internal_ord
13743: * ,inv_reservation_global.g_source_type_rma) THEN
13744: * --
13745: * cto_workflow_api_pk.wf_update_after_inv_unreserv(
13746: * p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id

Line 13743: * ,inv_reservation_global.g_source_type_rma) THEN

13739: *-- Post Update CTO Validation
13740: * IF l_orig_rsv_tbl(1).demand_source_type_id in (
13741: * inv_reservation_global.g_source_type_oe
13742: * ,inv_reservation_global.g_source_type_internal_ord
13743: * ,inv_reservation_global.g_source_type_rma) THEN
13744: * --
13745: * cto_workflow_api_pk.wf_update_after_inv_unreserv(
13746: * p_order_line_id => l_orig_rsv_tbl(1).demand_source_line_id
13747: * , x_return_status => l_return_status

Line 13774: IF l_to_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN

13770: /* Commenting out call to CTO inventory_unreservation_check API. This
13771: API has already been called in the previous if then else. This
13772: issue has been reported in bug 2458523
13773: -- Pre Update CTO Validation
13774: IF l_to_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
13775: --
13776: cto_workflow_api_pk.inventory_unreservation_check(
13777: p_order_line_id => l_to_rsv_rec.demand_source_line_id
13778: , p_rsv_quantity => l_to_rsv_rec.primary_reservation_quantity

Line 13800: (inv_reservation_global.g_source_type_oe,

13796:
13797: -- Added for bug 2458523
13798: -- Pre Insert CTO Validation
13799: IF l_to_rsv_rec.demand_source_type_id IN
13800: (inv_reservation_global.g_source_type_oe,
13801: inv_reservation_global.g_source_type_internal_ord,
13802: inv_reservation_global.g_source_type_rma) THEN
13803:
13804: --

Line 13801: inv_reservation_global.g_source_type_internal_ord,

13797: -- Added for bug 2458523
13798: -- Pre Insert CTO Validation
13799: IF l_to_rsv_rec.demand_source_type_id IN
13800: (inv_reservation_global.g_source_type_oe,
13801: inv_reservation_global.g_source_type_internal_ord,
13802: inv_reservation_global.g_source_type_rma) THEN
13803:
13804: --
13805: cto_workflow_api_pk.inventory_reservation_check(

Line 13802: inv_reservation_global.g_source_type_rma) THEN

13798: -- Pre Insert CTO Validation
13799: IF l_to_rsv_rec.demand_source_type_id IN
13800: (inv_reservation_global.g_source_type_oe,
13801: inv_reservation_global.g_source_type_internal_ord,
13802: inv_reservation_global.g_source_type_rma) THEN
13803:
13804: --
13805: cto_workflow_api_pk.inventory_reservation_check(
13806: p_order_line_id => l_to_rsv_rec.demand_source_line_id

Line 13914: * inv_reservation_global.g_source_type_oe

13910: * No longer call the wf_update_after_inv_unreserv api from
13911: * transfer_reservation
13912: *-- Post Update CTO Validation
13913: * IF l_to_rsv_rec.demand_source_type_id in (
13914: * inv_reservation_global.g_source_type_oe
13915: * ,inv_reservation_global.g_source_type_internal_ord
13916: * ,inv_reservation_global.g_source_type_rma) THEN
13917: * --
13918: * cto_workflow_api_pk.wf_update_after_inv_unreserv(

Line 13915: * ,inv_reservation_global.g_source_type_internal_ord

13911: * transfer_reservation
13912: *-- Post Update CTO Validation
13913: * IF l_to_rsv_rec.demand_source_type_id in (
13914: * inv_reservation_global.g_source_type_oe
13915: * ,inv_reservation_global.g_source_type_internal_ord
13916: * ,inv_reservation_global.g_source_type_rma) THEN
13917: * --
13918: * cto_workflow_api_pk.wf_update_after_inv_unreserv(
13919: * p_order_line_id => l_to_rsv_rec.demand_source_line_id

Line 13916: * ,inv_reservation_global.g_source_type_rma) THEN

13912: *-- Post Update CTO Validation
13913: * IF l_to_rsv_rec.demand_source_type_id in (
13914: * inv_reservation_global.g_source_type_oe
13915: * ,inv_reservation_global.g_source_type_internal_ord
13916: * ,inv_reservation_global.g_source_type_rma) THEN
13917: * --
13918: * cto_workflow_api_pk.wf_update_after_inv_unreserv(
13919: * p_order_line_id => l_to_rsv_rec.demand_source_line_id
13920: * , x_return_status => l_return_status

Line 13940: IF l_to_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN

13936: IF (l_debug = 1) THEN
13937: debug_print('To row does not exists and transfer all is false');
13938: END IF;
13939: -- Pre Insert CTO Validation
13940: IF l_to_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
13941: --
13942: cto_workflow_api_pk.inventory_reservation_check(
13943: p_order_line_id => l_to_rsv_rec.demand_source_line_id
13944: , x_return_status => l_return_status

Line 14022: inv_reservation_global.g_source_type_asn) AND

14018: -- we need to update the original supply as PO, because we
14019: -- will have to transfer the reservation back to ASN while reducing
14020: -- and cancelling ASNs
14021: IF (l_to_rsv_rec.supply_source_type_id =
14022: inv_reservation_global.g_source_type_asn) AND
14023: (l_orig_rsv_tbl(1).supply_source_type_id = inv_reservation_global.g_source_type_po) THEN
14024:
14025: l_orig_supply_type_id := inv_reservation_global.g_source_type_po;
14026: IF (l_debug = 1) THEN

Line 14023: (l_orig_rsv_tbl(1).supply_source_type_id = inv_reservation_global.g_source_type_po) THEN

14019: -- will have to transfer the reservation back to ASN while reducing
14020: -- and cancelling ASNs
14021: IF (l_to_rsv_rec.supply_source_type_id =
14022: inv_reservation_global.g_source_type_asn) AND
14023: (l_orig_rsv_tbl(1).supply_source_type_id = inv_reservation_global.g_source_type_po) THEN
14024:
14025: l_orig_supply_type_id := inv_reservation_global.g_source_type_po;
14026: IF (l_debug = 1) THEN
14027: debug_print('The original supply is po and the new supply is asn' ||l_orig_supply_type_id);

Line 14025: l_orig_supply_type_id := inv_reservation_global.g_source_type_po;

14021: IF (l_to_rsv_rec.supply_source_type_id =
14022: inv_reservation_global.g_source_type_asn) AND
14023: (l_orig_rsv_tbl(1).supply_source_type_id = inv_reservation_global.g_source_type_po) THEN
14024:
14025: l_orig_supply_type_id := inv_reservation_global.g_source_type_po;
14026: IF (l_debug = 1) THEN
14027: debug_print('The original supply is po and the new supply is asn' ||l_orig_supply_type_id);
14028: END IF;
14029:

Line 14159: IF l_to_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN

14155: -- sales order, becuase we were only calling this cto api for
14156: -- partial reservation transfers. Now, call this API everytime
14157: -- transfer_reservation is called
14158: -- Post Insert CTO Validation
14159: IF l_to_rsv_rec.demand_source_type_id IN (inv_reservation_global.g_source_type_oe, inv_reservation_global.g_source_type_internal_ord, inv_reservation_global.g_source_type_rma) THEN
14160: --
14161: cto_workflow_api_pk.wf_update_after_inv_reserv(p_order_line_id => l_to_rsv_rec.demand_source_line_id, x_return_status => l_return_status, x_msg_count => x_msg_count, x_msg_data => x_msg_data);
14162:
14163: debug_print(' After CTO API' || l_return_status);

Line 15854: , p_query_input IN inv_reservation_global.mtl_reservation_rec_type

15850: , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
15851: , x_return_status OUT NOCOPY VARCHAR2
15852: , x_msg_count OUT NOCOPY NUMBER
15853: , x_msg_data OUT NOCOPY VARCHAR2
15854: , p_query_input IN inv_reservation_global.mtl_reservation_rec_type
15855: , p_lock_records IN VARCHAR2 DEFAULT fnd_api.g_false
15856: , p_sort_by_req_date IN NUMBER DEFAULT inv_reservation_global.g_query_no_sort
15857: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no
15858: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type

Line 15856: , p_sort_by_req_date IN NUMBER DEFAULT inv_reservation_global.g_query_no_sort

15852: , x_msg_count OUT NOCOPY NUMBER
15853: , x_msg_data OUT NOCOPY VARCHAR2
15854: , p_query_input IN inv_reservation_global.mtl_reservation_rec_type
15855: , p_lock_records IN VARCHAR2 DEFAULT fnd_api.g_false
15856: , p_sort_by_req_date IN NUMBER DEFAULT inv_reservation_global.g_query_no_sort
15857: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no
15858: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type
15859: , x_mtl_reservation_tbl_count OUT NOCOPY NUMBER
15860: , x_error_code OUT NOCOPY NUMBER

Line 15857: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no

15853: , x_msg_data OUT NOCOPY VARCHAR2
15854: , p_query_input IN inv_reservation_global.mtl_reservation_rec_type
15855: , p_lock_records IN VARCHAR2 DEFAULT fnd_api.g_false
15856: , p_sort_by_req_date IN NUMBER DEFAULT inv_reservation_global.g_query_no_sort
15857: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no
15858: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type
15859: , x_mtl_reservation_tbl_count OUT NOCOPY NUMBER
15860: , x_error_code OUT NOCOPY NUMBER
15861: ) IS

Line 15858: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type

15854: , p_query_input IN inv_reservation_global.mtl_reservation_rec_type
15855: , p_lock_records IN VARCHAR2 DEFAULT fnd_api.g_false
15856: , p_sort_by_req_date IN NUMBER DEFAULT inv_reservation_global.g_query_no_sort
15857: , p_cancel_order_mode IN NUMBER DEFAULT inv_reservation_global.g_cancel_order_no
15858: , x_mtl_reservation_tbl OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type
15859: , x_mtl_reservation_tbl_count OUT NOCOPY NUMBER
15860: , x_error_code OUT NOCOPY NUMBER
15861: ) IS
15862: l_api_version_number CONSTANT NUMBER := 1.0;

Line 15866: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

15862: l_api_version_number CONSTANT NUMBER := 1.0;
15863: l_api_name CONSTANT VARCHAR2(30) := 'Query_Reservation_OM_Hdr_Line';
15864: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
15865: l_counter INTEGER;
15866: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
15867:
15868: -- Cursor to fetch MTL_RESERVATION record based on passed
15869: -- demand_source_header_id and demand_source_line_id
15870:

Line 15949: WHERE demand_source_type_id IN (inv_reservation_global.g_source_type_oe

15945: , serial_number
15946: /***** End R12 ***/
15947:
15948: FROM mtl_reservations mr
15949: WHERE demand_source_type_id IN (inv_reservation_global.g_source_type_oe
15950: , inv_reservation_global.g_source_type_internal_ord
15951: , inv_reservation_global.g_source_type_rma
15952: )
15953: AND demand_source_header_id = dmd_source_header_id

Line 15950: , inv_reservation_global.g_source_type_internal_ord

15946: /***** End R12 ***/
15947:
15948: FROM mtl_reservations mr
15949: WHERE demand_source_type_id IN (inv_reservation_global.g_source_type_oe
15950: , inv_reservation_global.g_source_type_internal_ord
15951: , inv_reservation_global.g_source_type_rma
15952: )
15953: AND demand_source_header_id = dmd_source_header_id
15954: AND demand_source_line_id = dmd_source_line_id

Line 15951: , inv_reservation_global.g_source_type_rma

15947:
15948: FROM mtl_reservations mr
15949: WHERE demand_source_type_id IN (inv_reservation_global.g_source_type_oe
15950: , inv_reservation_global.g_source_type_internal_ord
15951: , inv_reservation_global.g_source_type_rma
15952: )
15953: AND demand_source_header_id = dmd_source_header_id
15954: AND demand_source_line_id = dmd_source_line_id
15955: ORDER BY NVL(mr.revision, ' ')

Line 16041: WHERE demand_source_type_id IN (inv_reservation_global.g_source_type_oe

16037: , serial_number
16038: /***** End R12 ***/
16039:
16040: FROM mtl_reservations mr
16041: WHERE demand_source_type_id IN (inv_reservation_global.g_source_type_oe
16042: , inv_reservation_global.g_source_type_internal_ord
16043: , inv_reservation_global.g_source_type_rma
16044: )
16045: AND demand_source_header_id = dmd_source_header_id

Line 16042: , inv_reservation_global.g_source_type_internal_ord

16038: /***** End R12 ***/
16039:
16040: FROM mtl_reservations mr
16041: WHERE demand_source_type_id IN (inv_reservation_global.g_source_type_oe
16042: , inv_reservation_global.g_source_type_internal_ord
16043: , inv_reservation_global.g_source_type_rma
16044: )
16045: AND demand_source_header_id = dmd_source_header_id
16046: AND demand_source_line_id = dmd_source_line_id

Line 16043: , inv_reservation_global.g_source_type_rma

16039:
16040: FROM mtl_reservations mr
16041: WHERE demand_source_type_id IN (inv_reservation_global.g_source_type_oe
16042: , inv_reservation_global.g_source_type_internal_ord
16043: , inv_reservation_global.g_source_type_rma
16044: )
16045: AND demand_source_header_id = dmd_source_header_id
16046: AND demand_source_line_id = dmd_source_line_id
16047: ORDER BY mr.requirement_date asc

Line 16134: WHERE demand_source_type_id IN (inv_reservation_global.g_source_type_oe

16130: , serial_number
16131: /***** End R12 ***/
16132:
16133: FROM mtl_reservations mr
16134: WHERE demand_source_type_id IN (inv_reservation_global.g_source_type_oe
16135: , inv_reservation_global.g_source_type_internal_ord
16136: , inv_reservation_global.g_source_type_rma
16137: )
16138: AND demand_source_header_id = dmd_source_header_id

Line 16135: , inv_reservation_global.g_source_type_internal_ord

16131: /***** End R12 ***/
16132:
16133: FROM mtl_reservations mr
16134: WHERE demand_source_type_id IN (inv_reservation_global.g_source_type_oe
16135: , inv_reservation_global.g_source_type_internal_ord
16136: , inv_reservation_global.g_source_type_rma
16137: )
16138: AND demand_source_header_id = dmd_source_header_id
16139: AND demand_source_line_id = dmd_source_line_id

Line 16136: , inv_reservation_global.g_source_type_rma

16132:
16133: FROM mtl_reservations mr
16134: WHERE demand_source_type_id IN (inv_reservation_global.g_source_type_oe
16135: , inv_reservation_global.g_source_type_internal_ord
16136: , inv_reservation_global.g_source_type_rma
16137: )
16138: AND demand_source_header_id = dmd_source_header_id
16139: AND demand_source_line_id = dmd_source_line_id
16140: ORDER BY mr.requirement_date DESC

Line 16146: x_error_code := inv_reservation_global.g_err_unexpected;

16142: , NVL(mr.lot_number, ' ')
16143: , NVL(mr.subinventory_code, ' ')
16144: , NVL(mr.locator_id, 0);
16145: BEGIN
16146: x_error_code := inv_reservation_global.g_err_unexpected;
16147:
16148: --
16149: -- Standard call to check for call compatibility
16150: IF NOT fnd_api.compatible_api_call(l_api_version_number, p_api_version_number, l_api_name, g_pkg_name) THEN

Line 16184: IF (p_sort_by_req_date NOT IN ( inv_reservation_global.g_query_req_date_inv_asc,

16180: END IF;
16181:
16182: --Bug#2872822/2914726 OM call to this API passes null. This was changed
16183: -- handle null also.
16184: IF (p_sort_by_req_date NOT IN ( inv_reservation_global.g_query_req_date_inv_asc,
16185: inv_reservation_global.g_query_req_date_inv_desc)) OR p_sort_by_req_date IS NULL
16186: then
16187: OPEN mrc(p_query_input.demand_source_header_id, p_query_input.demand_source_line_id);
16188: l_counter := 0;

Line 16185: inv_reservation_global.g_query_req_date_inv_desc)) OR p_sort_by_req_date IS NULL

16181:
16182: --Bug#2872822/2914726 OM call to this API passes null. This was changed
16183: -- handle null also.
16184: IF (p_sort_by_req_date NOT IN ( inv_reservation_global.g_query_req_date_inv_asc,
16185: inv_reservation_global.g_query_req_date_inv_desc)) OR p_sort_by_req_date IS NULL
16186: then
16187: OPEN mrc(p_query_input.demand_source_header_id, p_query_input.demand_source_line_id);
16188: l_counter := 0;
16189:

Line 16198: ELSIF p_sort_by_req_date =inv_reservation_global.g_query_req_date_inv_asc then

16194: x_mtl_reservation_tbl(l_counter) := l_rsv_rec;
16195: END LOOP;
16196:
16197: CLOSE mrc;
16198: ELSIF p_sort_by_req_date =inv_reservation_global.g_query_req_date_inv_asc then
16199: OPEN mrc_asc(p_query_input.demand_source_header_id,
16200: p_query_input.demand_source_line_id);
16201: l_counter := 0;
16202: LOOP

Line 16209: ELSIF p_sort_by_req_date =inv_reservation_global.g_query_req_date_inv_desc then

16205: l_counter := l_counter + 1;
16206: x_mtl_reservation_tbl(l_counter) := l_rsv_rec;
16207: END LOOP;
16208: CLOSE mrc_asc;
16209: ELSIF p_sort_by_req_date =inv_reservation_global.g_query_req_date_inv_desc then
16210: OPEN mrc_desc(p_query_input.demand_source_header_id,
16211: p_query_input.demand_source_line_id);
16212: l_counter := 0;
16213: LOOP

Line 16226: x_error_code := inv_reservation_global.g_err_no_error;

16222: END IF; --Sort by req date
16223: --
16224: x_mtl_reservation_tbl_count := l_counter;
16225: x_return_status := l_return_status;
16226: x_error_code := inv_reservation_global.g_err_no_error;
16227: --
16228: EXCEPTION
16229: WHEN fnd_api.g_exc_error THEN
16230: x_return_status := fnd_api.g_ret_sts_error;

Line 16288: l_src_rsv inv_reservation_global.mtl_reservation_rec_type;

16284: l_reservation_id NUMBER;
16285: l_demand_source_header_id NUMBER;
16286:
16287: -- MTL_RESERVATIONS record type declarations
16288: l_src_rsv inv_reservation_global.mtl_reservation_rec_type;
16289: l_xfr_rsv inv_reservation_global.mtl_reservation_rec_type;
16290: l_serial_number inv_reservation_global.serial_number_tbl_type;
16291:
16292:

Line 16289: l_xfr_rsv inv_reservation_global.mtl_reservation_rec_type;

16285: l_demand_source_header_id NUMBER;
16286:
16287: -- MTL_RESERVATIONS record type declarations
16288: l_src_rsv inv_reservation_global.mtl_reservation_rec_type;
16289: l_xfr_rsv inv_reservation_global.mtl_reservation_rec_type;
16290: l_serial_number inv_reservation_global.serial_number_tbl_type;
16291:
16292:
16293: -- Cursor to fetch the from reservations

Line 16290: l_serial_number inv_reservation_global.serial_number_tbl_type;

16286:
16287: -- MTL_RESERVATIONS record type declarations
16288: l_src_rsv inv_reservation_global.mtl_reservation_rec_type;
16289: l_xfr_rsv inv_reservation_global.mtl_reservation_rec_type;
16290: l_serial_number inv_reservation_global.serial_number_tbl_type;
16291:
16292:
16293: -- Cursor to fetch the from reservations
16294: -- INVCONV - Incorporate secondaries into select

Line 17031: , x_failed_rsv_temp_tbl OUT NOCOPY inv_reservation_global.mtl_failed_rsv_tbl_type

17027: , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
17028: , x_return_status OUT NOCOPY VARCHAR2
17029: , x_msg_count OUT NOCOPY NUMBER
17030: , x_msg_data OUT NOCOPY VARCHAR2
17031: , x_failed_rsv_temp_tbl OUT NOCOPY inv_reservation_global.mtl_failed_rsv_tbl_type
17032: ) IS
17033: l_api_version_number CONSTANT NUMBER := 1.0;
17034: l_api_name CONSTANT VARCHAR2(30) := 'Do_check_for_commit';
17035: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;

Line 17038: l_failed_rsv_temp_tbl inv_reservation_global.mtl_failed_rsv_tbl_type;

17034: l_api_name CONSTANT VARCHAR2(30) := 'Do_check_for_commit';
17035: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
17036: l_no_violation BOOLEAN;
17037: l_root_id INTEGER;
17038: l_failed_rsv_temp_tbl inv_reservation_global.mtl_failed_rsv_tbl_type;
17039: l_failed_rsv_temp_rec inv_reservation_global.mtl_failed_rsv_rec_type;
17040: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
17041: p_original_serial_number inv_reservation_global.serial_number_tbl_type;
17042: l_reservation_id NUMBER;

Line 17039: l_failed_rsv_temp_rec inv_reservation_global.mtl_failed_rsv_rec_type;

17035: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
17036: l_no_violation BOOLEAN;
17037: l_root_id INTEGER;
17038: l_failed_rsv_temp_tbl inv_reservation_global.mtl_failed_rsv_tbl_type;
17039: l_failed_rsv_temp_rec inv_reservation_global.mtl_failed_rsv_rec_type;
17040: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
17041: p_original_serial_number inv_reservation_global.serial_number_tbl_type;
17042: l_reservation_id NUMBER;
17043: l_failed_rsv_temp_tbl_count INTEGER := 0;

Line 17040: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

17036: l_no_violation BOOLEAN;
17037: l_root_id INTEGER;
17038: l_failed_rsv_temp_tbl inv_reservation_global.mtl_failed_rsv_tbl_type;
17039: l_failed_rsv_temp_rec inv_reservation_global.mtl_failed_rsv_rec_type;
17040: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
17041: p_original_serial_number inv_reservation_global.serial_number_tbl_type;
17042: l_reservation_id NUMBER;
17043: l_failed_rsv_temp_tbl_count INTEGER := 0;
17044: l_error_code VARCHAR2(100);

Line 17041: p_original_serial_number inv_reservation_global.serial_number_tbl_type;

17037: l_root_id INTEGER;
17038: l_failed_rsv_temp_tbl inv_reservation_global.mtl_failed_rsv_tbl_type;
17039: l_failed_rsv_temp_rec inv_reservation_global.mtl_failed_rsv_rec_type;
17040: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
17041: p_original_serial_number inv_reservation_global.serial_number_tbl_type;
17042: l_reservation_id NUMBER;
17043: l_failed_rsv_temp_tbl_count INTEGER := 0;
17044: l_error_code VARCHAR2(100);
17045: l_demand_source_line_id NUMBER;

Line 17179: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type ;

17175: IS
17176:
17177: l_api_name CONSTANT VARCHAR2(30) := 'Transfer_Reservation_SubXfer';
17178: -- Define local variables
17179: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type ;
17180: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type ;
17181: l_original_serial_number_Tab inv_reservation_global.serial_number_tbl_type ;
17182: l_to_serial_number_Tab inv_reservation_global.serial_number_tbl_type ;
17183: l_Reservation_Id Number;

Line 17180: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type ;

17176:
17177: l_api_name CONSTANT VARCHAR2(30) := 'Transfer_Reservation_SubXfer';
17178: -- Define local variables
17179: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type ;
17180: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type ;
17181: l_original_serial_number_Tab inv_reservation_global.serial_number_tbl_type ;
17182: l_to_serial_number_Tab inv_reservation_global.serial_number_tbl_type ;
17183: l_Reservation_Id Number;
17184: l_return_status VARCHAR2(1):= fnd_api.g_ret_sts_success;

Line 17181: l_original_serial_number_Tab inv_reservation_global.serial_number_tbl_type ;

17177: l_api_name CONSTANT VARCHAR2(30) := 'Transfer_Reservation_SubXfer';
17178: -- Define local variables
17179: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type ;
17180: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type ;
17181: l_original_serial_number_Tab inv_reservation_global.serial_number_tbl_type ;
17182: l_to_serial_number_Tab inv_reservation_global.serial_number_tbl_type ;
17183: l_Reservation_Id Number;
17184: l_return_status VARCHAR2(1):= fnd_api.g_ret_sts_success;
17185: l_debug number;

Line 17182: l_to_serial_number_Tab inv_reservation_global.serial_number_tbl_type ;

17178: -- Define local variables
17179: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type ;
17180: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type ;
17181: l_original_serial_number_Tab inv_reservation_global.serial_number_tbl_type ;
17182: l_to_serial_number_Tab inv_reservation_global.serial_number_tbl_type ;
17183: l_Reservation_Id Number;
17184: l_return_status VARCHAR2(1):= fnd_api.g_ret_sts_success;
17185: l_debug number;
17186:

Line 17339: l_serial_number_tbl inv_reservation_global.serial_number_tbl_type;

17335: TYPE rsv_serials_item_tbl IS TABLE OF rsv_serials_item_rec
17336: INDEX BY BINARY_INTEGER;
17337:
17338: l_rsv_serials_tbl rsv_serials_item_tbl;
17339: l_serial_number_tbl inv_reservation_global.serial_number_tbl_type;
17340: l_index NUMBER := 0;
17341: l_rsv_serials_tbl_count NUMBER := 0;
17342: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
17343: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

Line 17342: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

17338: l_rsv_serials_tbl rsv_serials_item_tbl;
17339: l_serial_number_tbl inv_reservation_global.serial_number_tbl_type;
17340: l_index NUMBER := 0;
17341: l_rsv_serials_tbl_count NUMBER := 0;
17342: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
17343: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
17344: l_reservation_id NUMBER;
17345:
17346: -- cursor of getting reservations with serial_number reserved in the lpn which

Line 17343: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

17339: l_serial_number_tbl inv_reservation_global.serial_number_tbl_type;
17340: l_index NUMBER := 0;
17341: l_rsv_serials_tbl_count NUMBER := 0;
17342: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
17343: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
17344: l_reservation_id NUMBER;
17345:
17346: -- cursor of getting reservations with serial_number reserved in the lpn which
17347: -- outermost_lpn_id of the lpn = p_outermost_lpn_id and the reservation does not