DBA Data[Home] [Help]
Skip to content

PACKAGE BODY: APPS.BEN_PTNL_LER_FOR_PER_API

Source


1 Package Body ben_ptnl_ler_for_per_api as
2 /* $Header: bepplapi.pkb 120.0.12020000.3 2013/02/04 16:24:38 usaraswa ship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  ben_ptnl_ler_for_per_api.';
7 g_debug boolean := hr_utility.debug_enabled;
8 --
9 -- ----------------------------------------------------------------------------
10 -- |------------------------< derive_PPL_statcd_dates >-----------------------|
11 -- ----------------------------------------------------------------------------
12 --
13 procedure derive_PPL_statcd_dates
14   (p_ptnl_ler_for_per_stat_cd in  varchar2
15   ,p_effective_date           in  date
16   ,p_mnl_dt                   out nocopy date
17   ,p_dtctd_dt                 out nocopy date
18   ,p_procd_dt                 out nocopy date
19   ,p_unprocd_dt               out nocopy date
20   ,p_voidd_dt                 out nocopy date) is
21   --
22   -- Declare cursors and local variables
23   --
24   -- l_proc varchar2(72) := g_package||'derive_PPL_statcd_dates';
25   --
26 begin
27   --
28   -- DEBUG : Not critical to have set_location.
29   --
30   --
31   -- Set OUT parameters
32   --
33   if p_ptnl_ler_for_per_stat_cd = 'DTCTD' then
34     --
35     p_dtctd_dt   := p_effective_date;
36     --
37   elsif p_ptnl_ler_for_per_stat_cd = 'UNPROCD' then
38     --
39     p_unprocd_dt := p_effective_date;
40     --
41   elsif p_ptnl_ler_for_per_stat_cd = 'PROCD' then
42     --
43     p_procd_dt   := p_effective_date;
44     --
45   elsif p_ptnl_ler_for_per_stat_cd = 'VOIDD' then
46     --
47     p_voidd_dt   := p_effective_date;
48     --
49   elsif p_ptnl_ler_for_per_stat_cd = 'MNL' then
50     --
51     p_mnl_dt     := p_effective_date;
52     --
53   end if;
54   --
55   -- DEBUG : Not critical to have set_location.
56   --
57 end derive_PPL_statcd_dates;
58 --
59 -- ----------------------------------------------------------------------------
60 -- |------------------------< create_ptnl_ler_for_per >-----------------------|
61 -- ----------------------------------------------------------------------------
62 --
63 procedure create_ptnl_ler_for_per
64   (p_validate                       in boolean    default false
65   ,p_ptnl_ler_for_per_id            out nocopy number
66   ,p_csd_by_ptnl_ler_for_per_id     in  number    default null
67   ,p_lf_evt_ocrd_dt                 in  date      default null
68   ,p_trgr_table_pk_id               in  number    default null
69   ,p_ptnl_ler_for_per_stat_cd       in  varchar2  default null
70   ,p_ptnl_ler_for_per_src_cd        in  varchar2  default null
71   ,p_mnl_dt                         in  date      default null
72   ,p_enrt_perd_id                   in  number    default null
73   ,p_ler_id                         in  number    default null
74   ,p_person_id                      in  number    default null
75   ,p_business_group_id              in  number    default null
76   ,p_dtctd_dt                       in  date      default null
77   ,p_procd_dt                       in  date      default null
78   ,p_unprocd_dt                     in  date      default null
79   ,p_voidd_dt                       in  date      default null
80   ,p_mnlo_dt                        in  date      default null
81   ,p_ntfn_dt                        in  date      default null
82   ,p_request_id                     in  number    default null
83   ,p_program_application_id         in  number    default null
84   ,p_program_id                     in  number    default null
85   ,p_program_update_date            in  date      default null
86   ,p_object_version_number          out nocopy number
87   ,p_effective_date                 in  date
88   ,p_called_from_form               in  varchar2  default 'N') is
89   --
90   -- Declare cursors and local variables
91   --
92   l_ptnl_ler_for_per_id ben_ptnl_ler_for_per.ptnl_ler_for_per_id%TYPE;
93   l_proc varchar2(72) ;
94   l_object_version_number ben_ptnl_ler_for_per.object_version_number%TYPE;
95 
96   --
97   cursor c_chk_elig_crit(c_ler_id number,c_effective_date date) is
98      select '1' from dual where exists
99        (select obj.ELIG_OBJ_ID from ben_elig_obj_f obj ,
100 	                     ben_elig_obj_elig_profl_f obe,
101 			     ben_ler_f ler
102 		     where c_effective_date  between obj.effective_start_date
103                            and obj.effective_end_date
104 			   and  c_effective_date  between obe.effective_start_date
105                            and obe.effective_end_date
106 			   and obj.table_name = 'BEN_LER_F'
107 			   and obj.column_name = 'LER_ID'
108 			   and obj.column_value = p_ler_id
109 			   and obj.business_group_id = p_business_group_id
110 			   and obe.business_group_id = p_business_group_id
111 			   and obj.ELIG_OBJ_ID = obe.ELIG_OBJ_ID
112 			   and ler.ler_id = to_number(obj.column_value)
113 			   and ler.business_group_id = p_business_group_id
114                            and c_effective_date between ler.effective_start_date and ler.effective_end_date
115 	                   and ler.typ_cd not in ('IREC', 'SCHEDDU', 'COMP', 'GSP', 'ABS')
116 	);
117   l_dummy varchar2(1);
118   l_continue_eval boolean;
119   l_elig_return_status varchar2(1);
120   l_score_tab           ben_evaluate_elig_profiles.scoreTab;
121   --
122 
123 begin
124   --
125   g_debug := hr_utility.debug_enabled;
126   if g_debug then
127     l_proc := g_package||'create_ptnl_ler_for_per';
128     hr_utility.set_location('Entering:'|| l_proc, 10);
129   end if;
130   --
131   -- Issue a savepoint if operating in validation only mode
132   --
133   hr_utility.set_location('p_ler_id '|| p_ler_id, 10);
134   hr_utility.set_location('p_effective_date '|| p_effective_date, 10);
135   hr_utility.set_location('p_person_id '|| p_person_id, 10);
136   hr_utility.set_location('p_business_group_id '|| p_business_group_id, 10);
137   l_continue_eval := true;
138   if( nvl(p_called_from_form,'N') = 'N') then
139     open c_chk_elig_crit(p_ler_id, nvl(p_lf_evt_ocrd_dt,p_effective_date)) ;
140     fetch c_chk_elig_crit into l_dummy;
141     if(c_chk_elig_crit%notfound) then
142        hr_utility.set_location('No elig criteria', 10);
143        close c_chk_elig_crit;
144        l_continue_eval := true;
145     else
146        close c_chk_elig_crit;
147        hr_utility.set_location('Evaluate elig profiles', 10);
148 	   --Bug 16218328 commented the below If condition
149       -- if fnd_global.conc_request_id in (0,-1) then
150 		     ben_env_object.init
151 		     (p_business_group_id => p_business_group_id,
152 		      p_thread_id => null,
153 		      p_chunk_size => null,
154 		      p_threads => null,
155 		      p_max_errors => null,
156 		      p_benefit_action_id => null,
157 		      p_effective_date=> p_effective_date);
158 	--end if;
159 
160 	ben_eval_comm_ler_elig_profl.check_eligible
161 			  (p_person_id  => p_person_id
162 			  ,p_effective_date  => nvl(p_lf_evt_ocrd_dt,p_effective_date)
163                           ,p_lf_evt_ocrd_dt => p_lf_evt_ocrd_dt
164 			  ,p_business_group_id  => p_business_group_id
165 			  ,p_source   => 'L'
166 			  ,p_col_value => p_ler_id
167 			  ,p_elig_flag => l_elig_return_status);
168 
169            if(l_elig_return_status = 'Y') then
170 	       hr_utility.set_location('criteria satisfied', 10);
171                l_continue_eval := true;
172            else
173 	      hr_utility.set_location('criteria not satisfied ', 10);
174 	      l_continue_eval := false;
175            end if;
176     end if;
177   else
178       l_continue_eval := true;
179   end if;
180 
181   if(l_continue_eval) then
182 
183   if p_validate then
184     --
185     savepoint create_ptnl_ler_for_per;
186     --
187   end if;
188   --
189   -- Process Logic
190   --
191   begin
192     --
193     -- Start of API User Hook for the before hook of create_ptnl_ler_for_per
194     --
195     ben_ptnl_ler_for_per_bk1.create_ptnl_ler_for_per_b
196       (p_lf_evt_ocrd_dt                 =>  trunc(p_lf_evt_ocrd_dt)
197       ,p_trgr_table_pk_id               =>  p_trgr_table_pk_id
198       ,p_csd_by_ptnl_ler_for_per_id     =>  p_csd_by_ptnl_ler_for_per_id
199       ,p_ptnl_ler_for_per_stat_cd       =>  p_ptnl_ler_for_per_stat_cd
200       ,p_ptnl_ler_for_per_src_cd        =>  p_ptnl_ler_for_per_src_cd
201       ,p_mnl_dt                         =>  trunc(p_mnl_dt)
202       ,p_enrt_perd_id                   =>  p_enrt_perd_id
203       ,p_ler_id                         =>  p_ler_id
204       ,p_person_id                      =>  p_person_id
205       ,p_business_group_id              =>  p_business_group_id
206       ,p_dtctd_dt                       =>  trunc(p_dtctd_dt)
207       ,p_procd_dt                       =>  trunc(p_procd_dt)
208       ,p_unprocd_dt                     =>  trunc(p_unprocd_dt)
209       ,p_voidd_dt                       =>  trunc(p_voidd_dt)
210       ,p_mnlo_dt                        =>  trunc(p_mnlo_dt)
211       ,p_ntfn_dt                        =>  trunc(p_ntfn_dt)
212       ,p_request_id                     =>  p_request_id
213       ,p_program_application_id         =>  p_program_application_id
214       ,p_program_id                     =>  p_program_id
215       ,p_program_update_date            =>  trunc(p_program_update_date)
216       ,p_effective_date                 =>  trunc(p_effective_date)
217       );
218     --
219   exception
220     --
221     when hr_api.cannot_find_prog_unit then
222       --
223       hr_api.cannot_find_prog_unit_error
224         (p_module_name => 'CREATE_ptnl_ler_for_per'
225         ,p_hook_type   => 'BP');
226     --
227     -- End of API User Hook for the before hook of create_ptnl_ler_for_per
228     --
229   end;
230   --
231   ben_ppl_ins.ins
232     (p_ptnl_ler_for_per_id           => l_ptnl_ler_for_per_id
233     ,p_csd_by_ptnl_ler_for_per_id    => p_csd_by_ptnl_ler_for_per_id
234     ,p_lf_evt_ocrd_dt                => trunc(p_lf_evt_ocrd_dt)
235     ,p_trgr_table_pk_id              => p_trgr_table_pk_id
236     ,p_ptnl_ler_for_per_stat_cd      => p_ptnl_ler_for_per_stat_cd
237     ,p_ptnl_ler_for_per_src_cd       => p_ptnl_ler_for_per_src_cd
238     ,p_mnl_dt                        => trunc(p_mnl_dt)
239     ,p_enrt_perd_id                  => p_enrt_perd_id
240     ,p_ler_id                        => p_ler_id
241     ,p_person_id                     => p_person_id
242     ,p_business_group_id             => p_business_group_id
243     ,p_dtctd_dt                      => trunc(p_dtctd_dt)
244     ,p_procd_dt                      => trunc(p_procd_dt)
245     ,p_unprocd_dt                    => trunc(p_unprocd_dt)
246     ,p_voidd_dt                      => trunc(p_voidd_dt)
247     ,p_mnlo_dt                       => trunc(p_mnlo_dt)
248     ,p_ntfn_dt                       => trunc(p_ntfn_dt)
249     ,p_request_id                    => p_request_id
250     ,p_program_application_id        => p_program_application_id
251     ,p_program_id                    => p_program_id
252     ,p_program_update_date           => trunc(p_program_update_date)
253     ,p_object_version_number         => l_object_version_number
254     ,p_effective_date                => trunc(p_effective_date));
255   --
256   begin
257     --
258     -- Start of API User Hook for the after hook of create_ptnl_ler_for_per
259     --
260     ben_ptnl_ler_for_per_bk1.create_ptnl_ler_for_per_a
261       (p_ptnl_ler_for_per_id            =>  l_ptnl_ler_for_per_id
262       ,p_csd_by_ptnl_ler_for_per_id     =>  p_csd_by_ptnl_ler_for_per_id
263       ,p_lf_evt_ocrd_dt                 =>  trunc(p_lf_evt_ocrd_dt)
264       ,p_trgr_table_pk_id               =>  p_trgr_table_pk_id
265       ,p_ptnl_ler_for_per_stat_cd       =>  p_ptnl_ler_for_per_stat_cd
266       ,p_ptnl_ler_for_per_src_cd        =>  p_ptnl_ler_for_per_src_cd
267       ,p_mnl_dt                         =>  trunc(p_mnl_dt)
268       ,p_enrt_perd_id                   =>  p_enrt_perd_id
269       ,p_ler_id                         =>  p_ler_id
270       ,p_person_id                      =>  p_person_id
271       ,p_business_group_id              =>  p_business_group_id
272       ,p_dtctd_dt                       =>  trunc(p_dtctd_dt)
273       ,p_procd_dt                       =>  trunc(p_procd_dt)
274       ,p_unprocd_dt                     =>  trunc(p_unprocd_dt)
275       ,p_voidd_dt                       =>  trunc(p_voidd_dt)
276       ,p_mnlo_dt                        =>  trunc(p_mnlo_dt)
277       ,p_ntfn_dt                        =>  trunc(p_ntfn_dt)
278       ,p_request_id                     =>  p_request_id
279       ,p_program_application_id         =>  p_program_application_id
280       ,p_program_id                     =>  p_program_id
281       ,p_program_update_date            =>  trunc(p_program_update_date)
282       ,p_object_version_number          =>  l_object_version_number
283       ,p_effective_date                 =>  trunc(p_effective_date)
284       );
285     --
286   exception
287     --
288     when hr_api.cannot_find_prog_unit then
289       --
290       hr_api.cannot_find_prog_unit_error
291         (p_module_name => 'CREATE_ptnl_ler_for_per'
292         ,p_hook_type   => 'AP');
293     --
294     -- End of API User Hook for the after hook of create_ptnl_ler_for_per
295     --
296   end;
297   --
298   if g_debug then
299     hr_utility.set_location(l_proc, 60);
300   end if;
301   --
302   -- When in validation only mode raise the Validate_Enabled exception
303   --
304   if p_validate then
305     raise hr_api.validate_enabled;
306   end if;
307   --
308   -- Set all output arguments
309   --
310   p_ptnl_ler_for_per_id   := l_ptnl_ler_for_per_id;
311   p_object_version_number := l_object_version_number;
312 
313   end if;
314   --
315   if g_debug then
316     hr_utility.set_location(' Leaving:'||l_proc, 70);
317   end if;
318   --
319 exception
320   --
321   when hr_api.validate_enabled then
322     --
323     -- As the Validate_Enabled exception has been raised
324     -- we must rollback to the savepoint
325     --
326     ROLLBACK TO create_ptnl_ler_for_per;
327     --
328     -- Only set output warning arguments
329     -- (Any key or derived arguments must be set to null
330     -- when validation only mode is being used.)
331     --
332     p_ptnl_ler_for_per_id   := null;
333     p_object_version_number := null;
334     --
335     if g_debug then
336        hr_utility.set_location(' Leaving:'||l_proc, 80);
337     end if;
338     --
339   when others then
340     --
341     -- A validation or unexpected error has occured
342     --
343     /* Inserted for nocopy changes */
344     p_ptnl_ler_for_per_id   := null;
345     p_object_version_number := null;
346     raise;
347     --
348 end create_ptnl_ler_for_per;
349 -- ----------------------------------------------------------------------------
350 -- |------------------------< create_ptnl_ler_for_per_perf >------------------|
351 -- ----------------------------------------------------------------------------
352 --
353 procedure create_ptnl_ler_for_per_perf
354   (p_validate                       in boolean    default false
355   ,p_ptnl_ler_for_per_id            out nocopy number
356   ,p_csd_by_ptnl_ler_for_per_id     in  number    default null
357   ,p_lf_evt_ocrd_dt                 in  date      default null
358   ,p_trgr_table_pk_id               in  number    default null
359   ,p_ptnl_ler_for_per_stat_cd       in  varchar2  default null
360   ,p_ptnl_ler_for_per_src_cd        in  varchar2  default null
361   ,p_mnl_dt                         in  date      default null
362   ,p_enrt_perd_id                   in  number    default null
363   ,p_ler_id                         in  number    default null
364   ,p_person_id                      in  number    default null
365   ,p_business_group_id              in  number    default null
366   ,p_dtctd_dt                       in  date      default null
367   ,p_procd_dt                       in  date      default null
368   ,p_unprocd_dt                     in  date      default null
369   ,p_voidd_dt                       in  date      default null
370   ,p_mnlo_dt                        in  date      default null
371   ,p_ntfn_dt                        in  date      default null
372   ,p_request_id                     in  number    default null
373   ,p_program_application_id         in  number    default null
374   ,p_program_id                     in  number    default null
375   ,p_program_update_date            in  date      default null
376   ,p_object_version_number          out nocopy number
377   ,p_effective_date                 in  date) is
378   --
379   -- Declare cursors and local variables
380   --
381   l_ptnl_ler_for_per_id ben_ptnl_ler_for_per.ptnl_ler_for_per_id%TYPE;
382   -- DEBUG : l_proc varchar2(72) := g_package||'create_ptnl_ler_for_per';
383   l_object_version_number ben_ptnl_ler_for_per.object_version_number%TYPE;
384   --
385 begin
386   --
387   if p_validate then
388     --
389     savepoint create_ptnl_ler_for_per;
390     --
391   end if;
392   --
393   -- Process Logic
394   --
395   begin
396     --
397     -- Start of API User Hook for the before hook of create_ptnl_ler_for_per
398     --
399     ben_ptnl_ler_for_per_bk1.create_ptnl_ler_for_per_b
400       (p_lf_evt_ocrd_dt                 =>  trunc(p_lf_evt_ocrd_dt)
401       ,p_trgr_table_pk_id               =>  p_trgr_table_pk_id
402       ,p_csd_by_ptnl_ler_for_per_id     =>  p_csd_by_ptnl_ler_for_per_id
403       ,p_ptnl_ler_for_per_stat_cd       =>  p_ptnl_ler_for_per_stat_cd
404       ,p_ptnl_ler_for_per_src_cd        =>  p_ptnl_ler_for_per_src_cd
405       ,p_mnl_dt                         =>  p_mnl_dt
406       ,p_enrt_perd_id                   =>  p_enrt_perd_id
407       ,p_ler_id                         =>  p_ler_id
408       ,p_person_id                      =>  p_person_id
409       ,p_business_group_id              =>  p_business_group_id
410       ,p_dtctd_dt                       =>  trunc(p_dtctd_dt)
411       ,p_procd_dt                       =>  trunc(p_procd_dt)
412       ,p_unprocd_dt                     =>  trunc(p_unprocd_dt)
413       ,p_voidd_dt                       =>  trunc(p_voidd_dt)
414       ,p_mnlo_dt                        =>  trunc(p_mnlo_dt)
415       ,p_ntfn_dt                        =>  trunc(p_ntfn_dt)
416       ,p_request_id                     =>  p_request_id
417       ,p_program_application_id         =>  p_program_application_id
418       ,p_program_id                     =>  p_program_id
419       ,p_program_update_date            =>  trunc(p_program_update_date)
420       ,p_effective_date                 =>  trunc(p_effective_date));
421     --
422   exception
423     --
424     when hr_api.cannot_find_prog_unit then
425       --
426       hr_api.cannot_find_prog_unit_error
427         (p_module_name => 'CREATE_ptnl_ler_for_per'
428         ,p_hook_type   => 'BP');
429     --
430     -- End of API User Hook for the before hook of create_ptnl_ler_for_per
431     --
432   end;
433   --
434   l_object_version_number := 1;
435   --
436   select ben_ptnl_ler_for_per_s.nextval
437   into   l_ptnl_ler_for_per_id
438   from   sys.dual;
439   --
440   insert into ben_ptnl_ler_for_per
441     (ptnl_ler_for_per_id
442     ,csd_by_ptnl_ler_for_per_id
443     ,lf_evt_ocrd_dt
444     ,trgr_table_pk_id
445     ,ptnl_ler_for_per_stat_cd
446     ,ptnl_ler_for_per_src_cd
447     ,mnl_dt
448     ,enrt_perd_id
449     ,ler_id
450     ,person_id
451     ,business_group_id
452     ,dtctd_dt
453     ,procd_dt
454     ,unprocd_dt
455     ,voidd_dt
456     ,mnlo_dt
457     ,ntfn_dt
458     ,request_id
459     ,program_application_id
460     ,program_id
461     ,program_update_date
462     ,object_version_number)
463   values
464     (l_ptnl_ler_for_per_id
465     ,p_csd_by_ptnl_ler_for_per_id
466     ,trunc(p_lf_evt_ocrd_dt)
467     ,p_trgr_table_pk_id
468     ,p_ptnl_ler_for_per_stat_cd
469     ,p_ptnl_ler_for_per_src_cd
470     ,trunc(p_mnl_dt)
471     ,p_enrt_perd_id
472     ,p_ler_id
473     ,p_person_id
474     ,p_business_group_id
475     ,trunc(p_dtctd_dt)
476     ,trunc(p_procd_dt)
477     ,trunc(p_unprocd_dt)
478     ,trunc(p_voidd_dt)
479     ,trunc(p_mnlo_dt)
480     ,trunc(p_ntfn_dt)
481     ,p_request_id
482     ,p_program_application_id
483     ,p_program_id
484     ,p_program_update_date
485     ,l_object_version_number);
486   --
487   begin
488     --
489     -- Start of API User Hook for the after hook of create_ptnl_ler_for_per
490     --
491     ben_ptnl_ler_for_per_bk1.create_ptnl_ler_for_per_a
492       (p_ptnl_ler_for_per_id            =>  l_ptnl_ler_for_per_id
493       ,p_csd_by_ptnl_ler_for_per_id     =>  p_csd_by_ptnl_ler_for_per_id
494       ,p_lf_evt_ocrd_dt                 =>  trunc(p_lf_evt_ocrd_dt)
495       ,p_trgr_table_pk_id               =>  p_trgr_table_pk_id
496       ,p_ptnl_ler_for_per_stat_cd       =>  p_ptnl_ler_for_per_stat_cd
497       ,p_ptnl_ler_for_per_src_cd        =>  p_ptnl_ler_for_per_src_cd
498       ,p_mnl_dt                         =>  trunc(p_mnl_dt)
499       ,p_enrt_perd_id                   =>  p_enrt_perd_id
500       ,p_ler_id                         =>  p_ler_id
501       ,p_person_id                      =>  p_person_id
502       ,p_business_group_id              =>  p_business_group_id
503       ,p_dtctd_dt                       =>  trunc(p_dtctd_dt)
504       ,p_procd_dt                       =>  trunc(p_procd_dt)
505       ,p_unprocd_dt                     =>  trunc(p_unprocd_dt)
506       ,p_voidd_dt                       =>  trunc(p_voidd_dt)
507       ,p_mnlo_dt                        =>  trunc(p_mnlo_dt)
508       ,p_ntfn_dt                        =>  trunc(p_ntfn_dt)
509       ,p_request_id                     =>  p_request_id
510       ,p_program_application_id         =>  p_program_application_id
511       ,p_program_id                     =>  p_program_id
512       ,p_program_update_date            =>  trunc(p_program_update_date)
513       ,p_object_version_number          =>  l_object_version_number
514       ,p_effective_date                 =>  trunc(p_effective_date));
515     --
516   exception
517     --
518     when hr_api.cannot_find_prog_unit then
519       --
520       hr_api.cannot_find_prog_unit_error
521         (p_module_name => 'CREATE_ptnl_ler_for_per'
522         ,p_hook_type   => 'AP');
523     --
524     -- End of API User Hook for the after hook of create_ptnl_ler_for_per
525     --
526   end;
527   --
528   -- When in validation only mode raise the Validate_Enabled exception
529   --
530   if p_validate then
531     raise hr_api.validate_enabled;
532   end if;
533   --
534   -- Set all output arguments
535   --
536   p_ptnl_ler_for_per_id   := l_ptnl_ler_for_per_id;
537   p_object_version_number := l_object_version_number;
538   --
539 exception
540   --
541   when hr_api.validate_enabled then
542     --
543     -- As the Validate_Enabled exception has been raised
544     -- we must rollback to the savepoint
545     --
546     ROLLBACK TO create_ptnl_ler_for_per;
547     --
548     -- Only set output warning arguments
549     -- (Any key or derived arguments must be set to null
550     -- when validation only mode is being used.)
551     --
552     p_ptnl_ler_for_per_id   := null;
553     p_object_version_number := null;
554     -- DEBUG : hr_utility.set_location(' Leaving:'||l_proc, 80);
555     --
556   when others then
557     --
558     -- A validation or unexpected error has occured
559     --
560     /* Inserted for nocopy changes */
561     p_ptnl_ler_for_per_id   := null;
562     p_object_version_number := null;
563     raise;
564     --
565 end create_ptnl_ler_for_per_perf;
566 -- ----------------------------------------------------------------------------
567 -- |------------------------< update_ptnl_ler_for_per >-----------------------|
568 -- ----------------------------------------------------------------------------
569 --
570 procedure update_ptnl_ler_for_per
571   (p_validate                       in boolean    default false
572   ,p_ptnl_ler_for_per_id            in  number
573   ,p_csd_by_ptnl_ler_for_per_id     in  number    default hr_api.g_number
574   ,p_lf_evt_ocrd_dt                 in  date      default hr_api.g_date
575   ,p_trgr_table_pk_id               in  number    default hr_api.g_number
576   ,p_ptnl_ler_for_per_stat_cd       in  varchar2  default hr_api.g_varchar2
577   ,p_ptnl_ler_for_per_src_cd        in  varchar2  default hr_api.g_varchar2
578   ,p_mnl_dt                         in  date      default hr_api.g_date
579   ,p_enrt_perd_id                   in  number    default hr_api.g_number
580   ,p_ler_id                         in  number    default hr_api.g_number
581   ,p_person_id                      in  number    default hr_api.g_number
582   ,p_business_group_id              in  number    default hr_api.g_number
583   ,p_dtctd_dt                       in  date      default hr_api.g_date
584   ,p_procd_dt                       in  date      default hr_api.g_date
585   ,p_unprocd_dt                     in  date      default hr_api.g_date
586   ,p_voidd_dt                       in  date      default hr_api.g_date
587   ,p_mnlo_dt                        in  date      default hr_api.g_date
588   ,p_ntfn_dt                        in  date      default hr_api.g_date
589   ,p_request_id                     in  number    default hr_api.g_number
590   ,p_program_application_id         in  number    default hr_api.g_number
591   ,p_program_id                     in  number    default hr_api.g_number
592   ,p_program_update_date            in  date      default hr_api.g_date
593   ,p_object_version_number          in out nocopy number
594   ,p_effective_date                 in  date) is
595   --
596   -- Declare cursors and local variables
597   --
598   l_proc varchar2(72) ;
599   l_object_version_number ben_ptnl_ler_for_per.object_version_number%TYPE;
600   --
601 begin
602   --
603   g_debug := hr_utility.debug_enabled;
604   if g_debug then
605     l_proc := g_package||'update_ptnl_ler_for_per';
606     hr_utility.set_location('Entering:'|| l_proc, 10);
607   end if;
608   --
609   -- Issue a savepoint if operating in validation only mode
610   --
611   if p_validate then
612     --
613     savepoint update_ptnl_ler_for_per;
614     --
615   end if;
616   --
617   -- Process Logic
618   --
619   l_object_version_number := p_object_version_number;
620   --
621   begin
622     --
623     -- Start of API User Hook for the before hook of update_ptnl_ler_for_per
624     --
625     ben_ptnl_ler_for_per_bk2.update_ptnl_ler_for_per_b
626       (p_ptnl_ler_for_per_id            =>  p_ptnl_ler_for_per_id
627       ,p_csd_by_ptnl_ler_for_per_id     =>  p_csd_by_ptnl_ler_for_per_id
628       ,p_lf_evt_ocrd_dt                 =>  trunc(p_lf_evt_ocrd_dt)
629       ,p_trgr_table_pk_id               =>  p_trgr_table_pk_id
630       ,p_ptnl_ler_for_per_stat_cd       =>  p_ptnl_ler_for_per_stat_cd
631       ,p_ptnl_ler_for_per_src_cd        =>  p_ptnl_ler_for_per_src_cd
632       ,p_mnl_dt                         =>  trunc(p_mnl_dt)
633       ,p_enrt_perd_id                   =>  p_enrt_perd_id
634       ,p_ler_id                         =>  p_ler_id
635       ,p_person_id                      =>  p_person_id
636       ,p_business_group_id              =>  p_business_group_id
637       ,p_dtctd_dt                       =>  trunc(p_dtctd_dt)
638       ,p_procd_dt                       =>  trunc(p_procd_dt)
639       ,p_unprocd_dt                     =>  trunc(p_unprocd_dt)
640       ,p_voidd_dt                       =>  trunc(p_voidd_dt)
641       ,p_mnlo_dt                        =>  trunc(p_mnlo_dt)
642       ,p_ntfn_dt                        =>  trunc(p_ntfn_dt)
643       ,p_request_id                     =>  p_request_id
644       ,p_program_application_id         =>  p_program_application_id
645       ,p_program_id                     =>  p_program_id
646       ,p_program_update_date            =>  trunc(p_program_update_date)
647       ,p_object_version_number          =>  p_object_version_number
648       ,p_effective_date                 =>  trunc(p_effective_date));
649     --
650   exception
651     --
652     when hr_api.cannot_find_prog_unit then
653       --
654       hr_api.cannot_find_prog_unit_error
655         (p_module_name => 'UPDATE_ptnl_ler_for_per'
656         ,p_hook_type   => 'BP');
657     --
658     -- End of API User Hook for the before hook of update_ptnl_ler_for_per
659     --
660   end;
661   --
662   ben_ppl_upd.upd
663     (p_ptnl_ler_for_per_id           => p_ptnl_ler_for_per_id
664     ,p_csd_by_ptnl_ler_for_per_id    => p_csd_by_ptnl_ler_for_per_id
665     ,p_lf_evt_ocrd_dt                => trunc(p_lf_evt_ocrd_dt)
666     ,p_trgr_table_pk_id              => p_trgr_table_pk_id
667     ,p_ptnl_ler_for_per_stat_cd      => p_ptnl_ler_for_per_stat_cd
668     ,p_ptnl_ler_for_per_src_cd       => p_ptnl_ler_for_per_src_cd
669     ,p_mnl_dt                        => trunc(p_mnl_dt)
670     ,p_enrt_perd_id                  => p_enrt_perd_id
671     ,p_ler_id                        => p_ler_id
672     ,p_person_id                     => p_person_id
673     ,p_business_group_id             => p_business_group_id
674     ,p_dtctd_dt                      => trunc(p_dtctd_dt)
675     ,p_procd_dt                      => trunc(p_procd_dt )
676     ,p_unprocd_dt                    => trunc(p_unprocd_dt)
677     ,p_voidd_dt                      => trunc(p_voidd_dt)
678     ,p_mnlo_dt                       => trunc(p_mnlo_dt)
679     ,p_ntfn_dt                       => trunc(p_ntfn_dt)
680     ,p_request_id                    => p_request_id
681     ,p_program_application_id        => p_program_application_id
682     ,p_program_id                    => p_program_id
683     ,p_program_update_date           => trunc(p_program_update_date)
684     ,p_object_version_number         => l_object_version_number
685     ,p_effective_date                => trunc(p_effective_date));
686   --
687   begin
688     --
689     -- Start of API User Hook for the after hook of update_ptnl_ler_for_per
690     --
691     ben_ptnl_ler_for_per_bk2.update_ptnl_ler_for_per_a
692       (p_ptnl_ler_for_per_id            =>  p_ptnl_ler_for_per_id
693       ,p_csd_by_ptnl_ler_for_per_id     =>  p_csd_by_ptnl_ler_for_per_id
694       ,p_lf_evt_ocrd_dt                 =>  trunc(p_lf_evt_ocrd_dt)
695       ,p_trgr_table_pk_id               =>  p_trgr_table_pk_id
696       ,p_ptnl_ler_for_per_stat_cd       =>  p_ptnl_ler_for_per_stat_cd
697       ,p_ptnl_ler_for_per_src_cd        =>  p_ptnl_ler_for_per_src_cd
698       ,p_mnl_dt                         =>  trunc(p_mnl_dt)
699       ,p_enrt_perd_id                   =>  p_enrt_perd_id
700       ,p_ler_id                         =>  p_ler_id
701       ,p_person_id                      =>  p_person_id
702       ,p_business_group_id              =>  p_business_group_id
703       ,p_dtctd_dt                       =>  trunc(p_dtctd_dt)
704       ,p_procd_dt                       =>  trunc(p_procd_dt)
705       ,p_unprocd_dt                     =>  trunc(p_unprocd_dt)
706       ,p_voidd_dt                       =>  trunc(p_voidd_dt)
707       ,p_mnlo_dt                        =>  trunc(p_mnlo_dt)
708       ,p_ntfn_dt                        =>  trunc(p_ntfn_dt)
709       ,p_request_id                     =>  p_request_id
710       ,p_program_application_id         =>  p_program_application_id
711       ,p_program_id                     =>  p_program_id
712       ,p_program_update_date            =>  trunc(p_program_update_date)
713       ,p_object_version_number          =>  l_object_version_number
714       ,p_effective_date                 =>  trunc(p_effective_date));
715     --
716   exception
717     --
718     when hr_api.cannot_find_prog_unit then
719       --
720       hr_api.cannot_find_prog_unit_error
721         (p_module_name => 'UPDATE_ptnl_ler_for_per'
722         ,p_hook_type   => 'AP');
723     --
724     -- End of API User Hook for the after hook of update_ptnl_ler_for_per
725     --
726   end;
727   --
728   if g_debug then
729     hr_utility.set_location(l_proc, 60);
730   end if;
731   --
732   -- When in validation only mode raise the Validate_Enabled exception
733   --
734   if p_validate then
735     raise hr_api.validate_enabled;
736   end if;
737   --
738   -- Set all output arguments
739   --
740   p_object_version_number := l_object_version_number;
741   --
742   if g_debug then
743     hr_utility.set_location(' Leaving:'||l_proc, 70);
744   end if;
745   --
746 exception
747   --
748   when hr_api.validate_enabled then
749     --
750     -- As the Validate_Enabled exception has been raised
751     -- we must rollback to the savepoint
752     --
753     ROLLBACK TO update_ptnl_ler_for_per;
754     --
755     -- Only set output warning arguments
756     -- (Any key or derived arguments must be set to null
757     -- when validation only mode is being used.)
758     --
759     if g_debug then
760        hr_utility.set_location(' Leaving:'||l_proc, 80);
761     end if;
762     --
763   when others then
764     --
765     -- A validation or unexpected error has occured
766     --
767     /* Inserted for nocopy changes */
768     p_object_version_number := l_object_version_number;
769     raise;
770     --
771 end update_ptnl_ler_for_per;
772 -- ----------------------------------------------------------------------------
773 -- |------------------------< update_ptnl_ler_for_per_perf >------------------|
774 -- ----------------------------------------------------------------------------
775 --
776 procedure update_ptnl_ler_for_per_perf
777   (p_validate                       in boolean    default false
778   ,p_ptnl_ler_for_per_id            in  number
779   ,p_csd_by_ptnl_ler_for_per_id     in  number    default hr_api.g_number
780   ,p_lf_evt_ocrd_dt                 in  date      default hr_api.g_date
781   ,p_trgr_table_pk_id               in  number    default hr_api.g_number
782   ,p_ptnl_ler_for_per_stat_cd       in  varchar2  default hr_api.g_varchar2
783   ,p_ptnl_ler_for_per_src_cd        in  varchar2  default hr_api.g_varchar2
784   ,p_mnl_dt                         in  date      default hr_api.g_date
785   ,p_enrt_perd_id                   in  number    default hr_api.g_number
786   ,p_ler_id                         in  number    default hr_api.g_number
787   ,p_person_id                      in  number    default hr_api.g_number
788   ,p_business_group_id              in  number    default hr_api.g_number
789   ,p_dtctd_dt                       in  date      default hr_api.g_date
790   ,p_procd_dt                       in  date      default hr_api.g_date
791   ,p_unprocd_dt                     in  date      default hr_api.g_date
792   ,p_voidd_dt                       in  date      default hr_api.g_date
793   ,p_mnlo_dt                        in  date      default hr_api.g_date
794   ,p_ntfn_dt                        in  date      default hr_api.g_date
795   ,p_request_id                     in  number    default hr_api.g_number
796   ,p_program_application_id         in  number    default hr_api.g_number
797   ,p_program_id                     in  number    default hr_api.g_number
798   ,p_program_update_date            in  date      default hr_api.g_date
799   ,p_object_version_number          in out nocopy number
800   ,p_effective_date                 in  date) is
801   --
802   -- Declare cursors and local variables
803   --
804   -- l_proc varchar2(72) := g_package||'update_ptnl_ler_for_per';
805   l_object_version_number ben_ptnl_ler_for_per.object_version_number%TYPE;
806   --
807   l_ptnl_ler_for_per_id      number;
808   l_csd_by_ptnl_ler_for_per_id      number;
809   l_lf_evt_ocrd_dt           date;
810   l_trgr_table_pk_id         number;
811   l_ntfn_dt                  date;
812   l_dtctd_dt                 date;
813   l_procd_dt                 date;
814   l_unprocd_dt               date;
815   l_voidd_dt                 date;
816   l_mnlo_dt                  date;
817   l_mnl_dt                   date;
818   l_ptnl_ler_for_per_stat_cd varchar2(30);
819   l_ptnl_ler_for_per_src_cd  varchar2(30);
820   l_enrt_perd_id             number;
821   l_ler_id                   number;
822   l_business_group_id        number;
823   l_person_id                number;
824   l_request_id               number;
825   l_program_application_id   number;
826   l_program_id               number;
827   l_program_update_date      date;
828   --
829 begin
830   --
831   -- Issue a savepoint if operating in validation only mode
832   --
833   if p_validate then
834     --
835     savepoint update_ptnl_ler_for_per;
836     --
837   end if;
838   --
839   l_object_version_number := p_object_version_number;
840   --
841   begin
842     --
843     -- Start of API User Hook for the before hook of update_ptnl_ler_for_per
844     --
845     ben_ptnl_ler_for_per_bk2.update_ptnl_ler_for_per_b
846       (p_ptnl_ler_for_per_id            =>  p_ptnl_ler_for_per_id
847       ,p_csd_by_ptnl_ler_for_per_id     =>  p_csd_by_ptnl_ler_for_per_id
848       ,p_lf_evt_ocrd_dt                 =>  trunc(p_lf_evt_ocrd_dt)
849       ,p_trgr_table_pk_id               =>  p_trgr_table_pk_id
850       ,p_ptnl_ler_for_per_stat_cd       =>  p_ptnl_ler_for_per_stat_cd
851       ,p_ptnl_ler_for_per_src_cd        =>  p_ptnl_ler_for_per_src_cd
852       ,p_mnl_dt                         =>  trunc(p_mnl_dt)
853       ,p_enrt_perd_id                   =>  p_enrt_perd_id
854       ,p_ler_id                         =>  p_ler_id
855       ,p_person_id                      =>  p_person_id
856       ,p_business_group_id              =>  p_business_group_id
857       ,p_dtctd_dt                       =>  p_dtctd_dt
858       ,p_procd_dt                       =>  trunc(p_procd_dt)
859       ,p_unprocd_dt                     =>  trunc(p_unprocd_dt)
860       ,p_voidd_dt                       =>  trunc(p_voidd_dt)
861       ,p_mnlo_dt                        =>  trunc(p_mnlo_dt)
862       ,p_ntfn_dt                        =>  trunc(p_ntfn_dt)
863       ,p_request_id                     =>  p_request_id
864       ,p_program_application_id         =>  p_program_application_id
865       ,p_program_id                     =>  p_program_id
866       ,p_program_update_date            =>  trunc(p_program_update_date)
867       ,p_object_version_number          =>  p_object_version_number
868       ,p_effective_date                 =>  trunc(p_effective_date));
869     --
870   exception
871     --
872     when hr_api.cannot_find_prog_unit then
873       --
874       hr_api.cannot_find_prog_unit_error
875         (p_module_name => 'UPDATE_ptnl_ler_for_per'
876         ,p_hook_type   => 'BP');
877     --
878     -- End of API User Hook for the before hook of update_ptnl_ler_for_per
879     --
880   end;
881   --
882   -- Lock the record so we can default properly
883   --
884   ben_ppl_shd.lck(p_ptnl_ler_for_per_id   => p_ptnl_ler_for_per_id,
885                   p_object_version_number => l_object_version_number);
886   --
887   -- default variables for update
888   --
889   l_csd_by_ptnl_ler_for_per_id := p_csd_by_ptnl_ler_for_per_id;
890   If (l_csd_by_ptnl_ler_for_per_id = hr_api.g_number) then
891     l_csd_by_ptnl_ler_for_per_id :=
892     ben_ppl_shd.g_old_rec.csd_by_ptnl_ler_for_per_id;
893   End If;
894   l_lf_evt_ocrd_dt := trunc(p_lf_evt_ocrd_dt);
895   If (p_lf_evt_ocrd_dt = hr_api.g_date) then
896     l_lf_evt_ocrd_dt :=
897     ben_ppl_shd.g_old_rec.lf_evt_ocrd_dt;
898   End If;
899   l_trgr_table_pk_id := p_trgr_table_pk_id;
900   If (p_trgr_table_pk_id = hr_api.g_number) then
901     l_trgr_table_pk_id :=
902     ben_ppl_shd.g_old_rec.trgr_table_pk_id;
903   End If;
904   l_ptnl_ler_for_per_stat_cd := p_ptnl_ler_for_per_stat_cd;
905   If (l_ptnl_ler_for_per_stat_cd = hr_api.g_varchar2) then
906     l_ptnl_ler_for_per_stat_cd :=
907     ben_ppl_shd.g_old_rec.ptnl_ler_for_per_stat_cd;
908   End If;
909   l_ptnl_ler_for_per_src_cd := p_ptnl_ler_for_per_src_cd;
910   If (l_ptnl_ler_for_per_src_cd = hr_api.g_varchar2) then
911     l_ptnl_ler_for_per_src_cd :=
912     ben_ppl_shd.g_old_rec.ptnl_ler_for_per_src_cd;
913   End If;
914   l_enrt_perd_id := p_enrt_perd_id;
915   If (l_enrt_perd_id = hr_api.g_number) then
916     l_enrt_perd_id :=
917     ben_ppl_shd.g_old_rec.enrt_perd_id;
918   End If;
919   l_ler_id := p_ler_id;
920   If (l_ler_id = hr_api.g_number) then
921     l_ler_id :=
922     ben_ppl_shd.g_old_rec.ler_id;
923   End If;
924   l_ntfn_dt := trunc(p_ntfn_dt);
925   If (l_ntfn_dt = hr_api.g_date) then
926     l_ntfn_dt :=
927     ben_ppl_shd.g_old_rec.ntfn_dt;
928   End If;
929   l_dtctd_dt := trunc(p_dtctd_dt);
930   If (l_dtctd_dt = hr_api.g_date) then
931     l_dtctd_dt :=
932     ben_ppl_shd.g_old_rec.dtctd_dt;
933   End If;
934   l_procd_dt := trunc(p_procd_dt);
935   If (l_procd_dt = hr_api.g_date) then
936     l_procd_dt :=
937     ben_ppl_shd.g_old_rec.procd_dt;
938   End If;
939   l_unprocd_dt := trunc(p_unprocd_dt);
940   If (l_unprocd_dt = hr_api.g_date) then
941     l_unprocd_dt :=
942     ben_ppl_shd.g_old_rec.unprocd_dt;
943   End If;
944   l_voidd_dt := trunc(p_voidd_dt);
945   If (l_voidd_dt = hr_api.g_date) then
946     l_voidd_dt :=
947     ben_ppl_shd.g_old_rec.voidd_dt;
948   End If;
949   l_mnlo_dt := trunc(p_mnlo_dt);
950   If (l_mnlo_dt = hr_api.g_date) then
951     l_mnlo_dt :=
952     ben_ppl_shd.g_old_rec.mnlo_dt;
953   End If;
954   l_mnl_dt := trunc(p_mnl_dt);
955   If (l_mnl_dt = hr_api.g_date) then
956     l_mnl_dt :=
957     ben_ppl_shd.g_old_rec.mnl_dt;
958   End If;
959   l_person_id := p_person_id;
960   If (l_person_id = hr_api.g_number) then
961     l_person_id :=
962     ben_ppl_shd.g_old_rec.person_id;
963   End If;
964   l_business_group_id := p_business_group_id;
965   If (l_business_group_id = hr_api.g_number) then
966     l_business_group_id :=
967     ben_ppl_shd.g_old_rec.business_group_id;
968   End If;
969   l_request_id := p_request_id;
970   If (l_request_id = hr_api.g_number) then
971     l_request_id :=
972     ben_ppl_shd.g_old_rec.request_id;
973   End If;
974   l_program_application_id := p_program_application_id;
975   If (l_program_application_id = hr_api.g_number) then
976     l_program_application_id :=
977     ben_ppl_shd.g_old_rec.program_application_id;
978   End If;
979   l_program_id := p_program_id;
980   If (l_program_id = hr_api.g_number) then
981     l_program_id :=
982     ben_ppl_shd.g_old_rec.program_id;
983   End If;
984   l_program_update_date := trunc(p_program_update_date);
985   If (l_program_update_date = hr_api.g_date) then
986     l_program_update_date :=
987     ben_ppl_shd.g_old_rec.program_update_date;
988   End If;
989   --
990   l_object_version_number := l_object_version_number + 1;
991   --
992   -- Update the row using the old values for defaulted parameters and
993   -- any changed values for passed parameters.
994   --
995   update ben_ptnl_ler_for_per
996     set lf_evt_ocrd_dt           = l_lf_evt_ocrd_dt,
997         trgr_table_pk_id         = l_trgr_table_pk_id,
998         csd_by_ptnl_ler_for_per_id = l_csd_by_ptnl_ler_for_per_id,
999         ptnl_ler_for_per_stat_cd = l_ptnl_ler_for_per_stat_cd,
1000         ptnl_ler_for_per_src_cd  = l_ptnl_ler_for_per_src_cd,
1001         mnl_dt                   = l_mnl_dt,
1002         enrt_perd_id             = l_enrt_perd_id,
1003         ler_id                   = l_ler_id,
1004         person_id                = l_person_id,
1005         business_group_id        = l_business_group_id,
1006         dtctd_dt                 = l_dtctd_dt,
1007         procd_dt                 = l_procd_dt,
1008         unprocd_dt               = l_unprocd_dt,
1009         voidd_dt                 = l_voidd_dt,
1010         mnlo_dt                  = l_mnlo_dt,
1011         ntfn_dt                  = l_ntfn_dt,
1012         request_id               = l_request_id,
1013         program_application_id   = l_program_application_id,
1014         program_id               = l_program_id,
1015         program_update_date      = l_program_update_date,
1016         object_version_number    = l_object_version_number
1017     where ptnl_ler_for_per_id    = p_ptnl_ler_for_per_id;
1018   --
1019   begin
1020     --
1021     -- Start of API User Hook for the after hook of update_ptnl_ler_for_per
1022     --
1023     ben_ptnl_ler_for_per_bk2.update_ptnl_ler_for_per_a
1024       (p_ptnl_ler_for_per_id            =>  p_ptnl_ler_for_per_id
1025       ,p_csd_by_ptnl_ler_for_per_id     =>  p_csd_by_ptnl_ler_for_per_id
1026       ,p_lf_evt_ocrd_dt                 =>  trunc(p_lf_evt_ocrd_dt)
1027       ,p_trgr_table_pk_id               =>  p_trgr_table_pk_id
1028       ,p_ptnl_ler_for_per_stat_cd       =>  p_ptnl_ler_for_per_stat_cd
1029       ,p_ptnl_ler_for_per_src_cd        =>  p_ptnl_ler_for_per_src_cd
1030       ,p_mnl_dt                         =>  trunc(p_mnl_dt)
1031       ,p_enrt_perd_id                   =>  p_enrt_perd_id
1032       ,p_ler_id                         =>  p_ler_id
1033       ,p_person_id                      =>  p_person_id
1034       ,p_business_group_id              =>  p_business_group_id
1035       ,p_dtctd_dt                       =>  trunc(p_dtctd_dt)
1036       ,p_procd_dt                       =>  trunc(p_procd_dt)
1037       ,p_unprocd_dt                     =>  trunc(p_unprocd_dt)
1038       ,p_voidd_dt                       =>  trunc(p_voidd_dt)
1039       ,p_mnlo_dt                        =>  trunc(p_mnlo_dt)
1040       ,p_ntfn_dt                        =>  trunc(p_ntfn_dt)
1041       ,p_request_id                     =>  p_request_id
1042       ,p_program_application_id         =>  p_program_application_id
1043       ,p_program_id                     =>  p_program_id
1044       ,p_program_update_date            =>  trunc(p_program_update_date)
1045       ,p_object_version_number          =>  l_object_version_number
1046       ,p_effective_date                 =>  trunc(p_effective_date));
1047     --
1048   exception
1049     --
1050     when hr_api.cannot_find_prog_unit then
1051       --
1052       hr_api.cannot_find_prog_unit_error
1053         (p_module_name => 'UPDATE_ptnl_ler_for_per'
1054         ,p_hook_type   => 'AP');
1055     --
1056     -- End of API User Hook for the after hook of update_ptnl_ler_for_per
1057     --
1058   end;
1059   --
1060   -- When in validation only mode raise the Validate_Enabled exception
1061   --
1062   if p_validate then
1063     raise hr_api.validate_enabled;
1064   end if;
1065   --
1066   -- Set all output arguments
1067   --
1068   p_object_version_number := l_object_version_number;
1069   --
1070 exception
1071   --
1072   when hr_api.validate_enabled then
1073     --
1074     -- As the Validate_Enabled exception has been raised
1075     -- we must rollback to the savepoint
1076     --
1077     ROLLBACK TO update_ptnl_ler_for_per;
1078     --
1079     -- Only set output warning arguments
1080     -- (Any key or derived arguments must be set to null
1081     -- when validation only mode is being used.)
1082     --
1083   when others then
1084     --
1085     -- A validation or unexpected error has occured
1086     --
1087     /* Inserted for nocopy changes */
1088     p_object_version_number := l_object_version_number;
1089     raise;
1090     --
1091 end update_ptnl_ler_for_per_perf;
1092 -- ----------------------------------------------------------------------------
1093 -- |------------------------< delete_ptnl_ler_for_per >-----------------------|
1094 -- ----------------------------------------------------------------------------
1095 --
1096 procedure delete_ptnl_ler_for_per
1097   (p_validate                       in  boolean  default false
1098   ,p_ptnl_ler_for_per_id            in  number
1099   ,p_object_version_number          in out nocopy number
1100   ,p_effective_date                 in  date) is
1101   --
1102   -- Declare cursors and local variables
1103   --
1104   l_proc varchar2(72);
1105   l_object_version_number ben_ptnl_ler_for_per.object_version_number%TYPE;
1106   --
1107 begin
1108   --
1109   g_debug := hr_utility.debug_enabled;
1110   if g_debug then
1111     l_proc := g_package||'update_ptnl_ler_for_per';
1112     hr_utility.set_location('Entering:'|| l_proc, 10);
1113   end if;
1114   --
1115   -- Issue a savepoint if operating in validation only mode
1116   --
1117   if p_validate then
1118     --
1119     savepoint delete_ptnl_ler_for_per;
1120     --
1121   end if;
1122   --
1123   -- Process Logic
1124   --
1125   l_object_version_number := p_object_version_number;
1126   --
1127   begin
1128     --
1129     -- Start of API User Hook for the before hook of delete_ptnl_ler_for_per
1130     --
1131     ben_ptnl_ler_for_per_bk3.delete_ptnl_ler_for_per_b
1132       (p_ptnl_ler_for_per_id            =>  p_ptnl_ler_for_per_id
1133       ,p_object_version_number          =>  p_object_version_number
1134       ,p_effective_date                 =>  trunc(p_effective_date));
1135     --
1136   exception
1137     --
1138     when hr_api.cannot_find_prog_unit then
1139       --
1140       hr_api.cannot_find_prog_unit_error
1141         (p_module_name => 'DELETE_ptnl_ler_for_per'
1142         ,p_hook_type   => 'BP');
1143     --
1144     -- End of API User Hook for the before hook of delete_ptnl_ler_for_per
1145     --
1146   end;
1147   --
1148   ben_ppl_del.del
1149     (p_ptnl_ler_for_per_id           => p_ptnl_ler_for_per_id
1150     ,p_object_version_number         => l_object_version_number
1151     ,p_effective_date                => p_effective_date);
1152   --
1153   begin
1154     --
1155     -- Start of API User Hook for the after hook of delete_ptnl_ler_for_per
1156     --
1157     ben_ptnl_ler_for_per_bk3.delete_ptnl_ler_for_per_a
1158       (p_ptnl_ler_for_per_id            =>  p_ptnl_ler_for_per_id
1159       ,p_object_version_number          =>  l_object_version_number
1160       ,p_effective_date                 =>  trunc(p_effective_date));
1161     --
1162   exception
1163     --
1164     when hr_api.cannot_find_prog_unit then
1165       --
1166       hr_api.cannot_find_prog_unit_error
1167         (p_module_name => 'DELETE_ptnl_ler_for_per'
1168         ,p_hook_type   => 'AP');
1169     --
1170     -- End of API User Hook for the after hook of delete_ptnl_ler_for_per
1171     --
1172   end;
1173   --
1174   if g_debug then
1175     hr_utility.set_location(l_proc, 60);
1176   end if;
1177   --
1178   -- When in validation only mode raise the Validate_Enabled exception
1179   --
1180   if p_validate then
1181     raise hr_api.validate_enabled;
1182   end if;
1183   --
1184   if g_debug then
1185     hr_utility.set_location(' Leaving:'||l_proc, 70);
1186   end if;
1187   --
1188 exception
1189   --
1190   when hr_api.validate_enabled then
1191     --
1192     -- As the Validate_Enabled exception has been raised
1193     -- we must rollback to the savepoint
1194     --
1195     ROLLBACK TO delete_ptnl_ler_for_per;
1196     --
1197     -- Only set output warning arguments
1198     -- (Any key or derived arguments must be set to null
1199     -- when validation only mode is being used.)
1200     --
1201     --
1202   when others then
1203     --
1204     -- A validation or unexpected error has occured
1205     --
1206     /* Inserted for nocopy changes */
1207     p_object_version_number := l_object_version_number;
1208     raise;
1209     --
1210 end delete_ptnl_ler_for_per;
1211 --
1212 -- ----------------------------------------------------------------------------
1213 -- |-------------------------------< lck >------------------------------------|
1214 -- ----------------------------------------------------------------------------
1215 --
1216 procedure lck
1217   (p_ptnl_ler_for_per_id            in     number
1218   ,p_object_version_number          in     number) is
1219   --
1220   --
1221   -- Declare cursors and local variables
1222   --
1223   l_proc varchar2(72);
1224   --
1225 begin
1226   --
1227   g_debug := hr_utility.debug_enabled;
1228   if g_debug then
1229     l_proc := g_package||'lck';
1230     hr_utility.set_location('Entering:'|| l_proc, 10);
1231   end if;
1232   --
1233   ben_ppl_shd.lck
1234     (p_ptnl_ler_for_per_id        => p_ptnl_ler_for_per_id
1235     ,p_object_version_number      => p_object_version_number);
1236   --
1237   if g_debug then
1238      hr_utility.set_location(' Leaving:'||l_proc, 70);
1239   end if;
1240   --
1241 end lck;
1242 --
1243 end ben_ptnl_ler_for_per_api;