DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_BATCH_ELCTBL_CHC_API

Source


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