DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_BATCH_BNFT_CERT_INFO_API

Source


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