DBA Data[Home] [Help]

APPS.WSM_RESERVATIONS_PVT dependencies on WSM_RESERVATIONS

Line 1: package body WSM_RESERVATIONS_PVT as

1: package body WSM_RESERVATIONS_PVT as
2: /* $Header: WSMVRSVB.pls 120.16 2006/06/21 10:17:28 sisankar noship $ */
3:
4: /* Package name */
5: g_pkg_name VARCHAR2(20) := 'WSM_RESERVATIONS_PVT';

Line 5: g_pkg_name VARCHAR2(20) := 'WSM_RESERVATIONS_PVT';

1: package body WSM_RESERVATIONS_PVT as
2: /* $Header: WSMVRSVB.pls 120.16 2006/06/21 10:17:28 sisankar noship $ */
3:
4: /* Package name */
5: g_pkg_name VARCHAR2(20) := 'WSM_RESERVATIONS_PVT';
6:
7: type t_wsm_rsv_v_tbl_type is table of wsm_reservations_v%rowtype index by binary_integer;
8: type t_wsm_reservations is table of wsm_reservations%rowtype index by binary_integer;
9: --type r_mtl_rsv_rec_type is record of mtl_reservations%rowtype;

Line 7: type t_wsm_rsv_v_tbl_type is table of wsm_reservations_v%rowtype index by binary_integer;

3:
4: /* Package name */
5: g_pkg_name VARCHAR2(20) := 'WSM_RESERVATIONS_PVT';
6:
7: type t_wsm_rsv_v_tbl_type is table of wsm_reservations_v%rowtype index by binary_integer;
8: type t_wsm_reservations is table of wsm_reservations%rowtype index by binary_integer;
9: --type r_mtl_rsv_rec_type is record of mtl_reservations%rowtype;
10: --MP: Sale order changes
11: l_mtl_rsv_rec inv_reservation_global.mtl_maintain_rsv_rec_type;

Line 8: type t_wsm_reservations is table of wsm_reservations%rowtype index by binary_integer;

4: /* Package name */
5: g_pkg_name VARCHAR2(20) := 'WSM_RESERVATIONS_PVT';
6:
7: type t_wsm_rsv_v_tbl_type is table of wsm_reservations_v%rowtype index by binary_integer;
8: type t_wsm_reservations is table of wsm_reservations%rowtype index by binary_integer;
9: --type r_mtl_rsv_rec_type is record of mtl_reservations%rowtype;
10: --MP: Sale order changes
11: l_mtl_rsv_rec inv_reservation_global.mtl_maintain_rsv_rec_type;
12:

Line 60: l_module CONSTANT VARCHAR2(100) := 'wsm.plsql.WSM_RESERVATIONS_PVT.modify_reservations_wlt';

56: l_msg_tokens WSM_Log_PVT.token_rec_tbl;
57: l_log_level number := FND_LOG.G_CURRENT_RUNTIME_LEVEL;
58:
59: l_stmt_num NUMBER;
60: l_module CONSTANT VARCHAR2(100) := 'wsm.plsql.WSM_RESERVATIONS_PVT.modify_reservations_wlt';
61: l_param_tbl WSM_Log_PVT.param_tbl_type;
62:
63: l_msg_index number;
64: l_quantity_modified NUMBER;

Line 106: from wsm_reservations_v

102: --MP Delete Changes Start
103: BEGIN
104: select *
105: bulk collect into l_wsm_rsv_v_tbl
106: from wsm_reservations_v
107: where wip_entity_id = p_starting_jobs_tbl(p_rep_job_index).wip_entity_id;
108: EXCEPTION
109: when no_data_found then
110: return;

Line 183: from wsm_reservations_v

179: --MP Delete Changes Start
180: BEGIN
181: select *
182: bulk collect into l_wsm_rsv_v_tbl
183: from wsm_reservations_v
184: where wip_entity_id = p_starting_jobs_tbl(p_rep_job_index).wip_entity_id;
185: EXCEPTION
186: when no_data_found then
187: return;

Line 230: l_rsvd_qty := Wsm_reservations_pvt.check_reservation_quantity(

226: end loop; --MP delete reservations loop
227: end if; --MP Delete Changes :End of check on l_wsm_rsv_v_tbl.count > 0
228: --Elsif (p_starting_jobs_tbl(p_starting_jobs_tbl.first).net_quantity > p_resulting_jobs_tbl(p_sj_also_rj_index).net_quantity) then
229: ELSE
230: l_rsvd_qty := Wsm_reservations_pvt.check_reservation_quantity(
231: p_wip_entity_id => p_resulting_jobs_tbl(p_sj_also_rj_index).wip_entity_id,
232: P_org_id => p_starting_jobs_tbl(p_rep_job_index).organization_id,
233: P_inventory_item_id => p_starting_jobs_tbl(p_rep_job_index).primary_item_id
234: );

Line 315: from wsm_reservations_v

311: --MP Delete Changes Start
312: BEGIN
313: select *
314: bulk collect into l_wsm_rsv_v_tbl
315: from wsm_reservations_v
316: where wip_entity_id = p_starting_jobs_tbl(p_rep_job_index).wip_entity_id;
317: EXCEPTION
318: when no_data_found then
319: return;

Line 395: from wsm_reservations_v

391: --collect the SO rsv for the SJ from wsm_rsv_v
392: BEGIN
393: select *
394: bulk collect into l_wsm_rsv_v_tbl
395: from wsm_reservations_v
396: where wip_entity_id = p_starting_jobs_tbl(l_counter).wip_entity_id;
397: EXCEPTION
398: when no_data_found then
399: null;

Line 403: --For each SO rsvn in wsm_reservations_v for p_starting_jobs_tbl (l_counter) loop

399: null;
400: END;
401:
402: if l_wsm_rsv_v_tbl.count>0 then
403: --For each SO rsvn in wsm_reservations_v for p_starting_jobs_tbl (l_counter) loop
404: For i in l_wsm_rsv_v_tbl.first .. l_wsm_rsv_v_tbl.last loop
405:
406: --old reservation info populated
407: l_rsv_old.reservation_id := l_wsm_rsv_v_tbl(i).reservation_id;

Line 485: from wsm_reservations_v

481: --MP Delete Changes Start
482: BEGIN
483: select *
484: bulk collect into l_wsm_rsv_v_tbl
485: from wsm_reservations_v
486: where wip_entity_id = p_starting_jobs_tbl(l_counter).wip_entity_id;
487: EXCEPTION
488: when no_data_found then
489: return;

Line 548: WSM_RESERVATIONS_PVT.Modify_reservations_jobupdate(

544: if l_rsvd_qty > p_resulting_jobs_tbl(l_rj_index).net_quantity THEN
545: l_return_status := FND_API.G_RET_STS_SUCCESS;
546: l_msg_count := 0;
547: l_msg_data := null;
548: WSM_RESERVATIONS_PVT.Modify_reservations_jobupdate(
549: p_wip_entity_id => p_resulting_jobs_tbl(l_rj_index).wip_entity_id,
550: P_old_net_qty => l_rsvd_qty, --p_resulting_jobs_tbl(l_rj_index).net_quantity,
551: P_new_net_qty => p_resulting_jobs_tbl(l_rj_index).net_quantity,
552: P_inventory_item_id => p_resulting_jobs_tbl(l_rj_index).primary_item_id,

Line 566: p_msg_text => 'WSM_RESERVATIONS_PVT.Modify_reservations_jobupdate failed:'||l_msg_data,

562: if( g_log_level_statement >= l_log_level ) then
563:
564: l_msg_tokens.delete;
565: WSM_log_PVT.logMessage(p_module_name => l_module ,
566: p_msg_text => 'WSM_RESERVATIONS_PVT.Modify_reservations_jobupdate failed:'||l_msg_data,
567: p_stmt_num => l_stmt_num ,
568: p_msg_tokens => l_msg_tokens,
569: p_fnd_msg_level => G_MSG_LVL_ERROR ,
570: p_fnd_log_level => G_LOG_LEVEL_ERROR ,

Line 640: l_wsm_rsvn_tbl t_wsm_reservations;

636: l_rsv_old inv_reservation_global.mtl_reservation_rec_type;
637: l_rsv_new inv_reservation_global.mtl_reservation_rec_type;
638: l_dummy_sn inv_reservation_global.serial_number_tbl_type;
639: --l_mtl_rsv_rec inv_reservations_global.mtl_rsv_tbl_type;
640: l_wsm_rsvn_tbl t_wsm_reservations;
641:
642: l_new_rsv_id NUMBER;
643: l_quantity_modified NUMBER;
644:

Line 679: /*have this call wherever wsm_reservations_v is used*/

675: l_stmt_num := 10;
676: /* Initialize API return status to success */
677: x_return_status := FND_API.G_RET_STS_SUCCESS;
678:
679: /*have this call wherever wsm_reservations_v is used*/
680: --MO_GLOBAL.SET_POLICY_CONTEXT ('S', p_org_id);
681:
682: l_rsv_new.supply_source_header_id := p_wip_entity_id;
683: --l_rsv_new.inventory_item_id :=p_inventory_item_id;

Line 688: --Insert the reservations for this job in the WSM_RESERVATIONS table.Before that check if the reserved qty against the job is more than what exactly the job has at completion.If that is the case,reduce reservations associated with the job.

684: --l_rsv_new.organization_id := p_org_id;
685:
686: If p_txn_type = 2 then --completion txn
687:
688: --Insert the reservations for this job in the WSM_RESERVATIONS table.Before that check if the reserved qty against the job is more than what exactly the job has at completion.If that is the case,reduce reservations associated with the job.
689:
690: l_rsvd_qty := check_reservation_quantity(p_wip_entity_id => p_wip_entity_id,
691: P_org_id => p_org_id,
692: P_inventory_item_id => p_inventory_item_id

Line 766: INSERT INTO wsm_reservations (

762: end if;
763:
764: End if;
765:
766: INSERT INTO wsm_reservations (
767: Wip_entity_id,
768: Reservation_id,
769: Demand_source_header_id,
770: Demand_source_line_id,

Line 777: from wsm_reservations_v

773: reservation_id,
774: demand_source_header_id,
775: demand_source_line_id,
776: primary_quantity
777: from wsm_reservations_v
778: where wip_entity_id= p_wip_entity_id
779: and organization_id = p_org_id
780: and inventory_item_id = p_inventory_item_id
781: );

Line 785: --Check if entries exist for this job in WSM_RESERVATIONS table. If yes, go to nxt step. Else, return.

781: );
782:
783: Elsif p_txn_type = 3 then --return transaction
784:
785: --Check if entries exist for this job in WSM_RESERVATIONS table. If yes, go to nxt step. Else, return.
786: BEGIN
787: select *
788: bulk collect into l_wsm_rsvn_tbl
789: from wsm_reservations

Line 789: from wsm_reservations

785: --Check if entries exist for this job in WSM_RESERVATIONS table. If yes, go to nxt step. Else, return.
786: BEGIN
787: select *
788: bulk collect into l_wsm_rsvn_tbl
789: from wsm_reservations
790: where wip_entity_id = p_wip_entity_id;
791:
792: EXCEPTION
793: when no_data_found then

Line 796: --If (entry exists in WSM_RESERVATIONS for this job) then

792: EXCEPTION
793: when no_data_found then
794: return;
795: END;
796: --If (entry exists in WSM_RESERVATIONS for this job) then
797: If l_wsm_rsvn_tbl.count > 0 then
798:
799: --Check if demand exists by querying the mtl_reservations table. If yes, then query the corresponding demand and supply details from history table and call create_reservations( ) to create them again against the job.
800:

Line 820: --For each SO reservation against the job in WSM_RESERVATIONS loop

816: when no_data_found then
817: return;
818: END;
819:
820: --For each SO reservation against the job in WSM_RESERVATIONS loop
821: For j in l_wsm_rsvn_tbl.first .. l_wsm_rsvn_tbl.last loop
822:
823: BEGIN
824: select primary_reservation_quantity

Line 834: --Transfer_reservation to job A with l_rsv_new.reservation_qty = min (mtl_reservations.reservation_qty, wsm_reservations.reserved_qty)

830: l_reservation_quantity := -1;
831: END;
832:
833: If l_reservation_quantity <> -1 then
834: --Transfer_reservation to job A with l_rsv_new.reservation_qty = min (mtl_reservations.reservation_qty, wsm_reservations.reserved_qty)
835: --Call the API as below.
836:
837: --populate l_rsv_old record with reservation details against the inventory for this SO from mtl_reservations.
838: l_rsv_old.reservation_id := l_wsm_rsvn_tbl(j).reservation_id;

Line 840: --populate l_rsv_new record with changed reservation details against this job for this SO from wsm_reservations.

836:
837: --populate l_rsv_old record with reservation details against the inventory for this SO from mtl_reservations.
838: l_rsv_old.reservation_id := l_wsm_rsvn_tbl(j).reservation_id;
839:
840: --populate l_rsv_new record with changed reservation details against this job for this SO from wsm_reservations.
841: l_rsv_new.supply_source_header_id := p_wip_entity_id;
842: l_rsv_new.supply_source_type_id := 5;
843: l_rsv_new.subinventory_code := null;
844: l_rsv_new.locator_id := null;

Line 905: /*now delete the rows corresponding to this job in wsm_reservations*/

901: where wip_entity_id = p_wip_entity_id
902: and organization_id = p_org_id;
903:
904: end if;
905: /*now delete the rows corresponding to this job in wsm_reservations*/
906: delete from wsm_reservations
907: where wip_entity_id = p_wip_entity_id;
908: end if;
909:

Line 906: delete from wsm_reservations

902: and organization_id = p_org_id;
903:
904: end if;
905: /*now delete the rows corresponding to this job in wsm_reservations*/
906: delete from wsm_reservations
907: where wip_entity_id = p_wip_entity_id;
908: end if;
909:
910: -- Standard call to get message count and if count is 1, get message info.

Line 987: l_module CONSTANT VARCHAR2(100) := 'wsm.plsql.WSM_RESERVATIONS_PVT.modify_reservations_jobupdate';

983: l_msg_tokens WSM_Log_PVT.token_rec_tbl;
984: l_log_level number := FND_LOG.G_CURRENT_RUNTIME_LEVEL;
985:
986: l_stmt_num NUMBER;
987: l_module CONSTANT VARCHAR2(100) := 'wsm.plsql.WSM_RESERVATIONS_PVT.modify_reservations_jobupdate';
988: l_param_tbl WSM_Log_PVT.param_tbl_type;
989:
990: l_msg_index number;
991: -- Logging variables...

Line 1004: /*have this call wherever wsm_reservations_v is used*/

1000: l_stmt_num := 10;
1001: /* Initialize API return status to success */
1002: x_return_status := FND_API.G_RET_STS_SUCCESS;
1003:
1004: /*have this call wherever wsm_reservations_v is used*/
1005: --MO_GLOBAL.SET_POLICY_CONTEXT ('S', p_org_id);
1006:
1007: l_rsv.supply_source_header_id := p_wip_entity_id;
1008: l_rsv.inventory_item_id :=p_inventory_item_id;

Line 1296: /*have this call wherever wsm_reservations_v is used*/

1292: is
1293: L_rsvd_qty number :=0;
1294:
1295: BEGIN
1296: /*have this call wherever wsm_reservations_v is used*/
1297: --MO_GLOBAL.SET_POLICY_CONTEXT ('S', p_org_id);
1298: BEGIN
1299:
1300: -- modified the SQL to have primary quantity instead of reservation qty.

Line 1303: from wsm_reservations_v

1299:
1300: -- modified the SQL to have primary quantity instead of reservation qty.
1301: Select sum (primary_quantity)
1302: into l_rsvd_qty
1303: from wsm_reservations_v
1304: where wip_entity_id = p_wip_entity_id
1305: and organization_id = p_org_id
1306: and inventory_item_id = p_inventory_item_id;
1307: EXCEPTION

Line 1326: /*have this call wherever wsm_reservations_v is used*/

1322:
1323: l_rsv_exists number := 0 ;
1324:
1325: BEGIN
1326: /*have this call wherever wsm_reservations_v is used*/
1327: --MO_GLOBAL.SET_POLICY_CONTEXT ('S', p_org_id);
1328: BEGIN
1329: select 1 into l_rsv_exists
1330: from wsm_reservations_v

Line 1330: from wsm_reservations_v

1326: /*have this call wherever wsm_reservations_v is used*/
1327: --MO_GLOBAL.SET_POLICY_CONTEXT ('S', p_org_id);
1328: BEGIN
1329: select 1 into l_rsv_exists
1330: from wsm_reservations_v
1331: where wip_entity_id = p_wip_entity_id
1332: and organization_id = p_org_id
1333: and inventory_item_id = p_inventory_item_id
1334: and rownum = 1;

Line 1347: end WSM_RESERVATIONS_PVT;

1343: Return false;
1344: end if;
1345: end check_reservation_exists;
1346:
1347: end WSM_RESERVATIONS_PVT;