[Home] [Help]
PACKAGE BODY: APPS.INV_LOCATION
Source
1 PACKAGE BODY INV_LOCATION AS
2 /* $Header: INVHLOCB.pls 120.1 2005/11/29 17:09:16 pojha noship $ */
3 --
4 --
5 PROCEDURE INV_PREDEL_VALIDATION (p_location_id number)
6 IS
7 --
8 v_delete_permitted varchar2(1);
9 l_msg varchar2(30);
10 --
11 --
12 BEGIN
13 --
14 hr_utility.set_location('INV_LOCATION.INV_PREDEL_VALIDATION', 1);
15 --
16 begin
17
18 l_msg := 'INV_LOC_INTERORG_SHIP_METHODS';
19 select 'Y'
20 into v_delete_permitted
21 from sys.dual
22 where not exists (
23
24 select null
25 from MTL_INTERORG_SHIP_METHODS
26 where FROM_LOCATION_ID = P_LOCATION_ID
27 or TO_LOCATION_ID = P_LOCATION_ID
28 );
29
30
31 l_msg := 'INV_LOC_TRANSACTIONS_TEMP';
32 select 'Y'
33 into v_delete_permitted
34 from sys.dual
35 where not exists (
36
37 select null
38 from MTL_MATERIAL_TRANSACTIONS_TEMP
39 where SHIP_TO_LOCATION = P_LOCATION_ID
40 );
41
42
43 l_msg := 'INV_LOC_MOVEMENT_PARAMTERS';
44 select 'Y'
45 into v_delete_permitted
46 from sys.dual
47 where not exists (
48
49 select null
50 from MTL_MOVEMENT_PARAMETERS
51 where TAX_OFFICE_LOCATION_ID = P_LOCATION_ID
52 );
53
54
55 -- bug 4730244 : Deleted the check on mtl_movement_statistics
56
57 l_msg := 'INV_LOC_REPLENISH_HEADERS';
58 select 'Y'
59 into v_delete_permitted
60 from sys.dual
61 where not exists (
62
63 select null
64 from MTL_REPLENISH_HEADERS
65 where DELIVERY_LOCATION_ID = P_LOCATION_ID
66 );
67
68
69 l_msg := 'INV_LOC_REPLENISH_HEADERS_INT';
70 select 'Y'
71 into v_delete_permitted
72 from sys.dual
73 where not exists (
74
75 select null
76 from MTL_REPLENISH_HEADERS_INT
77 where DELIVERY_LOCATION_ID = P_LOCATION_ID
78 );
79
80
81 l_msg := 'INV_LOC_MTL_SUPPLY';
82 select 'Y'
83 into v_delete_permitted
84 from sys.dual
85 where not exists (
86
87 select null
88 from MTL_SUPPLY
89 where
90 -- Commented out the below for Bug2828220
91 -- PO_LINE_LOCATION_ID = P_LOCATION_ID
92 LOCATION_ID = P_LOCATION_ID
93 );
94
95
96 l_msg := 'INV_LOC_TRANSACTION_INTERFACE';
97 select 'Y'
98 into v_delete_permitted
99 from sys.dual
100 where not exists (
101
102 select null
103 from MTL_TRANSACTIONS_INTERFACE
104 where SHIP_TO_LOCATION_ID = P_LOCATION_ID
105 );
106
107 exception
108 when NO_DATA_FOUND then
109 hr_utility.set_message (401, l_msg);
110 hr_utility.raise_error;
111 end;
112 --
113 --
114 END INV_PREDEL_VALIDATION;
115 --
116 END INV_LOCATION;