DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PRV_CTFN_PRVDD_API

Source


1 Package Body ben_prv_ctfn_prvdd_api as
2 /* $Header: bervcapi.pkb 115.4 2004/01/22 09:53:37 mmudigon noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  ben_prv_ctfn_prvdd_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |---------------------< create_prv_ctfn_prvdd >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_prv_ctfn_prvdd
13   (p_validate                       in  boolean   default false
14   ,p_prtt_rt_val_ctfn_prvdd_id        out nocopy number
15   ,p_enrt_ctfn_rqd_flag             in  varchar2  default 'N'
16   ,p_enrt_ctfn_typ_cd               in  varchar2  default null
17   ,p_enrt_ctfn_recd_dt              in  date      default null
18   ,p_enrt_ctfn_dnd_dt               in  date      default null
19   ,p_prtt_rt_val_id              in  number    default null
20   ,p_business_group_id              in  number    default null
21   ,p_rvc_attribute_category         in  varchar2  default null
22   ,p_rvc_attribute1                 in  varchar2  default null
23   ,p_rvc_attribute2                 in  varchar2  default null
24   ,p_rvc_attribute3                 in  varchar2  default null
25   ,p_rvc_attribute4                 in  varchar2  default null
26   ,p_rvc_attribute5                 in  varchar2  default null
27   ,p_rvc_attribute6                 in  varchar2  default null
28   ,p_rvc_attribute7                 in  varchar2  default null
29   ,p_rvc_attribute8                 in  varchar2  default null
30   ,p_rvc_attribute9                 in  varchar2  default null
31   ,p_rvc_attribute10                in  varchar2  default null
32   ,p_rvc_attribute11                in  varchar2  default null
33   ,p_rvc_attribute12                in  varchar2  default null
34   ,p_rvc_attribute13                in  varchar2  default null
35   ,p_rvc_attribute14                in  varchar2  default null
36   ,p_rvc_attribute15                in  varchar2  default null
37   ,p_rvc_attribute16                in  varchar2  default null
38   ,p_rvc_attribute17                in  varchar2  default null
39   ,p_rvc_attribute18                in  varchar2  default null
40   ,p_rvc_attribute19                in  varchar2  default null
41   ,p_rvc_attribute20                in  varchar2  default null
42   ,p_rvc_attribute21                in  varchar2  default null
43   ,p_rvc_attribute22                in  varchar2  default null
44   ,p_rvc_attribute23                in  varchar2  default null
45   ,p_rvc_attribute24                in  varchar2  default null
46   ,p_rvc_attribute25                in  varchar2  default null
47   ,p_rvc_attribute26                in  varchar2  default null
48   ,p_rvc_attribute27                in  varchar2  default null
49   ,p_rvc_attribute28                in  varchar2  default null
50   ,p_rvc_attribute29                in  varchar2  default null
51   ,p_rvc_attribute30                in  varchar2  default null
52   ,p_request_id                     in  number    default null
53   ,p_program_application_id         in  number    default null
54   ,p_program_id                     in  number    default null
55   ,p_program_update_date            in  date      default null
56   ,p_object_version_number          out nocopy number
57   ,p_effective_date                 in  date
58   ) is
59   --
60   -- Declare cursors and local variables
61   --
62   l_prtt_rt_val_ctfn_prvdd_id ben_prtt_rt_val_ctfn_prvdd.prtt_rt_val_ctfn_prvdd_id%TYPE;
63   l_proc varchar2(72) := g_package||'create_prv_ctfn_prvdd';
64   l_object_version_number ben_prtt_rt_val_ctfn_prvdd.object_version_number%TYPE;
65   --
66 begin
67   --
68   hr_utility.set_location('Entering:'|| l_proc, 10);
69   --
70   -- Initialize environment
71   --
72   if fnd_global.conc_request_id = -1 then
73     --
74     ben_env_object.init
75       (p_business_group_id => p_business_group_id,
76        p_effective_date    => p_effective_date,
77        p_thread_id         => null,
78        p_chunk_size        => null,
79        p_threads           => null,
80        p_max_errors        => null,
81        p_benefit_action_id => null);
82     --
83   end if;
84   --
85   -- Issue a savepoint if operating in validation only mode
86   --
87   savepoint create_prv_ctfn_prvdd;
88   --
89   hr_utility.set_location(l_proc, 20);
90   --
91   -- Process Logic
92   --
93   begin
94     --
95     -- Start of API User Hook for the before hook of create_prv_ctfn_prvdd
96     --
97     ben_prv_ctfn_prvdd_bk1.create_prv_ctfn_prvdd_b
98       (
99        p_prtt_rt_val_ctfn_prvdd_id      => l_prtt_rt_val_ctfn_prvdd_id
100       ,p_enrt_ctfn_rqd_flag             =>  p_enrt_ctfn_rqd_flag
101       ,p_enrt_ctfn_typ_cd               =>  p_enrt_ctfn_typ_cd
102       ,p_enrt_ctfn_recd_dt              =>  p_enrt_ctfn_recd_dt
103       ,p_enrt_ctfn_dnd_dt               =>  p_enrt_ctfn_dnd_dt
104       ,p_prtt_rt_val_id                 =>  p_prtt_rt_val_id
105       ,p_business_group_id              =>  p_business_group_id
106       ,p_rvc_attribute_category         =>  p_rvc_attribute_category
107       ,p_rvc_attribute1                 =>  p_rvc_attribute1
108       ,p_rvc_attribute2                 =>  p_rvc_attribute2
109       ,p_rvc_attribute3                 =>  p_rvc_attribute3
110       ,p_rvc_attribute4                 =>  p_rvc_attribute4
111       ,p_rvc_attribute5                 =>  p_rvc_attribute5
112       ,p_rvc_attribute6                 =>  p_rvc_attribute6
113       ,p_rvc_attribute7                 =>  p_rvc_attribute7
114       ,p_rvc_attribute8                 =>  p_rvc_attribute8
115       ,p_rvc_attribute9                 =>  p_rvc_attribute9
116       ,p_rvc_attribute10                =>  p_rvc_attribute10
117       ,p_rvc_attribute11                =>  p_rvc_attribute11
118       ,p_rvc_attribute12                =>  p_rvc_attribute12
119       ,p_rvc_attribute13                =>  p_rvc_attribute13
120       ,p_rvc_attribute14                =>  p_rvc_attribute14
121       ,p_rvc_attribute15                =>  p_rvc_attribute15
122       ,p_rvc_attribute16                =>  p_rvc_attribute16
123       ,p_rvc_attribute17                =>  p_rvc_attribute17
124       ,p_rvc_attribute18                =>  p_rvc_attribute18
125       ,p_rvc_attribute19                =>  p_rvc_attribute19
126       ,p_rvc_attribute20                =>  p_rvc_attribute20
127       ,p_rvc_attribute21                =>  p_rvc_attribute21
128       ,p_rvc_attribute22                =>  p_rvc_attribute22
129       ,p_rvc_attribute23                =>  p_rvc_attribute23
130       ,p_rvc_attribute24                =>  p_rvc_attribute24
131       ,p_rvc_attribute25                =>  p_rvc_attribute25
132       ,p_rvc_attribute26                =>  p_rvc_attribute26
133       ,p_rvc_attribute27                =>  p_rvc_attribute27
134       ,p_rvc_attribute28                =>  p_rvc_attribute28
135       ,p_rvc_attribute29                =>  p_rvc_attribute29
136       ,p_rvc_attribute30                =>  p_rvc_attribute30
137       ,p_effective_date                 => trunc(p_effective_date)
138       );
139   exception
140     when hr_api.cannot_find_prog_unit then
141       hr_api.cannot_find_prog_unit_error
142         (
143          p_module_name => 'CREATE_prv_ctfn_prvdd'
144         ,p_hook_type   => 'BP'
145         );
146     --
147     -- End of API User Hook for the before hook of create_prv_ctfn_prvdd
148     --
149   end;
150   --
151   ben_rvc_ins.ins
152     (
153      p_prtt_rt_val_ctfn_prvdd_id       => l_prtt_rt_val_ctfn_prvdd_id
154     ,p_enrt_ctfn_rqd_flag            => p_enrt_ctfn_rqd_flag
155     ,p_enrt_ctfn_typ_cd              => p_enrt_ctfn_typ_cd
156     ,p_enrt_ctfn_recd_dt             => p_enrt_ctfn_recd_dt
157     ,p_enrt_ctfn_dnd_dt              => p_enrt_ctfn_dnd_dt
158     ,p_prtt_rt_val_id             => p_prtt_rt_val_id
159     ,p_business_group_id             => p_business_group_id
160     ,p_rvc_attribute_category        => p_rvc_attribute_category
161     ,p_rvc_attribute1                => p_rvc_attribute1
162     ,p_rvc_attribute2                => p_rvc_attribute2
163     ,p_rvc_attribute3                => p_rvc_attribute3
164     ,p_rvc_attribute4                => p_rvc_attribute4
165     ,p_rvc_attribute5                => p_rvc_attribute5
166     ,p_rvc_attribute6                => p_rvc_attribute6
167     ,p_rvc_attribute7                => p_rvc_attribute7
168     ,p_rvc_attribute8                => p_rvc_attribute8
169     ,p_rvc_attribute9                => p_rvc_attribute9
170     ,p_rvc_attribute10               => p_rvc_attribute10
171     ,p_rvc_attribute11               => p_rvc_attribute11
172     ,p_rvc_attribute12               => p_rvc_attribute12
173     ,p_rvc_attribute13               => p_rvc_attribute13
174     ,p_rvc_attribute14               => p_rvc_attribute14
175     ,p_rvc_attribute15               => p_rvc_attribute15
176     ,p_rvc_attribute16               => p_rvc_attribute16
177     ,p_rvc_attribute17               => p_rvc_attribute17
178     ,p_rvc_attribute18               => p_rvc_attribute18
179     ,p_rvc_attribute19               => p_rvc_attribute19
180     ,p_rvc_attribute20               => p_rvc_attribute20
181     ,p_rvc_attribute21               => p_rvc_attribute21
182     ,p_rvc_attribute22               => p_rvc_attribute22
183     ,p_rvc_attribute23               => p_rvc_attribute23
184     ,p_rvc_attribute24               => p_rvc_attribute24
185     ,p_rvc_attribute25               => p_rvc_attribute25
186     ,p_rvc_attribute26               => p_rvc_attribute26
187     ,p_rvc_attribute27               => p_rvc_attribute27
188     ,p_rvc_attribute28               => p_rvc_attribute28
189     ,p_rvc_attribute29               => p_rvc_attribute29
190     ,p_rvc_attribute30               => p_rvc_attribute30
191     ,p_request_id                    => p_request_id
192     ,p_program_application_id        => p_program_application_id
193     ,p_program_id                    => p_program_id
194     ,p_program_update_date           => p_program_update_date
195     ,p_object_version_number         => l_object_version_number
196     ,p_effective_date                => trunc(p_effective_date)
197     );
198   --
199   begin
200     --
201     -- Start of API User Hook for the after hook of create_prv_ctfn_prvdd
202     --
203     ben_prv_ctfn_prvdd_bk1.create_prv_ctfn_prvdd_a
204       (
205        p_prtt_rt_val_ctfn_prvdd_id        =>  l_prtt_rt_val_ctfn_prvdd_id
206       ,p_enrt_ctfn_rqd_flag             =>  p_enrt_ctfn_rqd_flag
207       ,p_enrt_ctfn_typ_cd               =>  p_enrt_ctfn_typ_cd
208       ,p_enrt_ctfn_recd_dt              =>  p_enrt_ctfn_recd_dt
209       ,p_enrt_ctfn_dnd_dt               =>  p_enrt_ctfn_dnd_dt
210       ,p_prtt_rt_val_id              =>  p_prtt_rt_val_id
211       ,p_business_group_id              =>  p_business_group_id
212       ,p_rvc_attribute_category         =>  p_rvc_attribute_category
213       ,p_rvc_attribute1                 =>  p_rvc_attribute1
214       ,p_rvc_attribute2                 =>  p_rvc_attribute2
215       ,p_rvc_attribute3                 =>  p_rvc_attribute3
216       ,p_rvc_attribute4                 =>  p_rvc_attribute4
217       ,p_rvc_attribute5                 =>  p_rvc_attribute5
218       ,p_rvc_attribute6                 =>  p_rvc_attribute6
219       ,p_rvc_attribute7                 =>  p_rvc_attribute7
220       ,p_rvc_attribute8                 =>  p_rvc_attribute8
221       ,p_rvc_attribute9                 =>  p_rvc_attribute9
222       ,p_rvc_attribute10                =>  p_rvc_attribute10
223       ,p_rvc_attribute11                =>  p_rvc_attribute11
224       ,p_rvc_attribute12                =>  p_rvc_attribute12
225       ,p_rvc_attribute13                =>  p_rvc_attribute13
226       ,p_rvc_attribute14                =>  p_rvc_attribute14
227       ,p_rvc_attribute15                =>  p_rvc_attribute15
228       ,p_rvc_attribute16                =>  p_rvc_attribute16
229       ,p_rvc_attribute17                =>  p_rvc_attribute17
230       ,p_rvc_attribute18                =>  p_rvc_attribute18
231       ,p_rvc_attribute19                =>  p_rvc_attribute19
232       ,p_rvc_attribute20                =>  p_rvc_attribute20
233       ,p_rvc_attribute21                =>  p_rvc_attribute21
234       ,p_rvc_attribute22                =>  p_rvc_attribute22
235       ,p_rvc_attribute23                =>  p_rvc_attribute23
236       ,p_rvc_attribute24                =>  p_rvc_attribute24
237       ,p_rvc_attribute25                =>  p_rvc_attribute25
238       ,p_rvc_attribute26                =>  p_rvc_attribute26
239       ,p_rvc_attribute27                =>  p_rvc_attribute27
240       ,p_rvc_attribute28                =>  p_rvc_attribute28
241       ,p_rvc_attribute29                =>  p_rvc_attribute29
242       ,p_rvc_attribute30                =>  p_rvc_attribute30
243       ,p_request_id                    => p_request_id
244       ,p_program_application_id        => p_program_application_id
245       ,p_program_id                    => p_program_id
246       ,p_program_update_date           => p_program_update_date
247       ,p_object_version_number          =>  l_object_version_number
248       ,p_effective_date                      => trunc(p_effective_date)
249       );
250   exception
251     when hr_api.cannot_find_prog_unit then
252       hr_api.cannot_find_prog_unit_error
253         (p_module_name => 'CREATE_prv_ctfn_prvdd'
254         ,p_hook_type   => 'AP'
255         );
256     --
257     -- End of API User Hook for the after hook of create_prv_ctfn_prvdd
258     --
259   end;
260   --
261   hr_utility.set_location(l_proc, 60);
262   --
263   -- When in validation only mode raise the Validate_Enabled exception
264   --
265   if p_validate then
266     raise hr_api.validate_enabled;
267   end if;
268   --
269   -- Set all output arguments
270   --
271   p_prtt_rt_val_ctfn_prvdd_id := l_prtt_rt_val_ctfn_prvdd_id;
272   p_object_version_number := l_object_version_number;
273   --
274   hr_utility.set_location(' Leaving:'||l_proc, 70);
275   --
276 exception
277   --
278   when hr_api.validate_enabled then
279     --
280     -- As the Validate_Enabled exception has been raised
281     -- we must rollback to the savepoint
282     --
283     ROLLBACK TO create_prv_ctfn_prvdd;
284     --
285     -- Only set output warning arguments
286     -- (Any key or derived arguments must be set to null
287     -- when validation only mode is being used.)
288     --
289     p_prtt_rt_val_ctfn_prvdd_id := null;
290     p_object_version_number  := null;
291     hr_utility.set_location(' Leaving:'||l_proc, 80);
292     --
293   when others then
294     --
295     -- A validation or unexpected error has occured
296     --
297     ROLLBACK TO create_prv_ctfn_prvdd;
298     p_prtt_rt_val_ctfn_prvdd_id := null;
299     p_object_version_number  := null;
300     raise;
301     --
302 end create_prv_ctfn_prvdd;
303 -- ----------------------------------------------------------------------------
304 -- |---------------------< update_prv_ctfn_prvdd >--- ------------------|
305 -- ----------------------------------------------------------------------------
306 --
307 procedure update_prv_ctfn_prvdd
308   (p_validate                       in  boolean   default false
309   ,p_prtt_rt_val_ctfn_prvdd_id        in  number
310   ,p_enrt_ctfn_rqd_flag             in  varchar2  default hr_api.g_varchar2
311   ,p_enrt_ctfn_typ_cd               in  varchar2  default hr_api.g_varchar2
312   ,p_enrt_ctfn_recd_dt              in  date      default hr_api.g_date
313   ,p_enrt_ctfn_dnd_dt               in  date      default hr_api.g_date
314   ,p_prtt_rt_val_id              in  number    default hr_api.g_number
315   ,p_business_group_id              in  number    default hr_api.g_number
316   ,p_rvc_attribute_category         in  varchar2  default hr_api.g_varchar2
317   ,p_rvc_attribute1                 in  varchar2  default hr_api.g_varchar2
318   ,p_rvc_attribute2                 in  varchar2  default hr_api.g_varchar2
319   ,p_rvc_attribute3                 in  varchar2  default hr_api.g_varchar2
320   ,p_rvc_attribute4                 in  varchar2  default hr_api.g_varchar2
321   ,p_rvc_attribute5                 in  varchar2  default hr_api.g_varchar2
322   ,p_rvc_attribute6                 in  varchar2  default hr_api.g_varchar2
323   ,p_rvc_attribute7                 in  varchar2  default hr_api.g_varchar2
324   ,p_rvc_attribute8                 in  varchar2  default hr_api.g_varchar2
325   ,p_rvc_attribute9                 in  varchar2  default hr_api.g_varchar2
326   ,p_rvc_attribute10                in  varchar2  default hr_api.g_varchar2
327   ,p_rvc_attribute11                in  varchar2  default hr_api.g_varchar2
328   ,p_rvc_attribute12                in  varchar2  default hr_api.g_varchar2
329   ,p_rvc_attribute13                in  varchar2  default hr_api.g_varchar2
330   ,p_rvc_attribute14                in  varchar2  default hr_api.g_varchar2
331   ,p_rvc_attribute15                in  varchar2  default hr_api.g_varchar2
332   ,p_rvc_attribute16                in  varchar2  default hr_api.g_varchar2
333   ,p_rvc_attribute17                in  varchar2  default hr_api.g_varchar2
334   ,p_rvc_attribute18                in  varchar2  default hr_api.g_varchar2
335   ,p_rvc_attribute19                in  varchar2  default hr_api.g_varchar2
336   ,p_rvc_attribute20                in  varchar2  default hr_api.g_varchar2
337   ,p_rvc_attribute21                in  varchar2  default hr_api.g_varchar2
338   ,p_rvc_attribute22                in  varchar2  default hr_api.g_varchar2
339   ,p_rvc_attribute23                in  varchar2  default hr_api.g_varchar2
340   ,p_rvc_attribute24                in  varchar2  default hr_api.g_varchar2
341   ,p_rvc_attribute25                in  varchar2  default hr_api.g_varchar2
342   ,p_rvc_attribute26                in  varchar2  default hr_api.g_varchar2
343   ,p_rvc_attribute27                in  varchar2  default hr_api.g_varchar2
344   ,p_rvc_attribute28                in  varchar2  default hr_api.g_varchar2
345   ,p_rvc_attribute29                in  varchar2  default hr_api.g_varchar2
346   ,p_rvc_attribute30                in  varchar2  default hr_api.g_varchar2
347   ,p_request_id                     in  number    default hr_api.g_number
348   ,p_program_application_id         in  number    default hr_api.g_number
349   ,p_program_id                     in  number    default hr_api.g_number
350   ,p_program_update_date            in  date      default hr_api.g_date
351   ,p_object_version_number          in out nocopy number
352   ,p_effective_date                 in  date
353   ) is
354   --
355   -- Declare cursors and local variables
356   --
357   l_proc varchar2(72) := g_package||'update_prv_ctfn_prvdd';
358   l_object_version_number ben_prtt_rt_val_ctfn_prvdd.object_version_number%TYPE;
359   --
360   cursor c_prv is
361    select prv.*, pil.person_id, abr.input_value_id, abr.element_type_id
362    from ben_prtt_rt_val prv,
363         ben_per_in_ler  pil,
364         ben_acty_base_rt_f abr
365    where prv.prtt_rt_val_id = p_prtt_rt_val_id
366      and prv.business_group_id = p_business_group_id
367      and pil.per_in_ler_stat_cd not in ('VOIDD', 'BCKDT')
368      and pil.per_in_ler_id = prv.per_in_ler_id
369      and abr.acty_base_rt_id = prv.acty_base_rt_id
370      and p_effective_date between abr.effective_start_date and
371                                   abr.effective_end_date;
372   --
373   l_prv_rec      c_prv%rowtype;
374   l_ovn          number;
375   l_dummy_number number;
376   --
377 begin
378   --
379   hr_utility.set_location('Entering:'|| l_proc, 10);
380   --
381   -- Initialize environment
382   --
383   if fnd_global.conc_request_id = -1 then
384     --
385     ben_env_object.init
386       (p_business_group_id => p_business_group_id,
387        p_effective_date    => p_effective_date,
388        p_thread_id         => null,
389        p_chunk_size        => null,
390        p_threads           => null,
391        p_max_errors        => null,
392        p_benefit_action_id => null);
393     --
394   end if;
395   --
396   -- Issue a savepoint if operating in validation only mode
397   --
401   --
398   savepoint update_prv_ctfn_prvdd;
399   --
400   hr_utility.set_location(l_proc, 20);
402   -- Process Logic
403   --
404   l_object_version_number := p_object_version_number;
405   --
406   begin
407     --
408     -- Start of API User Hook for the before hook of update_prv_ctfn_prvdd
409     --
410     ben_prv_ctfn_prvdd_bk2.update_prv_ctfn_prvdd_b
411       (
412        p_prtt_rt_val_ctfn_prvdd_id        =>  p_prtt_rt_val_ctfn_prvdd_id
413       ,p_enrt_ctfn_rqd_flag             =>  p_enrt_ctfn_rqd_flag
414       ,p_enrt_ctfn_typ_cd               =>  p_enrt_ctfn_typ_cd
415       ,p_enrt_ctfn_recd_dt              =>  p_enrt_ctfn_recd_dt
416       ,p_enrt_ctfn_dnd_dt               =>  p_enrt_ctfn_dnd_dt
417       ,p_prtt_rt_val_id              =>  p_prtt_rt_val_id
418       ,p_business_group_id              =>  p_business_group_id
419       ,p_rvc_attribute_category         =>  p_rvc_attribute_category
420       ,p_rvc_attribute1                 =>  p_rvc_attribute1
421       ,p_rvc_attribute2                 =>  p_rvc_attribute2
422       ,p_rvc_attribute3                 =>  p_rvc_attribute3
423       ,p_rvc_attribute4                 =>  p_rvc_attribute4
424       ,p_rvc_attribute5                 =>  p_rvc_attribute5
425       ,p_rvc_attribute6                 =>  p_rvc_attribute6
426       ,p_rvc_attribute7                 =>  p_rvc_attribute7
427       ,p_rvc_attribute8                 =>  p_rvc_attribute8
428       ,p_rvc_attribute9                 =>  p_rvc_attribute9
429       ,p_rvc_attribute10                =>  p_rvc_attribute10
430       ,p_rvc_attribute11                =>  p_rvc_attribute11
431       ,p_rvc_attribute12                =>  p_rvc_attribute12
432       ,p_rvc_attribute13                =>  p_rvc_attribute13
433       ,p_rvc_attribute14                =>  p_rvc_attribute14
434       ,p_rvc_attribute15                =>  p_rvc_attribute15
435       ,p_rvc_attribute16                =>  p_rvc_attribute16
436       ,p_rvc_attribute17                =>  p_rvc_attribute17
437       ,p_rvc_attribute18                =>  p_rvc_attribute18
438       ,p_rvc_attribute19                =>  p_rvc_attribute19
439       ,p_rvc_attribute20                =>  p_rvc_attribute20
440       ,p_rvc_attribute21                =>  p_rvc_attribute21
441       ,p_rvc_attribute22                =>  p_rvc_attribute22
442       ,p_rvc_attribute23                =>  p_rvc_attribute23
443       ,p_rvc_attribute24                =>  p_rvc_attribute24
444       ,p_rvc_attribute25                =>  p_rvc_attribute25
445       ,p_rvc_attribute26                =>  p_rvc_attribute26
446       ,p_rvc_attribute27                =>  p_rvc_attribute27
447       ,p_rvc_attribute28                =>  p_rvc_attribute28
448       ,p_rvc_attribute29                =>  p_rvc_attribute29
449       ,p_rvc_attribute30                =>  p_rvc_attribute30
450       ,p_request_id                    => p_request_id
451       ,p_program_application_id        => p_program_application_id
452       ,p_program_id                    => p_program_id
453       ,p_program_update_date           => p_program_update_date
454       ,p_object_version_number          =>  p_object_version_number
455     ,p_effective_date                      => trunc(p_effective_date)
456       );
457   exception
458     when hr_api.cannot_find_prog_unit then
459       hr_api.cannot_find_prog_unit_error
460         (p_module_name => 'UPDATE_prv_ctfn_prvdd'
461         ,p_hook_type   => 'BP'
462         );
463     --
464     -- End of API User Hook for the before hook of update_prv_ctfn_prvdd
465     --
466   end;
467   --
468   ben_rvc_upd.upd
469     (
470      p_prtt_rt_val_ctfn_prvdd_id       => p_prtt_rt_val_ctfn_prvdd_id
471     ,p_enrt_ctfn_rqd_flag            => p_enrt_ctfn_rqd_flag
472     ,p_enrt_ctfn_typ_cd              => p_enrt_ctfn_typ_cd
473     ,p_enrt_ctfn_recd_dt             => p_enrt_ctfn_recd_dt
474     ,p_enrt_ctfn_dnd_dt              => p_enrt_ctfn_dnd_dt
475     ,p_prtt_rt_val_id             => p_prtt_rt_val_id
476     ,p_business_group_id             => p_business_group_id
477     ,p_rvc_attribute_category        => p_rvc_attribute_category
478     ,p_rvc_attribute1                => p_rvc_attribute1
479     ,p_rvc_attribute2                => p_rvc_attribute2
480     ,p_rvc_attribute3                => p_rvc_attribute3
481     ,p_rvc_attribute4                => p_rvc_attribute4
482     ,p_rvc_attribute5                => p_rvc_attribute5
483     ,p_rvc_attribute6                => p_rvc_attribute6
484     ,p_rvc_attribute7                => p_rvc_attribute7
485     ,p_rvc_attribute8                => p_rvc_attribute8
486     ,p_rvc_attribute9                => p_rvc_attribute9
487     ,p_rvc_attribute10               => p_rvc_attribute10
488     ,p_rvc_attribute11               => p_rvc_attribute11
489     ,p_rvc_attribute12               => p_rvc_attribute12
490     ,p_rvc_attribute13               => p_rvc_attribute13
491     ,p_rvc_attribute14               => p_rvc_attribute14
492     ,p_rvc_attribute15               => p_rvc_attribute15
493     ,p_rvc_attribute16               => p_rvc_attribute16
494     ,p_rvc_attribute17               => p_rvc_attribute17
495     ,p_rvc_attribute18               => p_rvc_attribute18
496     ,p_rvc_attribute19               => p_rvc_attribute19
497     ,p_rvc_attribute20               => p_rvc_attribute20
498     ,p_rvc_attribute21               => p_rvc_attribute21
499     ,p_rvc_attribute22               => p_rvc_attribute22
500     ,p_rvc_attribute23               => p_rvc_attribute23
504     ,p_rvc_attribute27               => p_rvc_attribute27
501     ,p_rvc_attribute24               => p_rvc_attribute24
502     ,p_rvc_attribute25               => p_rvc_attribute25
503     ,p_rvc_attribute26               => p_rvc_attribute26
505     ,p_rvc_attribute28               => p_rvc_attribute28
506     ,p_rvc_attribute29               => p_rvc_attribute29
507     ,p_rvc_attribute30               => p_rvc_attribute30
508       ,p_request_id                    => p_request_id
509       ,p_program_application_id        => p_program_application_id
510       ,p_program_id                    => p_program_id
511       ,p_program_update_date           => p_program_update_date
512     ,p_object_version_number         => l_object_version_number
513     ,p_effective_date                => trunc(p_effective_date)
514     );
515   --
516   begin
517     --
518     -- Start of API User Hook for the after hook of update_prv_ctfn_prvdd
519     --
520     ben_prv_ctfn_prvdd_bk2.update_prv_ctfn_prvdd_a
521       (
522        p_prtt_rt_val_ctfn_prvdd_id        =>  p_prtt_rt_val_ctfn_prvdd_id
523       ,p_enrt_ctfn_rqd_flag             =>  p_enrt_ctfn_rqd_flag
524       ,p_enrt_ctfn_typ_cd               =>  p_enrt_ctfn_typ_cd
525       ,p_enrt_ctfn_recd_dt              =>  p_enrt_ctfn_recd_dt
526       ,p_enrt_ctfn_dnd_dt               =>  p_enrt_ctfn_dnd_dt
527       ,p_prtt_rt_val_id              =>  p_prtt_rt_val_id
528       ,p_business_group_id              =>  p_business_group_id
529       ,p_rvc_attribute_category         =>  p_rvc_attribute_category
530       ,p_rvc_attribute1                 =>  p_rvc_attribute1
531       ,p_rvc_attribute2                 =>  p_rvc_attribute2
532       ,p_rvc_attribute3                 =>  p_rvc_attribute3
533       ,p_rvc_attribute4                 =>  p_rvc_attribute4
534       ,p_rvc_attribute5                 =>  p_rvc_attribute5
535       ,p_rvc_attribute6                 =>  p_rvc_attribute6
536       ,p_rvc_attribute7                 =>  p_rvc_attribute7
537       ,p_rvc_attribute8                 =>  p_rvc_attribute8
538       ,p_rvc_attribute9                 =>  p_rvc_attribute9
539       ,p_rvc_attribute10                =>  p_rvc_attribute10
540       ,p_rvc_attribute11                =>  p_rvc_attribute11
541       ,p_rvc_attribute12                =>  p_rvc_attribute12
542       ,p_rvc_attribute13                =>  p_rvc_attribute13
543       ,p_rvc_attribute14                =>  p_rvc_attribute14
544       ,p_rvc_attribute15                =>  p_rvc_attribute15
545       ,p_rvc_attribute16                =>  p_rvc_attribute16
546       ,p_rvc_attribute17                =>  p_rvc_attribute17
547       ,p_rvc_attribute18                =>  p_rvc_attribute18
548       ,p_rvc_attribute19                =>  p_rvc_attribute19
549       ,p_rvc_attribute20                =>  p_rvc_attribute20
550       ,p_rvc_attribute21                =>  p_rvc_attribute21
551       ,p_rvc_attribute22                =>  p_rvc_attribute22
552       ,p_rvc_attribute23                =>  p_rvc_attribute23
553       ,p_rvc_attribute24                =>  p_rvc_attribute24
554       ,p_rvc_attribute25                =>  p_rvc_attribute25
555       ,p_rvc_attribute26                =>  p_rvc_attribute26
556       ,p_rvc_attribute27                =>  p_rvc_attribute27
557       ,p_rvc_attribute28                =>  p_rvc_attribute28
558       ,p_rvc_attribute29                =>  p_rvc_attribute29
559       ,p_rvc_attribute30                =>  p_rvc_attribute30
560       ,p_request_id                    => p_request_id
561       ,p_program_application_id        => p_program_application_id
562       ,p_program_id                    => p_program_id
563       ,p_program_update_date           => p_program_update_date
564       ,p_object_version_number          =>  l_object_version_number
565       ,p_effective_date                 => trunc(p_effective_date)
566       );
567   exception
568     when hr_api.cannot_find_prog_unit then
569       hr_api.cannot_find_prog_unit_error
570         (p_module_name => 'UPDATE_prv_ctfn_prvdd'
571         ,p_hook_type   => 'AP'
572         );
573     --
574     -- End of API User Hook for the after hook of update_prv_ctfn_prvdd
575     --
576   end;
577   --
578   -- LGE : if certification recieved then create element entry.
579   --
580   if nvl(p_enrt_ctfn_recd_dt, hr_api.g_date) <> hr_api.g_date and
581      nvl(p_enrt_ctfn_dnd_dt, hr_api.g_date) =  hr_api.g_date
582   then
583     --
584     -- Create element entry.
585     --
586     open c_prv;
587     fetch c_prv into l_prv_rec;
588     close c_prv;
589     --
590     /*
591     if result_is_suspended(
595      ='N' then
592        p_prtt_enrt_rslt_id => l_prv_rec.prtt_enrt_rslt_id,
593        p_business_group_id => p_business_group_id,
594        p_effective_date    => p_effective_date)
596     */
597      --
598      ben_element_entry.create_enrollment_element
599       (p_business_group_id        => p_business_group_id
600       ,p_prtt_rt_val_id           => p_prtt_rt_val_id
601       ,p_person_id                => l_prv_rec.person_id
602       ,p_acty_ref_perd            => l_prv_rec.acty_ref_perd_cd
603       ,p_acty_base_rt_id          => l_prv_rec.acty_base_rt_id
604       ,p_enrt_rslt_id             => l_prv_rec.prtt_enrt_rslt_id
605       ,p_rt_start_date            => l_prv_rec.rt_strt_dt
606       ,p_rt                       => l_prv_rec.rt_val
607       ,p_cmncd_rt                 => l_prv_rec.cmcd_rt_val
608       ,p_ann_rt                   => l_prv_rec.ann_rt_val
609       ,p_input_value_id           => l_prv_rec.input_value_id
610       ,p_element_type_id          => l_prv_rec.element_type_id
611       ,p_prv_object_version_number=> l_prv_rec.object_version_number
612       ,p_effective_date           => p_effective_date
613       ,p_eev_screen_entry_value   => l_dummy_number
614       ,p_element_entry_value_id   => l_dummy_number
615       );
616      --
617     -- end if;
618     --
619   end if;
620   hr_utility.set_location(' Leaving:'||l_proc, 64);
621   --
622   -- When in validation only mode raise the Validate_Enabled exception
623   --
624   if p_validate then
625     raise hr_api.validate_enabled;
626   end if;
627   --
628   -- Set all output arguments
629   --
630   p_object_version_number := l_object_version_number;
631 
632   --
633   hr_utility.set_location(' Leaving:'||l_proc, 70);
634   --
635 exception
636   --
637   when hr_api.validate_enabled then
638     --
639     -- As the Validate_Enabled exception has been raised
640     -- we must rollback to the savepoint
641     --
642     ROLLBACK TO update_prv_ctfn_prvdd;
643     --
644     -- Only set output warning arguments
645     -- (Any key or derived arguments must be set to null
646     -- when validation only mode is being used.)
647     --
648     hr_utility.set_location(' Leaving:'||l_proc, 80);
649     --
650   when others then
651     --
652     -- A validation or unexpected error has occured
653     --
654     ROLLBACK TO update_prv_ctfn_prvdd;
655     raise;
656     --
657 end update_prv_ctfn_prvdd;
658 --
659 -- ----------------------------------------------------------------------------
660 -- |---------------------< delete_prv_ctfn_prvdd >----------------------|
661 -- ----------------------------------------------------------------------------
662 --
663 procedure delete_prv_ctfn_prvdd
664   (p_validate                       in  boolean  default false
665   ,p_prtt_rt_val_ctfn_prvdd_id        in  number
666   ,p_object_version_number          in out nocopy number
667   ,p_effective_date                 in  date
668   ,p_check_actions                  in varchar2 default 'Y'
669   ) is
670   --
671   -- Declare cursors and local variables
672   --
676   l_prtt_rt_val_id      number(15);
673   l_proc varchar2(72) := g_package||'delete_prv_ctfn_prvdd';
674   l_object_version_number ben_prtt_rt_val_ctfn_prvdd.object_version_number%TYPE;
675   --
677   l_rslt_object_version_number number(15);
678   l_business_group_id      number(15);
679   l_exist                  varchar2(1) := 'N';
680   --
681 begin
682   --
683   hr_utility.set_location('Entering:'|| l_proc, 10);
684   --
685   -- Get action item id and the business group id.
686   --
687   -- Initialize environment
688   --
689   if fnd_global.conc_request_id = -1 then
690     --
691     ben_env_object.init
692       (p_business_group_id => l_business_group_id,
693        p_effective_date    => p_effective_date,
694        p_thread_id         => null,
695        p_chunk_size        => null,
696        p_threads           => null,
697        p_max_errors        => null,
698        p_benefit_action_id => null);
699     --
700   end if;
701   --
702   -- Issue a savepoint if operating in validation only mode
703   --
704   savepoint delete_prv_ctfn_prvdd;
705   --
706   hr_utility.set_location(l_proc, 20);
707   --
708   -- Process Logic
709   --
710   l_object_version_number := p_object_version_number;
711   --
712   begin
713     --
714     -- Start of API User Hook for the before hook of delete_prv_ctfn_prvdd
715     --
716     ben_prv_ctfn_prvdd_bk3.delete_prv_ctfn_prvdd_b
717       (p_prtt_rt_val_ctfn_prvdd_id        =>  p_prtt_rt_val_ctfn_prvdd_id
718       ,p_object_version_number          =>  p_object_version_number
719       ,p_effective_date                 => trunc(p_effective_date) );
720   exception
721     when hr_api.cannot_find_prog_unit then
722       hr_api.cannot_find_prog_unit_error
723         (p_module_name => 'DELETE_prv_ctfn_prvdd'
724         ,p_hook_type   => 'BP'
725         );
726     --
727     -- End of API User Hook for the before hook of delete_prv_ctfn_prvdd
728     --
729   end;
730   --
731   ben_rvc_del.del
732     (
733      p_prtt_rt_val_ctfn_prvdd_id       => p_prtt_rt_val_ctfn_prvdd_id
734     ,p_object_version_number         => l_object_version_number
735     ,p_effective_date                => p_effective_date
736     );
737   --
738   --
739   begin
740     --
741     -- Start of API User Hook for the after hook of delete_prv_ctfn_prvdd
742     --
743     ben_prv_ctfn_prvdd_bk3.delete_prv_ctfn_prvdd_a
744       (
745        p_prtt_rt_val_ctfn_prvdd_id        =>  p_prtt_rt_val_ctfn_prvdd_id
749   exception
746       ,p_object_version_number          =>  l_object_version_number
747       ,p_effective_date                      => trunc(p_effective_date)
748       );
750     when hr_api.cannot_find_prog_unit then
754         );
751       hr_api.cannot_find_prog_unit_error
752         (p_module_name => 'DELETE_prv_ctfn_prvdd'
753         ,p_hook_type   => 'AP'
755     --
756     -- End of API User Hook for the after hook of delete_prv_ctfn_prvdd
757     --
758   end;
759   --
760   hr_utility.set_location(l_proc, 60);
761   --
762   -- When in validation only mode raise the Validate_Enabled exception
763   --
764   if p_validate then
770 exception
765     raise hr_api.validate_enabled;
766   end if;
767   --
768   hr_utility.set_location(' Leaving:'||l_proc, 70);
769   --
771   --
772   when hr_api.validate_enabled then
773     --
774     -- As the Validate_Enabled exception has been raised
775     -- we must rollback to the savepoint
776     --
777     ROLLBACK TO delete_prv_ctfn_prvdd;
778     --
779     -- Only set output warning arguments
780     -- (Any key or derived arguments must be set to null
781     -- when validation only mode is being used.)
782     --
783     --
784   when others then
785     --
789     raise;
786     -- A validation or unexpected error has occured
787     --
788     ROLLBACK TO delete_prv_ctfn_prvdd;
790     --
791 end delete_prv_ctfn_prvdd;
792 --
793 -- ----------------------------------------------------------------------------
794 -- |-------------------------------< lck >------------------------------------|
795 -- ----------------------------------------------------------------------------
796 --
797 procedure lck
798   (
799    p_prtt_rt_val_ctfn_prvdd_id      in     number
800   ,p_object_version_number          in     number
801   ) is
802   --
803   --
804   -- Declare cursors and local variables
805   --
806   l_proc varchar2(72) := g_package||'lck';
807   --
808 begin
809   --
810   hr_utility.set_location('Entering:'|| l_proc, 10);
811   --
812   ben_rvc_shd.lck
813     (
814       p_prtt_rt_val_ctfn_prvdd_id    => p_prtt_rt_val_ctfn_prvdd_id
815      ,p_object_version_number      => p_object_version_number
816     );
817   --
818   hr_utility.set_location(' Leaving:'||l_proc, 70);
819   --
820 end lck;
821 --
822 end ben_prv_ctfn_prvdd_api;