DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PRTT_PREM_API

Source


1 Package Body ben_PRTT_PREM_api as
2 /* $Header: beppeapi.pkb 120.1.12010000.2 2008/08/05 15:16:09 ubhat ship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  ben_PRTT_PREM_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< recalc_PRTT_PREM >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure recalc_PRTT_PREM
13   (p_prtt_prem_id                   in  number default null
14   ,p_std_prem_uom                   in  varchar2  default null
15   ,p_std_prem_val                   in out nocopy number
16   ,p_actl_prem_id                   in  number    default null
17   ,p_prtt_enrt_rslt_id              in  number    default null
18   ,p_per_in_ler_id                  in  number
19   ,p_ler_id                         in  number
20   ,p_lf_evt_ocrd_dt                 in  date
21   ,p_elig_per_elctbl_chc_id         in  number
22   ,p_enrt_bnft_id                   in  number
23   ,p_business_group_id              in  number    default null
24   -- bof FONM
25   ,p_enrt_cvg_strt_dt               in  date    default null
26   ,p_rt_strt_dt                     in  date    default null
27  -- eof FONM
28   ,p_effective_date                 in  date
29   ) is
30 
31   l_proc varchar2(72) := g_package||'recalc_PRTT_PREM';
32   --- FONM p_date param added
33   cursor c_prtt_prem (p_date date ) is
34     select ppe.std_prem_val, ppe.actl_prem_id, ppe.prtt_enrt_rslt_id
35     from ben_prtt_prem_f ppe
36     where ppe.prtt_prem_id = p_prtt_prem_id
37     --and p_effective_date between
38     and p_date between
39         ppe.effective_start_date and ppe.effective_end_date;
40   l_prtt_prem c_prtt_prem%rowtype;
41 
42   --- FONM p_date param added
43   cursor c_actl_prem(p_actl_prem_id number , p_date date) is
44     select apr.mlt_cd, apr.pl_id, apr.oipl_id, apr.bnft_rt_typ_cd, apr.val,
45            apr.rndg_cd, apr.rndg_rl, apr.upr_lmt_val, apr.lwr_lmt_val,
46            apr.upr_lmt_calc_rl, apr.lwr_lmt_calc_rl, prem_asnmt_cd, val_calc_rl
47     from ben_actl_prem_f apr
48     where apr.actl_prem_id = p_actl_prem_id
49     --and p_effective_date between
50     and p_date between
51         apr.effective_start_date and apr.effective_end_date;
52   l_actl_prem c_actl_prem%rowtype;
53 
54   --- FONM p_date param added
55   cursor c_cvg(p_pl_id number, p_oipl_id number,p_date date ) is
56     select ccm.entr_val_at_enrt_flag,
57            ccm.cvg_mlt_cd
58     from ben_cvg_amt_calc_mthd_f ccm
59     where ((ccm.pl_id = p_pl_id and p_oipl_id is null)
60     or (ccm.oipl_id = p_oipl_id and p_pl_id is null))
61     --and p_effective_date between
62     and p_date between
63         ccm.effective_start_date and ccm.effective_end_date;
64   l_cvg c_cvg%rowtype;
65 
66   cursor c_rslt(p_prtt_enrt_rslt_id number) is
67     select pen.bnft_amt, pen.person_id,  pen.pgm_id,
68            pen.pl_id, pen.oipl_id, pen.pl_typ_id, pen.per_in_ler_id, pen.ler_id,
69            epe.elig_per_elctbl_chc_id, b.enrt_bnft_id, pen.business_group_id,
70            b.entr_val_at_enrt_flag, b.cvg_mlt_cd
71     from ben_prtt_enrt_rslt_f pen, ben_elig_per_elctbl_chc epe, ben_enrt_bnft b
72     where pen.prtt_enrt_rslt_id = p_prtt_enrt_rslt_id
73     and   pen.prtt_enrt_rslt_id = epe.prtt_enrt_rslt_id
74     and   b.elig_per_elctbl_chc_id(+) = epe.elig_per_elctbl_chc_id
75     and   pen.prtt_enrt_rslt_stat_cd is null
76 --    and   (b.entr_val_at_enrt_flag = 'Y' or
77 --           b.cvg_mlt_cd = 'ERL')
78     and p_effective_date between
79         pen.effective_start_date and pen.effective_end_date;
80   l_rslt c_rslt%rowtype;
81 
82   --- FONM p_date param added
83   cursor c_opt(p_oipl_id in number,p_date date) is
84     select oipl.opt_id
85     from   ben_oipl_f oipl
86     where  oipl.oipl_id = p_oipl_id
87     --  and  p_effective_date between
88       and  p_date between
89              oipl.effective_start_date and oipl.effective_end_date;
90 
91   l_opt c_opt%rowtype;
92 
93   --
94   cursor c_apv is
95   select 'X'
96     from ben_ACTL_PREM_VRBL_RT_f apv
97    where apv.actl_prem_id = p_actl_prem_id
98      and p_effective_date between apv.effective_start_date
99                               and apv.effective_end_date;
100 
101 
102 /*  cursor c_pil is
103     select pil.LF_EVT_OCRD_DT
104     from ben_per_in_ler pil
105     where pil.per_in_ler_id = p_per_in_ler_id;
106   l_pil c_pil%rowtype;
107 */
108 
109  l_variable_val number;
110  l_vr_trtmt_cd  varchar2(80);
111  l_dummy_number number;
112  l_dummy_char   varchar2(80);
113  l_fonm_eff_dt  date ;
114  l_recalc_premium  boolean := FALSE; -- 5557305: All Logic w.r.t this param is added.
115  -- bof FONM
116 
117  cursor c_epe  is
118  select *
119  from  ben_elig_per_elctbl_chc
120  where elig_per_elctbl_chc_id = p_elig_per_elctbl_chc_id  ;
121  l_epe_row c_epe%rowtype ;
122 
123  l_fonm_date  date        := nvl(p_enrt_cvg_strt_dt,p_lf_evt_ocrd_dt); -- prem created on cvg date so use first
124  l_fonm_flag  varchar2(1) :=   ben_manage_life_events.fonm ;
125  l_fonm_cvg_strt_dt   date ;
126  l_fonm_rt_strt_dt    date ;
127 
128  -- eof FONM
129 begin
130   hr_utility.set_location('Entering:'|| l_proc, 10);
131    -- bof FONM
132   if  l_fonm_flag  = 'Y'   then
133       l_fonm_cvg_strt_dt :=  p_enrt_cvg_strt_dt ;
134       l_fonm_rt_strt_dt := p_rt_strt_dt ;
135       open c_epe ;
136       fetch c_epe into l_epe_row  ;
137       close c_epe ;
138       if  l_epe_row.fonm_cvg_strt_dt is not null then
139          l_fonm_cvg_strt_dt    := l_epe_row.fonm_cvg_strt_dt ;
140       end if ;
141       l_fonm_date := nvl(l_fonm_cvg_strt_dt,l_fonm_date ) ;
142       l_fonm_eff_dt := l_fonm_date ;        -- this date for fonm fonm date or effective date to get opt
143       --if p_rt_strt_dt not null then
144       --end if ;
145   else -- if called from enrollment process fonm_flag is null
146     --
147     open c_epe ;
148     fetch c_epe into l_epe_row  ;
149     close c_epe ;
150     if  l_epe_row.fonm_cvg_strt_dt is not null then
151        l_fonm_cvg_strt_dt    := l_epe_row.fonm_cvg_strt_dt ;
152     end if ;
153     l_fonm_date := nvl(l_fonm_cvg_strt_dt,l_fonm_date ) ;
154     l_fonm_eff_dt := nvl(l_epe_row.fonm_cvg_strt_dt, p_effective_date ) ;
155     --
156   end if ;
157   -- eof FONM
158   hr_utility.set_location('effective_date:'|| p_effective_date, 10);
159   hr_utility.set_location('p_lf_evt_ocrd_dt:'|| p_lf_evt_ocrd_dt, 10);
160   hr_utility.set_location('p_enrt_cvg_strt_dt:'|| p_enrt_cvg_strt_dt, 10);
161   hr_utility.set_location('l_fonm_date:'|| l_fonm_date, 10);
162   hr_utility.set_location('l_fonm_eff_date:'|| l_fonm_eff_dt, 10);
163 
164   if p_std_prem_val is null or p_actl_prem_id is null or p_prtt_enrt_rslt_id is null
165      then
166      if p_prtt_prem_id is null then
167         -- If we are calling this procedure prior to a create premium, we need all these
168         -- parms passed in.
169         fnd_message.set_name('BEN', 'BEN_91832_PACKAGE_PARAM_NULL');
170         fnd_message.set_token('PACKAGE', l_proc);
171         fnd_message.set_token('PARAM',
172            'p_std_prem_val or p_actl_prem_id or p_prtt_enrt_rslt_id');
173         fnd_message.raise_error;
174      else
175         --- fonm parameter added
176         open c_prtt_prem(l_fonm_date);
177         fetch c_prtt_prem into l_prtt_prem;
178         if c_prtt_prem%NOTFOUND or c_prtt_prem%NOTFOUND is null then
179            close c_prtt_prem;
180            hr_utility.set_location('BEN_91563_BENVRBRT_APR_NF', 11);
181            fnd_message.set_name('BEN', 'BEN_91563_BENVRBRT_APR_NF');
182            fnd_message.raise_error;
183         end if;
184         close c_prtt_prem;
185         p_std_prem_val := l_prtt_prem.std_prem_val;  -- output parm
186      end if;
187   else
188      l_prtt_prem.actl_prem_id := p_actl_prem_id;
189      l_prtt_prem.prtt_enrt_rslt_id := p_prtt_enrt_rslt_id;
190   end if;
191    --- fonm parameter added
192   open c_actl_prem(l_prtt_prem.actl_prem_id,l_fonm_date );
193   fetch c_actl_prem into l_actl_prem;
194   if c_actl_prem%NOTFOUND or c_actl_prem%NOTFOUND is null then
195      close c_actl_prem;
196      hr_utility.set_location('BEN_91577_BENACPRM_APR_NF', 20);
197      fnd_message.set_name('BEN', 'BEN_91577_BENACPRM_APR_NF');
198      fnd_message.raise_error;
199   end if;
200   close c_actl_prem;
201 
202   -- If the premium is a multiple of coverage and that coverage value is
203   -- entered at enrollment, we need to re-calc the premium value.
204   --
205     -- 5557305 : Recalculate 'Actual Premium' for all Modes,
206     -- as there might be Variable Premiums. So, even if the 'actual premium'
207     -- did not change, variable premium would have changed.
208     --
209   l_recalc_premium := FALSE;
210   --
211   if (l_actl_prem.mlt_cd = 'CVG' and l_actl_prem.prem_asnmt_cd = 'ENRT')
212   then
213      --- fonm parameter added
214      open c_cvg(l_actl_prem.pl_id, l_actl_prem.oipl_id,l_fonm_date);
215      fetch c_cvg into l_cvg;
216      if c_cvg%NOTFOUND then
217            close c_cvg;
218            hr_utility.set_location('BEN_92494_COVERAGE_NF', 30);
219            fnd_message.set_name('BEN', 'BEN_92492_COVERAGE_NF');
220            fnd_message.set_token('ID', to_char(l_prtt_prem.actl_prem_id));
221            fnd_message.raise_error;
222      end if;
223      close c_cvg;
224      --
225      if l_cvg.entr_val_at_enrt_flag = 'Y' or l_cvg.cvg_mlt_cd = 'ERL' then
226            l_recalc_premium := true;
227      end if;
228   --
229   end if;
230 
231   --
232   if (not l_recalc_premium) then
233     open c_apv;
234     fetch c_apv into l_dummy_char;
235     if c_apv%FOUND then
236         l_recalc_premium := true;
237     end if;
238     close c_apv;
239   end if;
240     --
241   if l_recalc_premium then
242 --         if l_cvg.entr_val_at_enrt_flag = 'Y' or l_cvg.cvg_mlt_cd = 'ERL' then
243        open c_rslt(l_prtt_prem.prtt_enrt_rslt_id);
244        fetch c_rslt into l_rslt;
245        if c_rslt%NOTFOUND or c_rslt%NOTFOUND is null then
246           close c_rslt;
247           hr_utility.set_location('BEN_91711_ENRT_RSLT_NOT_FND', 11);
248           fnd_message.set_name('BEN', 'BEN_91711_ENRT_RSLT_NOT_FND');
249           fnd_message.set_token('PROC',l_proc);
250           fnd_message.set_token('ID', to_char(l_prtt_prem.prtt_enrt_rslt_id));
251           fnd_message.set_token('PERSON_ID',null);
252           fnd_message.set_token('LER_ID', to_char(p_ler_id));
253           fnd_message.set_token('EFFECTIVE_DATE', to_char(p_effective_date));
254           fnd_message.raise_error;
255        end if;
256        close c_rslt;
257           --
258        if l_rslt.oipl_id is not null then
259           --- fonm parameter added
260           open c_opt(l_rslt.oipl_id,l_fonm_eff_dt);
261           fetch c_opt into l_opt;
262           close c_opt;
263        end if;
264        -- re-calc the premium value
265        BEN_DETERMINE_ACTUAL_PREMIUM.compute_premium
266         (p_person_id              => l_rslt.person_id,
267          p_lf_evt_ocrd_dt         => p_lf_evt_ocrd_dt,
268          p_effective_date         => p_effective_date,
269          p_business_group_id      => l_rslt.business_group_id,
270          p_per_in_ler_id          => p_per_in_ler_id,
271          p_ler_id                 => p_ler_id,
272          p_actl_prem_id           => l_prtt_prem.actl_prem_id,
273          p_perform_rounding_flg   => TRUE,
274          p_calc_only_rt_val_flag  => TRUE,
275          p_pgm_id                 => l_rslt.pgm_id,
276          p_pl_typ_id              => l_rslt.pl_typ_id,
277          p_pl_id                  => l_rslt.pl_id,
278          p_oipl_id                => l_rslt.oipl_id,
279          p_opt_id                 => l_opt.opt_id,
280          p_elig_per_elctbl_chc_id => p_elig_per_elctbl_chc_id,
281          p_enrt_bnft_id           => p_enrt_bnft_id,
282          p_bnft_amt               => l_rslt.bnft_amt,
283          p_prem_val               => l_actl_prem.val,
284          p_mlt_cd                 => l_actl_prem.mlt_cd,
285          p_bnft_rt_typ_cd         => l_actl_prem.bnft_rt_typ_cd,
286          p_val_calc_rl            => l_actl_prem.val_calc_rl,
287          p_rndg_cd                => l_actl_prem.rndg_cd,
288          p_rndg_rl                => l_actl_prem.rndg_rl,
289          p_upr_lmt_val            => l_actl_prem.upr_lmt_val,
290          p_lwr_lmt_val            => l_actl_prem.lwr_lmt_val,
291          p_upr_lmt_calc_rl        => l_actl_prem.upr_lmt_calc_rl,
292          p_lwr_lmt_calc_rl        => l_actl_prem.lwr_lmt_calc_rl,
293          -- bof Fonm
294          p_fonm_cvg_strt_dt       => l_fonm_cvg_strt_dt ,
295          p_fonm_rt_strt_dt        => l_fonm_rt_strt_dt  ,
296          -- eof FONM
297          p_computed_val           => p_std_prem_val); -- output
298 
299    end if;
300   --end if;
301   hr_utility.set_location('p_std_prem_val:'||to_char(p_std_prem_val), 99);
302   hr_utility.set_location('Leaving:'|| l_proc, 99);
303 end recalc_PRTT_PREM;
304 --
305 -- ----------------------------------------------------------------------------
306 -- |------------------------< create_PRTT_PREM >----------------------|
307 -- ----------------------------------------------------------------------------
308 --
309 procedure create_PRTT_PREM
310   (p_validate                       in  boolean   default false
311   ,p_prtt_prem_id                   out nocopy number
312   ,p_effective_start_date           out nocopy date
313   ,p_effective_end_date             out nocopy date
314   ,p_std_prem_uom                   in  varchar2  default null
315   ,p_std_prem_val                   in  number    default null
316   ,p_actl_prem_id                   in  number    default null
317   ,p_prtt_enrt_rslt_id              in  number    default null
318   ,p_per_in_ler_id              in  number
319   ,p_business_group_id              in  number    default null
320   ,p_ppe_attribute_category         in  varchar2  default null
321   ,p_ppe_attribute1                 in  varchar2  default null
322   ,p_ppe_attribute2                 in  varchar2  default null
323   ,p_ppe_attribute3                 in  varchar2  default null
324   ,p_ppe_attribute4                 in  varchar2  default null
325   ,p_ppe_attribute5                 in  varchar2  default null
326   ,p_ppe_attribute6                 in  varchar2  default null
327   ,p_ppe_attribute7                 in  varchar2  default null
328   ,p_ppe_attribute8                 in  varchar2  default null
329   ,p_ppe_attribute9                 in  varchar2  default null
330   ,p_ppe_attribute10                in  varchar2  default null
331   ,p_ppe_attribute11                in  varchar2  default null
332   ,p_ppe_attribute12                in  varchar2  default null
333   ,p_ppe_attribute13                in  varchar2  default null
334   ,p_ppe_attribute14                in  varchar2  default null
335   ,p_ppe_attribute15                in  varchar2  default null
336   ,p_ppe_attribute16                in  varchar2  default null
337   ,p_ppe_attribute17                in  varchar2  default null
338   ,p_ppe_attribute18                in  varchar2  default null
339   ,p_ppe_attribute19                in  varchar2  default null
340   ,p_ppe_attribute20                in  varchar2  default null
341   ,p_ppe_attribute21                in  varchar2  default null
342   ,p_ppe_attribute22                in  varchar2  default null
343   ,p_ppe_attribute23                in  varchar2  default null
344   ,p_ppe_attribute24                in  varchar2  default null
345   ,p_ppe_attribute25                in  varchar2  default null
346   ,p_ppe_attribute26                in  varchar2  default null
347   ,p_ppe_attribute27                in  varchar2  default null
348   ,p_ppe_attribute28                in  varchar2  default null
349   ,p_ppe_attribute29                in  varchar2  default null
350   ,p_ppe_attribute30                in  varchar2  default null
351   ,p_object_version_number          out nocopy number
352   ,p_request_id                     in  number    default null
353   ,p_program_application_id         in  number    default null
354   ,p_program_id                     in  number    default null
355   ,p_program_update_date            in  date      default null
356   ,p_effective_date                 in  date
357   ) is
358   --
359   -- Declare cursors and local variables
360   --
361   l_prtt_prem_id ben_prtt_prem_f.prtt_prem_id%TYPE;
362   l_effective_start_date ben_prtt_prem_f.effective_start_date%TYPE;
363   l_effective_end_date ben_prtt_prem_f.effective_end_date%TYPE;
364   l_proc varchar2(72) := g_package||'create_PRTT_PREM';
365   l_object_version_number ben_prtt_prem_f.object_version_number%TYPE;
366   --
367 begin
368   --
369   hr_utility.set_location('Entering:'|| l_proc, 10);
370   --
371   -- Issue a savepoint if operating in validation only mode
372   --
373   savepoint create_PRTT_PREM;
374   --
375   hr_utility.set_location(l_proc, 20);
376   --
377   -- Process Logic
378   --
379   begin
380     --
381     -- Start of API User Hook for the before hook of create_PRTT_PREM
382     --
383     ben_PRTT_PREM_bk1.create_PRTT_PREM_b
384       (
385        p_std_prem_uom                   =>  p_std_prem_uom
386       ,p_std_prem_val                   =>  p_std_prem_val
387       ,p_actl_prem_id                   =>  p_actl_prem_id
388       ,p_prtt_enrt_rslt_id              =>  p_prtt_enrt_rslt_id
389       ,p_per_in_ler_id              =>  p_per_in_ler_id
390       ,p_business_group_id              =>  p_business_group_id
391       ,p_ppe_attribute_category         =>  p_ppe_attribute_category
392       ,p_ppe_attribute1                 =>  p_ppe_attribute1
393       ,p_ppe_attribute2                 =>  p_ppe_attribute2
394       ,p_ppe_attribute3                 =>  p_ppe_attribute3
395       ,p_ppe_attribute4                 =>  p_ppe_attribute4
396       ,p_ppe_attribute5                 =>  p_ppe_attribute5
397       ,p_ppe_attribute6                 =>  p_ppe_attribute6
398       ,p_ppe_attribute7                 =>  p_ppe_attribute7
399       ,p_ppe_attribute8                 =>  p_ppe_attribute8
400       ,p_ppe_attribute9                 =>  p_ppe_attribute9
401       ,p_ppe_attribute10                =>  p_ppe_attribute10
402       ,p_ppe_attribute11                =>  p_ppe_attribute11
403       ,p_ppe_attribute12                =>  p_ppe_attribute12
404       ,p_ppe_attribute13                =>  p_ppe_attribute13
405       ,p_ppe_attribute14                =>  p_ppe_attribute14
406       ,p_ppe_attribute15                =>  p_ppe_attribute15
407       ,p_ppe_attribute16                =>  p_ppe_attribute16
408       ,p_ppe_attribute17                =>  p_ppe_attribute17
409       ,p_ppe_attribute18                =>  p_ppe_attribute18
410       ,p_ppe_attribute19                =>  p_ppe_attribute19
411       ,p_ppe_attribute20                =>  p_ppe_attribute20
412       ,p_ppe_attribute21                =>  p_ppe_attribute21
413       ,p_ppe_attribute22                =>  p_ppe_attribute22
414       ,p_ppe_attribute23                =>  p_ppe_attribute23
415       ,p_ppe_attribute24                =>  p_ppe_attribute24
416       ,p_ppe_attribute25                =>  p_ppe_attribute25
417       ,p_ppe_attribute26                =>  p_ppe_attribute26
418       ,p_ppe_attribute27                =>  p_ppe_attribute27
419       ,p_ppe_attribute28                =>  p_ppe_attribute28
420       ,p_ppe_attribute29                =>  p_ppe_attribute29
421       ,p_ppe_attribute30                =>  p_ppe_attribute30
422       ,p_request_id                     =>  p_request_id
423       ,p_program_application_id         =>  p_program_application_id
424       ,p_program_id                     =>  p_program_id
425       ,p_program_update_date            =>  p_program_update_date
426       ,p_effective_date                 => trunc(p_effective_date)
427       );
428   exception
429     when hr_api.cannot_find_prog_unit then
430       hr_api.cannot_find_prog_unit_error
431         (
432          p_module_name => 'CREATE_PRTT_PREM'
433         ,p_hook_type   => 'BP'
434         );
435     --
436     -- End of API User Hook for the before hook of create_PRTT_PREM
437     --
438   end;
439   --
440   ben_ppe_ins.ins
441     (
442      p_prtt_prem_id                  => l_prtt_prem_id
443     ,p_effective_start_date          => l_effective_start_date
444     ,p_effective_end_date            => l_effective_end_date
445     ,p_std_prem_uom                  => p_std_prem_uom
446     ,p_std_prem_val                  => p_std_prem_val
447     ,p_actl_prem_id                  => p_actl_prem_id
448     ,p_prtt_enrt_rslt_id             => p_prtt_enrt_rslt_id
449     ,p_per_in_ler_id             => p_per_in_ler_id
450     ,p_business_group_id             => p_business_group_id
451     ,p_ppe_attribute_category        => p_ppe_attribute_category
452     ,p_ppe_attribute1                => p_ppe_attribute1
453     ,p_ppe_attribute2                => p_ppe_attribute2
454     ,p_ppe_attribute3                => p_ppe_attribute3
455     ,p_ppe_attribute4                => p_ppe_attribute4
456     ,p_ppe_attribute5                => p_ppe_attribute5
457     ,p_ppe_attribute6                => p_ppe_attribute6
458     ,p_ppe_attribute7                => p_ppe_attribute7
459     ,p_ppe_attribute8                => p_ppe_attribute8
460     ,p_ppe_attribute9                => p_ppe_attribute9
461     ,p_ppe_attribute10               => p_ppe_attribute10
462     ,p_ppe_attribute11               => p_ppe_attribute11
463     ,p_ppe_attribute12               => p_ppe_attribute12
464     ,p_ppe_attribute13               => p_ppe_attribute13
465     ,p_ppe_attribute14               => p_ppe_attribute14
466     ,p_ppe_attribute15               => p_ppe_attribute15
467     ,p_ppe_attribute16               => p_ppe_attribute16
468     ,p_ppe_attribute17               => p_ppe_attribute17
469     ,p_ppe_attribute18               => p_ppe_attribute18
470     ,p_ppe_attribute19               => p_ppe_attribute19
471     ,p_ppe_attribute20               => p_ppe_attribute20
472     ,p_ppe_attribute21               => p_ppe_attribute21
473     ,p_ppe_attribute22               => p_ppe_attribute22
474     ,p_ppe_attribute23               => p_ppe_attribute23
475     ,p_ppe_attribute24               => p_ppe_attribute24
476     ,p_ppe_attribute25               => p_ppe_attribute25
477     ,p_ppe_attribute26               => p_ppe_attribute26
478     ,p_ppe_attribute27               => p_ppe_attribute27
479     ,p_ppe_attribute28               => p_ppe_attribute28
480     ,p_ppe_attribute29               => p_ppe_attribute29
481     ,p_ppe_attribute30               => p_ppe_attribute30
482     ,p_object_version_number         => l_object_version_number
483     ,p_request_id                    => p_request_id
484     ,p_program_application_id        => p_program_application_id
485     ,p_program_id                    => p_program_id
486     ,p_program_update_date           => p_program_update_date
487     ,p_effective_date                => trunc(p_effective_date)
488     );
489   --
490   begin
491     --
492     -- Start of API User Hook for the after hook of create_PRTT_PREM
493     --
494     ben_PRTT_PREM_bk1.create_PRTT_PREM_a
495       (
496        p_prtt_prem_id                   =>  l_prtt_prem_id
497       ,p_effective_start_date           =>  l_effective_start_date
498       ,p_effective_end_date             =>  l_effective_end_date
499       ,p_std_prem_uom                   =>  p_std_prem_uom
500       ,p_std_prem_val                   =>  p_std_prem_val
501       ,p_actl_prem_id                   =>  p_actl_prem_id
502       ,p_prtt_enrt_rslt_id              =>  p_prtt_enrt_rslt_id
503       ,p_per_in_ler_id              =>  p_per_in_ler_id
504       ,p_business_group_id              =>  p_business_group_id
505       ,p_ppe_attribute_category         =>  p_ppe_attribute_category
506       ,p_ppe_attribute1                 =>  p_ppe_attribute1
507       ,p_ppe_attribute2                 =>  p_ppe_attribute2
508       ,p_ppe_attribute3                 =>  p_ppe_attribute3
509       ,p_ppe_attribute4                 =>  p_ppe_attribute4
510       ,p_ppe_attribute5                 =>  p_ppe_attribute5
511       ,p_ppe_attribute6                 =>  p_ppe_attribute6
512       ,p_ppe_attribute7                 =>  p_ppe_attribute7
513       ,p_ppe_attribute8                 =>  p_ppe_attribute8
514       ,p_ppe_attribute9                 =>  p_ppe_attribute9
515       ,p_ppe_attribute10                =>  p_ppe_attribute10
516       ,p_ppe_attribute11                =>  p_ppe_attribute11
517       ,p_ppe_attribute12                =>  p_ppe_attribute12
518       ,p_ppe_attribute13                =>  p_ppe_attribute13
519       ,p_ppe_attribute14                =>  p_ppe_attribute14
520       ,p_ppe_attribute15                =>  p_ppe_attribute15
521       ,p_ppe_attribute16                =>  p_ppe_attribute16
522       ,p_ppe_attribute17                =>  p_ppe_attribute17
523       ,p_ppe_attribute18                =>  p_ppe_attribute18
524       ,p_ppe_attribute19                =>  p_ppe_attribute19
525       ,p_ppe_attribute20                =>  p_ppe_attribute20
526       ,p_ppe_attribute21                =>  p_ppe_attribute21
527       ,p_ppe_attribute22                =>  p_ppe_attribute22
528       ,p_ppe_attribute23                =>  p_ppe_attribute23
529       ,p_ppe_attribute24                =>  p_ppe_attribute24
530       ,p_ppe_attribute25                =>  p_ppe_attribute25
531       ,p_ppe_attribute26                =>  p_ppe_attribute26
532       ,p_ppe_attribute27                =>  p_ppe_attribute27
533       ,p_ppe_attribute28                =>  p_ppe_attribute28
534       ,p_ppe_attribute29                =>  p_ppe_attribute29
535       ,p_ppe_attribute30                =>  p_ppe_attribute30
536       ,p_object_version_number          =>  l_object_version_number
537       ,p_request_id                     =>  p_request_id
538       ,p_program_application_id         =>  p_program_application_id
539       ,p_program_id                     =>  p_program_id
540       ,p_program_update_date            =>  p_program_update_date
541       ,p_effective_date                      => trunc(p_effective_date)
542       );
543   exception
544     when hr_api.cannot_find_prog_unit then
545       hr_api.cannot_find_prog_unit_error
546         (p_module_name => 'CREATE_PRTT_PREM'
547         ,p_hook_type   => 'AP'
548         );
549     --
550     -- End of API User Hook for the after hook of create_PRTT_PREM
551     --
552   end;
553   --
554   hr_utility.set_location(l_proc, 60);
555   --
556   -- When in validation only mode raise the Validate_Enabled exception
557   --
558   if p_validate then
559     raise hr_api.validate_enabled;
560   end if;
561   --
562   -- Set all output arguments
563   --
564   p_prtt_prem_id := l_prtt_prem_id;
565   p_effective_start_date := l_effective_start_date;
566   p_effective_end_date := l_effective_end_date;
567   p_object_version_number := l_object_version_number;
568   --
569   hr_utility.set_location(' Leaving:'||l_proc, 70);
570   --
571 exception
572   --
573   when hr_api.validate_enabled then
574     --
575     -- As the Validate_Enabled exception has been raised
576     -- we must rollback to the savepoint
577     --
578     ROLLBACK TO create_PRTT_PREM;
579     --
580     -- Only set output warning arguments
581     -- (Any key or derived arguments must be set to null
582     -- when validation only mode is being used.)
583     --
584     p_prtt_prem_id := null;
585     p_effective_start_date := null;
586     p_effective_end_date := null;
587     p_object_version_number  := null;
588     hr_utility.set_location(' Leaving:'||l_proc, 80);
589     --
590   when others then
591     --
592     -- A validation or unexpected error has occured
593     --
594     ROLLBACK TO create_PRTT_PREM;
595     raise;
596     --
597 end create_PRTT_PREM;
598 --
599 -- ----------------------------------------------------------------------------
600 -- |------------------------< create_PRTT_PREM >----------------------|
601 -- ----------------------------------------------------------------------------
602 --
603 procedure create_PRTT_PREM
604   (p_validate                       in  boolean   default false
605   ,p_prtt_prem_id                   out nocopy number
606   ,p_effective_start_date           out nocopy date
607   ,p_effective_end_date             out nocopy date
608   ,p_std_prem_uom                   in  varchar2  default null
609   ,p_std_prem_val                   in  number    default null
610   ,p_actl_prem_id                   in  number    default null
611   ,p_prtt_enrt_rslt_id              in  number    default null
612   ,p_business_group_id              in  number    default null
613   ,p_ppe_attribute_category         in  varchar2  default null
614   ,p_ppe_attribute1                 in  varchar2  default null
615   ,p_ppe_attribute2                 in  varchar2  default null
616   ,p_ppe_attribute3                 in  varchar2  default null
617   ,p_ppe_attribute4                 in  varchar2  default null
618   ,p_ppe_attribute5                 in  varchar2  default null
619   ,p_ppe_attribute6                 in  varchar2  default null
620   ,p_ppe_attribute7                 in  varchar2  default null
621   ,p_ppe_attribute8                 in  varchar2  default null
622   ,p_ppe_attribute9                 in  varchar2  default null
623   ,p_ppe_attribute10                in  varchar2  default null
624   ,p_ppe_attribute11                in  varchar2  default null
625   ,p_ppe_attribute12                in  varchar2  default null
626   ,p_ppe_attribute13                in  varchar2  default null
627   ,p_ppe_attribute14                in  varchar2  default null
628   ,p_ppe_attribute15                in  varchar2  default null
629   ,p_ppe_attribute16                in  varchar2  default null
630   ,p_ppe_attribute17                in  varchar2  default null
631   ,p_ppe_attribute18                in  varchar2  default null
632   ,p_ppe_attribute19                in  varchar2  default null
633   ,p_ppe_attribute20                in  varchar2  default null
634   ,p_ppe_attribute21                in  varchar2  default null
635   ,p_ppe_attribute22                in  varchar2  default null
636   ,p_ppe_attribute23                in  varchar2  default null
637   ,p_ppe_attribute24                in  varchar2  default null
638   ,p_ppe_attribute25                in  varchar2  default null
639   ,p_ppe_attribute26                in  varchar2  default null
640   ,p_ppe_attribute27                in  varchar2  default null
641   ,p_ppe_attribute28                in  varchar2  default null
642   ,p_ppe_attribute29                in  varchar2  default null
643   ,p_ppe_attribute30                in  varchar2  default null
644   ,p_object_version_number          out nocopy number
645   ,p_request_id                     in  number    default null
646   ,p_program_application_id         in  number    default null
647   ,p_program_id                     in  number    default null
648   ,p_program_update_date            in  date      default null
649   ,p_effective_date                 in  date
650   ) is
651   --
652   -- Declare cursors and local variables
653   --
654   l_prtt_prem_id ben_prtt_prem_f.prtt_prem_id%TYPE;
655   l_effective_start_date ben_prtt_prem_f.effective_start_date%TYPE;
656   l_effective_end_date ben_prtt_prem_f.effective_end_date%TYPE;
657   l_proc varchar2(72) := g_package||'create_PRTT_PREM';
658   l_object_version_number ben_prtt_prem_f.object_version_number%TYPE;
659   l_per_in_ler_id ben_prtt_prem_f.per_in_ler_id%TYPE;
660   --
661   cursor c_per_in_ler is
662     select pen.per_in_ler_id
663     from   ben_prtt_enrt_rslt_f pen
664     where  pen.prtt_enrt_rslt_id=p_prtt_enrt_rslt_id and
665            pen.prtt_enrt_rslt_stat_cd is null and
666            pen.business_group_id+0=p_business_group_id and
667            p_effective_date between
668              pen.effective_start_date and pen.effective_end_date;
669   --
670 begin
671   --
672   hr_utility.set_location('Entering:'|| l_proc, 10);
673   --
674   -- Issue a savepoint if operating in validation only mode
675   --
676   savepoint create_PRTT_PREM;
677   --
678   open c_per_in_ler;
679   fetch c_per_in_ler into l_per_in_ler_id;
680   close c_per_in_ler;
681   --
682   hr_utility.set_location(l_proc, 20);
683   --
684   -- Process Logic
685   --
686   begin
687     --
688     -- Start of API User Hook for the before hook of create_PRTT_PREM
689     --
690     ben_PRTT_PREM_bk1.create_PRTT_PREM_b
691       (
692        p_std_prem_uom                   =>  p_std_prem_uom
693       ,p_std_prem_val                   =>  p_std_prem_val
694       ,p_actl_prem_id                   =>  p_actl_prem_id
695       ,p_prtt_enrt_rslt_id              =>  p_prtt_enrt_rslt_id
696       ,p_per_in_ler_id              =>  l_per_in_ler_id
697       ,p_business_group_id              =>  p_business_group_id
698       ,p_ppe_attribute_category         =>  p_ppe_attribute_category
699       ,p_ppe_attribute1                 =>  p_ppe_attribute1
700       ,p_ppe_attribute2                 =>  p_ppe_attribute2
701       ,p_ppe_attribute3                 =>  p_ppe_attribute3
702       ,p_ppe_attribute4                 =>  p_ppe_attribute4
703       ,p_ppe_attribute5                 =>  p_ppe_attribute5
704       ,p_ppe_attribute6                 =>  p_ppe_attribute6
705       ,p_ppe_attribute7                 =>  p_ppe_attribute7
706       ,p_ppe_attribute8                 =>  p_ppe_attribute8
707       ,p_ppe_attribute9                 =>  p_ppe_attribute9
708       ,p_ppe_attribute10                =>  p_ppe_attribute10
709       ,p_ppe_attribute11                =>  p_ppe_attribute11
710       ,p_ppe_attribute12                =>  p_ppe_attribute12
711       ,p_ppe_attribute13                =>  p_ppe_attribute13
712       ,p_ppe_attribute14                =>  p_ppe_attribute14
713       ,p_ppe_attribute15                =>  p_ppe_attribute15
714       ,p_ppe_attribute16                =>  p_ppe_attribute16
715       ,p_ppe_attribute17                =>  p_ppe_attribute17
716       ,p_ppe_attribute18                =>  p_ppe_attribute18
717       ,p_ppe_attribute19                =>  p_ppe_attribute19
718       ,p_ppe_attribute20                =>  p_ppe_attribute20
719       ,p_ppe_attribute21                =>  p_ppe_attribute21
720       ,p_ppe_attribute22                =>  p_ppe_attribute22
721       ,p_ppe_attribute23                =>  p_ppe_attribute23
722       ,p_ppe_attribute24                =>  p_ppe_attribute24
723       ,p_ppe_attribute25                =>  p_ppe_attribute25
724       ,p_ppe_attribute26                =>  p_ppe_attribute26
725       ,p_ppe_attribute27                =>  p_ppe_attribute27
726       ,p_ppe_attribute28                =>  p_ppe_attribute28
727       ,p_ppe_attribute29                =>  p_ppe_attribute29
728       ,p_ppe_attribute30                =>  p_ppe_attribute30
729       ,p_request_id                     =>  p_request_id
730       ,p_program_application_id         =>  p_program_application_id
731       ,p_program_id                     =>  p_program_id
732       ,p_program_update_date            =>  p_program_update_date
733       ,p_effective_date                 => trunc(p_effective_date)
734       );
735   exception
736     when hr_api.cannot_find_prog_unit then
737       hr_api.cannot_find_prog_unit_error
738         (
739          p_module_name => 'CREATE_PRTT_PREM'
740         ,p_hook_type   => 'BP'
741         );
742     --
743     -- End of API User Hook for the before hook of create_PRTT_PREM
744     --
745   end;
746   --
747   ben_ppe_ins.ins
748     (
749      p_prtt_prem_id                  => l_prtt_prem_id
750     ,p_effective_start_date          => l_effective_start_date
751     ,p_effective_end_date            => l_effective_end_date
752     ,p_std_prem_uom                  => p_std_prem_uom
753     ,p_std_prem_val                  => p_std_prem_val
754     ,p_actl_prem_id                  => p_actl_prem_id
755     ,p_prtt_enrt_rslt_id             => p_prtt_enrt_rslt_id
756     ,p_per_in_ler_id             => l_per_in_ler_id
757     ,p_business_group_id             => p_business_group_id
758     ,p_ppe_attribute_category        => p_ppe_attribute_category
759     ,p_ppe_attribute1                => p_ppe_attribute1
760     ,p_ppe_attribute2                => p_ppe_attribute2
761     ,p_ppe_attribute3                => p_ppe_attribute3
762     ,p_ppe_attribute4                => p_ppe_attribute4
763     ,p_ppe_attribute5                => p_ppe_attribute5
764     ,p_ppe_attribute6                => p_ppe_attribute6
765     ,p_ppe_attribute7                => p_ppe_attribute7
766     ,p_ppe_attribute8                => p_ppe_attribute8
767     ,p_ppe_attribute9                => p_ppe_attribute9
768     ,p_ppe_attribute10               => p_ppe_attribute10
769     ,p_ppe_attribute11               => p_ppe_attribute11
770     ,p_ppe_attribute12               => p_ppe_attribute12
771     ,p_ppe_attribute13               => p_ppe_attribute13
772     ,p_ppe_attribute14               => p_ppe_attribute14
773     ,p_ppe_attribute15               => p_ppe_attribute15
774     ,p_ppe_attribute16               => p_ppe_attribute16
775     ,p_ppe_attribute17               => p_ppe_attribute17
776     ,p_ppe_attribute18               => p_ppe_attribute18
777     ,p_ppe_attribute19               => p_ppe_attribute19
778     ,p_ppe_attribute20               => p_ppe_attribute20
779     ,p_ppe_attribute21               => p_ppe_attribute21
780     ,p_ppe_attribute22               => p_ppe_attribute22
781     ,p_ppe_attribute23               => p_ppe_attribute23
782     ,p_ppe_attribute24               => p_ppe_attribute24
783     ,p_ppe_attribute25               => p_ppe_attribute25
784     ,p_ppe_attribute26               => p_ppe_attribute26
785     ,p_ppe_attribute27               => p_ppe_attribute27
786     ,p_ppe_attribute28               => p_ppe_attribute28
787     ,p_ppe_attribute29               => p_ppe_attribute29
788     ,p_ppe_attribute30               => p_ppe_attribute30
789     ,p_object_version_number         => l_object_version_number
790     ,p_request_id                    => p_request_id
791     ,p_program_application_id        => p_program_application_id
792     ,p_program_id                    => p_program_id
793     ,p_program_update_date           => p_program_update_date
794     ,p_effective_date                => trunc(p_effective_date)
795     );
796   --
797   begin
798     --
799     -- Start of API User Hook for the after hook of create_PRTT_PREM
800     --
801     ben_PRTT_PREM_bk1.create_PRTT_PREM_a
802       (
803        p_prtt_prem_id                   =>  l_prtt_prem_id
804       ,p_effective_start_date           =>  l_effective_start_date
805       ,p_effective_end_date             =>  l_effective_end_date
806       ,p_std_prem_uom                   =>  p_std_prem_uom
807       ,p_std_prem_val                   =>  p_std_prem_val
808       ,p_actl_prem_id                   =>  p_actl_prem_id
809       ,p_prtt_enrt_rslt_id              =>  p_prtt_enrt_rslt_id
810       ,p_per_in_ler_id              =>  l_per_in_ler_id
811       ,p_business_group_id              =>  p_business_group_id
812       ,p_ppe_attribute_category         =>  p_ppe_attribute_category
813       ,p_ppe_attribute1                 =>  p_ppe_attribute1
814       ,p_ppe_attribute2                 =>  p_ppe_attribute2
815       ,p_ppe_attribute3                 =>  p_ppe_attribute3
816       ,p_ppe_attribute4                 =>  p_ppe_attribute4
817       ,p_ppe_attribute5                 =>  p_ppe_attribute5
818       ,p_ppe_attribute6                 =>  p_ppe_attribute6
819       ,p_ppe_attribute7                 =>  p_ppe_attribute7
820       ,p_ppe_attribute8                 =>  p_ppe_attribute8
821       ,p_ppe_attribute9                 =>  p_ppe_attribute9
822       ,p_ppe_attribute10                =>  p_ppe_attribute10
823       ,p_ppe_attribute11                =>  p_ppe_attribute11
824       ,p_ppe_attribute12                =>  p_ppe_attribute12
825       ,p_ppe_attribute13                =>  p_ppe_attribute13
826       ,p_ppe_attribute14                =>  p_ppe_attribute14
827       ,p_ppe_attribute15                =>  p_ppe_attribute15
828       ,p_ppe_attribute16                =>  p_ppe_attribute16
829       ,p_ppe_attribute17                =>  p_ppe_attribute17
830       ,p_ppe_attribute18                =>  p_ppe_attribute18
831       ,p_ppe_attribute19                =>  p_ppe_attribute19
832       ,p_ppe_attribute20                =>  p_ppe_attribute20
833       ,p_ppe_attribute21                =>  p_ppe_attribute21
834       ,p_ppe_attribute22                =>  p_ppe_attribute22
835       ,p_ppe_attribute23                =>  p_ppe_attribute23
836       ,p_ppe_attribute24                =>  p_ppe_attribute24
837       ,p_ppe_attribute25                =>  p_ppe_attribute25
838       ,p_ppe_attribute26                =>  p_ppe_attribute26
839       ,p_ppe_attribute27                =>  p_ppe_attribute27
840       ,p_ppe_attribute28                =>  p_ppe_attribute28
841       ,p_ppe_attribute29                =>  p_ppe_attribute29
842       ,p_ppe_attribute30                =>  p_ppe_attribute30
843       ,p_object_version_number          =>  l_object_version_number
844       ,p_request_id                     =>  p_request_id
845       ,p_program_application_id         =>  p_program_application_id
846       ,p_program_id                     =>  p_program_id
847       ,p_program_update_date            =>  p_program_update_date
848       ,p_effective_date                      => trunc(p_effective_date)
849       );
850   exception
851     when hr_api.cannot_find_prog_unit then
852       hr_api.cannot_find_prog_unit_error
853         (p_module_name => 'CREATE_PRTT_PREM'
854         ,p_hook_type   => 'AP'
855         );
856     --
857     -- End of API User Hook for the after hook of create_PRTT_PREM
858     --
859   end;
860   --
861   hr_utility.set_location(l_proc, 60);
862   --
863   -- When in validation only mode raise the Validate_Enabled exception
864   --
865   if p_validate then
866     raise hr_api.validate_enabled;
867   end if;
868   --
869   -- Set all output arguments
870   --
871   p_prtt_prem_id := l_prtt_prem_id;
872   p_effective_start_date := l_effective_start_date;
873   p_effective_end_date := l_effective_end_date;
874   p_object_version_number := l_object_version_number;
875   --
876   hr_utility.set_location(' Leaving:'||l_proc, 70);
877   --
878 exception
879   --
880   when hr_api.validate_enabled then
881     --
882     -- As the Validate_Enabled exception has been raised
883     -- we must rollback to the savepoint
884     --
885     ROLLBACK TO create_PRTT_PREM;
886     --
887     -- Only set output warning arguments
888     -- (Any key or derived arguments must be set to null
889     -- when validation only mode is being used.)
890     --
891     p_prtt_prem_id := null;
892     p_effective_start_date := null;
893     p_effective_end_date := null;
894     p_object_version_number  := null;
895     hr_utility.set_location(' Leaving:'||l_proc, 80);
896     --
897   when others then
898     --
899     -- A validation or unexpected error has occured
900     --
901     ROLLBACK TO create_PRTT_PREM;
902     raise;
903     --
904 end create_PRTT_PREM;
905 -- ----------------------------------------------------------------------------
906 -- |------------------------< update_PRTT_PREM >--- ------------------|
907 -- ----------------------------------------------------------------------------
908 --
909 procedure update_PRTT_PREM
910   (p_validate                       in  boolean   default false
911   ,p_prtt_prem_id                   in  number
912   ,p_effective_start_date           out nocopy date
913   ,p_effective_end_date             out nocopy date
914   ,p_std_prem_uom                   in  varchar2  default hr_api.g_varchar2
915   ,p_std_prem_val                   in  number    default hr_api.g_number
916   ,p_actl_prem_id                   in  number    default hr_api.g_number
917   ,p_prtt_enrt_rslt_id              in  number    default hr_api.g_number
918   ,p_per_in_ler_id              in  number
919   ,p_business_group_id              in  number    default hr_api.g_number
920   ,p_ppe_attribute_category         in  varchar2  default hr_api.g_varchar2
921   ,p_ppe_attribute1                 in  varchar2  default hr_api.g_varchar2
922   ,p_ppe_attribute2                 in  varchar2  default hr_api.g_varchar2
923   ,p_ppe_attribute3                 in  varchar2  default hr_api.g_varchar2
924   ,p_ppe_attribute4                 in  varchar2  default hr_api.g_varchar2
925   ,p_ppe_attribute5                 in  varchar2  default hr_api.g_varchar2
926   ,p_ppe_attribute6                 in  varchar2  default hr_api.g_varchar2
927   ,p_ppe_attribute7                 in  varchar2  default hr_api.g_varchar2
928   ,p_ppe_attribute8                 in  varchar2  default hr_api.g_varchar2
929   ,p_ppe_attribute9                 in  varchar2  default hr_api.g_varchar2
930   ,p_ppe_attribute10                in  varchar2  default hr_api.g_varchar2
931   ,p_ppe_attribute11                in  varchar2  default hr_api.g_varchar2
932   ,p_ppe_attribute12                in  varchar2  default hr_api.g_varchar2
933   ,p_ppe_attribute13                in  varchar2  default hr_api.g_varchar2
934   ,p_ppe_attribute14                in  varchar2  default hr_api.g_varchar2
935   ,p_ppe_attribute15                in  varchar2  default hr_api.g_varchar2
936   ,p_ppe_attribute16                in  varchar2  default hr_api.g_varchar2
937   ,p_ppe_attribute17                in  varchar2  default hr_api.g_varchar2
938   ,p_ppe_attribute18                in  varchar2  default hr_api.g_varchar2
939   ,p_ppe_attribute19                in  varchar2  default hr_api.g_varchar2
940   ,p_ppe_attribute20                in  varchar2  default hr_api.g_varchar2
941   ,p_ppe_attribute21                in  varchar2  default hr_api.g_varchar2
942   ,p_ppe_attribute22                in  varchar2  default hr_api.g_varchar2
943   ,p_ppe_attribute23                in  varchar2  default hr_api.g_varchar2
944   ,p_ppe_attribute24                in  varchar2  default hr_api.g_varchar2
945   ,p_ppe_attribute25                in  varchar2  default hr_api.g_varchar2
946   ,p_ppe_attribute26                in  varchar2  default hr_api.g_varchar2
947   ,p_ppe_attribute27                in  varchar2  default hr_api.g_varchar2
948   ,p_ppe_attribute28                in  varchar2  default hr_api.g_varchar2
949   ,p_ppe_attribute29                in  varchar2  default hr_api.g_varchar2
950   ,p_ppe_attribute30                in  varchar2  default hr_api.g_varchar2
951   ,p_object_version_number          in out nocopy number
952   ,p_request_id                     in  number    default hr_api.g_number
953   ,p_program_application_id         in  number    default hr_api.g_number
954   ,p_program_id                     in  number    default hr_api.g_number
955   ,p_program_update_date            in  date      default hr_api.g_date
956   ,p_effective_date                 in  date
957   ,p_datetrack_mode                 in  varchar2
958   ) is
959   --
960   -- Declare cursors and local variables
961   --
962   l_proc varchar2(72) := g_package||'update_PRTT_PREM';
963   l_object_version_number ben_prtt_prem_f.object_version_number%TYPE;
964   l_effective_start_date ben_prtt_prem_f.effective_start_date%TYPE;
965   l_effective_end_date ben_prtt_prem_f.effective_end_date%TYPE;
966   --
967 begin
968   --
969   hr_utility.set_location('Entering:'|| l_proc, 10);
970   --
971   -- Issue a savepoint if operating in validation only mode
972   --
973   savepoint update_PRTT_PREM;
974   --
975   hr_utility.set_location(l_proc, 20);
976   --
977   -- Process Logic
978   --
979   l_object_version_number := p_object_version_number;
980   --
981   begin
982     --
983     -- Start of API User Hook for the before hook of update_PRTT_PREM
984     --
985     ben_PRTT_PREM_bk2.update_PRTT_PREM_b
986       (
987        p_prtt_prem_id                   =>  p_prtt_prem_id
988       ,p_std_prem_uom                   =>  p_std_prem_uom
989       ,p_std_prem_val                   =>  p_std_prem_val
990       ,p_actl_prem_id                   =>  p_actl_prem_id
991       ,p_prtt_enrt_rslt_id              =>  p_prtt_enrt_rslt_id
992       ,p_per_in_ler_id              =>  p_per_in_ler_id
993       ,p_business_group_id              =>  p_business_group_id
994       ,p_ppe_attribute_category         =>  p_ppe_attribute_category
995       ,p_ppe_attribute1                 =>  p_ppe_attribute1
996       ,p_ppe_attribute2                 =>  p_ppe_attribute2
997       ,p_ppe_attribute3                 =>  p_ppe_attribute3
998       ,p_ppe_attribute4                 =>  p_ppe_attribute4
999       ,p_ppe_attribute5                 =>  p_ppe_attribute5
1000       ,p_ppe_attribute6                 =>  p_ppe_attribute6
1001       ,p_ppe_attribute7                 =>  p_ppe_attribute7
1002       ,p_ppe_attribute8                 =>  p_ppe_attribute8
1003       ,p_ppe_attribute9                 =>  p_ppe_attribute9
1004       ,p_ppe_attribute10                =>  p_ppe_attribute10
1005       ,p_ppe_attribute11                =>  p_ppe_attribute11
1006       ,p_ppe_attribute12                =>  p_ppe_attribute12
1007       ,p_ppe_attribute13                =>  p_ppe_attribute13
1008       ,p_ppe_attribute14                =>  p_ppe_attribute14
1009       ,p_ppe_attribute15                =>  p_ppe_attribute15
1010       ,p_ppe_attribute16                =>  p_ppe_attribute16
1011       ,p_ppe_attribute17                =>  p_ppe_attribute17
1012       ,p_ppe_attribute18                =>  p_ppe_attribute18
1013       ,p_ppe_attribute19                =>  p_ppe_attribute19
1014       ,p_ppe_attribute20                =>  p_ppe_attribute20
1015       ,p_ppe_attribute21                =>  p_ppe_attribute21
1016       ,p_ppe_attribute22                =>  p_ppe_attribute22
1017       ,p_ppe_attribute23                =>  p_ppe_attribute23
1018       ,p_ppe_attribute24                =>  p_ppe_attribute24
1019       ,p_ppe_attribute25                =>  p_ppe_attribute25
1020       ,p_ppe_attribute26                =>  p_ppe_attribute26
1021       ,p_ppe_attribute27                =>  p_ppe_attribute27
1022       ,p_ppe_attribute28                =>  p_ppe_attribute28
1023       ,p_ppe_attribute29                =>  p_ppe_attribute29
1024       ,p_ppe_attribute30                =>  p_ppe_attribute30
1025       ,p_object_version_number          =>  p_object_version_number
1026       ,p_request_id                     =>  p_request_id
1027       ,p_program_application_id         =>  p_program_application_id
1028       ,p_program_id                     =>  p_program_id
1029       ,p_program_update_date            =>  p_program_update_date
1030     ,p_effective_date                      => trunc(p_effective_date)
1031     ,p_datetrack_mode                      => p_datetrack_mode
1032       );
1033   exception
1034     when hr_api.cannot_find_prog_unit then
1035       hr_api.cannot_find_prog_unit_error
1036         (p_module_name => 'UPDATE_PRTT_PREM'
1037         ,p_hook_type   => 'BP'
1038         );
1039     --
1040     -- End of API User Hook for the before hook of update_PRTT_PREM
1041     --
1042   end;
1043   --
1044   ben_ppe_upd.upd
1045     (
1046      p_prtt_prem_id                  => p_prtt_prem_id
1047     ,p_effective_start_date          => l_effective_start_date
1048     ,p_effective_end_date            => l_effective_end_date
1049     ,p_std_prem_uom                  => p_std_prem_uom
1050     ,p_std_prem_val                  => p_std_prem_val
1051     ,p_actl_prem_id                  => p_actl_prem_id
1052     ,p_prtt_enrt_rslt_id             => p_prtt_enrt_rslt_id
1053     ,p_per_in_ler_id             => p_per_in_ler_id
1054     ,p_business_group_id             => p_business_group_id
1055     ,p_ppe_attribute_category        => p_ppe_attribute_category
1056     ,p_ppe_attribute1                => p_ppe_attribute1
1057     ,p_ppe_attribute2                => p_ppe_attribute2
1058     ,p_ppe_attribute3                => p_ppe_attribute3
1059     ,p_ppe_attribute4                => p_ppe_attribute4
1060     ,p_ppe_attribute5                => p_ppe_attribute5
1061     ,p_ppe_attribute6                => p_ppe_attribute6
1062     ,p_ppe_attribute7                => p_ppe_attribute7
1063     ,p_ppe_attribute8                => p_ppe_attribute8
1064     ,p_ppe_attribute9                => p_ppe_attribute9
1065     ,p_ppe_attribute10               => p_ppe_attribute10
1066     ,p_ppe_attribute11               => p_ppe_attribute11
1067     ,p_ppe_attribute12               => p_ppe_attribute12
1068     ,p_ppe_attribute13               => p_ppe_attribute13
1069     ,p_ppe_attribute14               => p_ppe_attribute14
1070     ,p_ppe_attribute15               => p_ppe_attribute15
1071     ,p_ppe_attribute16               => p_ppe_attribute16
1072     ,p_ppe_attribute17               => p_ppe_attribute17
1073     ,p_ppe_attribute18               => p_ppe_attribute18
1074     ,p_ppe_attribute19               => p_ppe_attribute19
1075     ,p_ppe_attribute20               => p_ppe_attribute20
1076     ,p_ppe_attribute21               => p_ppe_attribute21
1077     ,p_ppe_attribute22               => p_ppe_attribute22
1078     ,p_ppe_attribute23               => p_ppe_attribute23
1079     ,p_ppe_attribute24               => p_ppe_attribute24
1080     ,p_ppe_attribute25               => p_ppe_attribute25
1081     ,p_ppe_attribute26               => p_ppe_attribute26
1082     ,p_ppe_attribute27               => p_ppe_attribute27
1083     ,p_ppe_attribute28               => p_ppe_attribute28
1084     ,p_ppe_attribute29               => p_ppe_attribute29
1085     ,p_ppe_attribute30               => p_ppe_attribute30
1086     ,p_object_version_number         => l_object_version_number
1087     ,p_request_id                    => p_request_id
1088     ,p_program_application_id        => p_program_application_id
1089     ,p_program_id                    => p_program_id
1090     ,p_program_update_date           => p_program_update_date
1091     ,p_effective_date                => trunc(p_effective_date)
1092     ,p_datetrack_mode                => p_datetrack_mode
1093     );
1094   --
1095   begin
1096     --
1097     -- Start of API User Hook for the after hook of update_PRTT_PREM
1098     --
1099     ben_PRTT_PREM_bk2.update_PRTT_PREM_a
1100       (
1101        p_prtt_prem_id                   =>  p_prtt_prem_id
1102       ,p_effective_start_date           =>  l_effective_start_date
1103       ,p_effective_end_date             =>  l_effective_end_date
1104       ,p_std_prem_uom                   =>  p_std_prem_uom
1105       ,p_std_prem_val                   =>  p_std_prem_val
1106       ,p_actl_prem_id                   =>  p_actl_prem_id
1107       ,p_prtt_enrt_rslt_id              =>  p_prtt_enrt_rslt_id
1108       ,p_per_in_ler_id              =>  p_per_in_ler_id
1109       ,p_business_group_id              =>  p_business_group_id
1110       ,p_ppe_attribute_category         =>  p_ppe_attribute_category
1111       ,p_ppe_attribute1                 =>  p_ppe_attribute1
1112       ,p_ppe_attribute2                 =>  p_ppe_attribute2
1113       ,p_ppe_attribute3                 =>  p_ppe_attribute3
1114       ,p_ppe_attribute4                 =>  p_ppe_attribute4
1115       ,p_ppe_attribute5                 =>  p_ppe_attribute5
1116       ,p_ppe_attribute6                 =>  p_ppe_attribute6
1117       ,p_ppe_attribute7                 =>  p_ppe_attribute7
1118       ,p_ppe_attribute8                 =>  p_ppe_attribute8
1119       ,p_ppe_attribute9                 =>  p_ppe_attribute9
1120       ,p_ppe_attribute10                =>  p_ppe_attribute10
1121       ,p_ppe_attribute11                =>  p_ppe_attribute11
1122       ,p_ppe_attribute12                =>  p_ppe_attribute12
1123       ,p_ppe_attribute13                =>  p_ppe_attribute13
1124       ,p_ppe_attribute14                =>  p_ppe_attribute14
1125       ,p_ppe_attribute15                =>  p_ppe_attribute15
1126       ,p_ppe_attribute16                =>  p_ppe_attribute16
1127       ,p_ppe_attribute17                =>  p_ppe_attribute17
1128       ,p_ppe_attribute18                =>  p_ppe_attribute18
1129       ,p_ppe_attribute19                =>  p_ppe_attribute19
1130       ,p_ppe_attribute20                =>  p_ppe_attribute20
1131       ,p_ppe_attribute21                =>  p_ppe_attribute21
1132       ,p_ppe_attribute22                =>  p_ppe_attribute22
1133       ,p_ppe_attribute23                =>  p_ppe_attribute23
1134       ,p_ppe_attribute24                =>  p_ppe_attribute24
1135       ,p_ppe_attribute25                =>  p_ppe_attribute25
1136       ,p_ppe_attribute26                =>  p_ppe_attribute26
1137       ,p_ppe_attribute27                =>  p_ppe_attribute27
1138       ,p_ppe_attribute28                =>  p_ppe_attribute28
1139       ,p_ppe_attribute29                =>  p_ppe_attribute29
1140       ,p_ppe_attribute30                =>  p_ppe_attribute30
1141       ,p_object_version_number          =>  l_object_version_number
1142       ,p_request_id                     =>  p_request_id
1143       ,p_program_application_id         =>  p_program_application_id
1144       ,p_program_id                     =>  p_program_id
1145       ,p_program_update_date            =>  p_program_update_date
1146       ,p_effective_date                     => trunc(p_effective_date)
1147       ,p_datetrack_mode                     => p_datetrack_mode
1148       );
1149   exception
1150     when hr_api.cannot_find_prog_unit then
1151       hr_api.cannot_find_prog_unit_error
1152         (p_module_name => 'UPDATE_PRTT_PREM'
1153         ,p_hook_type   => 'AP'
1154         );
1155     --
1156     -- End of API User Hook for the after hook of update_PRTT_PREM
1157     --
1158   end;
1159   --
1160   hr_utility.set_location(l_proc, 60);
1161   --
1162   -- When in validation only mode raise the Validate_Enabled exception
1163   --
1164   if p_validate then
1165     raise hr_api.validate_enabled;
1166   end if;
1167   --
1168   -- Set all output arguments
1169   --
1170   p_object_version_number := l_object_version_number;
1171   p_effective_start_date := l_effective_start_date;
1172   p_effective_end_date := l_effective_end_date;
1173   --
1174   hr_utility.set_location(' Leaving:'||l_proc, 70);
1175   --
1176 exception
1177   --
1178   when hr_api.validate_enabled then
1179     --
1180     -- As the Validate_Enabled exception has been raised
1181     -- we must rollback to the savepoint
1182     --
1183     ROLLBACK TO update_PRTT_PREM;
1184     --
1185     -- Only set output warning arguments
1186     -- (Any key or derived arguments must be set to null
1187     -- when validation only mode is being used.)
1188     --
1189     hr_utility.set_location(' Leaving:'||l_proc, 80);
1190     --
1191   when others then
1192     --
1193     -- A validation or unexpected error has occured
1194     --
1195     ROLLBACK TO update_PRTT_PREM;
1196     raise;
1197     --
1198 end update_PRTT_PREM;
1199 -- ----------------------------------------------------------------------------
1200 -- |------------------------< update_PRTT_PREM >--- ------------------|
1201 -- ----------------------------------------------------------------------------
1202 --
1203 procedure update_PRTT_PREM
1204   (p_validate                       in  boolean   default false
1205   ,p_prtt_prem_id                   in  number
1206   ,p_effective_start_date           out nocopy date
1207   ,p_effective_end_date             out nocopy date
1208   ,p_std_prem_uom                   in  varchar2  default hr_api.g_varchar2
1209   ,p_std_prem_val                   in  number    default hr_api.g_number
1210   ,p_actl_prem_id                   in  number    default hr_api.g_number
1211   ,p_prtt_enrt_rslt_id              in  number    default hr_api.g_number
1212   ,p_business_group_id              in  number    default hr_api.g_number
1213   ,p_ppe_attribute_category         in  varchar2  default hr_api.g_varchar2
1214   ,p_ppe_attribute1                 in  varchar2  default hr_api.g_varchar2
1215   ,p_ppe_attribute2                 in  varchar2  default hr_api.g_varchar2
1216   ,p_ppe_attribute3                 in  varchar2  default hr_api.g_varchar2
1217   ,p_ppe_attribute4                 in  varchar2  default hr_api.g_varchar2
1218   ,p_ppe_attribute5                 in  varchar2  default hr_api.g_varchar2
1219   ,p_ppe_attribute6                 in  varchar2  default hr_api.g_varchar2
1220   ,p_ppe_attribute7                 in  varchar2  default hr_api.g_varchar2
1221   ,p_ppe_attribute8                 in  varchar2  default hr_api.g_varchar2
1222   ,p_ppe_attribute9                 in  varchar2  default hr_api.g_varchar2
1223   ,p_ppe_attribute10                in  varchar2  default hr_api.g_varchar2
1224   ,p_ppe_attribute11                in  varchar2  default hr_api.g_varchar2
1225   ,p_ppe_attribute12                in  varchar2  default hr_api.g_varchar2
1226   ,p_ppe_attribute13                in  varchar2  default hr_api.g_varchar2
1227   ,p_ppe_attribute14                in  varchar2  default hr_api.g_varchar2
1228   ,p_ppe_attribute15                in  varchar2  default hr_api.g_varchar2
1229   ,p_ppe_attribute16                in  varchar2  default hr_api.g_varchar2
1230   ,p_ppe_attribute17                in  varchar2  default hr_api.g_varchar2
1231   ,p_ppe_attribute18                in  varchar2  default hr_api.g_varchar2
1232   ,p_ppe_attribute19                in  varchar2  default hr_api.g_varchar2
1233   ,p_ppe_attribute20                in  varchar2  default hr_api.g_varchar2
1234   ,p_ppe_attribute21                in  varchar2  default hr_api.g_varchar2
1235   ,p_ppe_attribute22                in  varchar2  default hr_api.g_varchar2
1236   ,p_ppe_attribute23                in  varchar2  default hr_api.g_varchar2
1237   ,p_ppe_attribute24                in  varchar2  default hr_api.g_varchar2
1238   ,p_ppe_attribute25                in  varchar2  default hr_api.g_varchar2
1239   ,p_ppe_attribute26                in  varchar2  default hr_api.g_varchar2
1240   ,p_ppe_attribute27                in  varchar2  default hr_api.g_varchar2
1241   ,p_ppe_attribute28                in  varchar2  default hr_api.g_varchar2
1242   ,p_ppe_attribute29                in  varchar2  default hr_api.g_varchar2
1243   ,p_ppe_attribute30                in  varchar2  default hr_api.g_varchar2
1244   ,p_object_version_number          in out nocopy number
1245   ,p_request_id                     in  number    default hr_api.g_number
1246   ,p_program_application_id         in  number    default hr_api.g_number
1247   ,p_program_id                     in  number    default hr_api.g_number
1248   ,p_program_update_date            in  date      default hr_api.g_date
1249   ,p_effective_date                 in  date
1250   ,p_datetrack_mode                 in  varchar2
1251   ) is
1252   --
1253   -- Declare cursors and local variables
1254   --
1255   l_proc varchar2(72) := g_package||'update_PRTT_PREM';
1256   l_object_version_number ben_prtt_prem_f.object_version_number%TYPE;
1257   l_effective_start_date ben_prtt_prem_f.effective_start_date%TYPE;
1258   l_effective_end_date ben_prtt_prem_f.effective_end_date%TYPE;
1259   l_per_in_ler_id ben_prtt_prem_f.per_in_ler_id%TYPE;
1260   --
1261   cursor c_per_in_ler is
1262     select pen.per_in_ler_id
1263     from   ben_prtt_enrt_rslt_f pen
1264     where  pen.prtt_enrt_rslt_id=p_prtt_enrt_rslt_id and
1265            pen.prtt_enrt_rslt_stat_cd is null and
1266            pen.business_group_id+0=p_business_group_id and
1267            p_effective_date between
1268              pen.effective_start_date and pen.effective_end_date;
1269   --
1270 begin
1271   --
1272   hr_utility.set_location('Entering:'|| l_proc, 10);
1273   --
1274   -- Issue a savepoint if operating in validation only mode
1275   --
1276   savepoint update_PRTT_PREM;
1277   --
1278   open c_per_in_ler;
1279   fetch c_per_in_ler into l_per_in_ler_id;
1280   if c_per_in_ler%notfound then
1281     l_per_in_ler_id:=hr_api.g_number;
1282   end if;
1283   close c_per_in_ler;
1284   --
1285   hr_utility.set_location(l_proc, 20);
1286   --
1287   -- Process Logic
1288   --
1289   l_object_version_number := p_object_version_number;
1290   --
1291   begin
1292     --
1293     -- Start of API User Hook for the before hook of update_PRTT_PREM
1294     --
1295     ben_PRTT_PREM_bk2.update_PRTT_PREM_b
1296       (
1297        p_prtt_prem_id                   =>  p_prtt_prem_id
1298       ,p_std_prem_uom                   =>  p_std_prem_uom
1299       ,p_std_prem_val                   =>  p_std_prem_val
1300       ,p_actl_prem_id                   =>  p_actl_prem_id
1301       ,p_prtt_enrt_rslt_id              =>  p_prtt_enrt_rslt_id
1302       ,p_per_in_ler_id              =>  l_per_in_ler_id
1303       ,p_business_group_id              =>  p_business_group_id
1304       ,p_ppe_attribute_category         =>  p_ppe_attribute_category
1305       ,p_ppe_attribute1                 =>  p_ppe_attribute1
1306       ,p_ppe_attribute2                 =>  p_ppe_attribute2
1307       ,p_ppe_attribute3                 =>  p_ppe_attribute3
1308       ,p_ppe_attribute4                 =>  p_ppe_attribute4
1309       ,p_ppe_attribute5                 =>  p_ppe_attribute5
1310       ,p_ppe_attribute6                 =>  p_ppe_attribute6
1311       ,p_ppe_attribute7                 =>  p_ppe_attribute7
1312       ,p_ppe_attribute8                 =>  p_ppe_attribute8
1313       ,p_ppe_attribute9                 =>  p_ppe_attribute9
1314       ,p_ppe_attribute10                =>  p_ppe_attribute10
1315       ,p_ppe_attribute11                =>  p_ppe_attribute11
1316       ,p_ppe_attribute12                =>  p_ppe_attribute12
1317       ,p_ppe_attribute13                =>  p_ppe_attribute13
1318       ,p_ppe_attribute14                =>  p_ppe_attribute14
1319       ,p_ppe_attribute15                =>  p_ppe_attribute15
1320       ,p_ppe_attribute16                =>  p_ppe_attribute16
1321       ,p_ppe_attribute17                =>  p_ppe_attribute17
1322       ,p_ppe_attribute18                =>  p_ppe_attribute18
1323       ,p_ppe_attribute19                =>  p_ppe_attribute19
1324       ,p_ppe_attribute20                =>  p_ppe_attribute20
1325       ,p_ppe_attribute21                =>  p_ppe_attribute21
1326       ,p_ppe_attribute22                =>  p_ppe_attribute22
1327       ,p_ppe_attribute23                =>  p_ppe_attribute23
1328       ,p_ppe_attribute24                =>  p_ppe_attribute24
1329       ,p_ppe_attribute25                =>  p_ppe_attribute25
1330       ,p_ppe_attribute26                =>  p_ppe_attribute26
1331       ,p_ppe_attribute27                =>  p_ppe_attribute27
1332       ,p_ppe_attribute28                =>  p_ppe_attribute28
1333       ,p_ppe_attribute29                =>  p_ppe_attribute29
1334       ,p_ppe_attribute30                =>  p_ppe_attribute30
1335       ,p_object_version_number          =>  p_object_version_number
1336       ,p_request_id                     =>  p_request_id
1337       ,p_program_application_id         =>  p_program_application_id
1338       ,p_program_id                     =>  p_program_id
1339       ,p_program_update_date            =>  p_program_update_date
1340     ,p_effective_date                      => trunc(p_effective_date)
1341     ,p_datetrack_mode                      => p_datetrack_mode
1342       );
1343   exception
1344     when hr_api.cannot_find_prog_unit then
1345       hr_api.cannot_find_prog_unit_error
1346         (p_module_name => 'UPDATE_PRTT_PREM'
1347         ,p_hook_type   => 'BP'
1348         );
1349     --
1350     -- End of API User Hook for the before hook of update_PRTT_PREM
1351     --
1352   end;
1353   --
1354   ben_ppe_upd.upd
1355     (
1356      p_prtt_prem_id                  => p_prtt_prem_id
1357     ,p_effective_start_date          => l_effective_start_date
1358     ,p_effective_end_date            => l_effective_end_date
1359     ,p_std_prem_uom                  => p_std_prem_uom
1360     ,p_std_prem_val                  => p_std_prem_val
1361     ,p_actl_prem_id                  => p_actl_prem_id
1362     ,p_prtt_enrt_rslt_id             => p_prtt_enrt_rslt_id
1363     ,p_per_in_ler_id             => l_per_in_ler_id
1364     ,p_business_group_id             => p_business_group_id
1365     ,p_ppe_attribute_category        => p_ppe_attribute_category
1366     ,p_ppe_attribute1                => p_ppe_attribute1
1367     ,p_ppe_attribute2                => p_ppe_attribute2
1368     ,p_ppe_attribute3                => p_ppe_attribute3
1369     ,p_ppe_attribute4                => p_ppe_attribute4
1370     ,p_ppe_attribute5                => p_ppe_attribute5
1371     ,p_ppe_attribute6                => p_ppe_attribute6
1372     ,p_ppe_attribute7                => p_ppe_attribute7
1373     ,p_ppe_attribute8                => p_ppe_attribute8
1374     ,p_ppe_attribute9                => p_ppe_attribute9
1375     ,p_ppe_attribute10               => p_ppe_attribute10
1376     ,p_ppe_attribute11               => p_ppe_attribute11
1377     ,p_ppe_attribute12               => p_ppe_attribute12
1378     ,p_ppe_attribute13               => p_ppe_attribute13
1379     ,p_ppe_attribute14               => p_ppe_attribute14
1380     ,p_ppe_attribute15               => p_ppe_attribute15
1381     ,p_ppe_attribute16               => p_ppe_attribute16
1382     ,p_ppe_attribute17               => p_ppe_attribute17
1383     ,p_ppe_attribute18               => p_ppe_attribute18
1384     ,p_ppe_attribute19               => p_ppe_attribute19
1385     ,p_ppe_attribute20               => p_ppe_attribute20
1386     ,p_ppe_attribute21               => p_ppe_attribute21
1387     ,p_ppe_attribute22               => p_ppe_attribute22
1388     ,p_ppe_attribute23               => p_ppe_attribute23
1389     ,p_ppe_attribute24               => p_ppe_attribute24
1390     ,p_ppe_attribute25               => p_ppe_attribute25
1391     ,p_ppe_attribute26               => p_ppe_attribute26
1392     ,p_ppe_attribute27               => p_ppe_attribute27
1393     ,p_ppe_attribute28               => p_ppe_attribute28
1394     ,p_ppe_attribute29               => p_ppe_attribute29
1395     ,p_ppe_attribute30               => p_ppe_attribute30
1396     ,p_object_version_number         => l_object_version_number
1397     ,p_request_id                    => p_request_id
1398     ,p_program_application_id        => p_program_application_id
1399     ,p_program_id                    => p_program_id
1400     ,p_program_update_date           => p_program_update_date
1401     ,p_effective_date                => trunc(p_effective_date)
1402     ,p_datetrack_mode                => p_datetrack_mode
1403     );
1404   --
1405   begin
1406     --
1407     -- Start of API User Hook for the after hook of update_PRTT_PREM
1408     --
1409     ben_PRTT_PREM_bk2.update_PRTT_PREM_a
1410       (
1411        p_prtt_prem_id                   =>  p_prtt_prem_id
1412       ,p_effective_start_date           =>  l_effective_start_date
1413       ,p_effective_end_date             =>  l_effective_end_date
1414       ,p_std_prem_uom                   =>  p_std_prem_uom
1415       ,p_std_prem_val                   =>  p_std_prem_val
1416       ,p_actl_prem_id                   =>  p_actl_prem_id
1417       ,p_prtt_enrt_rslt_id              =>  p_prtt_enrt_rslt_id
1418       ,p_per_in_ler_id              =>  l_per_in_ler_id
1419       ,p_business_group_id              =>  p_business_group_id
1420       ,p_ppe_attribute_category         =>  p_ppe_attribute_category
1421       ,p_ppe_attribute1                 =>  p_ppe_attribute1
1422       ,p_ppe_attribute2                 =>  p_ppe_attribute2
1423       ,p_ppe_attribute3                 =>  p_ppe_attribute3
1424       ,p_ppe_attribute4                 =>  p_ppe_attribute4
1425       ,p_ppe_attribute5                 =>  p_ppe_attribute5
1426       ,p_ppe_attribute6                 =>  p_ppe_attribute6
1427       ,p_ppe_attribute7                 =>  p_ppe_attribute7
1428       ,p_ppe_attribute8                 =>  p_ppe_attribute8
1429       ,p_ppe_attribute9                 =>  p_ppe_attribute9
1430       ,p_ppe_attribute10                =>  p_ppe_attribute10
1431       ,p_ppe_attribute11                =>  p_ppe_attribute11
1432       ,p_ppe_attribute12                =>  p_ppe_attribute12
1433       ,p_ppe_attribute13                =>  p_ppe_attribute13
1434       ,p_ppe_attribute14                =>  p_ppe_attribute14
1435       ,p_ppe_attribute15                =>  p_ppe_attribute15
1436       ,p_ppe_attribute16                =>  p_ppe_attribute16
1437       ,p_ppe_attribute17                =>  p_ppe_attribute17
1438       ,p_ppe_attribute18                =>  p_ppe_attribute18
1439       ,p_ppe_attribute19                =>  p_ppe_attribute19
1440       ,p_ppe_attribute20                =>  p_ppe_attribute20
1441       ,p_ppe_attribute21                =>  p_ppe_attribute21
1442       ,p_ppe_attribute22                =>  p_ppe_attribute22
1443       ,p_ppe_attribute23                =>  p_ppe_attribute23
1444       ,p_ppe_attribute24                =>  p_ppe_attribute24
1445       ,p_ppe_attribute25                =>  p_ppe_attribute25
1446       ,p_ppe_attribute26                =>  p_ppe_attribute26
1447       ,p_ppe_attribute27                =>  p_ppe_attribute27
1448       ,p_ppe_attribute28                =>  p_ppe_attribute28
1449       ,p_ppe_attribute29                =>  p_ppe_attribute29
1450       ,p_ppe_attribute30                =>  p_ppe_attribute30
1451       ,p_object_version_number          =>  l_object_version_number
1452       ,p_request_id                     =>  p_request_id
1453       ,p_program_application_id         =>  p_program_application_id
1454       ,p_program_id                     =>  p_program_id
1455       ,p_program_update_date            =>  p_program_update_date
1456       ,p_effective_date                     => trunc(p_effective_date)
1457       ,p_datetrack_mode                     => p_datetrack_mode
1458       );
1459   exception
1460     when hr_api.cannot_find_prog_unit then
1461       hr_api.cannot_find_prog_unit_error
1462         (p_module_name => 'UPDATE_PRTT_PREM'
1463         ,p_hook_type   => 'AP'
1464         );
1465     --
1466     -- End of API User Hook for the after hook of update_PRTT_PREM
1467     --
1468   end;
1469   --
1470   hr_utility.set_location(l_proc, 60);
1471   --
1472   -- When in validation only mode raise the Validate_Enabled exception
1473   --
1474   if p_validate then
1475     raise hr_api.validate_enabled;
1476   end if;
1477   --
1478   -- Set all output arguments
1479   --
1480   p_object_version_number := l_object_version_number;
1481   p_effective_start_date := l_effective_start_date;
1482   p_effective_end_date := l_effective_end_date;
1483   --
1484   hr_utility.set_location(' Leaving:'||l_proc, 70);
1485   --
1486 exception
1487   --
1488   when hr_api.validate_enabled then
1489     --
1490     -- As the Validate_Enabled exception has been raised
1491     -- we must rollback to the savepoint
1492     --
1493     ROLLBACK TO update_PRTT_PREM;
1494     --
1495     -- Only set output warning arguments
1496     -- (Any key or derived arguments must be set to null
1497     -- when validation only mode is being used.)
1498     --
1499     hr_utility.set_location(' Leaving:'||l_proc, 80);
1500     --
1501   when others then
1502     --
1503     -- A validation or unexpected error has occured
1504     --
1505     ROLLBACK TO update_PRTT_PREM;
1506     raise;
1507     --
1508 end update_PRTT_PREM;
1509 -- ----------------------------------------------------------------------------
1510 -- |------------------------< delete_PRTT_PREM >----------------------|
1511 -- ----------------------------------------------------------------------------
1512 --
1513 procedure delete_PRTT_PREM
1514   (p_validate                       in  boolean  default false
1515   ,p_prtt_prem_id                   in  number
1516   ,p_effective_start_date           out nocopy date
1517   ,p_effective_end_date             out nocopy date
1518   ,p_object_version_number          in out nocopy number
1519   ,p_effective_date                 in  date
1520   ,p_datetrack_mode                 in  varchar2
1521   ) is
1522   --
1523   -- Declare cursors and local variables
1524   --
1525   l_proc varchar2(72) := g_package||'update_PRTT_PREM';
1526   l_object_version_number ben_prtt_prem_f.object_version_number%TYPE;
1527   l_effective_start_date ben_prtt_prem_f.effective_start_date%TYPE;
1528   l_effective_end_date ben_prtt_prem_f.effective_end_date%TYPE;
1529   --
1530 begin
1531   --
1532   hr_utility.set_location('Entering:'|| l_proc, 10);
1533   --
1534   -- Issue a savepoint if operating in validation only mode
1535   --
1536   savepoint delete_PRTT_PREM;
1537   --
1538   hr_utility.set_location(l_proc, 20);
1539   --
1540   -- Process Logic
1541   --
1542   l_object_version_number := p_object_version_number;
1543   --
1544   --
1545   begin
1546     --
1547     -- Start of API User Hook for the before hook of delete_PRTT_PREM
1548     --
1549     ben_PRTT_PREM_bk3.delete_PRTT_PREM_b
1550       (
1551        p_prtt_prem_id                   =>  p_prtt_prem_id
1552       ,p_object_version_number          =>  p_object_version_number
1553     ,p_effective_date                      => trunc(p_effective_date)
1554     ,p_datetrack_mode                      => p_datetrack_mode
1555       );
1556   exception
1557     when hr_api.cannot_find_prog_unit then
1558       hr_api.cannot_find_prog_unit_error
1559         (p_module_name => 'DELETE_PRTT_PREM'
1560         ,p_hook_type   => 'BP'
1561         );
1562     --
1563     -- End of API User Hook for the before hook of delete_PRTT_PREM
1564     --
1565   end;
1566   --
1567   ben_ppe_del.del
1568     (
1569      p_prtt_prem_id                  => p_prtt_prem_id
1570     ,p_effective_start_date          => l_effective_start_date
1571     ,p_effective_end_date            => l_effective_end_date
1572     ,p_object_version_number         => l_object_version_number
1573     ,p_effective_date                => p_effective_date
1574     ,p_datetrack_mode                => p_datetrack_mode
1575     );
1576   --
1577   begin
1578     --
1579     -- Start of API User Hook for the after hook of delete_PRTT_PREM
1580     --
1581     ben_PRTT_PREM_bk3.delete_PRTT_PREM_a
1582       (
1583        p_prtt_prem_id                   =>  p_prtt_prem_id
1584       ,p_effective_start_date           =>  l_effective_start_date
1585       ,p_effective_end_date             =>  l_effective_end_date
1586       ,p_object_version_number          =>  l_object_version_number
1587     ,p_effective_date                      => trunc(p_effective_date)
1588     ,p_datetrack_mode                      => p_datetrack_mode
1589       );
1590   exception
1591     when hr_api.cannot_find_prog_unit then
1592       hr_api.cannot_find_prog_unit_error
1593         (p_module_name => 'DELETE_PRTT_PREM'
1594         ,p_hook_type   => 'AP'
1595         );
1596     --
1597     -- End of API User Hook for the after hook of delete_PRTT_PREM
1598     --
1599   end;
1600   --
1601   hr_utility.set_location(l_proc, 60);
1602   --
1603   -- When in validation only mode raise the Validate_Enabled exception
1604   --
1605   if p_validate then
1606     raise hr_api.validate_enabled;
1607   end if;
1608   --
1609   hr_utility.set_location(' Leaving:'||l_proc, 70);
1610   --
1611 exception
1612   --
1613   when hr_api.validate_enabled then
1614     --
1615     -- As the Validate_Enabled exception has been raised
1616     -- we must rollback to the savepoint
1617     --
1618     ROLLBACK TO delete_PRTT_PREM;
1619     --
1620     -- Only set output warning arguments
1621     -- (Any key or derived arguments must be set to null
1622     -- when validation only mode is being used.)
1623     --
1624     p_effective_start_date := null;
1625     p_effective_end_date := null;
1626     --
1627   when others then
1628     --
1629     -- A validation or unexpected error has occured
1630     --
1631     ROLLBACK TO delete_PRTT_PREM;
1632     raise;
1633     --
1634 end delete_PRTT_PREM;
1635 --
1636 -- ----------------------------------------------------------------------------
1637 -- |-------------------------------< lck >------------------------------------|
1638 -- ----------------------------------------------------------------------------
1639 --
1640 procedure lck
1641   (
1642    p_prtt_prem_id                   in     number
1643   ,p_object_version_number          in     number
1644   ,p_effective_date                 in     date
1645   ,p_datetrack_mode                 in     varchar2
1646   ,p_validation_start_date          out nocopy    date
1647   ,p_validation_end_date            out nocopy    date
1648   ) is
1649   --
1650   --
1651   -- Declare cursors and local variables
1652   --
1653   l_proc varchar2(72) := g_package||'lck';
1654   l_validation_start_date date;
1655   l_validation_end_date date;
1656   --
1657 begin
1658   --
1659   hr_utility.set_location('Entering:'|| l_proc, 10);
1660   --
1661   ben_ppe_shd.lck
1662     (
1663       p_prtt_prem_id                 => p_prtt_prem_id
1664      ,p_validation_start_date      => l_validation_start_date
1665      ,p_validation_end_date        => l_validation_end_date
1666      ,p_object_version_number      => p_object_version_number
1667      ,p_effective_date             => p_effective_date
1668      ,p_datetrack_mode             => p_datetrack_mode
1669     );
1670   --
1671   hr_utility.set_location(' Leaving:'||l_proc, 70);
1672   --
1673 end lck;
1674 --
1675 end ben_PRTT_PREM_api;