DBA Data[Home] [Help]

APPS.INV_MAINTAIN_RESERVATION_PUB dependencies on INV_RESERVATION_GLOBAL

Line 4: g_dummy_sn_tbl inv_reservation_global.serial_number_tbl_type;

1: PACKAGE BODY INV_MAINTAIN_RESERVATION_PUB AS
2: /* $Header: INVPMRVB.pls 120.26.12010000.3 2009/01/14 19:57:03 athammin ship $*/
3:
4: g_dummy_sn_tbl inv_reservation_global.serial_number_tbl_type;
5:
6: -- CodeReview.SU.03 Define a global variable for l_Debug
7: g_debug Number := Nvl(Fnd_Profile.Value('INV_DEBUG_TRACE'),0);
8:

Line 218: p_mtl_maintain_rsv_rec in inv_reservation_global.mtl_maintain_rsv_rec_type,

214: p_init_msg_lst in varchar2,
215: x_return_status out nocopy varchar2,
216: x_msg_count out nocopy number,
217: x_msg_data out nocopy varchar2,
218: p_mtl_maintain_rsv_rec in inv_reservation_global.mtl_maintain_rsv_rec_type,
219: p_delete_flag in varchar2,
220: p_sort_by_criteria in number,
221: x_quantity_modified out nocopy number ) is
222:

Line 230: c_cancel_order_no constant number := inv_reservation_global.g_cancel_order_no ;

226: c_module_name constant varchar2(2000) := 'inv.plsql.inv_maintain_reservations.reduce_reservation';
227: c_debug_enabled constant number := 1 ;
228: c_action_supply constant number := 0;
229: c_action_demand constant number := 1;
230: c_cancel_order_no constant number := inv_reservation_global.g_cancel_order_no ;
231:
232: -- l_debug number := nvl(fnd_profile.value('inv_debug_trace'), 0);
233: l_fnd_log_message varchar2(2000);
234: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

Line 234: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

230: c_cancel_order_no constant number := inv_reservation_global.g_cancel_order_no ;
231:
232: -- l_debug number := nvl(fnd_profile.value('inv_debug_trace'), 0);
233: l_fnd_log_message varchar2(2000);
234: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
235: l_query_input inv_reservation_global.mtl_reservation_rec_type;
236: l_mtl_reservation_tbl inv_reservation_global.mtl_reservation_tbl_type ;
237: l_mtl_reservation_tbl_count number ;
238: l_sort_by_criteria number ;

Line 235: l_query_input inv_reservation_global.mtl_reservation_rec_type;

231:
232: -- l_debug number := nvl(fnd_profile.value('inv_debug_trace'), 0);
233: l_fnd_log_message varchar2(2000);
234: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
235: l_query_input inv_reservation_global.mtl_reservation_rec_type;
236: l_mtl_reservation_tbl inv_reservation_global.mtl_reservation_tbl_type ;
237: l_mtl_reservation_tbl_count number ;
238: l_sort_by_criteria number ;
239: l_error_code number ;

Line 236: l_mtl_reservation_tbl inv_reservation_global.mtl_reservation_tbl_type ;

232: -- l_debug number := nvl(fnd_profile.value('inv_debug_trace'), 0);
233: l_fnd_log_message varchar2(2000);
234: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
235: l_query_input inv_reservation_global.mtl_reservation_rec_type;
236: l_mtl_reservation_tbl inv_reservation_global.mtl_reservation_tbl_type ;
237: l_mtl_reservation_tbl_count number ;
238: l_sort_by_criteria number ;
239: l_error_code number ;
240:

Line 243: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

239: l_error_code number ;
240:
241: -- following variables for calling transfer reservation api
242: l_is_transfer_supply varchar2(1);
243: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
244: -- convert_rsv_rec is used to convert expected_qty to primary_expected_uom_code
245: l_convert_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
246: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
247: l_original_serial_number inv_reservation_global.serial_number_tbl_type;

Line 245: l_convert_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

241: -- following variables for calling transfer reservation api
242: l_is_transfer_supply varchar2(1);
243: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
244: -- convert_rsv_rec is used to convert expected_qty to primary_expected_uom_code
245: l_convert_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
246: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
247: l_original_serial_number inv_reservation_global.serial_number_tbl_type;
248: l_to_serial_number inv_reservation_global.serial_number_tbl_type;
249: l_reservation_id number ;

Line 246: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

242: l_is_transfer_supply varchar2(1);
243: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
244: -- convert_rsv_rec is used to convert expected_qty to primary_expected_uom_code
245: l_convert_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
246: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
247: l_original_serial_number inv_reservation_global.serial_number_tbl_type;
248: l_to_serial_number inv_reservation_global.serial_number_tbl_type;
249: l_reservation_id number ;
250: l_primary_uom_code varchar2(10);

Line 247: l_original_serial_number inv_reservation_global.serial_number_tbl_type;

243: l_original_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
244: -- convert_rsv_rec is used to convert expected_qty to primary_expected_uom_code
245: l_convert_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
246: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
247: l_original_serial_number inv_reservation_global.serial_number_tbl_type;
248: l_to_serial_number inv_reservation_global.serial_number_tbl_type;
249: l_reservation_id number ;
250: l_primary_uom_code varchar2(10);
251: l_primary_expected_qty number ;

Line 248: l_to_serial_number inv_reservation_global.serial_number_tbl_type;

244: -- convert_rsv_rec is used to convert expected_qty to primary_expected_uom_code
245: l_convert_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
246: l_to_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
247: l_original_serial_number inv_reservation_global.serial_number_tbl_type;
248: l_to_serial_number inv_reservation_global.serial_number_tbl_type;
249: l_reservation_id number ;
250: l_primary_uom_code varchar2(10);
251: l_primary_expected_qty number ;
252: l_to_primary_transaction_qty number;

Line 328: if (p_mtl_maintain_rsv_rec.supply_source_type_id = inv_reservation_global.g_source_type_wip) then

324: elsif (p_mtl_maintain_rsv_rec.action = c_action_demand) then
325: l_source_header_id := p_mtl_maintain_rsv_rec.demand_source_header_id;
326: end if;
327:
328: if (p_mtl_maintain_rsv_rec.supply_source_type_id = inv_reservation_global.g_source_type_wip) then
329: if (g_debug= c_debug_enabled) then
330: mydebug ('before calling get_wip_entity_type' , c_api_name, 9);
331: end if;
332: inv_reservation_pvt.get_wip_entity_type

Line 368: l_sort_by_criteria := inv_reservation_global.g_query_supply_rcpt_date_asc;

364: if upper(nvl(p_delete_flag,'N')) = 'N' then
365: -- codereview.su.06. swap action types for sorting criteria
366: if p_mtl_maintain_rsv_rec.action = c_action_demand then
367: if p_sort_by_criteria is null then
368: l_sort_by_criteria := inv_reservation_global.g_query_supply_rcpt_date_asc;
369: else
370: l_sort_by_criteria := p_sort_by_criteria ;
371: end if;
372: elsif p_mtl_maintain_rsv_rec.action = c_action_supply then

Line 374: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;

370: l_sort_by_criteria := p_sort_by_criteria ;
371: end if;
372: elsif p_mtl_maintain_rsv_rec.action = c_action_supply then
373: if p_sort_by_criteria is null then
374: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;
375: else
376: l_sort_by_criteria := p_sort_by_criteria ;
377: end if;
378: end if;

Line 411: if (p_mtl_maintain_rsv_rec.supply_source_type_id <> inv_reservation_global.g_source_type_inv) then

407: -- supply source header is required column
408: -- codereview.su.07. source_header_id is required for following source types
409: -- po, wip, int req, ext req, asn, intrasit
410: -- not required for inventory source type
411: if (p_mtl_maintain_rsv_rec.supply_source_type_id <> inv_reservation_global.g_source_type_inv) then
412: check_reqd_param (
413: p_param_value => p_mtl_maintain_rsv_rec.supply_source_header_id,
414: p_param_name => 'p_mtl_maintain_rsv_rec.supply_source_header',
415: p_api_name => c_api_name );

Line 422: if (p_mtl_maintain_rsv_rec.supply_source_type_id = inv_reservation_global.g_source_type_wip

418: -- suppply source line is required column
419: -- codereview.su.07. source_line_id is required for following source types
420: -- po, int req, ext req, asn, intrasit
421: -- not required for inventory,wip
422: if (p_mtl_maintain_rsv_rec.supply_source_type_id = inv_reservation_global.g_source_type_wip
423: and l_wip_entity_type_id in (inv_reservation_global.g_wip_source_type_batch,inv_reservation_global.g_wip_source_type_cmro)) then
424: check_reqd_param (
425: p_param_value => p_mtl_maintain_rsv_rec.supply_source_line_id,
426: p_param_name => 'p_mtl_maintain_rsv_rec.supply_source_line_id',

Line 423: and l_wip_entity_type_id in (inv_reservation_global.g_wip_source_type_batch,inv_reservation_global.g_wip_source_type_cmro)) then

419: -- codereview.su.07. source_line_id is required for following source types
420: -- po, int req, ext req, asn, intrasit
421: -- not required for inventory,wip
422: if (p_mtl_maintain_rsv_rec.supply_source_type_id = inv_reservation_global.g_source_type_wip
423: and l_wip_entity_type_id in (inv_reservation_global.g_wip_source_type_batch,inv_reservation_global.g_wip_source_type_cmro)) then
424: check_reqd_param (
425: p_param_value => p_mtl_maintain_rsv_rec.supply_source_line_id,
426: p_param_name => 'p_mtl_maintain_rsv_rec.supply_source_line_id',
427: p_api_name => c_api_name );

Line 430: (inv_reservation_global.g_source_type_inv,

426: p_param_name => 'p_mtl_maintain_rsv_rec.supply_source_line_id',
427: p_api_name => c_api_name );
428: elsif (p_mtl_maintain_rsv_rec.supply_source_type_id
429: not in
430: (inv_reservation_global.g_source_type_inv,
431: inv_reservation_global.g_source_type_wip,
432: inv_reservation_global.g_source_type_account,
433: inv_reservation_global.g_source_type_account_alias)) then
434: check_reqd_param (

Line 431: inv_reservation_global.g_source_type_wip,

427: p_api_name => c_api_name );
428: elsif (p_mtl_maintain_rsv_rec.supply_source_type_id
429: not in
430: (inv_reservation_global.g_source_type_inv,
431: inv_reservation_global.g_source_type_wip,
432: inv_reservation_global.g_source_type_account,
433: inv_reservation_global.g_source_type_account_alias)) then
434: check_reqd_param (
435: p_param_value => p_mtl_maintain_rsv_rec.supply_source_line_id,

Line 432: inv_reservation_global.g_source_type_account,

428: elsif (p_mtl_maintain_rsv_rec.supply_source_type_id
429: not in
430: (inv_reservation_global.g_source_type_inv,
431: inv_reservation_global.g_source_type_wip,
432: inv_reservation_global.g_source_type_account,
433: inv_reservation_global.g_source_type_account_alias)) then
434: check_reqd_param (
435: p_param_value => p_mtl_maintain_rsv_rec.supply_source_line_id,
436: p_param_name => 'p_mtl_maintain_rsv_rec.supply_source_line_id',

Line 433: inv_reservation_global.g_source_type_account_alias)) then

429: not in
430: (inv_reservation_global.g_source_type_inv,
431: inv_reservation_global.g_source_type_wip,
432: inv_reservation_global.g_source_type_account,
433: inv_reservation_global.g_source_type_account_alias)) then
434: check_reqd_param (
435: p_param_value => p_mtl_maintain_rsv_rec.supply_source_line_id,
436: p_param_name => 'p_mtl_maintain_rsv_rec.supply_source_line_id',
437: p_api_name => c_api_name );

Line 444: if p_mtl_maintain_rsv_rec.supply_source_type_id = inv_reservation_global.g_source_type_asn then

440:
441: -- suppply source line detail required column
442: -- codereview.su.07. source_line_detail is required for following source types
443: -- asn
444: if p_mtl_maintain_rsv_rec.supply_source_type_id = inv_reservation_global.g_source_type_asn then
445: check_reqd_param (
446: p_param_value => p_mtl_maintain_rsv_rec.supply_source_line_detail,
447: p_param_name => 'p_mtl_maintain_rsv_rec.supply_source_line_detail',
448: p_api_name => c_api_name );

Line 473: if p_mtl_maintain_rsv_rec.demand_source_type_id <> inv_reservation_global.g_source_type_inv then

469: p_api_name => c_api_name );
470:
471: -- demand source header is required column
472: -- codereview.su.07. source_header_id is not required for inv source types
473: if p_mtl_maintain_rsv_rec.demand_source_type_id <> inv_reservation_global.g_source_type_inv then
474: check_reqd_param (
475: p_param_value => p_mtl_maintain_rsv_rec.demand_source_header_id,
476: p_param_name => 'p_mtl_maintain_rsv_rec.demand_source_header',
477: p_api_name => c_api_name );

Line 482: if (p_mtl_maintain_rsv_rec.demand_source_type_id = inv_reservation_global.g_source_type_wip

478: end if; -- check source header id
479:
480: -- demandy source line is required column
481: -- codereview.su.07. demand_source_line_id is not required for inv source types
482: if (p_mtl_maintain_rsv_rec.demand_source_type_id = inv_reservation_global.g_source_type_wip
483: and l_wip_entity_type_id in (inv_reservation_global.g_wip_source_type_cmro,
484: inv_reservation_global.g_wip_source_type_batch)) then
485: check_reqd_param (
486: p_param_value => p_mtl_maintain_rsv_rec.demand_source_line_id,

Line 483: and l_wip_entity_type_id in (inv_reservation_global.g_wip_source_type_cmro,

479:
480: -- demandy source line is required column
481: -- codereview.su.07. demand_source_line_id is not required for inv source types
482: if (p_mtl_maintain_rsv_rec.demand_source_type_id = inv_reservation_global.g_source_type_wip
483: and l_wip_entity_type_id in (inv_reservation_global.g_wip_source_type_cmro,
484: inv_reservation_global.g_wip_source_type_batch)) then
485: check_reqd_param (
486: p_param_value => p_mtl_maintain_rsv_rec.demand_source_line_id,
487: p_param_name => 'p_mtl_maintain_rsv_rec.demand_source_line_id',

Line 484: inv_reservation_global.g_wip_source_type_batch)) then

480: -- demandy source line is required column
481: -- codereview.su.07. demand_source_line_id is not required for inv source types
482: if (p_mtl_maintain_rsv_rec.demand_source_type_id = inv_reservation_global.g_source_type_wip
483: and l_wip_entity_type_id in (inv_reservation_global.g_wip_source_type_cmro,
484: inv_reservation_global.g_wip_source_type_batch)) then
485: check_reqd_param (
486: p_param_value => p_mtl_maintain_rsv_rec.demand_source_line_id,
487: p_param_name => 'p_mtl_maintain_rsv_rec.demand_source_line_id',
488: p_api_name => c_api_name );

Line 489: elsif (p_mtl_maintain_rsv_rec.demand_source_type_id not in (inv_reservation_global.g_source_type_inv,inv_reservation_global.g_source_type_account, inv_reservation_global.g_source_type_account_alias)) then

485: check_reqd_param (
486: p_param_value => p_mtl_maintain_rsv_rec.demand_source_line_id,
487: p_param_name => 'p_mtl_maintain_rsv_rec.demand_source_line_id',
488: p_api_name => c_api_name );
489: elsif (p_mtl_maintain_rsv_rec.demand_source_type_id not in (inv_reservation_global.g_source_type_inv,inv_reservation_global.g_source_type_account, inv_reservation_global.g_source_type_account_alias)) then
490: check_reqd_param (
491: p_param_value => p_mtl_maintain_rsv_rec.demand_source_line_id,
492: p_param_name => 'p_mtl_maintain_rsv_rec.demand_source_line_id',
493: p_api_name => c_api_name );

Line 639: = inv_reservation_global.g_source_type_inv

635:
636: l_staged_rec_exists := 'N' ;
637: for i in 1..l_mtl_reservation_tbl_count loop
638: if l_mtl_reservation_tbl(i).supply_source_type_id
639: = inv_reservation_global.g_source_type_inv
640: and nvl(l_mtl_reservation_tbl(i).staged_flag, 'N') = 'Y' then
641: l_staged_rec_exists := 'Y' ;
642: if (g_debug= c_debug_enabled) then
643: mydebug ('Staged reservation exists' ,c_api_name,1);

Line 666: and l_mtl_reservation_tbl(i).supply_source_type_id = inv_reservation_global.g_source_type_asn then

662: -- codereview.su.10 move it to begining of loop and assign record itself
663: l_original_rsv_rec := l_mtl_reservation_tbl(i) ;
664: if ( l_mtl_reservation_tbl(i).orig_supply_source_type_id
665: <> l_mtl_reservation_tbl(i).supply_source_type_id )
666: and l_mtl_reservation_tbl(i).supply_source_type_id = inv_reservation_global.g_source_type_asn then
667: l_original_rsv_rec.reservation_id :=
668: l_mtl_reservation_tbl(i).reservation_id ;
669: if (g_debug= c_debug_enabled) then
670: mydebug ('ASN reservation. Need to transfer to the

Line 674: l_to_rsv_rec.supply_source_type_id := inv_reservation_global.g_source_type_po ;

670: mydebug ('ASN reservation. Need to transfer to the
671: original supply' ,c_api_name,1);
672: end if;
673: if p_mtl_maintain_rsv_rec.action = c_action_supply then
674: l_to_rsv_rec.supply_source_type_id := inv_reservation_global.g_source_type_po ;
675: l_to_rsv_rec.supply_source_header_id := l_original_rsv_rec.supply_source_header_id;
676: l_to_rsv_rec.supply_source_line_id := l_original_rsv_rec.supply_source_line_id;
677: --codereview.su.11 assign supply_source_line_detail value too
678: l_to_rsv_rec.supply_source_line_detail := l_original_rsv_rec.supply_source_line_detail;

Line 683: l_to_rsv_rec.demand_source_type_id := inv_reservation_global.g_source_type_po ;

679: l_is_transfer_supply := fnd_api.g_true ;
680: -- codereview.su.12 comment out else statement. not required
681: /**************************
682: else
683: l_to_rsv_rec.demand_source_type_id := inv_reservation_global.g_source_type_po ;
684: l_to_rsv_rec.demand_source_header_id := l_original_rsv_rec.demand_source_header_id;
685: l_to_rsv_rec.demand_source_line_id := l_original_rsv_rec.demand_source_line_id;
686: l_to_rsv_rec.demand_source_delivery := null;
687: l_is_transfer_supply := fnd_api.g_false;

Line 1014: = inv_reservation_global.g_source_type_inv

1010:
1011: for i in 1..l_mtl_reservation_tbl_count loop
1012: -- dbms_output.put_line('looping through reservation records');
1013: if l_mtl_reservation_tbl(i).supply_source_type_id
1014: = inv_reservation_global.g_source_type_inv
1015: and nvl(l_mtl_reservation_tbl(i).staged_flag, 'N') = 'Y' then
1016: -- skip record
1017: -- dbms_output.put_line('skipping record');
1018: null;

Line 1307: procedure build_res_rec (x_reservation_rec out nocopy inv_reservation_global.mtl_reservation_rec_type)

1303: end reduce_reservation;
1304: --this procedure initializes the reservation record - only done when a new requisition reservation
1305: --is created
1306: --
1307: procedure build_res_rec (x_reservation_rec out nocopy inv_reservation_global.mtl_reservation_rec_type)
1308: is
1309:
1310: -- define constants for api version and api name
1311: c_api_version_number constant number := 1.0;

Line 1317: l_rsv inv_reservation_global.mtl_reservation_rec_type;

1313: c_module_name constant varchar2(2000) := 'inv.plsql.inv_maintain_reservation_pub';
1314: c_debug_enabled constant number := 1 ;
1315: l_fnd_log_message varchar2(2000);
1316:
1317: l_rsv inv_reservation_global.mtl_reservation_rec_type;
1318:
1319: begin
1320: --this procedure initializes the mtl_reservation record
1321: l_fnd_log_message := 'begining of procedure :';

Line 1337: inv_reservation_global.g_source_type_oe; -- order entry

1333: l_rsv.requirement_date := null;
1334: l_rsv.organization_id := null; -- org id
1335: l_rsv.inventory_item_id := null; -- item id
1336: l_rsv.demand_source_type_id :=
1337: inv_reservation_global.g_source_type_oe; -- order entry
1338: l_rsv.demand_source_name := null;
1339: l_rsv.demand_source_header_id := null; -- oe order number
1340: l_rsv.demand_source_line_id := null; -- oe order line number
1341: l_rsv.demand_source_delivery := null;

Line 1359: inv_reservation_global.g_source_type_req;

1355: l_rsv.autodetail_group_id := null;
1356: l_rsv.external_source_code := null;
1357: l_rsv.external_source_line_id := null;
1358: l_rsv.supply_source_type_id :=
1359: inv_reservation_global.g_source_type_req;
1360: l_rsv.supply_source_header_id := null; -- po req header id
1361: l_rsv.supply_source_line_id := null; -- po req line id
1362: l_rsv.supply_source_name := null;
1363: l_rsv.supply_source_line_detail := null;

Line 1462: l_rsv inv_reservation_global.mtl_reservation_rec_type;

1458: --l_debug number := nvl(fnd_profile.value('inv_debug_trace'), 0);
1459: l_fnd_log_message varchar2(2000);
1460: l_msg_index_out number;
1461:
1462: l_rsv inv_reservation_global.mtl_reservation_rec_type;
1463: l_return_status varchar2(1);
1464: --l_msg_count number := 0;
1465: --l_msg_data varchar2(2000);
1466: l_qty number;

Line 1511: inv_reservation_global.g_source_type_internal_ord,

1507: mydebug(l_fnd_log_message,c_api_name,9);
1508: end if;
1509:
1510: select decode (h.source_document_type_id, 10,
1511: inv_reservation_global.g_source_type_internal_ord,
1512: inv_reservation_global.g_source_type_oe )
1513: into l_demand_source_type_id
1514: from oe_order_headers_all h, oe_order_lines_all l
1515: where h.header_id = l.header_id

Line 1512: inv_reservation_global.g_source_type_oe )

1508: end if;
1509:
1510: select decode (h.source_document_type_id, 10,
1511: inv_reservation_global.g_source_type_internal_ord,
1512: inv_reservation_global.g_source_type_oe )
1513: into l_demand_source_type_id
1514: from oe_order_headers_all h, oe_order_lines_all l
1515: where h.header_id = l.header_id
1516: and l.line_id = p_demand_source_line_id;

Line 1721: ,x_rsv_array OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type

1717: ,p_supply_source_line_id IN NUMBER DEFAULT NULL
1718: ,p_supply_source_type_id IN NUMBER
1719: ,p_project_id IN NUMBER
1720: ,p_task_id IN NUMBER
1721: ,x_rsv_array OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type
1722: ,x_record_count OUT NOCOPY NUMBER
1723: ,x_msg_count OUT NOCOPY NUMBER
1724: ,x_msg_data OUT NOCOPY VARCHAR2
1725: ,x_return_status OUT NOCOPY VARCHAR2)

Line 1737: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

1733: --l_debug NUMBER := NVL(fnd_profile.VALUE('INV_DEBUG_TRACE'), 0);
1734: l_Fnd_Log_Message VARCHAR2(2000);
1735: l_Msg_Index_Out Number;
1736:
1737: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
1738: --l_msg_count NUMBER;
1739: --l_msg_data VARCHAR2(240);
1740: l_rsv_id NUMBER;
1741: l_return_status VARCHAR2(1);

Line 1743: l_rsv_array inv_reservation_global.mtl_reservation_tbl_type;

1739: --l_msg_data VARCHAR2(240);
1740: l_rsv_id NUMBER;
1741: l_return_status VARCHAR2(1);
1742: l_error_code NUMBER;
1743: l_rsv_array inv_reservation_global.mtl_reservation_tbl_type;
1744: l_record_count NUMBER;
1745: l_error_text VARCHAR2(2000);
1746: BEGIN
1747: l_Fnd_Log_message := 'Begining of procedure :';

Line 1774: (inv_reservation_global.g_source_type_po,

1770: FND_MESSAGE.SET_NAME('INV','INV_API_NULL_SOURCE_TYPE_ID');
1771: FND_MSG_PUB.Add;
1772: RAISE fnd_api.g_exc_unexpected_error;
1773: ELSIF p_supply_source_type_id NOT IN
1774: (inv_reservation_global.g_source_type_po,
1775: inv_reservation_global.g_source_type_internal_req,
1776: inv_reservation_global.g_source_type_req) THEN
1777: FND_MESSAGE.SET_NAME('INV','INV_API_INVALID_SOURCE_TYPE_ID');
1778: FND_MSG_PUB.Add;

Line 1775: inv_reservation_global.g_source_type_internal_req,

1771: FND_MSG_PUB.Add;
1772: RAISE fnd_api.g_exc_unexpected_error;
1773: ELSIF p_supply_source_type_id NOT IN
1774: (inv_reservation_global.g_source_type_po,
1775: inv_reservation_global.g_source_type_internal_req,
1776: inv_reservation_global.g_source_type_req) THEN
1777: FND_MESSAGE.SET_NAME('INV','INV_API_INVALID_SOURCE_TYPE_ID');
1778: FND_MSG_PUB.Add;
1779: RAISE fnd_api.g_exc_unexpected_error;

Line 1776: inv_reservation_global.g_source_type_req) THEN

1772: RAISE fnd_api.g_exc_unexpected_error;
1773: ELSIF p_supply_source_type_id NOT IN
1774: (inv_reservation_global.g_source_type_po,
1775: inv_reservation_global.g_source_type_internal_req,
1776: inv_reservation_global.g_source_type_req) THEN
1777: FND_MESSAGE.SET_NAME('INV','INV_API_INVALID_SOURCE_TYPE_ID');
1778: FND_MSG_PUB.Add;
1779: RAISE fnd_api.g_exc_unexpected_error;
1780: END IF;

Line 1801: , p_sort_by_req_date => inv_reservation_global.g_query_demand_ship_date_asc

1797: , x_msg_count => x_msg_count
1798: , x_msg_data => x_msg_data
1799: , p_query_input => l_rsv_rec
1800: , p_lock_records => fnd_api.g_false
1801: , p_sort_by_req_date => inv_reservation_global.g_query_demand_ship_date_asc
1802: , p_cancel_order_mode => inv_reservation_global.g_cancel_order_no
1803: , x_mtl_reservation_tbl => l_rsv_array
1804: , x_mtl_reservation_tbl_count => l_record_count
1805: , x_error_code => l_error_code

Line 1802: , p_cancel_order_mode => inv_reservation_global.g_cancel_order_no

1798: , x_msg_data => x_msg_data
1799: , p_query_input => l_rsv_rec
1800: , p_lock_records => fnd_api.g_false
1801: , p_sort_by_req_date => inv_reservation_global.g_query_demand_ship_date_asc
1802: , p_cancel_order_mode => inv_reservation_global.g_cancel_order_no
1803: , x_mtl_reservation_tbl => l_rsv_array
1804: , x_mtl_reservation_tbl_count => l_record_count
1805: , x_error_code => l_error_code
1806: );

Line 1990: , p_supply_source_type_id IN NUMBER DEFAULT inv_reservation_global.g_source_type_po)

1986: -- this procedure checks whether a reservation exists
1987: --
1988: FUNCTION EXISTS_RESERVATION( p_supply_source_header_id IN NUMBER DEFAULT NULL
1989: , p_supply_source_line_id IN NUMBER DEFAULT NULL
1990: , p_supply_source_type_id IN NUMBER DEFAULT inv_reservation_global.g_source_type_po)
1991:
1992: RETURN BOOLEAN IS
1993: -- Define Constants for API version and API name
1994: C_api_version_number CONSTANT NUMBER := 1.0;

Line 2003: l_rsv_array inv_reservation_global.mtl_reservation_tbl_type;

1999: --l_debug NUMBER := NVL(fnd_profile.VALUE('INV_DEBUG_TRACE'), 0);
2000: l_Fnd_Log_Message VARCHAR2(2000);
2001: l_Msg_Index_Out Number;
2002:
2003: l_rsv_array inv_reservation_global.mtl_reservation_tbl_type;
2004: l_record_count NUMBER;
2005: l_msg_count NUMBER;
2006: l_msg_data VARCHAR2(2000);
2007: l_return_status VARCHAR2(1);

Line 2097: ,x_res_array OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type

2093: (
2094: p_req_line_id IN NUMBER
2095: ,p_project_id IN NUMBER
2096: ,p_task_id IN NUMBER
2097: ,x_res_array OUT NOCOPY inv_reservation_global.mtl_reservation_tbl_type
2098: ,x_record_count OUT NOCOPY NUMBER
2099: )
2100: IS
2101: -- Define Constants for API version and API name

Line 2147: ,p_supply_source_type_id => inv_reservation_global.g_source_type_req

2143:
2144:
2145: QUERY_RES
2146: (p_supply_source_line_id => p_req_line_id
2147: ,p_supply_source_type_id => inv_reservation_global.g_source_type_req
2148: ,p_project_id => p_project_id
2149: ,p_task_id => p_task_id
2150: ,x_rsv_array => x_res_array
2151: ,x_record_count => l_record_count

Line 2223: l_rsv inv_reservation_global.mtl_reservation_rec_type;

2219: --l_debug NUMBER := NVL(fnd_profile.VALUE('INV_DEBUG_TRACE'), 0);
2220: l_Fnd_Log_Message VARCHAR2(2000);
2221: l_Msg_Index_Out Number;
2222:
2223: l_rsv inv_reservation_global.mtl_reservation_rec_type;
2224: l_rsv_new inv_reservation_global.mtl_reservation_rec_type;
2225: --l_msg_count NUMBER;
2226: --l_msg_data VARCHAR2(240);
2227: l_rsv_id NUMBER;

Line 2224: l_rsv_new inv_reservation_global.mtl_reservation_rec_type;

2220: l_Fnd_Log_Message VARCHAR2(2000);
2221: l_Msg_Index_Out Number;
2222:
2223: l_rsv inv_reservation_global.mtl_reservation_rec_type;
2224: l_rsv_new inv_reservation_global.mtl_reservation_rec_type;
2225: --l_msg_count NUMBER;
2226: --l_msg_data VARCHAR2(240);
2227: l_rsv_id NUMBER;
2228: l_return_status VARCHAR2(1);

Line 2477: l_rsv inv_reservation_global.mtl_reservation_rec_type;

2473: --l_debug NUMBER := NVL(fnd_profile.VALUE('INV_DEBUG_TRACE'), 0);
2474: l_Fnd_Log_Message VARCHAR2(2000);
2475: l_Msg_Index_Out Number;
2476:
2477: l_rsv inv_reservation_global.mtl_reservation_rec_type;
2478: l_rsv_new inv_reservation_global.mtl_reservation_rec_type;
2479: --l_msg_count NUMBER;
2480: --l_msg_data VARCHAR2(240);
2481: l_rsv_id NUMBER;

Line 2478: l_rsv_new inv_reservation_global.mtl_reservation_rec_type;

2474: l_Fnd_Log_Message VARCHAR2(2000);
2475: l_Msg_Index_Out Number;
2476:
2477: l_rsv inv_reservation_global.mtl_reservation_rec_type;
2478: l_rsv_new inv_reservation_global.mtl_reservation_rec_type;
2479: --l_msg_count NUMBER;
2480: --l_msg_data VARCHAR2(240);
2481: l_rsv_id NUMBER;
2482: l_return_status VARCHAR2(1);

Line 2774: l_rsv inv_reservation_global.mtl_reservation_rec_type;

2770: --l_debug NUMBER := NVL(fnd_profile.VALUE('INV_DEBUG_TRACE'), 0);
2771: l_Fnd_Log_Message VARCHAR2(2000);
2772: l_Msg_Index_Out Number;
2773:
2774: l_rsv inv_reservation_global.mtl_reservation_rec_type;
2775: --l_msg_count NUMBER;
2776: --l_msg_data VARCHAR2(240);
2777: l_rsv_id NUMBER;
2778: --l_dummy_sn inv_reservation_global.serial_number_tbl_type;

Line 2778: --l_dummy_sn inv_reservation_global.serial_number_tbl_type;

2774: l_rsv inv_reservation_global.mtl_reservation_rec_type;
2775: --l_msg_count NUMBER;
2776: --l_msg_data VARCHAR2(240);
2777: l_rsv_id NUMBER;
2778: --l_dummy_sn inv_reservation_global.serial_number_tbl_type;
2779: l_return_status VARCHAR2(1);
2780: BEGIN
2781: l_Fnd_Log_message := 'Begining of procedure :';
2782: -- Dbms_output.Put_line('Begining Of Procedure');

Line 3267: AND demand_source_type_id in (inv_reservation_global.g_source_type_oe,

3263: SELECT sum(nvl(primary_reservation_quantity,0)) sum_pri_res_qty, primary_uom_code
3264: FROM mtl_reservations
3265: WHERE demand_source_header_id = v_demand_header_id
3266: AND demand_source_line_id = v_demand_line_id
3267: AND demand_source_type_id in (inv_reservation_global.g_source_type_oe,
3268: inv_reservation_global.g_source_type_internal_ord)
3269: GROUP BY primary_uom_code;
3270: -- AND supply_source_type_id = inv_reservation_global.g_source_type_inv;
3271: -- comment out last restriction supply_source_type_id = inv_reservation_global.g_source_type_inv

Line 3268: inv_reservation_global.g_source_type_internal_ord)

3264: FROM mtl_reservations
3265: WHERE demand_source_header_id = v_demand_header_id
3266: AND demand_source_line_id = v_demand_line_id
3267: AND demand_source_type_id in (inv_reservation_global.g_source_type_oe,
3268: inv_reservation_global.g_source_type_internal_ord)
3269: GROUP BY primary_uom_code;
3270: -- AND supply_source_type_id = inv_reservation_global.g_source_type_inv;
3271: -- comment out last restriction supply_source_type_id = inv_reservation_global.g_source_type_inv
3272: -- since starting from r12, we will start to open manual reservations for WIP job....

Line 3270: -- AND supply_source_type_id = inv_reservation_global.g_source_type_inv;

3266: AND demand_source_line_id = v_demand_line_id
3267: AND demand_source_type_id in (inv_reservation_global.g_source_type_oe,
3268: inv_reservation_global.g_source_type_internal_ord)
3269: GROUP BY primary_uom_code;
3270: -- AND supply_source_type_id = inv_reservation_global.g_source_type_inv;
3271: -- comment out last restriction supply_source_type_id = inv_reservation_global.g_source_type_inv
3272: -- since starting from r12, we will start to open manual reservations for WIP job....
3273:
3274:

Line 3271: -- comment out last restriction supply_source_type_id = inv_reservation_global.g_source_type_inv

3267: AND demand_source_type_id in (inv_reservation_global.g_source_type_oe,
3268: inv_reservation_global.g_source_type_internal_ord)
3269: GROUP BY primary_uom_code;
3270: -- AND supply_source_type_id = inv_reservation_global.g_source_type_inv;
3271: -- comment out last restriction supply_source_type_id = inv_reservation_global.g_source_type_inv
3272: -- since starting from r12, we will start to open manual reservations for WIP job....
3273:
3274:
3275: /* Bug# 3085721, This Cursor will check if the reservation is already

Line 3284: AND Supply_source_type_id=inv_reservation_global.g_source_type_req;

3280: SELECT 'Exists'
3281: FROM mtl_reservations
3282: WHERE supply_source_header_id = v_requisition_header_id
3283: AND supply_source_line_id = v_requisition_line_id
3284: AND Supply_source_type_id=inv_reservation_global.g_source_type_req;
3285:
3286: CURSOR get_po_shipment(v_po_header_id IN NUMBER) IS
3287: SELECT pll.po_header_id
3288: ,pll.po_line_id

Line 3334: AND supply_source_type_id = inv_reservation_global.g_source_type_po

3330: , sum(nvl(primary_reservation_quantity,0)) primary_reservation_quantity
3331: FROM mtl_reservations
3332: WHERE supply_source_header_id = v_po_header_id
3333: AND supply_source_line_id = v_po_line_location_id
3334: AND supply_source_type_id = inv_reservation_global.g_source_type_po
3335: AND Nvl(project_id,-99) = nvl(v_project_id, -99)
3336: AND Nvl(task_id,-99) = nvl(v_task_id, -99)
3337: GROUP BY reservation_uom_code
3338: , primary_uom_code;

Line 3576: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;

3572: l_temp_res_qty NUMBER;
3573: l_lead_time NUMBER; -- Bug# 2984835.
3574: l_res_exists VARCHAR2(10); -- Bug# 3085721.
3575:
3576: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
3577: l_rsv_array inv_reservation_global.mtl_reservation_tbl_type;
3578:
3579: l_record_count NUMBER;
3580: l_qty_avail_to_reserve NUMBER;

Line 3577: l_rsv_array inv_reservation_global.mtl_reservation_tbl_type;

3573: l_lead_time NUMBER; -- Bug# 2984835.
3574: l_res_exists VARCHAR2(10); -- Bug# 3085721.
3575:
3576: l_rsv_rec inv_reservation_global.mtl_reservation_rec_type;
3577: l_rsv_array inv_reservation_global.mtl_reservation_tbl_type;
3578:
3579: l_record_count NUMBER;
3580: l_qty_avail_to_reserve NUMBER;
3581: l_qty_avail NUMBER;

Line 3610: l_mtl_maint_rsv_rec inv_reservation_global.mtl_maintain_rsv_rec_type;

3606: get_req_line_po_shipment_rec get_req_line_of_po_shipment%ROWTYPE;
3607: get_pt_count_po_shipment_rec get_pt_count_po_shipment%ROWTYPE;
3608: get_pt_po_shipment_rec get_proj_task_of_po_shipment%ROWTYPE;
3609:
3610: l_mtl_maint_rsv_rec inv_reservation_global.mtl_maintain_rsv_rec_type;
3611:
3612: get_po_res_qty_rec get_po_res_qty%ROWTYPE;
3613: get_po_shipment_rel_rec get_po_shipment_for_release%ROWTYPE;
3614: get_req_hdr_lines_rec get_req_hdr_lines%ROWTYPE;

Line 3622: p_mtl_maintain_rsv_rec inv_reservation_global.mtl_maintain_rsv_rec_type;

3618:
3619: get_rcv_transaction_rec get_rcv_transaction%ROWTYPE;
3620: get_rcv_transaction_asn_rec get_rcv_transaction_asn%ROWTYPE;
3621: get_rcv_txn_int_req_rec get_rcv_txn_int_req%ROWTYPE;
3622: p_mtl_maintain_rsv_rec inv_reservation_global.mtl_maintain_rsv_rec_type;
3623: get_source_doc_code_rec get_source_doc_code%ROWTYPE;
3624: l_delete_flag VARCHAR2(1);
3625: l_sort_by_criteria Number;
3626: --l_transaction_id NUMBER;

Line 3809: l_supply_source_type_id := inv_reservation_global.g_source_type_internal_req;

3805: mydebug(l_Fnd_Log_Message, c_api_name,9);
3806: END IF;
3807: -- Get the source_type_code to determine the requistion type
3808: IF Upper(interface_record_rec.source_type_code) = 'INVENTORY' THEN
3809: l_supply_source_type_id := inv_reservation_global.g_source_type_internal_req;
3810: else
3811: l_supply_source_type_id := inv_reservation_global.g_source_type_req;
3812: END IF;
3813:

Line 3811: l_supply_source_type_id := inv_reservation_global.g_source_type_req;

3807: -- Get the source_type_code to determine the requistion type
3808: IF Upper(interface_record_rec.source_type_code) = 'INVENTORY' THEN
3809: l_supply_source_type_id := inv_reservation_global.g_source_type_internal_req;
3810: else
3811: l_supply_source_type_id := inv_reservation_global.g_source_type_req;
3812: END IF;
3813:
3814: CREATE_RES
3815: ( p_inventory_item_id => interface_record_rec.item_id

Line 3927: , p_supply_source_type_id =>inv_reservation_global.g_source_type_po --IN NUMBER

3923: , x_msg_count =>x_msg_count --OUT NOCOPY NUMBER
3924: , x_msg_data =>x_msg_data --OUT NOCOPY VARCHAR2
3925: , p_organization_id =>get_po_shipment_rec.ship_to_organization_id--IN NUMBER default null
3926: , p_item_id =>get_po_shipment_rec.item_id --IN NUMBER default null
3927: , p_supply_source_type_id =>inv_reservation_global.g_source_type_po --IN NUMBER
3928: , p_supply_source_header_id =>p_header_id --IN NUMBER
3929: , p_supply_source_line_id =>get_po_shipment_rec.line_location_id --IN NUMBER
3930: , p_project_id =>get_req_line_po_shipment_rec.project_id--IN NUMBER default null
3931: , p_task_id =>get_req_line_po_shipment_rec.task_id --IN NUMBER default null

Line 3987: ,p_supply_source_type_id => inv_reservation_global.g_source_type_req

3983:
3984: update_res
3985: (p_supply_source_header_id => l_rsv_rec.supply_source_header_id
3986: ,p_supply_source_line_id => l_rsv_rec.supply_source_line_id
3987: ,p_supply_source_type_id => inv_reservation_global.g_source_type_req
3988: ,p_primary_reservation_quantity => l_qty_avail_to_reserve
3989: ,p_project_id => get_req_line_po_shipment_rec.project_id
3990: ,p_task_id => get_req_line_po_shipment_rec.task_id
3991: ,p_reservation_id => l_rsv_rec.reservation_id

Line 4017: ,p_supply_source_type_id =>inv_reservation_global.g_source_type_req

4013: TRANSFER_RES
4014: (p_from_reservation_id =>l_rsv_rec.reservation_id
4015: ,p_from_source_header_id =>l_rsv_rec.supply_source_header_id
4016: ,p_from_source_line_id =>l_rsv_rec.supply_source_line_id
4017: ,p_supply_source_type_id =>inv_reservation_global.g_source_type_req
4018: ,p_to_source_header_id =>p_header_id
4019: ,p_to_source_line_id =>get_po_shipment_rec.line_location_id
4020: ,p_to_supply_source_type_id =>inv_reservation_global.g_source_type_po
4021: ,p_primary_uom_code =>l_rsv_rec.primary_uom_code

Line 4020: ,p_to_supply_source_type_id =>inv_reservation_global.g_source_type_po

4016: ,p_from_source_line_id =>l_rsv_rec.supply_source_line_id
4017: ,p_supply_source_type_id =>inv_reservation_global.g_source_type_req
4018: ,p_to_source_header_id =>p_header_id
4019: ,p_to_source_line_id =>get_po_shipment_rec.line_location_id
4020: ,p_to_supply_source_type_id =>inv_reservation_global.g_source_type_po
4021: ,p_primary_uom_code =>l_rsv_rec.primary_uom_code
4022: ,p_primary_res_quantity =>l_primary_res_quantity
4023: ,x_msg_count => x_msg_count
4024: ,x_msg_data => x_msg_data

Line 4093: ,p_supply_source_type_id =>inv_reservation_global.g_source_type_req

4089: TRANSFER_RES
4090: (p_from_reservation_id =>l_rsv_rec.reservation_id
4091: ,p_from_source_header_id =>l_rsv_rec.supply_source_header_id
4092: ,p_from_source_line_id =>l_rsv_rec.supply_source_line_id
4093: ,p_supply_source_type_id =>inv_reservation_global.g_source_type_req
4094: ,p_to_source_header_id =>p_header_id
4095: ,p_to_source_line_id =>get_po_shipment_rec.line_location_id
4096: ,p_to_supply_source_type_id =>inv_reservation_global.g_source_type_po
4097: ,p_primary_uom_code =>l_rsv_rec.primary_uom_code

Line 4096: ,p_to_supply_source_type_id =>inv_reservation_global.g_source_type_po

4092: ,p_from_source_line_id =>l_rsv_rec.supply_source_line_id
4093: ,p_supply_source_type_id =>inv_reservation_global.g_source_type_req
4094: ,p_to_source_header_id =>p_header_id
4095: ,p_to_source_line_id =>get_po_shipment_rec.line_location_id
4096: ,p_to_supply_source_type_id =>inv_reservation_global.g_source_type_po
4097: ,p_primary_uom_code =>l_rsv_rec.primary_uom_code
4098: ,p_primary_res_quantity =>l_rsv_rec.primary_reservation_quantity
4099: ,x_msg_count =>x_msg_count
4100: ,x_msg_data =>x_msg_data

Line 4148: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;

4144: -- delete_flag to yes. delete all reservations for that
4145: -- supply line.
4146: -- calling reduce_reservation API
4147: l_delete_flag := 'Y';
4148: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;
4149: l_mtl_maint_rsv_rec.action := 0;--supply is reduced
4150: l_mtl_maint_rsv_rec.organization_id :=
4151: get_po_shipment_rec.ship_to_organization_id;
4152: l_mtl_maint_rsv_rec.inventory_item_id :=

Line 4154: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;

4150: l_mtl_maint_rsv_rec.organization_id :=
4151: get_po_shipment_rec.ship_to_organization_id;
4152: l_mtl_maint_rsv_rec.inventory_item_id :=
4153: get_po_shipment_rec.item_id;
4154: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;
4155: l_mtl_maint_rsv_rec.supply_source_header_id := p_header_id;
4156: l_mtl_maint_rsv_rec.supply_source_line_id :=
4157: get_po_shipment_rec.line_location_id;
4158: --l_mtl_maint_rsv_rec.supply_source_line_detail := NULL;

Line 4194: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po

4190: /***** Call reduce reservations instead of delete reservations
4191: DELETE_RES
4192: (p_supply_source_header_id => p_header_id
4193: ,p_supply_source_line_id => get_po_shipment_rec.line_location_id
4194: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po
4195: ,x_msg_count => x_msg_count
4196: ,x_msg_data => x_msg_data
4197: ,x_return_status => l_return_status);
4198: IF g_debug= C_Debug_Enabled THEN

Line 4236: , p_supply_source_type_id => inv_reservation_global.g_source_type_po

4232: , x_msg_count => x_msg_count
4233: , x_msg_data => x_msg_data
4234: , p_organization_id => get_po_shipment_rec.ship_to_organization_id
4235: , p_item_id => get_po_shipment_rec.item_id
4236: , p_supply_source_type_id => inv_reservation_global.g_source_type_po
4237: , p_supply_source_header_id => p_header_id
4238: , p_supply_source_line_id => get_po_shipment_rec.line_location_id
4239: , p_project_id => get_pt_po_shipment_rec.project_id
4240: , p_task_id => get_pt_po_shipment_rec.task_id

Line 4273: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;

4269:
4270: IF (get_po_res_qty_rec.primary_reservation_quantity > l_qty_avail) THEN
4271: -- calling reduce_reservation API
4272: l_mtl_maint_rsv_rec.action := 0;--supply is reduced
4273: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;
4274: l_mtl_maint_rsv_rec.organization_id :=
4275: get_po_shipment_rec.ship_to_organization_id;
4276: l_mtl_maint_rsv_rec.inventory_item_id :=
4277: get_po_shipment_rec.item_id;

Line 4278: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;

4274: l_mtl_maint_rsv_rec.organization_id :=
4275: get_po_shipment_rec.ship_to_organization_id;
4276: l_mtl_maint_rsv_rec.inventory_item_id :=
4277: get_po_shipment_rec.item_id;
4278: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;
4279: l_mtl_maint_rsv_rec.supply_source_header_id := p_header_id;
4280: l_mtl_maint_rsv_rec.supply_source_line_id := get_po_shipment_rec.line_location_id;
4281: -- l_mtl_maint_rsv_rec.supply_source_line_detail := NULL;
4282: --l_mtl_maint_rsv_rec.expected_quantity := get_po_res_qty_rec.primary_reservation_quantity - l_qty_avail_to_reserve;

Line 4521: l_Fnd_Log_Message := 'p_supply_source_type_id : '|| inv_reservation_global.g_source_type_po;

4517: l_Fnd_Log_Message := 'p_supply_source_header_id :' || get_rcv_transaction_rec.po_header_id;
4518: mydebug(l_Fnd_Log_Message, c_api_name,9);
4519: l_Fnd_Log_Message := 'p_supply_source_line_id : '|| get_rcv_transaction_rec.po_line_location_id;
4520: mydebug(l_Fnd_Log_Message, c_api_name,9);
4521: l_Fnd_Log_Message := 'p_supply_source_type_id : '|| inv_reservation_global.g_source_type_po;
4522: mydebug(l_Fnd_Log_Message, c_api_name,9);
4523: l_Fnd_Log_Message := 'p_project_id : '|| get_rcv_transaction_rec.project_id;
4524: mydebug(l_Fnd_Log_Message, c_api_name,9);
4525: l_Fnd_Log_Message := 'p_task_id: '||get_rcv_transaction_rec.task_id;

Line 4530: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po

4526: mydebug(l_Fnd_Log_Message, c_api_name,9);
4527: END IF;
4528: query_res(p_supply_source_header_id => get_rcv_transaction_rec.po_header_id
4529: ,p_supply_source_line_id => get_rcv_transaction_rec.po_line_location_id
4530: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po
4531: ,p_project_id => get_rcv_transaction_rec.project_id
4532: ,p_task_id => get_rcv_transaction_rec.task_id
4533: ,x_rsv_array => l_rsv_array
4534: ,x_record_count => l_record_count

Line 4572: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po

4568: TRANSFER_RES
4569: (p_from_reservation_id => l_rsv_array(l_record_index).reservation_id
4570: , p_from_source_header_id => get_rcv_transaction_rec.po_header_id
4571: ,p_from_source_line_id => get_rcv_transaction_rec.po_line_location_id
4572: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po
4573: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv
4574: ,p_subinventory_code => get_rcv_transaction_rec.subinventory
4575: ,p_locator_id => get_rcv_transaction_rec.locator_id
4576: ,p_lot_number => NVL(get_rcv_lot_number_rec.lot_num, NULL)

Line 4573: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv

4569: (p_from_reservation_id => l_rsv_array(l_record_index).reservation_id
4570: , p_from_source_header_id => get_rcv_transaction_rec.po_header_id
4571: ,p_from_source_line_id => get_rcv_transaction_rec.po_line_location_id
4572: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po
4573: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv
4574: ,p_subinventory_code => get_rcv_transaction_rec.subinventory
4575: ,p_locator_id => get_rcv_transaction_rec.locator_id
4576: ,p_lot_number => NVL(get_rcv_lot_number_rec.lot_num, NULL)
4577: ,p_revision => get_rcv_transaction_rec.item_revision

Line 4614: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po

4610: TRANSFER_RES
4611: (p_from_reservation_id => l_rsv_array(l_record_index).reservation_id
4612: ,p_from_source_header_id => get_rcv_transaction_rec.po_header_id
4613: ,p_from_source_line_id => get_rcv_transaction_rec.po_line_location_id
4614: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po
4615: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv
4616: ,p_subinventory_code => get_rcv_transaction_rec.subinventory
4617: ,p_locator_id => get_rcv_transaction_rec.locator_id
4618: ,p_lot_number => NVL(get_rcv_lot_number_rec.lot_num, NULL)

Line 4615: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv

4611: (p_from_reservation_id => l_rsv_array(l_record_index).reservation_id
4612: ,p_from_source_header_id => get_rcv_transaction_rec.po_header_id
4613: ,p_from_source_line_id => get_rcv_transaction_rec.po_line_location_id
4614: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po
4615: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv
4616: ,p_subinventory_code => get_rcv_transaction_rec.subinventory
4617: ,p_locator_id => get_rcv_transaction_rec.locator_id
4618: ,p_lot_number => NVL(get_rcv_lot_number_rec.lot_num, NULL)
4619: ,p_revision => get_rcv_transaction_rec.item_revision

Line 4812: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po

4808:
4809: query_res
4810: (p_supply_source_header_id => get_rcv_transaction_asn_rec.po_header_id
4811: ,p_supply_source_line_id => get_rcv_transaction_asn_rec.po_line_location_id
4812: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po
4813: ,p_project_id => get_rcv_transaction_asn_rec.project_id
4814: ,p_task_id => get_rcv_transaction_asn_rec.task_id
4815: ,x_rsv_array => l_rsv_array
4816: ,x_record_count => l_record_count

Line 4852: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po

4848: TRANSFER_RES
4849: (p_from_reservation_id => l_rsv_array(l_record_index).reservation_id
4850: , p_from_source_header_id => get_rcv_transaction_asn_rec.po_header_id
4851: ,p_from_source_line_id => get_rcv_transaction_asn_rec.po_line_location_id
4852: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po
4853: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv
4854: ,p_subinventory_code => get_rcv_transaction_rec.subinventory
4855: ,p_locator_id => get_rcv_transaction_rec.locator_id
4856: ,p_lot_number => NVL(get_rcv_lot_number_rec.lot_num, NULL)

Line 4853: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv

4849: (p_from_reservation_id => l_rsv_array(l_record_index).reservation_id
4850: , p_from_source_header_id => get_rcv_transaction_asn_rec.po_header_id
4851: ,p_from_source_line_id => get_rcv_transaction_asn_rec.po_line_location_id
4852: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po
4853: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv
4854: ,p_subinventory_code => get_rcv_transaction_rec.subinventory
4855: ,p_locator_id => get_rcv_transaction_rec.locator_id
4856: ,p_lot_number => NVL(get_rcv_lot_number_rec.lot_num, NULL)
4857: ,p_revision => get_rcv_transaction_asn_rec.item_revision

Line 4871: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po

4867: TRANSFER_RES
4868: (p_from_reservation_id => l_rsv_array(l_record_index).reservation_id
4869: ,p_from_source_header_id => get_rcv_transaction_asn_rec.po_header_id
4870: ,p_from_source_line_id => get_rcv_transaction_asn_rec.po_line_location_id
4871: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po
4872: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv
4873: ,p_subinventory_code => get_rcv_transaction_asn_rec.subinventory
4874: ,p_locator_id => get_rcv_transaction_asn_rec.locator_id
4875: ,p_lot_number => NVL(get_rcv_lot_number_rec.lot_num, NULL)

Line 4872: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv

4868: (p_from_reservation_id => l_rsv_array(l_record_index).reservation_id
4869: ,p_from_source_header_id => get_rcv_transaction_asn_rec.po_header_id
4870: ,p_from_source_line_id => get_rcv_transaction_asn_rec.po_line_location_id
4871: ,p_supply_source_type_id => inv_reservation_global.g_source_type_po
4872: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv
4873: ,p_subinventory_code => get_rcv_transaction_asn_rec.subinventory
4874: ,p_locator_id => get_rcv_transaction_asn_rec.locator_id
4875: ,p_lot_number => NVL(get_rcv_lot_number_rec.lot_num, NULL)
4876: ,p_revision => get_rcv_transaction_asn_rec.item_revision

Line 5026: ,p_supply_source_type_id => inv_reservation_global.g_source_type_internal_req

5022:
5023: query_res
5024: (p_supply_source_header_id => get_rcv_txn_int_req_rec.requisition_header_id
5025: ,p_supply_source_line_id => get_rcv_txn_int_req_rec.requisition_line_id
5026: ,p_supply_source_type_id => inv_reservation_global.g_source_type_internal_req
5027: ,p_project_id => get_rcv_txn_int_req_rec.project_id
5028: ,p_task_id => get_rcv_txn_int_req_rec.task_id
5029: ,x_rsv_array => l_rsv_array
5030: ,x_record_count => l_record_count

Line 5065: ,p_supply_source_type_id => inv_reservation_global.g_source_type_internal_req

5061: TRANSFER_RES
5062: (p_from_reservation_id => l_rsv_array(l_record_index).reservation_id
5063: ,p_from_source_header_id => get_rcv_txn_int_req_rec.requisition_header_id
5064: ,p_from_source_line_id => get_rcv_txn_int_req_rec.requisition_line_id
5065: ,p_supply_source_type_id => inv_reservation_global.g_source_type_internal_req
5066: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv
5067: ,p_subinventory_code => get_rcv_txn_int_req_rec.subinventory
5068: ,p_locator_id => get_rcv_txn_int_req_rec.locator_id
5069: ,p_lot_number => NVL(get_rcv_lot_number_rec.lot_num, NULL)

Line 5066: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv

5062: (p_from_reservation_id => l_rsv_array(l_record_index).reservation_id
5063: ,p_from_source_header_id => get_rcv_txn_int_req_rec.requisition_header_id
5064: ,p_from_source_line_id => get_rcv_txn_int_req_rec.requisition_line_id
5065: ,p_supply_source_type_id => inv_reservation_global.g_source_type_internal_req
5066: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv
5067: ,p_subinventory_code => get_rcv_txn_int_req_rec.subinventory
5068: ,p_locator_id => get_rcv_txn_int_req_rec.locator_id
5069: ,p_lot_number => NVL(get_rcv_lot_number_rec.lot_num, NULL)
5070: ,p_revision => get_rcv_txn_int_req_rec.item_revision

Line 5084: ,p_supply_source_type_id => inv_reservation_global.g_source_type_internal_req

5080: TRANSFER_RES
5081: (p_from_reservation_id => l_rsv_array(l_record_index).reservation_id
5082: ,p_from_source_header_id => get_rcv_txn_int_req_rec.requisition_header_id
5083: ,p_from_source_line_id => get_rcv_txn_int_req_rec.requisition_line_id
5084: ,p_supply_source_type_id => inv_reservation_global.g_source_type_internal_req
5085: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv
5086: ,p_subinventory_code => get_rcv_txn_int_req_rec.subinventory
5087: ,p_locator_id => get_rcv_txn_int_req_rec.locator_id
5088: ,p_lot_number => NVL(get_rcv_lot_number_rec.lot_num, NULL)

Line 5085: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv

5081: (p_from_reservation_id => l_rsv_array(l_record_index).reservation_id
5082: ,p_from_source_header_id => get_rcv_txn_int_req_rec.requisition_header_id
5083: ,p_from_source_line_id => get_rcv_txn_int_req_rec.requisition_line_id
5084: ,p_supply_source_type_id => inv_reservation_global.g_source_type_internal_req
5085: ,p_to_supply_source_type_id => inv_reservation_global.g_source_type_inv
5086: ,p_subinventory_code => get_rcv_txn_int_req_rec.subinventory
5087: ,p_locator_id => get_rcv_txn_int_req_rec.locator_id
5088: ,p_lot_number => NVL(get_rcv_lot_number_rec.lot_num, NULL)
5089: ,p_revision => get_rcv_txn_int_req_rec.item_revision

Line 5216: , p_supply_source_type_id =>inv_reservation_global.g_source_type_po

5212: , x_msg_count =>x_msg_count
5213: , x_msg_data =>x_msg_data
5214: , p_organization_id =>get_po_shipment_rel_rec.ship_to_organization_id
5215: , p_item_id =>get_po_shipment_rel_rec.item_id
5216: , p_supply_source_type_id =>inv_reservation_global.g_source_type_po
5217: , p_supply_source_header_id =>get_po_shipment_rel_rec.po_header_id
5218: , p_supply_source_line_id =>get_po_shipment_rel_rec.line_location_id
5219: , p_project_id =>get_req_line_po_shipment_rec.project_id
5220: , p_task_id =>get_req_line_po_shipment_rec.task_id

Line 5258: ,p_supply_source_type_id => inv_reservation_global.g_source_type_req

5254: IF (l_rsv_rec.primary_reservation_quantity > l_qty_avail_to_reserve) THEN
5255: update_res
5256: (p_supply_source_header_id => l_rsv_rec.supply_source_header_id
5257: ,p_supply_source_line_id => l_rsv_rec.supply_source_line_id
5258: ,p_supply_source_type_id => inv_reservation_global.g_source_type_req
5259: ,p_primary_reservation_quantity => l_qty_avail_to_reserve
5260: ,p_project_id => get_req_line_po_shipment_rec.project_id
5261: ,p_task_id => get_req_line_po_shipment_rec.task_id
5262: ,p_reservation_id => l_rsv_rec.reservation_id

Line 5286: ,p_supply_source_type_id =>inv_reservation_global.g_source_type_req

5282: TRANSFER_RES
5283: (p_from_reservation_id =>l_rsv_rec.reservation_id
5284: ,p_from_source_header_id =>l_rsv_rec.supply_source_header_id
5285: ,p_from_source_line_id =>l_rsv_rec.supply_source_line_id
5286: ,p_supply_source_type_id =>inv_reservation_global.g_source_type_req
5287: ,p_to_source_header_id =>get_po_shipment_rel_rec.po_header_id
5288: ,p_to_source_line_id =>get_po_shipment_rel_rec.line_location_id
5289: ,p_to_supply_source_type_id =>inv_reservation_global.g_source_type_po
5290: ,p_primary_uom_code =>l_rsv_rec.primary_uom_code

Line 5289: ,p_to_supply_source_type_id =>inv_reservation_global.g_source_type_po

5285: ,p_from_source_line_id =>l_rsv_rec.supply_source_line_id
5286: ,p_supply_source_type_id =>inv_reservation_global.g_source_type_req
5287: ,p_to_source_header_id =>get_po_shipment_rel_rec.po_header_id
5288: ,p_to_source_line_id =>get_po_shipment_rel_rec.line_location_id
5289: ,p_to_supply_source_type_id =>inv_reservation_global.g_source_type_po
5290: ,p_primary_uom_code =>l_rsv_rec.primary_uom_code
5291: ,p_primary_res_quantity =>l_primary_res_quantity
5292: ,x_msg_count =>x_msg_count
5293: ,x_msg_data =>x_msg_data

Line 5347: --,p_supply_source_type_id => inv_reservation_global.g_source_type_po

5343: -- reduce reservations instead
5344: -- DELETE_RES
5345: -- (p_supply_source_header_id => get_po_shipment_rel_rec.po_header_id
5346: -- ,p_supply_source_line_id => get_po_shipment_rel_rec.line_location_id
5347: --,p_supply_source_type_id => inv_reservation_global.g_source_type_po
5348: -- ,x_msg_count => x_msg_count
5349: -- ,x_msg_data => x_msg_data
5350: -- ,x_return_status => l_return_status);
5351: -- Call reduce reservations instead of delete

Line 5358: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;

5354: -- delete_flag to yes. delete all reservations for that
5355: -- supply line.
5356: -- calling reduce_reservation API
5357: l_delete_flag := 'Y';
5358: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;
5359: l_mtl_maint_rsv_rec.action := 0;--supply is reduced
5360: l_mtl_maint_rsv_rec.organization_id :=
5361: get_po_shipment_rel_rec.ship_to_organization_id;
5362: l_mtl_maint_rsv_rec.inventory_item_id :=

Line 5364: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;

5360: l_mtl_maint_rsv_rec.organization_id :=
5361: get_po_shipment_rel_rec.ship_to_organization_id;
5362: l_mtl_maint_rsv_rec.inventory_item_id :=
5363: get_po_shipment_rel_rec.item_id;
5364: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;
5365: l_mtl_maint_rsv_rec.supply_source_header_id := get_po_shipment_rel_rec.po_header_id;
5366: l_mtl_maint_rsv_rec.supply_source_line_id :=
5367: get_po_shipment_rel_rec.line_location_id;
5368: -- l_mtl_maint_rsv_rec.supply_source_line_detail := NULL;

Line 5433: , p_supply_source_type_id => inv_reservation_global.g_source_type_po --IN NUMBER

5429: , x_msg_count => x_msg_count --OUT NOCOPY NUMBER
5430: , x_msg_data => x_msg_data --OUT NOCOPY VARCHAR2
5431: , p_organization_id => get_po_shipment_rel_rec.ship_to_organization_id--IN NUMBER default null
5432: , p_item_id => get_po_shipment_rel_rec.item_id--IN NUMBER default null
5433: , p_supply_source_type_id => inv_reservation_global.g_source_type_po --IN NUMBER
5434: , p_supply_source_header_id => get_po_shipment_rel_rec.po_header_id --IN NUMBER ?? how do we query for blank PO
5435: , p_supply_source_line_id => get_po_shipment_rel_rec.line_location_id --IN NUMBER
5436: , p_project_id => get_pt_po_shipment_rec.project_id--IN NUMBER default null
5437: , p_task_id => get_pt_po_shipment_rec.task_id --IN NUMBER default null

Line 5466: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;

5462: ,l_po_primary_qty);*/
5463: IF (get_po_res_qty_rec.primary_reservation_quantity > l_qty_avail) THEN
5464: -- calling reduce_reservation API get_pt_po_shipment_rec
5465: l_mtl_maint_rsv_rec.action := 0;--supply is reduced
5466: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;
5467: l_mtl_maint_rsv_rec.organization_id
5468: := get_po_shipment_rel_rec.ship_to_organization_id;
5469: l_mtl_maint_rsv_rec.inventory_item_id := get_po_shipment_rel_rec.item_id;
5470:

Line 5471: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;

5467: l_mtl_maint_rsv_rec.organization_id
5468: := get_po_shipment_rel_rec.ship_to_organization_id;
5469: l_mtl_maint_rsv_rec.inventory_item_id := get_po_shipment_rel_rec.item_id;
5470:
5471: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;
5472: l_mtl_maint_rsv_rec.supply_source_header_id := get_po_shipment_rel_rec.po_header_id;
5473: l_mtl_maint_rsv_rec.supply_source_line_id := get_po_shipment_rel_rec.line_location_id;
5474: -- l_mtl_maint_rsv_rec.supply_source_line_detail := NULL;
5475: --l_mtl_maint_rsv_rec.expected_quantity :=

Line 5539: l_supply_source_type_id := inv_reservation_global.g_source_type_internal_req;

5535: mydebug ('Removing req supply for req line :'|| get_req_hdr_lines_rec.requisition_line_id , c_api_name,9);
5536: END IF;
5537:
5538: IF Upper(get_req_hdr_lines_rec.source_type_code) = 'INVENTORY' THEN
5539: l_supply_source_type_id := inv_reservation_global.g_source_type_internal_req;
5540: else
5541: l_supply_source_type_id := inv_reservation_global.g_source_type_req;
5542: END IF;
5543:

Line 5541: l_supply_source_type_id := inv_reservation_global.g_source_type_req;

5537:
5538: IF Upper(get_req_hdr_lines_rec.source_type_code) = 'INVENTORY' THEN
5539: l_supply_source_type_id := inv_reservation_global.g_source_type_internal_req;
5540: else
5541: l_supply_source_type_id := inv_reservation_global.g_source_type_req;
5542: END IF;
5543:
5544: IF EXISTS_RESERVATION(p_supply_source_header_id => p_header_id,
5545: p_supply_source_line_id => get_req_hdr_lines_rec.requisition_line_id,

Line 5577: l_supply_source_type_id := inv_reservation_global.g_source_type_internal_req;

5573: END;
5574:
5575:
5576: IF Upper(l_source_type_code) = 'INVENTORY' THEN
5577: l_supply_source_type_id := inv_reservation_global.g_source_type_internal_req;
5578: else
5579: l_supply_source_type_id := inv_reservation_global.g_source_type_req;
5580: END IF;
5581:

Line 5579: l_supply_source_type_id := inv_reservation_global.g_source_type_req;

5575:
5576: IF Upper(l_source_type_code) = 'INVENTORY' THEN
5577: l_supply_source_type_id := inv_reservation_global.g_source_type_internal_req;
5578: else
5579: l_supply_source_type_id := inv_reservation_global.g_source_type_req;
5580: END IF;
5581:
5582: IF EXISTS_RESERVATION(p_supply_source_line_id => p_line_id,
5583: p_supply_source_type_id => l_supply_source_type_id) THEN

Line 5611: -- ,p_supply_source_type_id => inv_reservation_global.g_source_type_po

5607: EXIT WHEN get_po_shipment%NOTFOUND;
5608:
5609: --DELETE_RES (p_supply_source_header_id => p_header_id
5610: -- ,p_supply_source_line_id => get_po_shipment_rec.line_location_id
5611: -- ,p_supply_source_type_id => inv_reservation_global.g_source_type_po
5612: -- ,x_msg_count => x_msg_count
5613: -- ,x_msg_data => x_msg_data
5614: -- ,x_return_status => l_return_status);
5615: IF g_debug= C_Debug_Enabled THEN

Line 5619: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;

5615: IF g_debug= C_Debug_Enabled THEN
5616: mydebug ('Removing po line location. po line loc.:'|| get_po_shipment_rec.line_location_id,c_api_name,9);
5617: END IF;
5618: l_delete_flag := 'Y';
5619: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;
5620: l_mtl_maint_rsv_rec.action := 0;--supply is reduced
5621: l_mtl_maint_rsv_rec.organization_id :=
5622: get_po_shipment_rec.ship_to_organization_id;
5623: l_mtl_maint_rsv_rec.inventory_item_id :=

Line 5625: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;

5621: l_mtl_maint_rsv_rec.organization_id :=
5622: get_po_shipment_rec.ship_to_organization_id;
5623: l_mtl_maint_rsv_rec.inventory_item_id :=
5624: get_po_shipment_rec.item_id;
5625: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;
5626: l_mtl_maint_rsv_rec.supply_source_header_id := p_header_id;
5627: l_mtl_maint_rsv_rec.supply_source_line_id :=
5628: get_po_shipment_rec.line_location_id;
5629: -- l_mtl_maint_rsv_rec.supply_source_line_detail := NULL;

Line 5687: -- ,p_supply_source_type_id => inv_reservation_global.g_source_type_po

5683: EXIT WHEN get_line_loc_for_po_line%NOTFOUND;
5684:
5685: -- DELETE_RES (p_supply_source_header_id => l_po_header_id
5686: -- ,p_supply_source_line_id => get_distr_rec.line_location_id
5687: -- ,p_supply_source_type_id => inv_reservation_global.g_source_type_po
5688: -- ,x_msg_count => x_msg_count
5689: -- ,x_msg_data => x_msg_data
5690: -- ,x_return_status => l_return_status);
5691: IF g_debug= C_Debug_Enabled THEN

Line 5696: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;

5692: mydebug ('Cancel line.Removing po line location. po line loc.:'|| get_line_loc_rec.line_location_id,c_api_name,9);
5693: END IF;
5694:
5695: l_delete_flag := 'Y';
5696: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;
5697: l_mtl_maint_rsv_rec.action := 0;--supply is reduced
5698: l_mtl_maint_rsv_rec.organization_id :=
5699: get_line_loc_rec.ship_to_organization_id;
5700: l_mtl_maint_rsv_rec.inventory_item_id :=

Line 5702: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;

5698: l_mtl_maint_rsv_rec.organization_id :=
5699: get_line_loc_rec.ship_to_organization_id;
5700: l_mtl_maint_rsv_rec.inventory_item_id :=
5701: get_line_loc_rec.item_id;
5702: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;
5703: l_mtl_maint_rsv_rec.supply_source_header_id := l_po_header_id;
5704: l_mtl_maint_rsv_rec.supply_source_line_id :=
5705: get_line_loc_rec.line_location_id;
5706: -- l_mtl_maint_rsv_rec.supply_source_line_detail := NULL;

Line 5763: -- ,p_supply_source_type_id => inv_reservation_global.g_source_type_po--

5759: -- EXIT WHEN get_distr_for_po_shipment%NOTFOUND;
5760: --
5761: -- DELETE_RES (p_supply_source_header_id => l_po_header_id
5762: -- ,p_supply_source_line_id => get_distr_rec.line_location_id
5763: -- ,p_supply_source_type_id => inv_reservation_global.g_source_type_po--
5764: -- ,x_msg_count => x_msg_count
5765: ---- ,x_msg_data => x_msg_data
5766: -- ,x_return_status => l_return_status);
5767: --

Line 5775: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;

5771: FETCH get_line_loc_for_po_shipment INTO get_line_loc_rec;
5772: CLOSE get_line_loc_for_po_shipment;
5773:
5774: l_delete_flag := 'Y';
5775: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;
5776: l_mtl_maint_rsv_rec.action := 0;--supply is reduced
5777: l_mtl_maint_rsv_rec.organization_id :=
5778: get_line_loc_rec.ship_to_organization_id;
5779: l_mtl_maint_rsv_rec.inventory_item_id :=

Line 5781: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;

5777: l_mtl_maint_rsv_rec.organization_id :=
5778: get_line_loc_rec.ship_to_organization_id;
5779: l_mtl_maint_rsv_rec.inventory_item_id :=
5780: get_line_loc_rec.item_id;
5781: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;
5782: l_mtl_maint_rsv_rec.supply_source_header_id := get_line_loc_rec.po_header_id;
5783: l_mtl_maint_rsv_rec.supply_source_line_id := p_line_location_id;
5784: -- l_mtl_maint_rsv_rec.supply_source_line_detail := NULL;
5785:

Line 5842: -- ,p_supply_source_type_id => inv_reservation_global.g_source_type_po

5838: -- EXIT WHEN get_distr_for_po_release%NOTFOUND;
5839:
5840: -- DELETE_RES ( p_supply_source_header_id => l_po_header_id
5841: -- ,p_supply_source_line_id => get_distr_rec.line_location_id
5842: -- ,p_supply_source_type_id => inv_reservation_global.g_source_type_po
5843: -- ,x_msg_count => x_msg_count
5844: -- ,x_msg_data => x_msg_data
5845: -- ,x_return_status => l_return_status);
5846:

Line 5858: -- ,p_supply_source_type_id => inv_reservation_global.g_source_type_po

5854: EXIT WHEN get_po_shipment%NOTFOUND;
5855:
5856: --DELETE_RES (p_supply_source_header_id => p_header_id
5857: -- ,p_supply_source_line_id => get_po_shipment_rec.line_location_id
5858: -- ,p_supply_source_type_id => inv_reservation_global.g_source_type_po
5859: -- ,x_msg_count => x_msg_count
5860: -- ,x_msg_data => x_msg_data
5861: -- ,x_return_status => l_return_status);
5862: IF g_debug= C_Debug_Enabled THEN

Line 5867: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;

5863: mydebug ('Removing po line location. po line loc.:'|| get_po_shipment_rec.line_location_id,c_api_name,9);
5864: END IF;
5865:
5866: l_delete_flag := 'Y';
5867: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;
5868: l_mtl_maint_rsv_rec.action := 0;--supply is reduced
5869: l_mtl_maint_rsv_rec.organization_id :=
5870: get_po_shipment_rec.ship_to_organization_id;
5871: l_mtl_maint_rsv_rec.inventory_item_id :=

Line 5873: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;

5869: l_mtl_maint_rsv_rec.organization_id :=
5870: get_po_shipment_rec.ship_to_organization_id;
5871: l_mtl_maint_rsv_rec.inventory_item_id :=
5872: get_po_shipment_rec.item_id;
5873: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;
5874: l_mtl_maint_rsv_rec.supply_source_header_id := l_po_header_id;
5875: l_mtl_maint_rsv_rec.supply_source_line_id :=
5876: get_po_shipment_rec.line_location_id;
5877: -- l_mtl_maint_rsv_rec.supply_source_line_detail := NULL;

Line 5936: -- ,p_supply_source_type_id => inv_reservation_global.g_source_type_po

5932: -- EXIT WHEN get_distr_for_po_shipment%NOTFOUND;
5933:
5934: -- DELETE_RES (p_supply_source_header_id => l_po_header_id
5935: -- ,p_supply_source_line_id => get_distr_rec.line_location_id
5936: -- ,p_supply_source_type_id => inv_reservation_global.g_source_type_po
5937: -- ,x_msg_count => x_msg_count
5938: -- ,x_msg_data => x_msg_data
5939: -- ,x_return_status => l_return_status);
5940: --

Line 5948: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;

5944: FETCH get_line_loc_for_po_shipment INTO get_line_loc_rec;
5945: CLOSE get_line_loc_for_po_shipment;
5946:
5947: l_delete_flag := 'Y';
5948: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;
5949: l_mtl_maint_rsv_rec.action := 0;--supply is reduced
5950: l_mtl_maint_rsv_rec.organization_id :=
5951: get_line_loc_rec.ship_to_organization_id;
5952: l_mtl_maint_rsv_rec.inventory_item_id :=

Line 5954: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;

5950: l_mtl_maint_rsv_rec.organization_id :=
5951: get_line_loc_rec.ship_to_organization_id;
5952: l_mtl_maint_rsv_rec.inventory_item_id :=
5953: get_line_loc_rec.item_id;
5954: l_mtl_maint_rsv_rec.supply_source_type_id:= inv_reservation_global.g_source_type_po;
5955: l_mtl_maint_rsv_rec.supply_source_header_id := get_line_loc_rec.po_header_id;
5956: l_mtl_maint_rsv_rec.supply_source_line_id := p_line_location_id;
5957: -- l_mtl_maint_rsv_rec.supply_source_line_detail := NULL;
5958:

Line 6007: inv_reservation_global.g_source_type_internal_req AND

6003: BEGIN
6004: SELECT Nvl(SUM(primary_reservation_quantity),0) INTO
6005: l_primary_res_qty FROM mtl_reservations
6006: WHERE supply_source_type_id =
6007: inv_reservation_global.g_source_type_internal_req AND
6008: supply_source_header_id = p_header_id AND
6009: supply_source_line_id = p_line_id;
6010: EXCEPTION
6011: WHEN no_data_found THEN

Line 6038: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;

6034: IF (p_ordered_quantity = 0) THEN
6035: -- delete all reservations for that req line
6036: -- calling reduce_reservation API
6037: l_delete_flag := 'Y';
6038: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;
6039: l_mtl_maint_rsv_rec.action := 0;--supply is reduced
6040: l_mtl_maint_rsv_rec.organization_id := l_organization_id;
6041: l_mtl_maint_rsv_rec.inventory_item_id := l_inventory_item_id;
6042: --bug #5498904 populated l_mtl_maint_rsv_rec.supply_source_type_id

Line 6043: l_mtl_maint_rsv_rec.supply_source_type_id := inv_reservation_global.g_source_type_internal_req;

6039: l_mtl_maint_rsv_rec.action := 0;--supply is reduced
6040: l_mtl_maint_rsv_rec.organization_id := l_organization_id;
6041: l_mtl_maint_rsv_rec.inventory_item_id := l_inventory_item_id;
6042: --bug #5498904 populated l_mtl_maint_rsv_rec.supply_source_type_id
6043: l_mtl_maint_rsv_rec.supply_source_type_id := inv_reservation_global.g_source_type_internal_req;
6044: l_supply_source_type_id := inv_reservation_global.g_source_type_internal_req;
6045: l_mtl_maint_rsv_rec.supply_source_header_id := p_header_id;
6046: l_mtl_maint_rsv_rec.supply_source_line_id := p_line_id;
6047: -- l_mtl_maint_rsv_rec.supply_source_line_detail := NULL;

Line 6044: l_supply_source_type_id := inv_reservation_global.g_source_type_internal_req;

6040: l_mtl_maint_rsv_rec.organization_id := l_organization_id;
6041: l_mtl_maint_rsv_rec.inventory_item_id := l_inventory_item_id;
6042: --bug #5498904 populated l_mtl_maint_rsv_rec.supply_source_type_id
6043: l_mtl_maint_rsv_rec.supply_source_type_id := inv_reservation_global.g_source_type_internal_req;
6044: l_supply_source_type_id := inv_reservation_global.g_source_type_internal_req;
6045: l_mtl_maint_rsv_rec.supply_source_header_id := p_header_id;
6046: l_mtl_maint_rsv_rec.supply_source_line_id := p_line_id;
6047: -- l_mtl_maint_rsv_rec.supply_source_line_detail := NULL;
6048:

Line 6087: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;

6083: -- reduce the reservations to the ordered qty
6084: -- Set the source type as internal req
6085:
6086: l_mtl_maint_rsv_rec.action := 0;--supply is reduced
6087: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;
6088: l_mtl_maint_rsv_rec.organization_id := l_organization_id;
6089: l_mtl_maint_rsv_rec.inventory_item_id := l_inventory_item_id;
6090: --bug #5498904 populated l_mtl_maint_rsv_rec.supply_source_type_id
6091: l_mtl_maint_rsv_rec.supply_source_type_id := inv_reservation_global.g_source_type_internal_req;

Line 6091: l_mtl_maint_rsv_rec.supply_source_type_id := inv_reservation_global.g_source_type_internal_req;

6087: l_sort_by_criteria := inv_reservation_global.g_query_demand_ship_date_desc;
6088: l_mtl_maint_rsv_rec.organization_id := l_organization_id;
6089: l_mtl_maint_rsv_rec.inventory_item_id := l_inventory_item_id;
6090: --bug #5498904 populated l_mtl_maint_rsv_rec.supply_source_type_id
6091: l_mtl_maint_rsv_rec.supply_source_type_id := inv_reservation_global.g_source_type_internal_req;
6092: l_supply_source_type_id := inv_reservation_global.g_source_type_internal_req;
6093: l_mtl_maint_rsv_rec.supply_source_header_id := p_header_id;
6094: l_mtl_maint_rsv_rec.supply_source_line_id := p_line_id;
6095: -- l_mtl_maint_rsv_rec.supply_source_line_detail := NULL;

Line 6092: l_supply_source_type_id := inv_reservation_global.g_source_type_internal_req;

6088: l_mtl_maint_rsv_rec.organization_id := l_organization_id;
6089: l_mtl_maint_rsv_rec.inventory_item_id := l_inventory_item_id;
6090: --bug #5498904 populated l_mtl_maint_rsv_rec.supply_source_type_id
6091: l_mtl_maint_rsv_rec.supply_source_type_id := inv_reservation_global.g_source_type_internal_req;
6092: l_supply_source_type_id := inv_reservation_global.g_source_type_internal_req;
6093: l_mtl_maint_rsv_rec.supply_source_header_id := p_header_id;
6094: l_mtl_maint_rsv_rec.supply_source_line_id := p_line_id;
6095: -- l_mtl_maint_rsv_rec.supply_source_line_detail := NULL;
6096: l_mtl_maint_rsv_rec.expected_quantity := p_ordered_quantity;