DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_APPROVAL_PERIOD_SETS_API

Source


1 Package Body hxc_approval_period_sets_api as
2 /* $Header: hxcaprpsapi.pkb 120.2 2005/09/23 08:04:54 sechandr noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  hxc_approval_period_sets_api.';
7 g_debug	   boolean	:= hr_utility.debug_enabled;
8 --
9 -- ----------------------------------------------------------------------------
10 -- |--------------------------< create_approval_period_sets >-----------------|
11 -- ----------------------------------------------------------------------------
12 --
13 procedure create_approval_period_sets
14   (p_validate                      in     boolean  default false
15   ,p_approval_period_set_id        in out nocopy number
16   ,p_object_version_number         in out nocopy number
17   ,p_name                          in     varchar2
18 --  ,p_effective_date                in     date     default null
19   ) is
20   --
21   -- Declare cursors and local variables
22   --
23 
24   l_proc   varchar2(72);
25   l_object_version_number hxc_approval_period_sets.object_version_number%TYPE;
26   l_approval_period_set_id hxc_approval_period_sets.approval_period_set_id%TYPE;
27 --
28 Begin
29 --
30   g_debug:=hr_utility.debug_enabled;
31   if g_debug then
32 	l_proc := g_package||'create_approval_period_sets';
33 	hr_utility.set_location('Entering:'|| l_proc, 10);
34   end if;--
35   -- Issue a savepoint
36   --
37   savepoint create_approval_period_sets;
38   --
39   if g_debug then
40 	hr_utility.set_location(l_proc, 20);
41   end if;
42   --
43   -- Truncate the time portion from all IN date parameters
44   --
45 
46   --
47   -- Call Before Process User Hook
48   --
49   begin
50     hxc_approval_period_sets_bk_1.create_approval_period_sets_b
51       (p_approval_period_set_id        => p_approval_period_set_id
52       ,p_object_version_number         => p_object_version_number
53       ,p_name                          => p_name
54   --    ,p_effective_date                => p_effective_date
55       );
56   exception
57     when hr_api.cannot_find_prog_unit then
58       hr_api.cannot_find_prog_unit_error
59         (p_module_name => 'create_approval_period_sets'
60         ,p_hook_type   => 'BP'
61         );
62   end;
63   --
64   if g_debug then
65 	hr_utility.set_location(l_proc, 30);
66   end if;
67   --
68 
69   --
70   -- Validation in addition to Row Handlers
71   --
72 
73 
74 
75   --
76   -- Process Logic
77   --
78   if g_debug then
79 	hr_utility.set_location(l_proc, 40);
80   end if;
81   --
82   -- call row handler
83   --
84   hxc_aps_ins.ins
85     (p_name                    => p_name
86     ,p_approval_period_set_id  => l_approval_period_set_id
87     ,p_object_version_number   => l_object_version_number
88     );
89   --
90   if g_debug then
91 	hr_utility.set_location(l_proc, 50);
92   end if;
93   --
94   -- Call After Process User Hook
95   --
96   begin
97     hxc_approval_period_sets_bk_1.create_approval_period_sets_a
98       (p_approval_period_set_id        => p_approval_period_set_id
99       ,p_object_version_number         => p_object_version_number
100       ,p_name                          => p_name
101    --   ,p_effective_date                => p_effective_date
102       );
103   exception
104     when hr_api.cannot_find_prog_unit then
105       hr_api.cannot_find_prog_unit_error
106         (p_module_name => 'create_approval_perriod_sets'
107         ,p_hook_type   => 'AP'
108         );
109   end;
110   --
111   if g_debug then
112 	hr_utility.set_location(l_proc, 60);
113   end if;
114   --
115   --
116   -- When in validation only mode raise the Validate_Enabled exception
117   --
118   if p_validate then
119     raise hr_api.validate_enabled;
120   end if;
121   --
122   --if g_debug then
123 	--hr_utility.set_location(' Leaving:'||l_proc, 70);
124   --end if;
125   --
126   --
127   -- Set all output arguments
128   --
129   p_approval_period_set_id := l_approval_period_set_id;
130   p_object_version_number  := l_object_version_number;
131   --
132   if g_debug then
133 	hr_utility.set_location(' Leaving:'||l_proc, 70);
134   end if;
135 exception
136   when hr_api.validate_enabled then
137     --
138     -- As the Validate_Enabled exception has been raised
139     -- we must rollback to the savepoint
140     --
141     rollback to create_approval_period_sets;
142     --
143     -- Only set output warning arguments
144     -- (Any key or derived arguments must be set to null
145     -- when validation only mode is being used.)
146     --
147     p_approval_period_set_id := null;
148     p_object_version_number  := null;
149     if g_debug then
150 	hr_utility.set_location(' Leaving:'||l_proc, 80);
151     end if;
152   when others then
153     --
154     -- A validation or unexpected error has occured
155     --
156     rollback to create_approval_period_sets;
157     if g_debug then
158 	hr_utility.set_location(' Leaving:'||l_proc, 90);
159     end if;
160     raise;
161     --
162 end create_approval_period_sets;
163 --
164 --
165 -- ----------------------------------------------------------------------------
166 -- |------------------------< update_approval_period_sets>--------------------|
167 -- ----------------------------------------------------------------------------
168 --
169 procedure update_approval_period_sets
170   (p_validate                      in     boolean  default false
171   ,p_approval_period_set_id        in     number
172   ,p_object_version_number         in out nocopy number
173   ,p_name                          in     varchar2
174  -- ,p_effective_date                in     date     default null
175   )is
176   --
177   -- Declare cursors and local variables
178   --
179   l_proc varchar2(72);
180   l_object_version_number hxc_approval_period_sets.object_version_number%TYPE := p_object_version_number;
181   --
182 Begin
183   g_debug:=hr_utility.debug_enabled;
184   --
185   if g_debug then
186 	l_proc := g_package||' update_approval_period_sets';
187 	hr_utility.set_location('Entering:'|| l_proc, 10);
188   end if;
189   --
190   -- Issue a savepoint if operating in validation only mode
191   --
192   savepoint update_approval_period_sets;
193   --
194   if g_debug then
195 	hr_utility.set_location(l_proc, 20);
196   end if;
197   --
198   -- Call Before Process User Hook
199   --
200   begin
201     hxc_approval_period_sets_bk_1.update_approval_period_sets_b
202     (p_approval_period_set_id => p_approval_period_set_id
203     ,p_object_version_number  => p_object_version_number
204     ,p_name                   => p_name
205   --  ,p_effective_date         => p_effective_date
206     );
207   exception
208     when hr_api.cannot_find_prog_unit then
209       hr_api.cannot_find_prog_unit_error
210         (p_module_name => 'update_approval_period_sets'
211         ,p_hook_type   => 'BP'
212         );
213   end;
214   --
215   --if g_debug then
216 	--hr_utility.set_location(l_proc, 30);
217   --end if;
218   --
219   -- Process Logic
220 --
221 -- call row handler
222 --
223 hxc_aps_upd.upd
224   (p_approval_period_set_id => p_approval_period_set_id
225   ,p_object_version_number  => l_object_version_number
226   ,p_name                   => p_name
227   );
228 --
229   --
230   if g_debug then
231 	hr_utility.set_location(l_proc, 40);
232   end if;
233   --
234   -- Call After Process User Hook
235   --
236   begin
237     hxc_approval_period_sets_bk_1.update_approval_period_sets_a
238   (p_approval_period_set_id => p_approval_period_set_id
239   ,p_object_version_number  => p_object_version_number
240   ,p_name                   => p_name
241  -- ,p_effective_date        => p_effective_date
242   );
243   exception
244     when hr_api.cannot_find_prog_unit then
245       hr_api.cannot_find_prog_unit_error
246         (p_module_name => 'update_approval_period_sets'
247         ,p_hook_type   => 'AP'
248         );
249   end;
250   --
251   if g_debug then
252 	hr_utility.set_location(l_proc, 50);
253   end if;
254   --
255   -- When in validation only mode raise the Validate_Enabled exception
256   --
257   if p_validate then
258     raise hr_api.validate_enabled;
259   end if;
260   --
261   if g_debug then
262 	hr_utility.set_location(' Leaving:'||l_proc, 60);
263   end if;
264   --
265   -- Set all output arguments
266   --
267   p_object_version_number := l_object_version_number;
268   --
269 exception
270   --
271   when hr_api.validate_enabled then
272     --
273     -- As the Validate_Enabled exception has been raised
274     -- we must rollback to the savepoint
275     --
276     ROLLBACK TO update_approval_period_sets;
277     --
278     -- Only set output warning arguments
279     -- (Any key or derived arguments must be set to null
280     -- when validation only mode is being used.)
281     --
282     p_object_version_number  := null;
283     --
284     if g_debug then
285 	hr_utility.set_location(' Leaving:'||l_proc, 60);
286     end if;
287     --
288   when others then
289     --
290     -- A validation or unexpected error has occured
291     --
292     ROLLBACK TO update_approval_period_sets;
293     if g_debug then
294 	hr_utility.set_location(' Leaving:'||l_proc, 70);
295     end if;
296     raise;
297     --
298 END update_approval_period_sets;
299 --
300 -- ----------------------------------------------------------------------------
301 -- |------------------------< delete_approval_period_sets >-------------------|
302 -- ----------------------------------------------------------------------------
303 --
304 procedure delete_approval_period_sets
305   (p_validate                       in  boolean  default false
306   ,p_approval_period_set_id         in  number
307   ,p_object_version_number          in  number
308   ) is
309   --
310   -- Declare cursors and local variables
311   --
312   l_proc varchar2(72);
313   --
314 begin
315   g_debug:=hr_utility.debug_enabled;
316   --
317   if g_debug then
318 	l_proc := g_package||'delete_approval_period_sets';
319 	hr_utility.set_location('Entering:'|| l_proc, 10);
320   end if;
321   --
322   -- Issue a savepoint if operating in validation only mode
323   --
324   savepoint delete_approval_period_sets;
325   --
326   if g_debug then
327 	hr_utility.set_location(l_proc, 20);
328   end if;
329   --
330   -- Call Before Process User Hook
331   --
332   begin
333   --
334           hxc_approval_period_sets_bk_1.delete_approval_period_sets_b
335           (p_approval_period_set_id => p_approval_period_set_id
336           ,p_object_version_number  => p_object_version_number
337           );
338   exception
339     when hr_api.cannot_find_prog_unit then
340       hr_api.cannot_find_prog_unit_error
341         (p_module_name => 'delete_approval_period_sets'
342         ,p_hook_type   => 'BP'
343         );
344   end;
345   --
346   if g_debug then
347 	hr_utility.set_location(l_proc, 30);
348   end if;
349   --
350   -- Process Logic
351   --
352   hxc_aps_del.del
353     (
354      p_approval_period_set_id => p_approval_period_set_id
355     ,p_object_version_number  => p_object_version_number
356     );
357   --
358   if g_debug then
359 	hr_utility.set_location(l_proc, 40);
360   end if;
361   --
362   -- Call After Process User Hook
363   --
364   begin
365   --
366         hxc_approval_period_sets_bk_1.delete_approval_period_sets_a
367           (p_approval_period_set_id => p_approval_period_set_id
368           ,p_object_version_number  => p_object_version_number
369           );
370   exception
371     when hr_api.cannot_find_prog_unit then
372       hr_api.cannot_find_prog_unit_error
373         (p_module_name => 'delete_approval_period_sets'
374         ,p_hook_type   => 'AP'
375         );
376   end;
377   --
378   -- When in validation only mode raise the Validate_Enabled exception
379   --
380   if p_validate then
381     raise hr_api.validate_enabled;
382   end if;
383   --
384   if g_debug then
385 	hr_utility.set_location(' Leaving:'||l_proc, 50);
386   end if;
387   --
388 exception
389   --
390   when hr_api.validate_enabled then
391     --
392     -- As the Validate_Enabled exception has been raised
393     -- we must rollback to the savepoint
394     --
395     ROLLBACK TO delete_approval_period_sets;
396     --
397   when others then
398     --
399     -- A validation or unexpected error has occured
400     --
401     ROLLBACK TO delete_approval_period_sets;
402     raise;
403     --
404 end delete_approval_period_sets;
405 --
406 end hxc_approval_period_sets_api;