DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_EPA_INS

Source


1 Package Body ben_epa_ins as
2 /* $Header: beeparhi.pkb 120.0 2005/05/28 02:35:20 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)    := '  ben_epa_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_epa_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_prtn_elig_f t
70     where  t.prtn_elig_id       = p_rec.prtn_elig_id
71     and    t.effective_start_date =
72              ben_epa_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_prtn_elig_f.created_by%TYPE;
77   l_creation_date       ben_prtn_elig_f.creation_date%TYPE;
78   l_last_update_date       ben_prtn_elig_f.last_update_date%TYPE;
79   l_last_updated_by     ben_prtn_elig_f.last_updated_by%TYPE;
80   l_last_update_login   ben_prtn_elig_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_prtn_elig_f',
90      p_base_key_column => 'prtn_elig_id',
91      p_base_key_value  => p_rec.prtn_elig_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       hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
116       hr_utility.set_message_token('PROCEDURE', l_proc);
117       hr_utility.set_message_token('STEP','10');
118       hr_utility.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_epa_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_prtn_elig_f
132   --
133   insert into ben_prtn_elig_f
134   (    prtn_elig_id,
135     effective_start_date,
136     effective_end_date,
137     business_group_id,
138     pgm_id,
139     pl_id,
140     oipl_id,
141     ptip_id,
142     plip_id,
143     trk_scr_for_inelg_flag,
144     prtn_eff_strt_dt_cd,
145     prtn_eff_end_dt_cd,
146     prtn_eff_strt_dt_rl,
147     prtn_eff_end_dt_rl,
148     wait_perd_dt_to_use_cd,
149     wait_perd_dt_to_use_rl,
150     wait_perd_val,
151     wait_perd_uom,
152     wait_perd_rl,
153     mx_poe_det_dt_cd,
154     mx_poe_det_dt_rl,
155     mx_poe_val,
156     mx_poe_uom,
157     mx_poe_rl,
158     mx_poe_apls_cd,
159     epa_attribute_category,
160     epa_attribute1,
161     epa_attribute2,
162     epa_attribute3,
163     epa_attribute4,
164     epa_attribute5,
165     epa_attribute6,
166     epa_attribute7,
167     epa_attribute8,
168     epa_attribute9,
169     epa_attribute10,
170     epa_attribute11,
171     epa_attribute12,
172     epa_attribute13,
173     epa_attribute14,
174     epa_attribute15,
175     epa_attribute16,
176     epa_attribute17,
177     epa_attribute18,
178     epa_attribute19,
179     epa_attribute20,
180     epa_attribute21,
181     epa_attribute22,
182     epa_attribute23,
183     epa_attribute24,
184     epa_attribute25,
185     epa_attribute26,
186     epa_attribute27,
187     epa_attribute28,
188     epa_attribute29,
189     epa_attribute30,
190     object_version_number,
191     created_by,
192        creation_date,
193        last_update_date,
194        last_updated_by,
195        last_update_login
196   )
197   Values
198   (    p_rec.prtn_elig_id,
199     p_rec.effective_start_date,
200     p_rec.effective_end_date,
201     p_rec.business_group_id,
202     p_rec.pgm_id,
203     p_rec.pl_id,
204     p_rec.oipl_id,
205     p_rec.ptip_id,
206     p_rec.plip_id,
207     nvl(p_rec.trk_scr_for_inelg_flag,'N'),
208     p_rec.prtn_eff_strt_dt_cd,
209     p_rec.prtn_eff_end_dt_cd,
210     p_rec.prtn_eff_strt_dt_rl,
211     p_rec.prtn_eff_end_dt_rl,
212     p_rec.wait_perd_dt_to_use_cd,
213     p_rec.wait_perd_dt_to_use_rl,
214     p_rec.wait_perd_val,
215     p_rec.wait_perd_uom,
216     p_rec.wait_perd_rl,
217     p_rec.mx_poe_det_dt_cd,
218     p_rec.mx_poe_det_dt_rl,
219     p_rec.mx_poe_val,
220     p_rec.mx_poe_uom,
221     p_rec.mx_poe_rl,
222     p_rec.mx_poe_apls_cd,
223     p_rec.epa_attribute_category,
224     p_rec.epa_attribute1,
225     p_rec.epa_attribute2,
226     p_rec.epa_attribute3,
227     p_rec.epa_attribute4,
228     p_rec.epa_attribute5,
229     p_rec.epa_attribute6,
230     p_rec.epa_attribute7,
231     p_rec.epa_attribute8,
232     p_rec.epa_attribute9,
233     p_rec.epa_attribute10,
234     p_rec.epa_attribute11,
235     p_rec.epa_attribute12,
236     p_rec.epa_attribute13,
237     p_rec.epa_attribute14,
238     p_rec.epa_attribute15,
239     p_rec.epa_attribute16,
240     p_rec.epa_attribute17,
241     p_rec.epa_attribute18,
242     p_rec.epa_attribute19,
243     p_rec.epa_attribute20,
244     p_rec.epa_attribute21,
245     p_rec.epa_attribute22,
246     p_rec.epa_attribute23,
247     p_rec.epa_attribute24,
248     p_rec.epa_attribute25,
249     p_rec.epa_attribute26,
250     p_rec.epa_attribute27,
251     p_rec.epa_attribute28,
252     p_rec.epa_attribute29,
253     p_rec.epa_attribute30,
254     p_rec.object_version_number,
255     l_created_by,
256        l_creation_date,
257        l_last_update_date,
258        l_last_updated_by,
259        l_last_update_login
260   );
261   --
262   ben_epa_shd.g_api_dml := false;   -- Unset the api dml status
263   hr_utility.set_location(' Leaving:'||l_proc, 15);
264 --
265 Exception
266   When hr_api.check_integrity_violated Then
267     -- A check constraint has been violated
268     ben_epa_shd.g_api_dml := false;   -- Unset the api dml status
269     ben_epa_shd.constraint_error
270       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
271   When hr_api.unique_integrity_violated Then
272     -- Unique integrity has been violated
273     ben_epa_shd.g_api_dml := false;   -- Unset the api dml status
274     ben_epa_shd.constraint_error
275       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
276   When Others Then
277     ben_epa_shd.g_api_dml := false;   -- Unset the api dml status
278     Raise;
279 End dt_insert_dml;
280 --
281 -- ----------------------------------------------------------------------------
282 -- |------------------------------< insert_dml >------------------------------|
283 -- ----------------------------------------------------------------------------
284 Procedure insert_dml
285     (p_rec              in out nocopy ben_epa_shd.g_rec_type,
286      p_effective_date     in    date,
287      p_datetrack_mode     in    varchar2,
288      p_validation_start_date in    date,
289      p_validation_end_date     in    date) is
290 --
291   l_proc    varchar2(72) := g_package||'insert_dml';
292 --
293 Begin
294   hr_utility.set_location('Entering:'||l_proc, 5);
295   --
296   dt_insert_dml(p_rec            => p_rec,
297         p_effective_date    => p_effective_date,
298         p_datetrack_mode    => p_datetrack_mode,
299                p_validation_start_date    => p_validation_start_date,
300         p_validation_end_date    => p_validation_end_date);
301   --
302   hr_utility.set_location(' Leaving:'||l_proc, 10);
303 End insert_dml;
304 --
305 -- ----------------------------------------------------------------------------
306 -- |------------------------------< pre_insert >------------------------------|
307 -- ----------------------------------------------------------------------------
308 -- {Start Of Comments}
309 --
310 -- Description:
311 --   This private procedure contains any processing which is required before
312 --   the insert dml. Presently, if the entity has a corresponding primary
313 --   key which is maintained by an associating sequence, the primary key for
314 --   the entity will be populated with the next sequence value in
315 --   preparation for the insert dml.
316 --   Also, if comments are defined for this entity, the comments insert
317 --   logic will also be called, generating a comment_id if required.
318 --
319 -- Prerequisites:
320 --   This is an internal procedure which is called from the ins procedure.
321 --
322 -- In Parameters:
323 --   A Pl/Sql record structre.
324 --
325 -- Post Success:
326 --   Processing continues.
327 --
328 -- Post Failure:
329 --   If an error has occurred, an error message and exception will be raised
330 --   but not handled.
331 --
332 -- Developer Implementation Notes:
333 --   Any pre-processing required before the insert dml is issued should be
334 --   coded within this procedure. As stated above, a good example is the
335 --   generation of a primary key number via a corresponding sequence.
336 --   It is important to note that any 3rd party maintenance should be reviewed
337 --   before placing in this procedure.
338 --
339 -- Access Status:
340 --   Internal Row Handler Use Only.
341 --
342 -- {End Of Comments}
343 -- ----------------------------------------------------------------------------
344 Procedure pre_insert
345     (p_rec              in out nocopy ben_epa_shd.g_rec_type,
346      p_effective_date        in date,
347      p_datetrack_mode        in varchar2,
348      p_validation_start_date    in date,
349      p_validation_end_date        in date) is
350   --
351   l_proc    varchar2(72) := g_package||'pre_insert';
352   --
353   cursor c1 is select ben_prtn_elig_f_s.nextval from sys.dual;
354   --
355 Begin
356   hr_utility.set_location('Entering:'||l_proc, 5);
357   --
358   open c1;
359     fetch c1 into p_rec.prtn_elig_id;
360   close c1;
361   --
362   hr_utility.set_location(' Leaving:'||l_proc, 10);
363 End pre_insert;
364 --
365 -- ----------------------------------------------------------------------------
366 -- |-----------------------------< post_insert >------------------------------|
367 -- ----------------------------------------------------------------------------
368 -- {Start Of Comments}
369 --
370 -- Description:
371 --   This private procedure contains any processing which is required after the
372 --   insert dml.
373 --
374 -- Prerequisites:
375 --   This is an internal procedure which is called from the ins procedure.
376 --
377 -- In Parameters:
378 --   A Pl/Sql record structre.
379 --
380 -- Post Success:
381 --   Processing continues.
382 --
383 -- Post Failure:
384 --   If an error has occurred, an error message and exception will be raised
385 --   but not handled.
386 --
387 -- Developer Implementation Notes:
388 --   Any post-processing required after the insert dml is issued should be
389 --   coded within this procedure. It is important to note that any 3rd party
390 --   maintenance should be reviewed before placing in this procedure.
391 --
392 -- Access Status:
393 --   Internal Row Handler Use Only.
394 --
395 -- {End Of Comments}
396 -- ----------------------------------------------------------------------------
397 Procedure post_insert
398     (p_rec              in ben_epa_shd.g_rec_type,
399      p_effective_date     in date,
400      p_datetrack_mode     in varchar2,
401      p_validation_start_date in date,
402      p_validation_end_date     in date) is
403   --
404   l_proc    varchar2(72) := g_package||'post_insert';
405   --
406 Begin
407   hr_utility.set_location('Entering:'||l_proc, 5);
408   --
409   -- Start of API User Hook for post_insert.
410   --
411   begin
412     --
413     ben_epa_rki.after_insert
414       (
415        p_prtn_elig_id                  =>p_rec.prtn_elig_id
416       ,p_effective_start_date          =>p_rec.effective_start_date
417       ,p_effective_end_date            =>p_rec.effective_end_date
418       ,p_business_group_id             =>p_rec.business_group_id
419       ,p_pgm_id                        =>p_rec.pgm_id
420       ,p_pl_id                         =>p_rec.pl_id
421       ,p_oipl_id                       =>p_rec.oipl_id
422       ,p_ptip_id                       =>p_rec.ptip_id
423       ,p_plip_id                       =>p_rec.plip_id
424       ,p_trk_scr_for_inelg_flag        =>p_rec.trk_scr_for_inelg_flag
428       ,p_prtn_eff_end_dt_rl            =>p_rec.prtn_eff_end_dt_rl
425       ,p_prtn_eff_strt_dt_cd           =>p_rec.prtn_eff_strt_dt_cd
426       ,p_prtn_eff_end_dt_cd            =>p_rec.prtn_eff_end_dt_cd
427       ,p_prtn_eff_strt_dt_rl           =>p_rec.prtn_eff_strt_dt_rl
429       ,p_wait_perd_dt_to_use_cd        =>p_rec.wait_perd_dt_to_use_cd
430       ,p_wait_perd_dt_to_use_rl        =>p_rec.wait_perd_dt_to_use_rl
431       ,p_wait_perd_val                 =>p_rec.wait_perd_val
432       ,p_wait_perd_uom                 =>p_rec.wait_perd_uom
433       ,p_wait_perd_rl                  =>p_rec.wait_perd_rl
434       ,p_mx_poe_det_dt_cd              =>p_rec.mx_poe_det_dt_cd
435       ,p_mx_poe_det_dt_rl              =>p_rec.mx_poe_det_dt_rl
436       ,p_mx_poe_val                    =>p_rec.mx_poe_val
437       ,p_mx_poe_uom                    =>p_rec.mx_poe_uom
438       ,p_mx_poe_rl                     =>p_rec.mx_poe_rl
439       ,p_mx_poe_apls_cd                =>p_rec.mx_poe_apls_cd
440       ,p_epa_attribute_category        =>p_rec.epa_attribute_category
441       ,p_epa_attribute1                =>p_rec.epa_attribute1
442       ,p_epa_attribute2                =>p_rec.epa_attribute2
443       ,p_epa_attribute3                =>p_rec.epa_attribute3
444       ,p_epa_attribute4                =>p_rec.epa_attribute4
445       ,p_epa_attribute5                =>p_rec.epa_attribute5
446       ,p_epa_attribute6                =>p_rec.epa_attribute6
447       ,p_epa_attribute7                =>p_rec.epa_attribute7
448       ,p_epa_attribute8                =>p_rec.epa_attribute8
449       ,p_epa_attribute9                =>p_rec.epa_attribute9
450       ,p_epa_attribute10               =>p_rec.epa_attribute10
451       ,p_epa_attribute11               =>p_rec.epa_attribute11
452       ,p_epa_attribute12               =>p_rec.epa_attribute12
453       ,p_epa_attribute13               =>p_rec.epa_attribute13
454       ,p_epa_attribute14               =>p_rec.epa_attribute14
455       ,p_epa_attribute15               =>p_rec.epa_attribute15
456       ,p_epa_attribute16               =>p_rec.epa_attribute16
457       ,p_epa_attribute17               =>p_rec.epa_attribute17
458       ,p_epa_attribute18               =>p_rec.epa_attribute18
459       ,p_epa_attribute19               =>p_rec.epa_attribute19
460       ,p_epa_attribute20               =>p_rec.epa_attribute20
461       ,p_epa_attribute21               =>p_rec.epa_attribute21
462       ,p_epa_attribute22               =>p_rec.epa_attribute22
463       ,p_epa_attribute23               =>p_rec.epa_attribute23
464       ,p_epa_attribute24               =>p_rec.epa_attribute24
465       ,p_epa_attribute25               =>p_rec.epa_attribute25
466       ,p_epa_attribute26               =>p_rec.epa_attribute26
467       ,p_epa_attribute27               =>p_rec.epa_attribute27
468       ,p_epa_attribute28               =>p_rec.epa_attribute28
469       ,p_epa_attribute29               =>p_rec.epa_attribute29
470       ,p_epa_attribute30               =>p_rec.epa_attribute30
471       ,p_object_version_number         =>p_rec.object_version_number
472       ,p_effective_date                =>p_effective_date
473       ,p_validation_start_date         =>p_validation_start_date
474       ,p_validation_end_date           =>p_validation_end_date
475       );
476     --
477   exception
478     --
479     when hr_api.cannot_find_prog_unit then
480       --
481       hr_api.cannot_find_prog_unit_error
482         (p_module_name => 'ben_prtn_elig_f'
483         ,p_hook_type   => 'AI');
484       --
485   end;
486   --
487   -- End of API User Hook for post_insert.
488   --
489   --
490   hr_utility.set_location(' Leaving:'||l_proc, 10);
491 End post_insert;
492 --
493 -- ----------------------------------------------------------------------------
494 -- |-------------------------------< ins_lck >--------------------------------|
495 -- ----------------------------------------------------------------------------
496 -- {Start Of Comments}
497 --
498 -- Description:
499 --   The ins_lck process has one main function to perform. When inserting
500 --   a datetracked row, we must validate the DT mode.
501 --   be manipulated.
502 --
503 -- Prerequisites:
504 --   This procedure can only be called for the datetrack mode of INSERT.
505 --
506 -- In Parameters:
507 --
508 -- Post Success:
509 --   On successful completion of the ins_lck process the parental
510 --   datetracked rows will be locked providing the p_enforce_foreign_locking
511 --   argument value is TRUE.
512 --   If the p_enforce_foreign_locking argument value is FALSE then the
513 --   parential rows are not locked.
514 --
515 -- Post Failure:
516 --   The Lck process can fail for:
517 --   1) When attempting to lock the row the row could already be locked by
518 --      another user. This will raise the HR_Api.Object_Locked exception.
519 --   2) When attempting to the lock the parent which doesn't exist.
520 --      For the entity to be locked the parent must exist!
521 --
522 -- Developer Implementation Notes:
523 --   None.
524 --
525 -- Access Status:
526 --   Internal Row Handler Use Only.
527 --
528 -- {End Of Comments}
529 -- ----------------------------------------------------------------------------
530 Procedure ins_lck
531     (p_effective_date     in  date,
532      p_datetrack_mode     in  varchar2,
533      p_rec              in  ben_epa_shd.g_rec_type,
537   l_proc          varchar2(72) := g_package||'ins_lck';
534      p_validation_start_date out nocopy date,
535      p_validation_end_date     out nocopy date) is
536 --
538   l_validation_start_date date;
539   l_validation_end_date      date;
540 --
541 Begin
542   hr_utility.set_location('Entering:'||l_proc, 5);
543   --
544   -- Validate the datetrack mode mode getting the validation start
545   -- and end dates for the specified datetrack operation.
546   --
547   dt_api.validate_dt_mode
548     (p_effective_date       => p_effective_date,
549      p_datetrack_mode       => p_datetrack_mode,
550      p_base_table_name       => 'ben_prtn_elig_f',
551      p_base_key_column       => 'prtn_elig_id',
552      p_base_key_value        => p_rec.prtn_elig_id,
553      p_parent_table_name1      => 'ff_formulas_f',
554      p_parent_key_column1      => 'formula_id',
555      p_parent_key_value1       => p_rec.prtn_eff_end_dt_rl,
556      p_parent_table_name2      => 'ben_oipl_f',
557      p_parent_key_column2      => 'oipl_id',
558      p_parent_key_value2       => p_rec.oipl_id,
559      p_parent_table_name3      => 'ben_pl_f',
560      p_parent_key_column3      => 'pl_id',
561      p_parent_key_value3       => p_rec.pl_id,
562      p_parent_table_name4      => 'ben_pgm_f',
563      p_parent_key_column4      => 'pgm_id',
564      p_parent_key_value4       => p_rec.pgm_id,
565      p_parent_table_name5      => 'ben_ptip_f',
566      p_parent_key_column5      => 'ptip_id',
567      p_parent_key_value5       => p_rec.ptip_id,
568      p_parent_table_name6      => 'ben_plip_f',
569      p_parent_key_column6      => 'plip_id',
570      p_parent_key_value6       => p_rec.plip_id,
571          p_enforce_foreign_locking => true,
572      p_validation_start_date   => l_validation_start_date,
573       p_validation_end_date       => l_validation_end_date);
574   --
575   -- Set the validation start and end date OUT arguments
576   --
577   p_validation_start_date := l_validation_start_date;
578   p_validation_end_date   := l_validation_end_date;
579   --
580   hr_utility.set_location(' Leaving:'||l_proc, 10);
581 --
582 End ins_lck;
583 --
584 -- ----------------------------------------------------------------------------
585 -- |---------------------------------< ins >----------------------------------|
586 -- ----------------------------------------------------------------------------
587 Procedure ins
588   (
589   p_rec           in out nocopy ben_epa_shd.g_rec_type,
590   p_effective_date in     date
591   ) is
592 --
593   l_proc            varchar2(72) := g_package||'ins';
594   l_datetrack_mode        varchar2(30) := 'INSERT';
595   l_validation_start_date    date;
596   l_validation_end_date        date;
597 --
598 Begin
599   hr_utility.set_location('Entering:'||l_proc, 5);
600   --
601   -- Call the lock operation
602   --
603   ins_lck
604     (p_effective_date     => p_effective_date,
605      p_datetrack_mode     => l_datetrack_mode,
606      p_rec              => p_rec,
607      p_validation_start_date => l_validation_start_date,
608      p_validation_end_date     => l_validation_end_date);
609   --
610   -- Call the supporting insert validate operations
611   --
612   ben_epa_bus.insert_validate
613     (p_rec             => p_rec,
614      p_effective_date     => p_effective_date,
615      p_datetrack_mode     => l_datetrack_mode,
616      p_validation_start_date => l_validation_start_date,
617      p_validation_end_date     => l_validation_end_date);
618   --
619   -- Call the supporting pre-insert operation
620   --
621   pre_insert
622      (p_rec             => p_rec,
623      p_effective_date     => p_effective_date,
624      p_datetrack_mode     => l_datetrack_mode,
625      p_validation_start_date => l_validation_start_date,
626      p_validation_end_date     => l_validation_end_date);
627   --
628   -- Insert the row
629   --
630   insert_dml
631      (p_rec             => p_rec,
632      p_effective_date     => p_effective_date,
633      p_datetrack_mode     => l_datetrack_mode,
634      p_validation_start_date => l_validation_start_date,
635      p_validation_end_date     => l_validation_end_date);
636   --
637   -- Call the supporting post-insert operation
638   --
639   post_insert
640      (p_rec             => p_rec,
641      p_effective_date     => p_effective_date,
642      p_datetrack_mode     => l_datetrack_mode,
643      p_validation_start_date => l_validation_start_date,
644      p_validation_end_date     => l_validation_end_date);
645 end ins;
646 --
647 -- ----------------------------------------------------------------------------
648 -- |---------------------------------< ins >----------------------------------|
649 -- ----------------------------------------------------------------------------
650 Procedure ins
651   (
652   p_prtn_elig_id                 out nocopy number,
653   p_effective_start_date         out nocopy date,
654   p_effective_end_date           out nocopy date,
655   p_business_group_id            in number,
656   p_pgm_id                       in number           default null,
657   p_pl_id                        in number           default null,
658   p_oipl_id                      in number           default null,
662   p_prtn_eff_strt_dt_cd          in varchar2         default null,
659   p_ptip_id                      in number           default null,
660   p_plip_id                      in number           default null,
661   p_trk_scr_for_inelg_flag       in varchar2         default null,
663   p_prtn_eff_end_dt_cd           in varchar2         default null,
664   p_prtn_eff_strt_dt_rl          in number           default null,
665   p_prtn_eff_end_dt_rl           in number           default null,
666   p_wait_perd_dt_to_use_cd       in varchar2         default null,
667   p_wait_perd_dt_to_use_rl       in number           default null,
668   p_wait_perd_val                in number           default null,
669   p_wait_perd_uom                in varchar2         default null,
670   p_wait_perd_rl                 in number           default null,
671   p_mx_poe_det_dt_cd             in varchar2         default null,
672   p_mx_poe_det_dt_rl             in number           default null,
673   p_mx_poe_val                   in number           default null,
674   p_mx_poe_uom                   in varchar2         default null,
675   p_mx_poe_rl                    in number           default null,
676   p_mx_poe_apls_cd               in varchar2         default null,
677   p_epa_attribute_category       in varchar2         default null,
678   p_epa_attribute1               in varchar2         default null,
679   p_epa_attribute2               in varchar2         default null,
680   p_epa_attribute3               in varchar2         default null,
681   p_epa_attribute4               in varchar2         default null,
682   p_epa_attribute5               in varchar2         default null,
683   p_epa_attribute6               in varchar2         default null,
684   p_epa_attribute7               in varchar2         default null,
685   p_epa_attribute8               in varchar2         default null,
686   p_epa_attribute9               in varchar2         default null,
687   p_epa_attribute10              in varchar2         default null,
688   p_epa_attribute11              in varchar2         default null,
689   p_epa_attribute12              in varchar2         default null,
690   p_epa_attribute13              in varchar2         default null,
691   p_epa_attribute14              in varchar2         default null,
692   p_epa_attribute15              in varchar2         default null,
693   p_epa_attribute16              in varchar2         default null,
694   p_epa_attribute17              in varchar2         default null,
695   p_epa_attribute18              in varchar2         default null,
696   p_epa_attribute19              in varchar2         default null,
697   p_epa_attribute20              in varchar2         default null,
698   p_epa_attribute21              in varchar2         default null,
699   p_epa_attribute22              in varchar2         default null,
700   p_epa_attribute23              in varchar2         default null,
701   p_epa_attribute24              in varchar2         default null,
702   p_epa_attribute25              in varchar2         default null,
703   p_epa_attribute26              in varchar2         default null,
704   p_epa_attribute27              in varchar2         default null,
705   p_epa_attribute28              in varchar2         default null,
706   p_epa_attribute29              in varchar2         default null,
707   p_epa_attribute30              in varchar2         default null,
708   p_object_version_number        out nocopy number,
709   p_effective_date         in date
710   ) is
711 --
712   l_rec        ben_epa_shd.g_rec_type;
713   l_proc    varchar2(72) := g_package||'ins';
714 --
715 Begin
716   hr_utility.set_location('Entering:'||l_proc, 5);
717   --
718   -- Call conversion function to turn arguments into the
719   -- p_rec structure.
720   --
721   l_rec :=
722   ben_epa_shd.convert_args
723   (
724   null,
725   null,
726   null,
727   p_business_group_id,
728   p_pgm_id,
729   p_pl_id,
730   p_oipl_id,
731   p_ptip_id,
732   p_plip_id,
733   p_trk_scr_for_inelg_flag,
734   p_prtn_eff_strt_dt_cd,
735   p_prtn_eff_end_dt_cd,
736   p_prtn_eff_strt_dt_rl,
737   p_prtn_eff_end_dt_rl,
738   p_wait_perd_dt_to_use_cd,
739   p_wait_perd_dt_to_use_rl,
740   p_wait_perd_val,
741   p_wait_perd_uom,
742   p_wait_perd_rl,
743   p_mx_poe_det_dt_cd,
744   p_mx_poe_det_dt_rl,
745   p_mx_poe_val,
746   p_mx_poe_uom,
747   p_mx_poe_rl,
748   p_mx_poe_apls_cd,
749   p_epa_attribute_category,
750   p_epa_attribute1,
751   p_epa_attribute2,
752   p_epa_attribute3,
753   p_epa_attribute4,
754   p_epa_attribute5,
755   p_epa_attribute6,
756   p_epa_attribute7,
757   p_epa_attribute8,
758   p_epa_attribute9,
759   p_epa_attribute10,
760   p_epa_attribute11,
761   p_epa_attribute12,
762   p_epa_attribute13,
763   p_epa_attribute14,
764   p_epa_attribute15,
765   p_epa_attribute16,
766   p_epa_attribute17,
767   p_epa_attribute18,
768   p_epa_attribute19,
769   p_epa_attribute20,
770   p_epa_attribute21,
771   p_epa_attribute22,
772   p_epa_attribute23,
773   p_epa_attribute24,
774   p_epa_attribute25,
775   p_epa_attribute26,
776   p_epa_attribute27,
777   p_epa_attribute28,
778   p_epa_attribute29,
779   p_epa_attribute30,
780   null
781   );
782   --
783   -- Having converted the arguments into the ben_epa_rec
784   -- plsql record structure we call the corresponding record
785   -- business process.
786   --
787   ins(l_rec, p_effective_date);
788   --
789   -- Set the OUT arguments.
790   --
791   p_prtn_elig_id            := l_rec.prtn_elig_id;
792   p_effective_start_date      := l_rec.effective_start_date;
793   p_effective_end_date        := l_rec.effective_end_date;
794   p_object_version_number     := l_rec.object_version_number;
795   --
796   --
797   hr_utility.set_location(' Leaving:'||l_proc, 10);
798 End ins;
799 --
800 end ben_epa_ins;