DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_ASG_BUDGET_VALUE_API

Source


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