DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PEP_INS

Source


4 -- ----------------------------------------------------------------------------
1 Package Body ben_pep_ins as
2 /* $Header: bepeprhi.pkb 120.0 2005/05/28 10:39:57 appldev noship $ */
3 --
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)    := '  ben_pep_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_pep_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_elig_per_f t
70     where  t.elig_per_id       = p_rec.elig_per_id
71     and    t.effective_start_date =
72              ben_pep_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_elig_per_f.created_by%TYPE;
77   l_creation_date       ben_elig_per_f.creation_date%TYPE;
78   l_last_update_date       ben_elig_per_f.last_update_date%TYPE;
79   l_last_updated_by     ben_elig_per_f.last_updated_by%TYPE;
80   l_last_update_login   ben_elig_per_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_elig_per_f',
90      p_base_key_column => 'elig_per_id',
91      p_base_key_value  => p_rec.elig_per_id);
92   hr_utility.set_location('Dn DTAPI_GOVN:'||l_proc, 5);
93   --
94   -- Set the effective start and end dates to the corresponding
95   -- validation start and end dates
96   --
97   p_rec.effective_start_date := p_validation_start_date;
98   p_rec.effective_end_date   := p_validation_end_date;
99   --
100   -- If the datetrack_mode is not INSERT then we must populate the WHO
101   -- columns with the 'old' creation values and 'new' updated values.
102   --
103   If (p_datetrack_mode <> 'INSERT') then
104     hr_utility.set_location(l_proc, 10);
105     --
106     -- Select the 'old' created values
107     --
108     Open C_Sel1;
109     Fetch C_Sel1 Into l_created_by, l_creation_date;
110     If C_Sel1%notfound Then
111       --
112       -- The previous 'old' created row has not been found. We need
116       fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
113       -- to error as an internal datetrack problem exists.
114       --
115       Close C_Sel1;
117       fnd_message.set_token('PROCEDURE', l_proc);
118       fnd_message.set_token('STEP','10');
119       fnd_message.raise_error;
120     End If;
121     Close C_Sel1;
122     --
123     -- Set the AOL updated WHO values
124     --
125     l_last_update_date   := sysdate;
126     l_last_updated_by    := fnd_global.user_id;
127     l_last_update_login  := fnd_global.login_id;
128   End If;
129   --
130   ben_pep_shd.g_api_dml := true;  -- Set the api dml status
131   --
132   -- Insert the row into: ben_elig_per_f
133   --
134   hr_utility.set_location('Ins PEP:'||l_proc, 5);
135   insert into ben_elig_per_f
136   (
137     elig_per_id,
138     effective_start_date,
139     effective_end_date,
140     business_group_id,
141     pl_id,
142     pgm_id,
143     plip_id,
144     ptip_id,
145     ler_id,
146     person_id,
147     per_in_ler_id,
148     dpnt_othr_pl_cvrd_rl_flag,
149     prtn_ovridn_thru_dt,
150     pl_key_ee_flag,
151     pl_hghly_compd_flag,
152     elig_flag,
153     comp_ref_amt,
154     cmbn_age_n_los_val,
155     comp_ref_uom,
156     age_val,
157     los_val,
158     prtn_end_dt,
159     prtn_strt_dt,
160     wait_perd_cmpltn_dt,
161     wait_perd_strt_dt ,
162     wv_ctfn_typ_cd,
163     hrs_wkd_val,
164     hrs_wkd_bndry_perd_cd,
165     prtn_ovridn_flag,
166     no_mx_prtn_ovrid_thru_flag,
167     prtn_ovridn_rsn_cd,
168     age_uom,
169     los_uom,
170     ovrid_svc_dt,
171     inelg_rsn_cd,
172     frz_los_flag,
173     frz_age_flag,
174     frz_cmp_lvl_flag,
175     frz_pct_fl_tm_flag,
176     frz_hrs_wkd_flag,
177     frz_comb_age_and_los_flag,
178     dstr_rstcn_flag,
179     pct_fl_tm_val,
180     wv_prtn_rsn_cd,
181     pl_wvd_flag,
182     rt_comp_ref_amt,
183     rt_cmbn_age_n_los_val,
184     rt_comp_ref_uom,
185     rt_age_val,
186     rt_los_val,
187     rt_hrs_wkd_val,
188     rt_hrs_wkd_bndry_perd_cd,
189     rt_age_uom,
190     rt_los_uom,
191     rt_pct_fl_tm_val,
192     rt_frz_los_flag,
193     rt_frz_age_flag,
194     rt_frz_cmp_lvl_flag,
195     rt_frz_pct_fl_tm_flag,
196     rt_frz_hrs_wkd_flag,
197     rt_frz_comb_age_and_los_flag,
198     once_r_cntug_cd,
199     pl_ordr_num,
200     plip_ordr_num,
201     ptip_ordr_num,
202     pep_attribute_category,
203     pep_attribute1,
204     pep_attribute2,
205     pep_attribute3,
206     pep_attribute4,
207     pep_attribute5,
208     pep_attribute6,
209     pep_attribute7,
210     pep_attribute8,
211     pep_attribute9,
212     pep_attribute10,
213     pep_attribute11,
214     pep_attribute12,
215     pep_attribute13,
216     pep_attribute14,
217     pep_attribute15,
218     pep_attribute16,
219     pep_attribute17,
220     pep_attribute18,
221     pep_attribute19,
222     pep_attribute20,
223     pep_attribute21,
224     pep_attribute22,
225     pep_attribute23,
226     pep_attribute24,
227     pep_attribute25,
228     pep_attribute26,
229     pep_attribute27,
230     pep_attribute28,
231     pep_attribute29,
232     pep_attribute30,
233     request_id,
234     program_application_id,
235     program_id,
236     program_update_date,
237     object_version_number,
238     created_by,
239     creation_date,
240     last_update_date,
241     last_updated_by,
242     last_update_login
243   )
244   Values
245   (
246     p_rec.elig_per_id,
247     p_rec.effective_start_date,
248     p_rec.effective_end_date,
249     p_rec.business_group_id,
250     p_rec.pl_id,
251     p_rec.pgm_id,
252     p_rec.plip_id,
253     p_rec.ptip_id,
254     p_rec.ler_id,
255     p_rec.person_id,
256     p_rec.per_in_ler_id,
257     p_rec.dpnt_othr_pl_cvrd_rl_flag,
258     p_rec.prtn_ovridn_thru_dt,
259     p_rec.pl_key_ee_flag,
260     p_rec.pl_hghly_compd_flag,
261     p_rec.elig_flag,
262     p_rec.comp_ref_amt,
263     p_rec.cmbn_age_n_los_val,
264     p_rec.comp_ref_uom,
265     p_rec.age_val,
266     p_rec.los_val,
267     p_rec.prtn_end_dt,
268     p_rec.prtn_strt_dt,
269     p_rec.wait_perd_cmpltn_dt,
270     p_rec.wait_perd_strt_dt ,
271     p_rec.wv_ctfn_typ_cd,
272     p_rec.hrs_wkd_val,
273     p_rec.hrs_wkd_bndry_perd_cd,
274     p_rec.prtn_ovridn_flag,
275     p_rec.no_mx_prtn_ovrid_thru_flag,
276     p_rec.prtn_ovridn_rsn_cd,
277     p_rec.age_uom,
278     p_rec.los_uom,
279     p_rec.ovrid_svc_dt,
280     p_rec.inelg_rsn_cd,
281     p_rec.frz_los_flag,
282     p_rec.frz_age_flag,
283     p_rec.frz_cmp_lvl_flag,
284     p_rec.frz_pct_fl_tm_flag,
285     p_rec.frz_hrs_wkd_flag,
286     p_rec.frz_comb_age_and_los_flag,
287     p_rec.dstr_rstcn_flag,
288     p_rec.pct_fl_tm_val,
289     p_rec.wv_prtn_rsn_cd,
290     p_rec.pl_wvd_flag,
291     p_rec.rt_comp_ref_amt,
292     p_rec.rt_cmbn_age_n_los_val,
293     p_rec.rt_comp_ref_uom,
294     p_rec.rt_age_val,
295     p_rec.rt_los_val,
296     p_rec.rt_hrs_wkd_val,
297     p_rec.rt_hrs_wkd_bndry_perd_cd,
298     p_rec.rt_age_uom,
299     p_rec.rt_los_uom,
300     p_rec.rt_pct_fl_tm_val,
301     p_rec.rt_frz_los_flag,
302     p_rec.rt_frz_age_flag,
303     p_rec.rt_frz_cmp_lvl_flag,
307     p_rec.once_r_cntug_cd,
304     p_rec.rt_frz_pct_fl_tm_flag,
305     p_rec.rt_frz_hrs_wkd_flag,
306     p_rec.rt_frz_comb_age_and_los_flag,
308     p_rec.pl_ordr_num,
309     p_rec.plip_ordr_num,
310     p_rec.ptip_ordr_num,
311     p_rec.pep_attribute_category,
312     p_rec.pep_attribute1,
313     p_rec.pep_attribute2,
314     p_rec.pep_attribute3,
315     p_rec.pep_attribute4,
316     p_rec.pep_attribute5,
317     p_rec.pep_attribute6,
318     p_rec.pep_attribute7,
319     p_rec.pep_attribute8,
320     p_rec.pep_attribute9,
321     p_rec.pep_attribute10,
322     p_rec.pep_attribute11,
323     p_rec.pep_attribute12,
324     p_rec.pep_attribute13,
325     p_rec.pep_attribute14,
326     p_rec.pep_attribute15,
327     p_rec.pep_attribute16,
328     p_rec.pep_attribute17,
329     p_rec.pep_attribute18,
330     p_rec.pep_attribute19,
331     p_rec.pep_attribute20,
332     p_rec.pep_attribute21,
333     p_rec.pep_attribute22,
334     p_rec.pep_attribute23,
335     p_rec.pep_attribute24,
336     p_rec.pep_attribute25,
337     p_rec.pep_attribute26,
338     p_rec.pep_attribute27,
339     p_rec.pep_attribute28,
340     p_rec.pep_attribute29,
341     p_rec.pep_attribute30,
342     p_rec.request_id,
343     p_rec.program_application_id,
344     p_rec.program_id,
345     p_rec.program_update_date,
346     p_rec.object_version_number,
347     l_created_by,
348     l_creation_date,
349     l_last_update_date,
350     l_last_updated_by,
351     l_last_update_login
352   );
353   --
354   ben_pep_shd.g_api_dml := false;   -- Unset the api dml status
355   hr_utility.set_location(' Leaving:'||l_proc, 15);
356 --
357 Exception
358   When hr_api.check_integrity_violated Then
359     -- A check constraint has been violated
360     ben_pep_shd.g_api_dml := false;   -- Unset the api dml status
361     ben_pep_shd.constraint_error
362       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
363   When hr_api.unique_integrity_violated Then
364     -- Unique integrity has been violated
365     ben_pep_shd.g_api_dml := false;   -- Unset the api dml status
366     ben_pep_shd.constraint_error
367       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
368   When Others Then
369     ben_pep_shd.g_api_dml := false;   -- Unset the api dml status
370     Raise;
371 End dt_insert_dml;
372 --
373 -- ----------------------------------------------------------------------------
374 -- |------------------------------< insert_dml >------------------------------|
375 -- ----------------------------------------------------------------------------
376 Procedure insert_dml
377     (p_rec              in out nocopy ben_pep_shd.g_rec_type,
378      p_effective_date     in    date,
379      p_datetrack_mode     in    varchar2,
380      p_validation_start_date in    date,
381      p_validation_end_date     in    date) is
382 --
383   l_proc    varchar2(72) := g_package||'insert_dml';
384 --
385 Begin
386   hr_utility.set_location('Entering:'||l_proc, 5);
387   --
388   dt_insert_dml(p_rec            => p_rec,
389         p_effective_date    => p_effective_date,
390         p_datetrack_mode    => p_datetrack_mode,
391                p_validation_start_date    => p_validation_start_date,
392         p_validation_end_date    => p_validation_end_date);
393   --
394   hr_utility.set_location(' Leaving:'||l_proc, 10);
395 End insert_dml;
396 --
397 -- ----------------------------------------------------------------------------
398 -- |------------------------------< pre_insert >------------------------------|
399 -- ----------------------------------------------------------------------------
400 -- {Start Of Comments}
401 --
402 -- Description:
403 --   This private procedure contains any processing which is required before
404 --   the insert dml. Presently, if the entity has a corresponding primary
405 --   key which is maintained by an associating sequence, the primary key for
406 --   the entity will be populated with the next sequence value in
407 --   preparation for the insert dml.
408 --   Also, if comments are defined for this entity, the comments insert
409 --   logic will also be called, generating a comment_id if required.
410 --
411 -- Prerequisites:
412 --   This is an internal procedure which is called from the ins procedure.
413 --
414 -- In Parameters:
415 --   A Pl/Sql record structre.
416 --
417 -- Post Success:
418 --   Processing continues.
419 --
420 -- Post Failure:
421 --   If an error has occurred, an error message and exception will be raised
422 --   but not handled.
423 --
424 -- Developer Implementation Notes:
425 --   Any pre-processing required before the insert dml is issued should be
426 --   coded within this procedure. As stated above, a good example is the
427 --   generation of a primary key number via a corresponding sequence.
428 --   It is important to note that any 3rd party maintenance should be reviewed
429 --   before placing in this procedure.
430 --
431 -- Access Status:
432 --   Internal Row Handler Use Only.
433 --
434 -- {End Of Comments}
435 -- ----------------------------------------------------------------------------
436 Procedure pre_insert
437     (p_rec              in out nocopy ben_pep_shd.g_rec_type,
438      p_effective_date        in date,
439      p_datetrack_mode        in varchar2,
440      p_validation_start_date    in date,
441      p_validation_end_date        in date) is
442 --
443   l_proc    varchar2(72) := g_package||'pre_insert';
444 --
445   Cursor C_Sel1 is select ben_elig_per_f_s.nextval from sys.dual;
446 --
447 Begin
448   hr_utility.set_location('Entering:'||l_proc, 5);
449   --
453   Open C_Sel1;
450   --
451   -- Select the next sequence number
452   --
454   Fetch C_Sel1 Into p_rec.elig_per_id;
455   Close C_Sel1;
456   --
457   --
458   hr_utility.set_location(' Leaving:'||l_proc, 10);
459 End pre_insert;
460 --
461 -- ----------------------------------------------------------------------------
462 -- |-----------------------------< post_insert >------------------------------|
463 -- ----------------------------------------------------------------------------
464 -- {Start Of Comments}
465 --
466 -- Description:
467 --   This private procedure contains any processing which is required after the
468 --   insert dml.
469 --
470 -- Prerequisites:
471 --   This is an internal procedure which is called from the ins procedure.
472 --
473 -- In Parameters:
474 --   A Pl/Sql record structre.
475 --
476 -- Post Success:
477 --   Processing continues.
478 --
479 -- Post Failure:
480 --   If an error has occurred, an error message and exception will be raised
481 --   but not handled.
482 --
483 -- Developer Implementation Notes:
484 --   Any post-processing required after the insert dml is issued should be
485 --   coded within this procedure. It is important to note that any 3rd party
486 --   maintenance should be reviewed before placing in this procedure.
487 --
488 -- Access Status:
489 --   Internal Row Handler Use Only.
490 --
491 -- {End Of Comments}
492 -- ----------------------------------------------------------------------------
493 Procedure post_insert
494     (p_rec              in ben_pep_shd.g_rec_type,
495      p_effective_date     in date,
496      p_datetrack_mode     in varchar2,
497      p_validation_start_date in date,
498      p_validation_end_date     in date) is
499 --
500   l_proc    varchar2(72) := g_package||'post_insert';
501 --
502 Begin
503   hr_utility.set_location('Entering:'||l_proc, 5);
504   --
505 ben_pep_rki.after_insert
506   (
507  p_elig_per_id                    => p_rec.elig_per_id,
508  p_effective_start_date           => p_rec.effective_start_date,
509  p_effective_end_date             => p_rec.effective_end_date,
510  p_business_group_id              => p_rec.business_group_id,
511  p_pl_id                          => p_rec.pl_id,
512  p_pgm_id                         => p_rec.pgm_id,
513  p_plip_id                        => p_rec.plip_id,
514  p_ptip_id                        => p_rec.ptip_id,
515  p_ler_id                         => p_rec.ler_id,
516  p_person_id                      => p_rec.person_id,
517  p_per_in_ler_id                      => p_rec.per_in_ler_id,
518  p_dpnt_othr_pl_cvrd_rl_flag      => p_rec.dpnt_othr_pl_cvrd_rl_flag,
519  p_prtn_ovridn_thru_dt            => p_rec.prtn_ovridn_thru_dt,
520  p_pl_key_ee_flag                 => p_rec.pl_key_ee_flag,
521  p_pl_hghly_compd_flag            => p_rec.pl_hghly_compd_flag,
522  p_elig_flag                      => p_rec.elig_flag,
523  p_comp_ref_amt                   => p_rec.comp_ref_amt,
524  p_cmbn_age_n_los_val             => p_rec.cmbn_age_n_los_val,
525  p_comp_ref_uom                   => p_rec.comp_ref_uom,
526  p_age_val                        => p_rec.age_val,
527  p_los_val                        => p_rec.los_val,
528  p_prtn_end_dt                    => p_rec.prtn_end_dt,
529  p_prtn_strt_dt                   => p_rec.prtn_strt_dt,
530  p_wait_perd_cmpltn_dt            => p_rec.wait_perd_cmpltn_dt,
531  p_wait_perd_strt_dt              => p_rec.wait_perd_strt_dt  ,
532  p_wv_ctfn_typ_cd                 => p_rec.wv_ctfn_typ_cd,
533  p_hrs_wkd_val                    => p_rec.hrs_wkd_val,
534  p_hrs_wkd_bndry_perd_cd          => p_rec.hrs_wkd_bndry_perd_cd,
535  p_prtn_ovridn_flag               => p_rec.prtn_ovridn_flag,
536  p_no_mx_prtn_ovrid_thru_flag     => p_rec.no_mx_prtn_ovrid_thru_flag,
537  p_prtn_ovridn_rsn_cd             => p_rec.prtn_ovridn_rsn_cd,
538  p_age_uom                        => p_rec.age_uom,
539  p_los_uom                        => p_rec.los_uom,
540  p_ovrid_svc_dt                   => p_rec.ovrid_svc_dt,
541  p_inelg_rsn_cd                   => p_rec.inelg_rsn_cd,
542  p_frz_los_flag                   => p_rec.frz_los_flag,
543  p_frz_age_flag                   => p_rec.frz_age_flag,
544  p_frz_cmp_lvl_flag               => p_rec.frz_cmp_lvl_flag,
545  p_frz_pct_fl_tm_flag             => p_rec.frz_pct_fl_tm_flag,
546  p_frz_hrs_wkd_flag               => p_rec.frz_hrs_wkd_flag,
547  p_frz_comb_age_and_los_flag      => p_rec.frz_comb_age_and_los_flag,
548  p_dstr_rstcn_flag                => p_rec.dstr_rstcn_flag,
549  p_pct_fl_tm_val                  => p_rec.pct_fl_tm_val,
550  p_wv_prtn_rsn_cd                 => p_rec.wv_prtn_rsn_cd,
551  p_pl_wvd_flag                    => p_rec.pl_wvd_flag,
552  p_rt_comp_ref_amt                => p_rec.rt_comp_ref_amt,
553  p_rt_cmbn_age_n_los_val          => p_rec.rt_cmbn_age_n_los_val,
554  p_rt_comp_ref_uom                => p_rec.rt_comp_ref_uom,
555  p_rt_age_val                     => p_rec.rt_age_val,
556  p_rt_los_val                     => p_rec.rt_los_val,
557  p_rt_hrs_wkd_val                 => p_rec.rt_hrs_wkd_val,
558  p_rt_hrs_wkd_bndry_perd_cd       => p_rec.rt_hrs_wkd_bndry_perd_cd,
559  p_rt_age_uom                     => p_rec.rt_age_uom,
560  p_rt_los_uom                     => p_rec.rt_los_uom,
561  p_rt_pct_fl_tm_val               => p_rec.rt_pct_fl_tm_val,
562  p_rt_frz_los_flag                => p_rec.rt_frz_los_flag,
563  p_rt_frz_age_flag                => p_rec.rt_frz_age_flag,
564  p_rt_frz_cmp_lvl_flag            => p_rec.rt_frz_cmp_lvl_flag,
565  p_rt_frz_pct_fl_tm_flag          => p_rec.rt_frz_pct_fl_tm_flag,
566  p_rt_frz_hrs_wkd_flag            => p_rec.rt_frz_hrs_wkd_flag,
570  p_plip_ordr_num                  => p_rec.plip_ordr_num,
567  p_rt_frz_comb_age_and_los_flag   => p_rec.rt_frz_comb_age_and_los_flag,
568  p_once_r_cntug_cd                => p_rec.once_r_cntug_cd,
569  p_pl_ordr_num                    => p_rec.pl_ordr_num,
571  p_ptip_ordr_num                  => p_rec.ptip_ordr_num,
572  p_pep_attribute_category         => p_rec.pep_attribute_category,
573  p_pep_attribute1                 => p_rec.pep_attribute1,
574  p_pep_attribute2                 => p_rec.pep_attribute2,
575  p_pep_attribute3                 => p_rec.pep_attribute3,
576  p_pep_attribute4                 => p_rec.pep_attribute4,
577  p_pep_attribute5                 => p_rec.pep_attribute5,
578  p_pep_attribute6                 => p_rec.pep_attribute6,
579  p_pep_attribute7                 => p_rec.pep_attribute7,
580  p_pep_attribute8                 => p_rec.pep_attribute8,
581  p_pep_attribute9                 => p_rec.pep_attribute9,
582  p_pep_attribute10                => p_rec.pep_attribute10,
583  p_pep_attribute11                => p_rec.pep_attribute11,
584  p_pep_attribute12                => p_rec.pep_attribute12,
585  p_pep_attribute13                => p_rec.pep_attribute13,
586  p_pep_attribute14                => p_rec.pep_attribute14,
587  p_pep_attribute15                => p_rec.pep_attribute15,
588  p_pep_attribute16                => p_rec.pep_attribute16,
589  p_pep_attribute17                => p_rec.pep_attribute17,
590  p_pep_attribute18                => p_rec.pep_attribute18,
591  p_pep_attribute19                => p_rec.pep_attribute19,
592  p_pep_attribute20                => p_rec.pep_attribute20,
593  p_pep_attribute21                => p_rec.pep_attribute21,
594  p_pep_attribute22                => p_rec.pep_attribute22,
595  p_pep_attribute23                => p_rec.pep_attribute23,
596  p_pep_attribute24                => p_rec.pep_attribute24,
597  p_pep_attribute25                => p_rec.pep_attribute25,
598  p_pep_attribute26                => p_rec.pep_attribute26,
599  p_pep_attribute27                => p_rec.pep_attribute27,
600  p_pep_attribute28                => p_rec.pep_attribute28,
601  p_pep_attribute29                => p_rec.pep_attribute29,
602  p_pep_attribute30                => p_rec.pep_attribute30,
603  p_request_id                     => p_rec.request_id,
604  p_program_application_id         => p_rec.program_application_id,
605  p_program_id                     => p_rec.program_id,
606  p_program_update_date            => p_rec.program_update_date,
607  p_object_version_number          => p_rec.object_version_number,
608  p_effective_date                 => p_effective_date,
609  p_validation_start_date          => p_validation_start_date,
610  p_validation_end_date            => p_validation_end_date);
611 
612 exception
613   when hr_api.cannot_find_prog_unit then
614     --
615     hr_api.cannot_find_prog_unit_error
616              (p_module_name => 'ben_elig_per_f',
617               p_hook_type => 'AI');
618 
619 End post_insert;
620 --
621 -- ----------------------------------------------------------------------------
622 -- |-------------------------------< ins_lck >--------------------------------|
623 -- ----------------------------------------------------------------------------
624 -- {Start Of Comments}
625 --
626 -- Description:
627 --   The ins_lck process has one main function to perform. When inserting
628 --   a datetracked row, we must validate the DT mode.
629 --   be manipulated.
630 --
631 -- Prerequisites:
632 --   This procedure can only be called for the datetrack mode of INSERT.
633 --
634 -- In Parameters:
635 --
636 -- Post Success:
637 --   On successful completion of the ins_lck process the parental
638 --   datetracked rows will be locked providing the p_enforce_foreign_locking
639 --   argument value is TRUE.
640 --   If the p_enforce_foreign_locking argument value is FALSE then the
641 --   parential rows are not locked.
642 --
643 -- Post Failure:
644 --   The Lck process can fail for:
645 --   1) When attempting to lock the row the row could already be locked by
646 --      another user. This will raise the HR_Api.Object_Locked exception.
647 --   2) When attempting to the lock the parent which doesn't exist.
648 --      For the entity to be locked the parent must exist!
649 --
650 -- Developer Implementation Notes:
651 --   None.
652 --
653 -- Access Status:
654 --   Internal Row Handler Use Only.
655 --
656 -- {End Of Comments}
657 -- ----------------------------------------------------------------------------
658 Procedure ins_lck
659     (p_effective_date        in     date,
660      p_datetrack_mode        in     varchar2,
661      p_rec                   in     ben_pep_shd.g_rec_type,
662      p_validation_start_date    out nocopy date,
663      p_validation_end_date      out nocopy date) is
664 --
665   l_proc          varchar2(72) := g_package||'ins_lck';
666   l_validation_start_date date;
667   l_validation_end_date      date;
668 --
669 Begin
670   hr_utility.set_location('Entering:'||l_proc, 5);
671   --
672   -- Validate the datetrack mode mode getting the validation start
673   -- and end dates for the specified datetrack operation.
674   --
675   dt_api.validate_dt_mode
676     (p_effective_date       => p_effective_date,
677      p_datetrack_mode       => p_datetrack_mode,
678      p_base_table_name       => 'ben_elig_per_f',
679      p_base_key_column       => 'elig_per_id',
680      p_base_key_value        => p_rec.elig_per_id,
681      p_parent_table_name1      => 'ben_ler_f',
682      p_parent_key_column1      => 'ler_id',
683      p_parent_key_value1       => p_rec.ler_id,
684      p_parent_table_name2      => 'ben_pgm_f',
688      p_parent_key_column3      => 'pl_id',
685      p_parent_key_column2      => 'pgm_id',
686      p_parent_key_value2       => p_rec.pgm_id,
687      p_parent_table_name3      => 'ben_pl_f',
689      p_parent_key_value3       => p_rec.pl_id,
690      p_parent_table_name4      => 'per_all_people_f',
691      p_parent_key_column4      => 'person_id',
692      p_parent_key_value4       => p_rec.person_id,
693      p_parent_table_name5      => 'ben_plip_f',
694      p_parent_key_column5      => 'plip_id',
695      p_parent_key_value5       => p_rec.plip_id,
696      p_parent_table_name6      => 'ben_ptip_f',
697      p_parent_key_column6      => 'ptip_id',
698      p_parent_key_value6       => p_rec.ptip_id,
699      p_enforce_foreign_locking => false,
700      p_validation_start_date   => l_validation_start_date,
701      p_validation_end_date       => l_validation_end_date
702      );
703   --
704   -- Set the validation start and end date OUT arguments
705   --
706   p_validation_start_date := l_validation_start_date;
707   p_validation_end_date   := l_validation_end_date;
708   --
709   hr_utility.set_location(' Leaving:'||l_proc, 10);
710 --
711 End ins_lck;
712 --
713 -- ----------------------------------------------------------------------------
714 -- |---------------------------------< ins >----------------------------------|
715 -- ----------------------------------------------------------------------------
716 Procedure ins
717   (p_rec                 in out nocopy ben_pep_shd.g_rec_type
718   ,p_effective_date      in     date
719   --
720   ,p_override_validation in     boolean          default false
721   ) is
722 --
723   l_proc            varchar2(72) := g_package||'ins';
724   l_datetrack_mode        varchar2(30) := 'INSERT';
725   l_validation_start_date    date;
726   l_validation_end_date        date;
727 --
728 Begin
729   hr_utility.set_location('Entering:'||l_proc, 5);
730   --
731   -- Call the lock operation
732   --
733   ins_lck
734     (p_effective_date      => p_effective_date,
735      p_datetrack_mode      => l_datetrack_mode,
736      p_rec                 => p_rec,
737      p_validation_start_date => l_validation_start_date,
738      p_validation_end_date     => l_validation_end_date);
739   --
740   -- Call the supporting insert validate operations
741   --
742   -- - Override validation for performance.
743   --
744   if not p_override_validation then
745     --
746     ben_pep_bus.insert_validate
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   end if;
754   --
755   -- Call the supporting pre-insert operation
756   --
757   pre_insert
758      (p_rec             => p_rec,
759      p_effective_date     => p_effective_date,
760      p_datetrack_mode     => l_datetrack_mode,
761      p_validation_start_date => l_validation_start_date,
762      p_validation_end_date     => l_validation_end_date);
763   --
764   -- Insert the row
765   --
766   insert_dml
767      (p_rec             => p_rec,
768      p_effective_date     => p_effective_date,
769      p_datetrack_mode     => l_datetrack_mode,
770      p_validation_start_date => l_validation_start_date,
771      p_validation_end_date     => l_validation_end_date);
772   --
773   -- Call the supporting post-insert operation
774   --
775   post_insert
776      (p_rec             => p_rec,
777      p_effective_date     => p_effective_date,
778      p_datetrack_mode     => l_datetrack_mode,
779      p_validation_start_date => l_validation_start_date,
780      p_validation_end_date     => l_validation_end_date);
781 end ins;
782 --
783 -- ----------------------------------------------------------------------------
784 -- |---------------------------------< ins >----------------------------------|
785 -- ----------------------------------------------------------------------------
786 Procedure ins
787   (
788   p_elig_per_id                  out nocopy number,
789   p_effective_start_date         out nocopy date,
790   p_effective_end_date           out nocopy date,
791   p_business_group_id            in number,
792   p_pl_id                        in number,
793   p_pgm_id                       in number           default null,
794   p_plip_id                      in number           default null,
795   p_ptip_id                      in number           default null,
796   p_ler_id                       in number           default null,
797   p_person_id                    in number,
798   p_per_in_ler_id                    in number,
799   p_dpnt_othr_pl_cvrd_rl_flag    in varchar2,
800   p_prtn_ovridn_thru_dt          in date             default null,
801   p_pl_key_ee_flag               in varchar2,
802   p_pl_hghly_compd_flag          in varchar2,
803   p_elig_flag                    in varchar2,
804   p_comp_ref_amt                 in number           default null,
805   p_cmbn_age_n_los_val           in number           default null,
806   p_comp_ref_uom                 in varchar2         default null,
807   p_age_val                      in number           default null,
808   p_los_val                      in number           default null,
809   p_prtn_end_dt                  in date             default null,
810   p_prtn_strt_dt                 in date             default null,
811   p_wait_perd_cmpltn_dt          in date             default null,
815   p_hrs_wkd_bndry_perd_cd        in varchar2         default null,
812   p_wait_perd_strt_dt            in date             default null,
813   p_wv_ctfn_typ_cd               in varchar2         default null,
814   p_hrs_wkd_val                  in number           default null,
816   p_prtn_ovridn_flag             in varchar2,
817   p_no_mx_prtn_ovrid_thru_flag   in varchar2,
818   p_prtn_ovridn_rsn_cd           in varchar2         default null,
819   p_age_uom                      in varchar2         default null,
820   p_los_uom                      in varchar2         default null,
821   p_ovrid_svc_dt                 in date             default null,
822   p_inelg_rsn_cd                 in varchar2         default null,
823   p_frz_los_flag                 in varchar2,
824   p_frz_age_flag                 in varchar2,
825   p_frz_cmp_lvl_flag             in varchar2,
826   p_frz_pct_fl_tm_flag           in varchar2,
827   p_frz_hrs_wkd_flag             in varchar2,
828   p_frz_comb_age_and_los_flag    in varchar2,
829   p_dstr_rstcn_flag              in varchar2,
830   p_pct_fl_tm_val                in number           default null,
831   p_wv_prtn_rsn_cd               in varchar2         default null,
832   p_pl_wvd_flag                  in varchar2,
833   p_rt_comp_ref_amt              in number           default null,
834   p_rt_cmbn_age_n_los_val        in number           default null,
835   p_rt_comp_ref_uom              in varchar2         default null,
836   p_rt_age_val                   in number           default null,
837   p_rt_los_val                   in number           default null,
838   p_rt_hrs_wkd_val               in number           default null,
839   p_rt_hrs_wkd_bndry_perd_cd     in varchar2         default null,
840   p_rt_age_uom                   in varchar2         default null,
841   p_rt_los_uom                   in varchar2         default null,
842   p_rt_pct_fl_tm_val             in number           default null,
843   p_rt_frz_los_flag              in varchar2,
844   p_rt_frz_age_flag              in varchar2,
845   p_rt_frz_cmp_lvl_flag          in varchar2,
846   p_rt_frz_pct_fl_tm_flag        in varchar2,
847   p_rt_frz_hrs_wkd_flag          in varchar2,
848   p_rt_frz_comb_age_and_los_flag in varchar2,
849   p_once_r_cntug_cd              in varchar2,
850   p_pl_ordr_num                  in number           default null,
851   p_plip_ordr_num                in number           default null,
852   p_ptip_ordr_num                in number           default null,
853   p_pep_attribute_category       in varchar2         default null,
854   p_pep_attribute1               in varchar2         default null,
855   p_pep_attribute2               in varchar2         default null,
856   p_pep_attribute3               in varchar2         default null,
857   p_pep_attribute4               in varchar2         default null,
858   p_pep_attribute5               in varchar2         default null,
859   p_pep_attribute6               in varchar2         default null,
860   p_pep_attribute7               in varchar2         default null,
861   p_pep_attribute8               in varchar2         default null,
862   p_pep_attribute9               in varchar2         default null,
863   p_pep_attribute10              in varchar2         default null,
864   p_pep_attribute11              in varchar2         default null,
865   p_pep_attribute12              in varchar2         default null,
866   p_pep_attribute13              in varchar2         default null,
867   p_pep_attribute14              in varchar2         default null,
868   p_pep_attribute15              in varchar2         default null,
869   p_pep_attribute16              in varchar2         default null,
870   p_pep_attribute17              in varchar2         default null,
871   p_pep_attribute18              in varchar2         default null,
872   p_pep_attribute19              in varchar2         default null,
873   p_pep_attribute20              in varchar2         default null,
874   p_pep_attribute21              in varchar2         default null,
875   p_pep_attribute22              in varchar2         default null,
876   p_pep_attribute23              in varchar2         default null,
877   p_pep_attribute24              in varchar2         default null,
878   p_pep_attribute25              in varchar2         default null,
879   p_pep_attribute26              in varchar2         default null,
880   p_pep_attribute27              in varchar2         default null,
881   p_pep_attribute28              in varchar2         default null,
882   p_pep_attribute29              in varchar2         default null,
883   p_pep_attribute30              in varchar2         default null,
884   p_request_id                   in number           default null,
885   p_program_application_id       in number           default null,
886   p_program_id                   in number           default null,
887   p_program_update_date          in date             default null,
888   p_object_version_number        out nocopy number,
889   p_effective_date		 in date,
890   --
891   p_override_validation          in boolean          default false
892   )
893 is
894 --
895   l_rec        ben_pep_shd.g_rec_type;
896   l_proc    varchar2(72) := g_package||'ins';
897 --
898 Begin
899   hr_utility.set_location('Entering:'||l_proc, 5);
900   --
901   -- Call conversion function to turn arguments into the
902   -- p_rec structure.
903   --
904   l_rec :=
905   ben_pep_shd.convert_args
906   (
907   null,
908   null,
909   null,
910   p_business_group_id,
911   p_pl_id,
912   p_pgm_id,
913   p_plip_id,
914   p_ptip_id,
915   p_ler_id,
916   p_person_id,
917   p_per_in_ler_id,
918   p_dpnt_othr_pl_cvrd_rl_flag,
919   p_prtn_ovridn_thru_dt,
920   p_pl_key_ee_flag,
921   p_pl_hghly_compd_flag,
922   p_elig_flag,
923   p_comp_ref_amt,
924   p_cmbn_age_n_los_val,
925   p_comp_ref_uom,
926   p_age_val,
927   p_los_val,
928   p_prtn_end_dt,
929   p_prtn_strt_dt,
930   p_wait_perd_cmpltn_dt,
931   p_wait_perd_strt_dt  ,
932   p_wv_ctfn_typ_cd,
933   p_hrs_wkd_val,
934   p_hrs_wkd_bndry_perd_cd,
935   p_prtn_ovridn_flag,
936   p_no_mx_prtn_ovrid_thru_flag,
937   p_prtn_ovridn_rsn_cd,
938   p_age_uom,
939   p_los_uom,
940   p_ovrid_svc_dt,
941   p_inelg_rsn_cd,
942   p_frz_los_flag,
943   p_frz_age_flag,
944   p_frz_cmp_lvl_flag,
945   p_frz_pct_fl_tm_flag,
946   p_frz_hrs_wkd_flag,
947   p_frz_comb_age_and_los_flag,
948   p_dstr_rstcn_flag,
949   p_pct_fl_tm_val,
950   p_wv_prtn_rsn_cd,
951   p_pl_wvd_flag,
952   p_rt_comp_ref_amt,
953   p_rt_cmbn_age_n_los_val,
954   p_rt_comp_ref_uom,
955   p_rt_age_val,
956   p_rt_los_val,
957   p_rt_hrs_wkd_val,
958   p_rt_hrs_wkd_bndry_perd_cd,
959   p_rt_age_uom,
960   p_rt_los_uom,
961   p_rt_pct_fl_tm_val,
962   p_rt_frz_los_flag,
963   p_rt_frz_age_flag,
964   p_rt_frz_cmp_lvl_flag,
965   p_rt_frz_pct_fl_tm_flag,
966   p_rt_frz_hrs_wkd_flag,
967   p_rt_frz_comb_age_and_los_flag,
968   p_once_r_cntug_cd,
969   p_pl_ordr_num,
970   p_plip_ordr_num,
971   p_ptip_ordr_num,
972   p_pep_attribute_category,
973   p_pep_attribute1,
974   p_pep_attribute2,
975   p_pep_attribute3,
976   p_pep_attribute4,
977   p_pep_attribute5,
978   p_pep_attribute6,
979   p_pep_attribute7,
980   p_pep_attribute8,
981   p_pep_attribute9,
982   p_pep_attribute10,
983   p_pep_attribute11,
984   p_pep_attribute12,
985   p_pep_attribute13,
986   p_pep_attribute14,
987   p_pep_attribute15,
988   p_pep_attribute16,
989   p_pep_attribute17,
990   p_pep_attribute18,
991   p_pep_attribute19,
992   p_pep_attribute20,
993   p_pep_attribute21,
994   p_pep_attribute22,
995   p_pep_attribute23,
996   p_pep_attribute24,
997   p_pep_attribute25,
998   p_pep_attribute26,
999   p_pep_attribute27,
1000   p_pep_attribute28,
1001   p_pep_attribute29,
1002   p_pep_attribute30,
1003   p_request_id,
1004   p_program_application_id,
1005   p_program_id,
1006   p_program_update_date,
1007   null
1008   );
1009   --
1010   -- Having converted the arguments into the ben_pep_rec
1011   -- plsql record structure we call the corresponding record
1012   -- business process.
1013   --
1014   ins(l_rec, p_effective_date,p_override_validation);
1015   --
1016   -- Set the OUT arguments.
1017   --
1018   p_elig_per_id            := l_rec.elig_per_id;
1019   p_effective_start_date      := l_rec.effective_start_date;
1020   p_effective_end_date        := l_rec.effective_end_date;
1021   p_object_version_number     := l_rec.object_version_number;
1022   --
1023   --
1024   hr_utility.set_location(' Leaving:'||l_proc, 10);
1025 End ins;
1026 --
1027 end ben_pep_ins;