DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CPP_INS

Source


1 Package Body ben_cpp_ins as
2 /* $Header: becpprhi.pkb 120.0.12020000.2 2012/07/03 12:04:37 amnaraya ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_cpp_ins.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |----------------------------< dt_insert_dml >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the actual dml insert logic for datetrack. The
17 --   functions of this procedure are as follows:
18 --   1) Get the object_version_number.
19 --   2) To set the effective start and end dates to the corresponding
20 --      validation start and end dates. Also, the object version number
21 --      record attribute is set.
22 --   3) To set and unset the g_api_dml status as required (as we are about to
23 --      perform dml).
24 --   4) To insert the row into the schema with the derived effective start
25 --      and end dates and the object version number.
26 --   5) To trap any constraint violations that may have occurred.
27 --   6) To raise any other errors.
28 --
29 -- Prerequisites:
30 --   This is an internal private procedure which must be called from the
31 --   insert_dml and pre_update (logic permitting) procedure and must have
32 --   all mandatory arguments set.
33 --
34 -- In Parameters:
35 --   A Pl/Sql record structre.
36 --
37 -- Post Success:
38 --   The specified row will be inserted into the schema.
39 --
40 -- Post Failure:
41 --   On the insert dml failure it is important to note that we always reset the
42 --   g_api_dml status to false.
43 --   If a check or unique integrity constraint violation is raised the
44 --   constraint_error procedure will be called.
45 --   If any other error is reported, the error will be raised after the
46 --   g_api_dml status is reset.
47 --
48 -- Developer Implementation Notes:
49 --   This is an internal datetrack maintenance procedure which should
50 --   not be modified in anyway.
51 --
52 -- Access Status:
53 --   Internal Row Handler Use Only.
54 --
55 -- {End Of Comments}
56 -- ----------------------------------------------------------------------------
57 Procedure dt_insert_dml
58 	(p_rec 			 in out nocopy ben_cpp_shd.g_rec_type,
59 	 p_effective_date	 in	date,
60 	 p_datetrack_mode	 in	varchar2,
61 	 p_validation_start_date in	date,
62 	 p_validation_end_date	 in	date) is
63 --
64 -- Cursor to select 'old' created AOL who column values
65 --
66   Cursor C_Sel1 Is
67     select t.created_by,
68            t.creation_date
69     from   ben_plip_f t
70     where  t.plip_id       = p_rec.plip_id
71     and    t.effective_start_date =
72              ben_cpp_shd.g_old_rec.effective_start_date
73     and    t.effective_end_date   = (p_validation_start_date - 1);
74 --
75   l_proc		varchar2(72) := g_package||'dt_insert_dml';
76   l_created_by          ben_plip_f.created_by%TYPE;
77   l_creation_date       ben_plip_f.creation_date%TYPE;
78   l_last_update_date   	ben_plip_f.last_update_date%TYPE;
79   l_last_updated_by     ben_plip_f.last_updated_by%TYPE;
80   l_last_update_login   ben_plip_f.last_update_login%TYPE;
81 --
82 Begin
83   hr_utility.set_location('Entering:'||l_proc, 5);
84   --
85   -- Get the object version number for the insert
86   --
87   p_rec.object_version_number :=
88     dt_api.get_object_version_number
89 	(p_base_table_name => 'ben_plip_f',
90 	 p_base_key_column => 'plip_id',
91 	 p_base_key_value  => p_rec.plip_id);
92   --
93   -- Set the effective start and end dates to the corresponding
94   -- validation start and end dates
95   --
96   p_rec.effective_start_date := p_validation_start_date;
97   p_rec.effective_end_date   := p_validation_end_date;
98   --
99   -- If the datetrack_mode is not INSERT then we must populate the WHO
100   -- columns with the 'old' creation values and 'new' updated values.
101   --
102   If (p_datetrack_mode <> 'INSERT') then
103     hr_utility.set_location(l_proc, 10);
104     --
105     -- Select the 'old' created values
106     --
107     Open C_Sel1;
108     Fetch C_Sel1 Into l_created_by, l_creation_date;
109     If C_Sel1%notfound Then
110       --
111       -- The previous 'old' created row has not been found. We need
112       -- to error as an internal datetrack problem exists.
113       --
114       Close C_Sel1;
115       fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
116       fnd_message.set_token('PROCEDURE', l_proc);
117       fnd_message.set_token('STEP','10');
118       fnd_message.raise_error;
119     End If;
120     Close C_Sel1;
121     --
122     -- Set the AOL updated WHO values
123     --
124     l_last_update_date   := sysdate;
125     l_last_updated_by    := fnd_global.user_id;
126     l_last_update_login  := fnd_global.login_id;
127   End If;
128   --
129   ben_cpp_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_plip_f
132   --
133   insert into ben_plip_f
134   (	plip_id,
135 	effective_start_date,
136 	effective_end_date,
137 	business_group_id,
138 	pgm_id,
139 	pl_id,
140 	cmbn_plip_id,
141 	dflt_flag,
142 	plip_stat_cd,
143 	dflt_enrt_cd,
144 	dflt_enrt_det_rl,
145 	ordr_num,
146         alws_unrstrctd_enrt_flag,
147         auto_enrt_mthd_rl,
148         enrt_cd,
149         enrt_mthd_cd,
150         enrt_rl,
151 	ivr_ident,
152         url_ref_name,
153         enrt_cvg_strt_dt_cd,
154         enrt_cvg_strt_dt_rl,
155         enrt_cvg_end_dt_cd,
156         enrt_cvg_end_dt_rl,
157         rt_strt_dt_cd,
158         rt_strt_dt_rl,
159         rt_end_dt_cd,
160         rt_end_dt_rl,
161         drvbl_fctr_apls_rts_flag,
162         drvbl_fctr_prtn_elig_flag,
163         elig_apls_flag,
164         prtn_elig_ovrid_alwd_flag,
165         trk_inelig_per_flag,
166         postelcn_edit_rl,
167  	dflt_to_asn_pndg_ctfn_cd,
168         dflt_to_asn_pndg_ctfn_rl,
169         mn_cvg_amt,
170         mn_cvg_rl,
171         mx_cvg_alwd_amt,
172 	mx_cvg_incr_alwd_amt,
173 	mx_cvg_incr_wcf_alwd_amt,
174 	mx_cvg_mlt_incr_num,
175 	mx_cvg_mlt_incr_wcf_num,
176 	mx_cvg_rl,
177 	mx_cvg_wcfn_amt,
178 	mx_cvg_wcfn_mlt_num,
179 	no_mn_cvg_amt_apls_flag,
180 	no_mn_cvg_incr_apls_flag,
181 	no_mx_cvg_amt_apls_flag,
182 	no_mx_cvg_incr_apls_flag,
183 	unsspnd_enrt_cd,
184 	prort_prtl_yr_cvg_rstrn_cd,
185 	prort_prtl_yr_cvg_rstrn_rl,
186         cvg_incr_r_decr_only_cd,
187         bnft_or_option_rstrctn_cd,
188         per_cvrd_cd  ,
189         short_name  ,
190         short_code  ,
191                 legislation_code  ,
192                 legislation_subgroup  ,
193         vrfy_fmly_mmbr_rl,
194         vrfy_fmly_mmbr_cd,
195         use_csd_rsd_prccng_cd,
196 	cpp_attribute_category,
197 	cpp_attribute1,
198 	cpp_attribute2,
199 	cpp_attribute3,
200 	cpp_attribute4,
201 	cpp_attribute5,
202 	cpp_attribute6,
203 	cpp_attribute7,
204 	cpp_attribute8,
205 	cpp_attribute9,
206 	cpp_attribute10,
207 	cpp_attribute11,
208 	cpp_attribute12,
209 	cpp_attribute13,
210 	cpp_attribute14,
211 	cpp_attribute15,
212 	cpp_attribute16,
213 	cpp_attribute17,
214 	cpp_attribute18,
215 	cpp_attribute19,
216 	cpp_attribute20,
217 	cpp_attribute21,
218 	cpp_attribute22,
219 	cpp_attribute23,
220 	cpp_attribute24,
221 	cpp_attribute25,
222 	cpp_attribute26,
223 	cpp_attribute27,
224 	cpp_attribute28,
225 	cpp_attribute29,
226 	cpp_attribute30,
227 	object_version_number
228    	, created_by,
229    	creation_date,
230    	last_update_date,
231    	last_updated_by,
232    	last_update_login,
233 	all_inelig
234   )
235   Values
236   (	p_rec.plip_id,
237 	p_rec.effective_start_date,
238 	p_rec.effective_end_date,
239 	p_rec.business_group_id,
240 	p_rec.pgm_id,
241 	p_rec.pl_id,
242 	p_rec.cmbn_plip_id,
243 	p_rec.dflt_flag,
244 	p_rec.plip_stat_cd,
245 	p_rec.dflt_enrt_cd,
246 	p_rec.dflt_enrt_det_rl,
247 	p_rec.ordr_num,
248         p_rec.alws_unrstrctd_enrt_flag,
249         p_rec.auto_enrt_mthd_rl,
250         p_rec.enrt_cd,
251         p_rec.enrt_mthd_cd,
252         p_rec.enrt_rl,
253 	p_rec.ivr_ident,
254         p_rec.url_ref_name,
255         p_rec.enrt_cvg_strt_dt_cd,
256         p_rec.enrt_cvg_strt_dt_rl,
257         p_rec.enrt_cvg_end_dt_cd,
258         p_rec.enrt_cvg_end_dt_rl,
259         p_rec.rt_strt_dt_cd,
260         p_rec.rt_strt_dt_rl,
261         p_rec.rt_end_dt_cd,
262         p_rec.rt_end_dt_rl,
263         p_rec.drvbl_fctr_apls_rts_flag,
264         p_rec.drvbl_fctr_prtn_elig_flag,
265         p_rec.elig_apls_flag,
266         p_rec.prtn_elig_ovrid_alwd_flag,
267         p_rec.trk_inelig_per_flag,
268         p_rec.postelcn_edit_rl,
269  	p_rec.dflt_to_asn_pndg_ctfn_cd,
270         p_rec.dflt_to_asn_pndg_ctfn_rl,
271         p_rec.mn_cvg_amt,
272         p_rec.mn_cvg_rl,
273         p_rec.mx_cvg_alwd_amt,
274 	p_rec.mx_cvg_incr_alwd_amt,
275 	p_rec.mx_cvg_incr_wcf_alwd_amt,
276 	p_rec.mx_cvg_mlt_incr_num,
277 	p_rec.mx_cvg_mlt_incr_wcf_num,
278 	p_rec.mx_cvg_rl,
279 	p_rec.mx_cvg_wcfn_amt,
280 	p_rec.mx_cvg_wcfn_mlt_num,
281 	p_rec.no_mn_cvg_amt_apls_flag,
282 	p_rec.no_mn_cvg_incr_apls_flag,
283 	p_rec.no_mx_cvg_amt_apls_flag,
284 	p_rec.no_mx_cvg_incr_apls_flag,
285 	p_rec.unsspnd_enrt_cd,
286 	p_rec.prort_prtl_yr_cvg_rstrn_cd,
287 	p_rec.prort_prtl_yr_cvg_rstrn_rl,
288         p_rec.cvg_incr_r_decr_only_cd,
289         p_rec.bnft_or_option_rstrctn_cd,
290         P_rec.per_cvrd_cd  ,
291         P_rec.short_name  ,
292         P_rec.short_code  ,
293                 P_rec.legislation_code  ,
294                 P_rec.legislation_subgroup  ,
295         P_rec.vrfy_fmly_mmbr_rl,
296         P_rec.vrfy_fmly_mmbr_cd,
297         P_rec.use_csd_rsd_prccng_cd,
298 	p_rec.cpp_attribute_category,
299 	p_rec.cpp_attribute1,
300 	p_rec.cpp_attribute2,
301 	p_rec.cpp_attribute3,
302 	p_rec.cpp_attribute4,
303 	p_rec.cpp_attribute5,
304 	p_rec.cpp_attribute6,
305 	p_rec.cpp_attribute7,
306 	p_rec.cpp_attribute8,
307 	p_rec.cpp_attribute9,
308 	p_rec.cpp_attribute10,
309 	p_rec.cpp_attribute11,
310 	p_rec.cpp_attribute12,
311 	p_rec.cpp_attribute13,
312 	p_rec.cpp_attribute14,
313 	p_rec.cpp_attribute15,
314 	p_rec.cpp_attribute16,
315 	p_rec.cpp_attribute17,
316 	p_rec.cpp_attribute18,
317 	p_rec.cpp_attribute19,
318 	p_rec.cpp_attribute20,
319 	p_rec.cpp_attribute21,
320 	p_rec.cpp_attribute22,
321 	p_rec.cpp_attribute23,
322 	p_rec.cpp_attribute24,
323 	p_rec.cpp_attribute25,
324 	p_rec.cpp_attribute26,
325 	p_rec.cpp_attribute27,
326 	p_rec.cpp_attribute28,
327 	p_rec.cpp_attribute29,
328 	p_rec.cpp_attribute30,
329 	p_rec.object_version_number
330 	, l_created_by,
331    	l_creation_date,
332    	l_last_update_date,
333    	l_last_updated_by,
334    	l_last_update_login,
335 	p_rec.all_inelig
336   );
337   --
338   ben_cpp_shd.g_api_dml := false;   -- Unset the api dml status
339   hr_utility.set_location(' Leaving:'||l_proc, 15);
340 --
341 Exception
342   When hr_api.check_integrity_violated Then
343     -- A check constraint has been violated
344     ben_cpp_shd.g_api_dml := false;   -- Unset the api dml status
345     ben_cpp_shd.constraint_error
346       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
347   When hr_api.unique_integrity_violated Then
348     -- Unique integrity has been violated
349     ben_cpp_shd.g_api_dml := false;   -- Unset the api dml status
350     ben_cpp_shd.constraint_error
351       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
352   When Others Then
353     ben_cpp_shd.g_api_dml := false;   -- Unset the api dml status
354     Raise;
355 End dt_insert_dml;
356 --
357 -- ----------------------------------------------------------------------------
358 -- |------------------------------< insert_dml >------------------------------|
359 -- ----------------------------------------------------------------------------
360 Procedure insert_dml
361 	(p_rec 			 in out nocopy ben_cpp_shd.g_rec_type,
362 	 p_effective_date	 in	date,
363 	 p_datetrack_mode	 in	varchar2,
364 	 p_validation_start_date in	date,
365 	 p_validation_end_date	 in	date) is
366 --
367   l_proc	varchar2(72) := g_package||'insert_dml';
368 --
369 Begin
370   hr_utility.set_location('Entering:'||l_proc, 5);
371   --
372   dt_insert_dml(p_rec			=> p_rec,
373 		p_effective_date	=> p_effective_date,
374 		p_datetrack_mode	=> p_datetrack_mode,
375        		p_validation_start_date	=> p_validation_start_date,
376 		p_validation_end_date	=> p_validation_end_date);
377   --
378   hr_utility.set_location(' Leaving:'||l_proc, 10);
379 End insert_dml;
380 --
381 -- ----------------------------------------------------------------------------
382 -- |------------------------------< pre_insert >------------------------------|
383 -- ----------------------------------------------------------------------------
384 -- {Start Of Comments}
385 --
386 -- Description:
387 --   This private procedure contains any processing which is required before
388 --   the insert dml. Presently, if the entity has a corresponding primary
389 --   key which is maintained by an associating sequence, the  for
390 --   the entity will be populated with the next sequence value in
391 --   preparation for the insert dml.
392 --   Also, if comments are defined for this entity, the comments insert
393 --   logic will also be called, generating a comment_id if required.
394 --
395 -- Prerequisites:
396 --   This is an internal procedure which is called from the ins procedure.
397 --
398 -- In Parameters:
399 --   A Pl/Sql record structre.
400 --
401 -- Post Success:
402 --   Processing continues.
403 --
404 -- Post Failure:
405 --   If an error has occurred, an error message and exception will be raised
406 --   but not handled.
407 --
408 -- Developer Implementation Notes:
409 --   Any pre-processing required before the insert dml is issued should be
410 --   coded within this procedure. As stated above, a good example is the
411 --   generation of a primary key number via a corresponding sequence.
412 --   It is important to note that any 3rd party maintenance should be reviewed
413 --   before placing in this procedure.
414 --
415 -- Access Status:
416 --   Internal Row Handler Use Only.
417 --
418 -- {End Of Comments}
419 -- ----------------------------------------------------------------------------
420 Procedure pre_insert
421 	(p_rec  			in out nocopy ben_cpp_shd.g_rec_type,
422 	 p_effective_date		in date,
423 	 p_datetrack_mode		in varchar2,
424 	 p_validation_start_date	in date,
425 	 p_validation_end_date		in date) is
426 --
427   l_proc	varchar2(72) := g_package||'pre_insert';
428 --
429 --
430 cursor c1 is
431     select ben_plip_f_s.nextval
432     from   sys.dual;
433 --
434 Begin
435   hr_utility.set_location('Entering:'||l_proc, 5);
436   --
437   --
438 open c1;
439     --
440     fetch c1 into p_rec.plip_id;
441     --
442   close c1;
443   --
444   --
445   hr_utility.set_location(' Leaving:'||l_proc, 10);
446 End pre_insert;
447 --
448 -- ----------------------------------------------------------------------------
449 -- |-----------------------------< post_insert >------------------------------|
450 -- ----------------------------------------------------------------------------
451 -- {Start Of Comments}
452 --
453 -- Description:
454 --   This private procedure contains any processing which is required after the
455 --   insert dml.
456 --
457 -- Prerequisites:
458 --   This is an internal procedure which is called from the ins procedure.
459 --
460 -- In Parameters:
461 --   A Pl/Sql record structre.
462 --
463 -- Post Success:
464 --   Processing continues.
465 --
466 -- Post Failure:
467 --   If an error has occurred, an error message and exception will be raised
468 --   but not handled.
469 --
470 -- Developer Implementation Notes:
471 --   Any post-processing required after the insert dml is issued should be
472 --   coded within this procedure. It is important to note that any 3rd party
473 --   maintenance should be reviewed before placing in this procedure.
474 --
475 -- Access Status:
476 --   Internal Row Handler Use Only.
477 --
478 -- {End Of Comments}
479 -- ----------------------------------------------------------------------------
480 Procedure post_insert
481 	(p_rec 			 in ben_cpp_shd.g_rec_type,
482 	 p_effective_date	 in date,
483 	 p_datetrack_mode	 in varchar2,
484 	 p_validation_start_date in date,
485 	 p_validation_end_date	 in date) is
486 --
487   l_proc	varchar2(72) := g_package||'post_insert';
488 --
489 Begin
490   hr_utility.set_location('Entering:'||l_proc, 5);
491 --
492 -- Added for GSP validations
493 pqh_gsp_ben_validations.plip_validations
494   	(  p_plip_id			=> p_rec.plip_id
495   	 , p_effective_date 		=> p_effective_date
496   	 , p_dml_operation 		=> 'I'
497   	 , p_business_group_id  	=> p_rec.business_group_id
498   	 , p_Plip_Stat_Cd		=> p_rec.Plip_Stat_Cd
499   	 );
500 
501   --
502   -- Start of API User Hook for post_insert.
503   --
504   begin
505     --
506     ben_cpp_rki.after_insert
507       (
508   p_plip_id                       =>p_rec.plip_id
509  ,p_effective_start_date          =>p_rec.effective_start_date
510  ,p_effective_end_date            =>p_rec.effective_end_date
511  ,p_business_group_id             =>p_rec.business_group_id
512  ,p_pgm_id                        =>p_rec.pgm_id
513  ,p_pl_id                         =>p_rec.pl_id
514  ,p_cmbn_plip_id                  =>p_rec.cmbn_plip_id
515  ,p_dflt_flag                     =>p_rec.dflt_flag
516  ,p_plip_stat_cd                  =>p_rec.plip_stat_cd
517  ,p_dflt_enrt_cd                  =>p_rec.dflt_enrt_cd
518  ,p_dflt_enrt_det_rl              =>p_rec.dflt_enrt_det_rl
519  ,p_ordr_num                      =>p_rec.ordr_num
520  ,p_alws_unrstrctd_enrt_flag      =>p_rec.alws_unrstrctd_enrt_flag
521  ,p_auto_enrt_mthd_rl             =>p_rec.auto_enrt_mthd_rl
522  ,p_enrt_cd                       =>p_rec.enrt_cd
523  ,p_enrt_mthd_cd                  =>p_rec.enrt_mthd_cd
524  ,p_enrt_rl                       =>p_rec.enrt_rl
525  ,p_ivr_ident                     =>p_rec.ivr_ident
526  ,p_url_ref_name                  =>p_rec.url_ref_name
527  ,p_enrt_cvg_strt_dt_cd           =>p_rec.enrt_cvg_strt_dt_cd
528  ,p_enrt_cvg_strt_dt_rl           =>p_rec.enrt_cvg_strt_dt_rl
529  ,p_enrt_cvg_end_dt_cd            =>p_rec.enrt_cvg_end_dt_cd
530  ,p_enrt_cvg_end_dt_rl            =>p_rec.enrt_cvg_end_dt_rl
531  ,p_rt_strt_dt_cd                 =>p_rec.rt_strt_dt_cd
532  ,p_rt_strt_dt_rl                 =>p_rec.rt_strt_dt_rl
533  ,p_rt_end_dt_cd                  =>p_rec.rt_end_dt_cd
534  ,p_rt_end_dt_rl                  =>p_rec.rt_end_dt_rl
535  ,p_drvbl_fctr_apls_rts_flag      =>p_rec.drvbl_fctr_apls_rts_flag
536  ,p_drvbl_fctr_prtn_elig_flag     =>p_rec.drvbl_fctr_prtn_elig_flag
537  ,p_elig_apls_flag                =>p_rec.elig_apls_flag
538  ,p_prtn_elig_ovrid_alwd_flag     =>p_rec.prtn_elig_ovrid_alwd_flag
539  ,p_trk_inelig_per_flag           =>p_rec.trk_inelig_per_flag
540  ,p_postelcn_edit_rl              =>p_rec.postelcn_edit_rl
541  ,p_dflt_to_asn_pndg_ctfn_cd      =>p_rec.dflt_to_asn_pndg_ctfn_cd
542  ,p_dflt_to_asn_pndg_ctfn_rl      =>p_rec.dflt_to_asn_pndg_ctfn_rl
543  ,p_mn_cvg_amt                    =>p_rec.mn_cvg_amt
544  ,p_mn_cvg_rl                     => p_rec.mn_cvg_rl
545  ,p_mx_cvg_alwd_amt               => p_rec.mx_cvg_alwd_amt
546  ,p_mx_cvg_incr_alwd_amt          =>p_rec.mx_cvg_incr_alwd_amt
547  ,p_mx_cvg_incr_wcf_alwd_amt      =>p_rec.mx_cvg_incr_wcf_alwd_amt
548  ,p_mx_cvg_mlt_incr_num           =>p_rec.mx_cvg_mlt_incr_num
549  ,p_mx_cvg_mlt_incr_wcf_num       =>p_rec.mx_cvg_mlt_incr_wcf_num
550  ,p_mx_cvg_rl                     =>p_rec.mx_cvg_rl
551  ,p_mx_cvg_wcfn_amt               =>p_rec.mx_cvg_wcfn_amt
552  ,p_mx_cvg_wcfn_mlt_num           =>p_rec.mx_cvg_wcfn_mlt_num
553  ,p_no_mn_cvg_amt_apls_flag       =>p_rec.no_mn_cvg_amt_apls_flag
554  ,p_no_mn_cvg_incr_apls_flag      =>p_rec.no_mn_cvg_incr_apls_flag
555  ,p_no_mx_cvg_amt_apls_flag       =>p_rec.no_mx_cvg_amt_apls_flag
556  ,p_no_mx_cvg_incr_apls_flag      =>p_rec.no_mx_cvg_incr_apls_flag
557  ,p_unsspnd_enrt_cd               =>p_rec.unsspnd_enrt_cd
558  ,p_prort_prtl_yr_cvg_rstrn_cd    =>p_rec.prort_prtl_yr_cvg_rstrn_cd
559  ,p_prort_prtl_yr_cvg_rstrn_rl    =>p_rec.prort_prtl_yr_cvg_rstrn_rl
560  ,p_cvg_incr_r_decr_only_cd       =>p_rec.cvg_incr_r_decr_only_cd
561  ,p_bnft_or_option_rstrctn_cd     =>p_rec.bnft_or_option_rstrctn_cd
562  ,p_per_cvrd_cd                   =>p_rec.per_cvrd_cd
563  ,p_short_name                   =>p_rec.short_name
564  ,p_short_code                   =>p_rec.short_code
565   ,p_legislation_code                   =>p_rec.legislation_code
566   ,p_legislation_subgroup                   =>p_rec.legislation_subgroup
567  ,p_vrfy_fmly_mmbr_rl             =>p_rec.vrfy_fmly_mmbr_rl
568  ,p_vrfy_fmly_mmbr_cd             =>p_rec.vrfy_fmly_mmbr_cd
569  ,p_use_csd_rsd_prccng_cd         =>p_rec.use_csd_rsd_prccng_cd
570  ,p_cpp_attribute_category        =>p_rec.cpp_attribute_category
571  ,p_cpp_attribute1                =>p_rec.cpp_attribute1
572  ,p_cpp_attribute2                =>p_rec.cpp_attribute2
573  ,p_cpp_attribute3                =>p_rec.cpp_attribute3
574  ,p_cpp_attribute4                =>p_rec.cpp_attribute4
575  ,p_cpp_attribute5                =>p_rec.cpp_attribute5
576  ,p_cpp_attribute6                =>p_rec.cpp_attribute6
577  ,p_cpp_attribute7                =>p_rec.cpp_attribute7
578  ,p_cpp_attribute8                =>p_rec.cpp_attribute8
579  ,p_cpp_attribute9                =>p_rec.cpp_attribute9
580  ,p_cpp_attribute10               =>p_rec.cpp_attribute10
581  ,p_cpp_attribute11               =>p_rec.cpp_attribute11
582  ,p_cpp_attribute12               =>p_rec.cpp_attribute12
583  ,p_cpp_attribute13               =>p_rec.cpp_attribute13
584  ,p_cpp_attribute14               =>p_rec.cpp_attribute14
585  ,p_cpp_attribute15               =>p_rec.cpp_attribute15
586  ,p_cpp_attribute16               =>p_rec.cpp_attribute16
587  ,p_cpp_attribute17               =>p_rec.cpp_attribute17
588  ,p_cpp_attribute18               =>p_rec.cpp_attribute18
589  ,p_cpp_attribute19               =>p_rec.cpp_attribute19
590  ,p_cpp_attribute20               =>p_rec.cpp_attribute20
591  ,p_cpp_attribute21               =>p_rec.cpp_attribute21
592  ,p_cpp_attribute22               =>p_rec.cpp_attribute22
593  ,p_cpp_attribute23               =>p_rec.cpp_attribute23
594  ,p_cpp_attribute24               =>p_rec.cpp_attribute24
595  ,p_cpp_attribute25               =>p_rec.cpp_attribute25
596  ,p_cpp_attribute26               =>p_rec.cpp_attribute26
597  ,p_cpp_attribute27               =>p_rec.cpp_attribute27
598  ,p_cpp_attribute28               =>p_rec.cpp_attribute28
599  ,p_cpp_attribute29               =>p_rec.cpp_attribute29
600  ,p_cpp_attribute30               =>p_rec.cpp_attribute30
601  ,p_all_inelig                     =>p_rec.all_inelig
602  ,p_object_version_number         =>p_rec.object_version_number
603  ,p_effective_date                =>p_effective_date
604  ,p_validation_start_date         =>p_validation_start_date
605  ,p_validation_end_date           =>p_validation_end_date
606       );
607     --
608   exception
609     --
610     when hr_api.cannot_find_prog_unit then
611       --
612       hr_api.cannot_find_prog_unit_error
613         (p_module_name => 'ben_plip_f'
614         ,p_hook_type   => 'AI');
615       --
616   end;
617   --
618   -- End of API User Hook for post_insert.
619   --
620   --
621   hr_utility.set_location(' Leaving:'||l_proc, 10);
622 End post_insert;
623 --
624 -- ----------------------------------------------------------------------------
625 -- |-------------------------------< ins_lck >--------------------------------|
626 -- ----------------------------------------------------------------------------
627 -- {Start Of Comments}
628 --
629 -- Description:
630 --   The ins_lck process has one main function to perform. When inserting
631 --   a datetracked row, we must validate the DT mode.
632 --   be manipulated.
633 --
634 -- Prerequisites:
635 --   This procedure can only be called for the datetrack mode of INSERT.
636 --
637 -- In Parameters:
638 --
639 -- Post Success:
640 --   On successful completion of the ins_lck process the parental
641 --   datetracked rows will be locked providing the p_enforce_foreign_locking
642 --   argument value is TRUE.
643 --   If the p_enforce_foreign_locking argument value is FALSE then the
644 --   parential rows are not locked.
645 --
646 -- Post Failure:
647 --   The Lck process can fail for:
648 --   1) When attempting to lock the row the row could already be locked by
649 --      another user. This will raise the HR_Api.Object_Locked exception.
650 --   2) When attempting to the lock the parent which doesn't exist.
651 --      For the entity to be locked the parent must exist!
652 --
653 -- Developer Implementation Notes:
654 --   None.
655 --
656 -- Access Status:
657 --   Internal Row Handler Use Only.
658 --
659 -- {End Of Comments}
660 -- ----------------------------------------------------------------------------
661 Procedure ins_lck
662 	(p_effective_date	 in  date,
663 	 p_datetrack_mode	 in  varchar2,
664 	 p_rec	 		 in  ben_cpp_shd.g_rec_type,
665 	 p_validation_start_date out nocopy date,
666 	 p_validation_end_date	 out nocopy date) is
667 --
668   l_proc		  varchar2(72) := g_package||'ins_lck';
669   l_validation_start_date date;
670   l_validation_end_date	  date;
671 --
672 Begin
673   hr_utility.set_location('Entering:'||l_proc, 5);
674   --
675   -- Validate the datetrack mode mode getting the validation start
676   -- and end dates for the specified datetrack operation.
677   --
678   dt_api.validate_dt_mode
679 	(p_effective_date	   => p_effective_date,
680 	 p_datetrack_mode	   => p_datetrack_mode,
681 	 p_base_table_name	   => 'ben_plip_f',
682 	 p_base_key_column	   => 'plip_id',
683 	 p_base_key_value 	   => p_rec.plip_id,
684 	 p_parent_table_name1      => 'ff_formulas_f',
685 	 p_parent_key_column1      => 'formula_id',
686 	 p_parent_key_value1       => p_rec.dflt_enrt_det_rl,
687 	 p_parent_table_name2      => 'ben_pl_f',
688 	 p_parent_key_column2      => 'pl_id',
689 	 p_parent_key_value2       => p_rec.pl_id,
690 	 p_parent_table_name3      => 'ben_pgm_f',
691 	 p_parent_key_column3      => 'pgm_id',
692 	 p_parent_key_value3       => p_rec.pgm_id,
693 	 p_parent_table_name4      => 'ben_cmbn_plip_f',
694 	 p_parent_key_column4      => 'cmbn_plip_id',
695 	 p_parent_key_value4       => p_rec.cmbn_plip_id,
696          p_enforce_foreign_locking => true,
697 	 p_validation_start_date   => l_validation_start_date,
698  	 p_validation_end_date	   => l_validation_end_date);
699   --
700   -- Set the validation start and end date OUT arguments
701   --
702   p_validation_start_date := l_validation_start_date;
703   p_validation_end_date   := l_validation_end_date;
704   --
705   hr_utility.set_location(' Leaving:'||l_proc, 10);
706 --
707 End ins_lck;
708 --
709 -- ----------------------------------------------------------------------------
710 -- |---------------------------------< ins >----------------------------------|
711 -- ----------------------------------------------------------------------------
712 Procedure ins
713   (
714   p_rec		   in out nocopy ben_cpp_shd.g_rec_type,
715   p_effective_date in     date
716   ) is
717 --
718   l_proc			varchar2(72) := g_package||'ins';
719   l_datetrack_mode		varchar2(30) := 'INSERT';
720   l_validation_start_date	date;
721   l_validation_end_date		date;
722 --
723 Begin
724   hr_utility.set_location('Entering:'||l_proc, 5);
725   --
726   -- Call the lock operation
727   --
728   ins_lck
729 	(p_effective_date	 => p_effective_date,
730 	 p_datetrack_mode	 => l_datetrack_mode,
731 	 p_rec	 		 => p_rec,
732 	 p_validation_start_date => l_validation_start_date,
733 	 p_validation_end_date	 => l_validation_end_date);
734   --
735   -- Call the supporting insert validate operations
736   --
737   ben_cpp_bus.insert_validate
738 	(p_rec			 => p_rec,
739 	 p_effective_date	 => p_effective_date,
740 	 p_datetrack_mode	 => l_datetrack_mode,
741 	 p_validation_start_date => l_validation_start_date,
742 	 p_validation_end_date	 => l_validation_end_date);
743   --
744   -- Call the supporting pre-insert operation
745   --
746   pre_insert
747  	(p_rec			 => p_rec,
748 	 p_effective_date	 => p_effective_date,
749 	 p_datetrack_mode	 => l_datetrack_mode,
750 	 p_validation_start_date => l_validation_start_date,
751 	 p_validation_end_date	 => l_validation_end_date);
752   --
753   -- Insert the row
754   --
755   insert_dml
756  	(p_rec			 => p_rec,
757 	 p_effective_date	 => p_effective_date,
758 	 p_datetrack_mode	 => l_datetrack_mode,
759 	 p_validation_start_date => l_validation_start_date,
760 	 p_validation_end_date	 => l_validation_end_date);
761   --
762   -- Call the supporting post-insert operation
763   --
764   post_insert
765  	(p_rec			 => p_rec,
766 	 p_effective_date	 => p_effective_date,
767 	 p_datetrack_mode	 => l_datetrack_mode,
768 	 p_validation_start_date => l_validation_start_date,
769 	 p_validation_end_date	 => l_validation_end_date);
770 end ins;
771 --
772 -- ----------------------------------------------------------------------------
773 -- |---------------------------------< ins >----------------------------------|
774 -- ----------------------------------------------------------------------------
775 Procedure ins
776   (
777   p_plip_id                      out nocopy number,
778   p_effective_start_date         out nocopy date,
779   p_effective_end_date           out nocopy date,
780   p_business_group_id            in number,
781   p_pgm_id                       in number,
782   p_pl_id                        in number,
783   p_cmbn_plip_id                 in number,
784   p_dflt_flag                    in varchar2,
785   p_plip_stat_cd                 in varchar2,
786   p_dflt_enrt_cd                 in varchar2,
787   p_dflt_enrt_det_rl             in number  ,
788   p_ordr_num                     in number  ,
789   p_alws_unrstrctd_enrt_flag     in varchar2,
790   p_auto_enrt_mthd_rl            in number  ,
791   p_enrt_cd                      in varchar2,
792   p_enrt_mthd_cd                 in varchar2,
793   p_enrt_rl                      in number  ,
794   p_ivr_ident                    in varchar2,
795   p_url_ref_name                 in varchar2,
796   p_enrt_cvg_strt_dt_cd          in varchar2,
797   p_enrt_cvg_strt_dt_rl          in number  ,
798   p_enrt_cvg_end_dt_cd           in varchar2,
799   p_enrt_cvg_end_dt_rl           in number  ,
800   p_rt_strt_dt_cd                in varchar2,
801   p_rt_strt_dt_rl                in number  ,
802   p_rt_end_dt_cd                 in varchar2,
803   p_rt_end_dt_rl                 in number  ,
804   p_drvbl_fctr_apls_rts_flag     in varchar2,
805   p_drvbl_fctr_prtn_elig_flag    in varchar2,
806   p_elig_apls_flag               in varchar2,
807   p_prtn_elig_ovrid_alwd_flag    in varchar2,
808   p_trk_inelig_per_flag          in varchar2,
809   p_postelcn_edit_rl             in number  ,
810   p_dflt_to_asn_pndg_ctfn_cd     in varchar2,
811   p_dflt_to_asn_pndg_ctfn_rl     in number  ,
812   p_mn_cvg_amt                   in number  ,
813   p_mn_cvg_rl                     in number ,
814   p_mx_cvg_alwd_amt               in number ,
815   p_mx_cvg_incr_alwd_amt          in number ,
816   p_mx_cvg_incr_wcf_alwd_amt      in number ,
817   p_mx_cvg_mlt_incr_num           in number ,
818   p_mx_cvg_mlt_incr_wcf_num       in number ,
819   p_mx_cvg_rl                     in number ,
820   p_mx_cvg_wcfn_amt               in number ,
821   p_mx_cvg_wcfn_mlt_num           in number ,
822   p_no_mn_cvg_amt_apls_flag       in varchar2,
823   p_no_mn_cvg_incr_apls_flag      in varchar2,
824   p_no_mx_cvg_amt_apls_flag       in varchar2,
825   p_no_mx_cvg_incr_apls_flag      in varchar2,
826   p_unsspnd_enrt_cd               in varchar2,
827   p_prort_prtl_yr_cvg_rstrn_cd    in varchar2,
828   p_prort_prtl_yr_cvg_rstrn_rl    in number  ,
829   p_cvg_incr_r_decr_only_cd      in varchar2 ,
830   p_bnft_or_option_rstrctn_cd    in varchar2 ,
831   p_per_cvrd_cd                  in varchar2 ,
832   p_short_name                  in varchar2 ,
833   p_short_code                  in varchar2 ,
834     p_legislation_code                  in varchar2 ,
835     p_legislation_subgroup                  in varchar2 ,
836   P_vrfy_fmly_mmbr_rl            in number   ,
837   P_vrfy_fmly_mmbr_cd            in varchar2 ,
838   P_use_csd_rsd_prccng_cd        in varchar2 ,
839   p_cpp_attribute_category       in varchar2,
840   p_cpp_attribute1               in varchar2,
841   p_cpp_attribute2               in varchar2,
842   p_cpp_attribute3               in varchar2,
843   p_cpp_attribute4               in varchar2,
844   p_cpp_attribute5               in varchar2,
845   p_cpp_attribute6               in varchar2,
846   p_cpp_attribute7               in varchar2,
847   p_cpp_attribute8               in varchar2,
848   p_cpp_attribute9               in varchar2,
849   p_cpp_attribute10              in varchar2,
850   p_cpp_attribute11              in varchar2,
851   p_cpp_attribute12              in varchar2,
852   p_cpp_attribute13              in varchar2,
853   p_cpp_attribute14              in varchar2,
854   p_cpp_attribute15              in varchar2,
855   p_cpp_attribute16              in varchar2,
856   p_cpp_attribute17              in varchar2,
857   p_cpp_attribute18              in varchar2,
858   p_cpp_attribute19              in varchar2,
859   p_cpp_attribute20              in varchar2,
860   p_cpp_attribute21              in varchar2,
861   p_cpp_attribute22              in varchar2,
862   p_cpp_attribute23              in varchar2,
863   p_cpp_attribute24              in varchar2,
864   p_cpp_attribute25              in varchar2,
865   p_cpp_attribute26              in varchar2,
866   p_cpp_attribute27              in varchar2,
867   p_cpp_attribute28              in varchar2,
868   p_cpp_attribute29              in varchar2,
869   p_cpp_attribute30              in varchar2,
870   p_all_inelig                     in  varchar2,
871   p_object_version_number        out nocopy number,
872   p_effective_date		 in date
873   ) is
874 --
875   l_rec		ben_cpp_shd.g_rec_type;
876   l_proc	varchar2(72) := g_package||'ins';
877 --
878 Begin
879   hr_utility.set_location('Entering:'||l_proc, 5);
880   --
881   -- Call conversion function to turn arguments into the
882   -- p_rec structure.
883   --
884   l_rec :=
885   ben_cpp_shd.convert_args
886   (
887   null,
888   null,
889   null,
890   p_business_group_id,
891   p_pgm_id,
892   p_pl_id,
893   p_cmbn_plip_id,
894   p_dflt_flag,
895   p_plip_stat_cd,
896   p_dflt_enrt_cd,
897   p_dflt_enrt_det_rl,
898   p_ordr_num,
899   p_alws_unrstrctd_enrt_flag,
900   p_auto_enrt_mthd_rl,
901   p_enrt_cd,
902   p_enrt_mthd_cd,
903   p_enrt_rl,
904   p_ivr_ident,
905   p_url_ref_name,
906   p_enrt_cvg_strt_dt_cd,
907   p_enrt_cvg_strt_dt_rl,
908   p_enrt_cvg_end_dt_cd,
909   p_enrt_cvg_end_dt_rl,
910   p_rt_strt_dt_cd,
911   p_rt_strt_dt_rl,
912   p_rt_end_dt_cd,
913   p_rt_end_dt_rl,
914   p_drvbl_fctr_apls_rts_flag,
915   p_drvbl_fctr_prtn_elig_flag,
916   p_elig_apls_flag,
917   p_prtn_elig_ovrid_alwd_flag,
918   p_trk_inelig_per_flag,
919   p_postelcn_edit_rl,
920   p_dflt_to_asn_pndg_ctfn_cd,
921   p_dflt_to_asn_pndg_ctfn_rl,
922   p_mn_cvg_amt,
923   p_mn_cvg_rl,
924   p_mx_cvg_alwd_amt,
925   p_mx_cvg_incr_alwd_amt,
926   p_mx_cvg_incr_wcf_alwd_amt,
927   p_mx_cvg_mlt_incr_num,
928   p_mx_cvg_mlt_incr_wcf_num,
929   p_mx_cvg_rl,
930   p_mx_cvg_wcfn_amt,
931   p_mx_cvg_wcfn_mlt_num,
932   p_no_mn_cvg_amt_apls_flag,
933   p_no_mn_cvg_incr_apls_flag,
934   p_no_mx_cvg_amt_apls_flag,
935   p_no_mx_cvg_incr_apls_flag,
936   p_unsspnd_enrt_cd,
937   p_prort_prtl_yr_cvg_rstrn_cd,
938   p_prort_prtl_yr_cvg_rstrn_rl,
939   p_cvg_incr_r_decr_only_cd,
940   p_bnft_or_option_rstrctn_cd,
941   p_per_cvrd_cd,
942   p_short_name,
943   p_short_code,
944     p_legislation_code,
945     p_legislation_subgroup,
946   P_vrfy_fmly_mmbr_rl,
947   P_vrfy_fmly_mmbr_cd,
948   P_use_csd_rsd_prccng_cd,
949   p_cpp_attribute_category,
950   p_cpp_attribute1,
951   p_cpp_attribute2,
952   p_cpp_attribute3,
953   p_cpp_attribute4,
954   p_cpp_attribute5,
955   p_cpp_attribute6,
956   p_cpp_attribute7,
957   p_cpp_attribute8,
958   p_cpp_attribute9,
959   p_cpp_attribute10,
960   p_cpp_attribute11,
961   p_cpp_attribute12,
962   p_cpp_attribute13,
963   p_cpp_attribute14,
964   p_cpp_attribute15,
965   p_cpp_attribute16,
966   p_cpp_attribute17,
967   p_cpp_attribute18,
968   p_cpp_attribute19,
969   p_cpp_attribute20,
970   p_cpp_attribute21,
971   p_cpp_attribute22,
972   p_cpp_attribute23,
973   p_cpp_attribute24,
974   p_cpp_attribute25,
975   p_cpp_attribute26,
976   p_cpp_attribute27,
977   p_cpp_attribute28,
978   p_cpp_attribute29,
979   p_cpp_attribute30,
980   p_all_inelig,
981   null
982   );
983   --
984   -- Having converted the arguments into the ben_cpp_rec
985   -- plsql record structure we call the corresponding record
986   -- business process.
987   --
988   ins(l_rec, p_effective_date);
989   --
990   -- Set the OUT arguments.
991   --
992   p_plip_id        	:= l_rec.plip_id;
993   p_effective_start_date  	:= l_rec.effective_start_date;
994   p_effective_end_date    	:= l_rec.effective_end_date;
995   p_object_version_number 	:= l_rec.object_version_number;
996   --
997   --
998   hr_utility.set_location(' Leaving:'||l_proc, 10);
999 End ins;
1000 --
1001 end ben_cpp_ins;