DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_BPL_INS

Source


1 Package Body ben_bpl_ins as
2 /* $Header: bebplrhi.pkb 120.1.12010000.2 2008/09/18 04:35:40 sallumwa ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_bpl_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_bpl_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_bnft_prvdd_ldgr_f t
70     where  t.bnft_prvdd_ldgr_id       = p_rec.bnft_prvdd_ldgr_id
71     and    t.effective_start_date =
72              ben_bpl_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_bnft_prvdd_ldgr_f.created_by%TYPE;
77   l_creation_date       ben_bnft_prvdd_ldgr_f.creation_date%TYPE;
78   l_last_update_date   	ben_bnft_prvdd_ldgr_f.last_update_date%TYPE;
79   l_last_updated_by     ben_bnft_prvdd_ldgr_f.last_updated_by%TYPE;
80   l_last_update_login   ben_bnft_prvdd_ldgr_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_bnft_prvdd_ldgr_f',
90 	 p_base_key_column => 'bnft_prvdd_ldgr_id',
91 	 p_base_key_value  => p_rec.bnft_prvdd_ldgr_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_bpl_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_bnft_prvdd_ldgr_f
132   --
133   insert into ben_bnft_prvdd_ldgr_f
134   (	bnft_prvdd_ldgr_id,
135 	effective_start_date,
136 	effective_end_date,
137 	prtt_ro_of_unusd_amt_flag,
138 	frftd_val,
139 	prvdd_val,
140 	used_val,
141 	bnft_prvdr_pool_id,
142 	acty_base_rt_id,
143 	per_in_ler_id,
144 	prtt_enrt_rslt_id,
145 	business_group_id,
146 	bpl_attribute_category,
147 	bpl_attribute1,
148 	bpl_attribute2,
149 	bpl_attribute3,
150 	bpl_attribute4,
151 	bpl_attribute5,
152 	bpl_attribute6,
153 	bpl_attribute7,
154 	bpl_attribute8,
155 	bpl_attribute9,
156 	bpl_attribute10,
157 	bpl_attribute11,
158 	bpl_attribute12,
159 	bpl_attribute13,
160 	bpl_attribute14,
161 	bpl_attribute15,
162 	bpl_attribute16,
163 	bpl_attribute17,
164 	bpl_attribute18,
165 	bpl_attribute19,
166 	bpl_attribute20,
167 	bpl_attribute21,
168 	bpl_attribute22,
169 	bpl_attribute23,
170 	bpl_attribute24,
171 	bpl_attribute25,
172 	bpl_attribute26,
173 	bpl_attribute27,
174 	bpl_attribute28,
175 	bpl_attribute29,
176 	bpl_attribute30,
177 	object_version_number,
178 	cash_recd_val,
179 	rld_up_val,
180   acty_ref_perd_cd,
181   cmcd_frftd_val,
182   cmcd_prvdd_val,
183   cmcd_rld_up_val,
184   cmcd_used_val,
185   cmcd_cash_recd_val,
186   cmcd_ref_perd_cd,
187   ann_frftd_val,
188   ann_prvdd_val,
189   ann_rld_up_val,
190   ann_used_val,
191   ann_cash_recd_val,
192    	created_by,
193    	creation_date,
194    	last_update_date,
195    	last_updated_by,
196    	last_update_login
197   )
198   Values
199   (	p_rec.bnft_prvdd_ldgr_id,
200 	p_rec.effective_start_date,
201 	p_rec.effective_end_date,
202 	p_rec.prtt_ro_of_unusd_amt_flag,
203 	p_rec.frftd_val,
204 	p_rec.prvdd_val,
205 	p_rec.used_val,
206 	p_rec.bnft_prvdr_pool_id,
207 	p_rec.acty_base_rt_id,
208 	p_rec.per_in_ler_id,
209 	p_rec.prtt_enrt_rslt_id,
210 	p_rec.business_group_id,
211 	p_rec.bpl_attribute_category,
212 	p_rec.bpl_attribute1,
213 	p_rec.bpl_attribute2,
214 	p_rec.bpl_attribute3,
215 	p_rec.bpl_attribute4,
216 	p_rec.bpl_attribute5,
217 	p_rec.bpl_attribute6,
218 	p_rec.bpl_attribute7,
219 	p_rec.bpl_attribute8,
220 	p_rec.bpl_attribute9,
221 	p_rec.bpl_attribute10,
222 	p_rec.bpl_attribute11,
223 	p_rec.bpl_attribute12,
224 	p_rec.bpl_attribute13,
225 	p_rec.bpl_attribute14,
226 	p_rec.bpl_attribute15,
227 	p_rec.bpl_attribute16,
228 	p_rec.bpl_attribute17,
229 	p_rec.bpl_attribute18,
230 	p_rec.bpl_attribute19,
231 	p_rec.bpl_attribute20,
232 	p_rec.bpl_attribute21,
233 	p_rec.bpl_attribute22,
234 	p_rec.bpl_attribute23,
235 	p_rec.bpl_attribute24,
236 	p_rec.bpl_attribute25,
237 	p_rec.bpl_attribute26,
238 	p_rec.bpl_attribute27,
239 	p_rec.bpl_attribute28,
240 	p_rec.bpl_attribute29,
241 	p_rec.bpl_attribute30,
242 	p_rec.object_version_number,
243 	p_rec.cash_recd_val,
244 	p_rec.rld_up_val,
245   p_rec.acty_ref_perd_cd,
246   p_rec.cmcd_frftd_val,
247   p_rec.cmcd_prvdd_val,
248   p_rec.cmcd_rld_up_val,
249   p_rec.cmcd_used_val,
250   p_rec.cmcd_cash_recd_val,
251   p_rec.cmcd_ref_perd_cd,
252   p_rec.ann_frftd_val,
253   p_rec.ann_prvdd_val,
254   p_rec.ann_rld_up_val,
255   p_rec.ann_used_val,
256   p_rec.ann_cash_recd_val,
257 	l_created_by,
258    	l_creation_date,
259    	l_last_update_date,
260    	l_last_updated_by,
261    	l_last_update_login
262   );
263   --
264   ben_bpl_shd.g_api_dml := false;   -- Unset the api dml status
265   hr_utility.set_location(' Leaving:'||l_proc, 15);
266 --
267 Exception
268   When hr_api.check_integrity_violated Then
269     -- A check constraint has been violated
270     ben_bpl_shd.g_api_dml := false;   -- Unset the api dml status
271     ben_bpl_shd.constraint_error
272       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
273   When hr_api.unique_integrity_violated Then
274     -- Unique integrity has been violated
275     ben_bpl_shd.g_api_dml := false;   -- Unset the api dml status
276     ben_bpl_shd.constraint_error
277       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
278   When Others Then
279     ben_bpl_shd.g_api_dml := false;   -- Unset the api dml status
280     Raise;
281 End dt_insert_dml;
282 --
283 -- ----------------------------------------------------------------------------
284 -- |------------------------------< insert_dml >------------------------------|
285 -- ----------------------------------------------------------------------------
286 Procedure insert_dml
287 	(p_rec 			 in out nocopy ben_bpl_shd.g_rec_type,
288 	 p_effective_date	 in	date,
289 	 p_datetrack_mode	 in	varchar2,
290 	 p_validation_start_date in	date,
291 	 p_validation_end_date	 in	date) is
292 --
293   l_proc	varchar2(72) := g_package||'insert_dml';
294 --
295 Begin
296   hr_utility.set_location('Entering:'||l_proc, 5);
297   --
298   dt_insert_dml(p_rec			=> p_rec,
299 		p_effective_date	=> p_effective_date,
300 		p_datetrack_mode	=> p_datetrack_mode,
301        		p_validation_start_date	=> p_validation_start_date,
302 		p_validation_end_date	=> p_validation_end_date);
303   --
304   hr_utility.set_location(' Leaving:'||l_proc, 10);
305 End insert_dml;
306 --
307 -- ----------------------------------------------------------------------------
308 -- |------------------------------< pre_insert >------------------------------|
309 -- ----------------------------------------------------------------------------
310 -- {Start Of Comments}
311 --
312 -- Description:
313 --   This private procedure contains any processing which is required before
314 --   the insert dml. Presently, if the entity has a corresponding primary
315 --   key which is maintained by an associating sequence, the primary key for
316 --   the entity will be populated with the next sequence value in
317 --   preparation for the insert dml.
318 --   Also, if comments are defined for this entity, the comments insert
319 --   logic will also be called, generating a comment_id if required.
320 --
321 -- Prerequisites:
322 --   This is an internal procedure which is called from the ins procedure.
323 --
324 -- In Parameters:
325 --   A Pl/Sql record structre.
326 --
327 -- Post Success:
328 --   Processing continues.
329 --
330 -- Post Failure:
331 --   If an error has occurred, an error message and exception will be raised
332 --   but not handled.
333 --
334 -- Developer Implementation Notes:
335 --   Any pre-processing required before the insert dml is issued should be
336 --   coded within this procedure. As stated above, a good example is the
337 --   generation of a primary key number via a corresponding sequence.
338 --   It is important to note that any 3rd party maintenance should be reviewed
339 --   before placing in this procedure.
340 --
341 -- Access Status:
342 --   Internal Row Handler Use Only.
343 --
344 -- {End Of Comments}
345 -- ----------------------------------------------------------------------------
346 Procedure pre_insert
347 	(p_rec  			in out nocopy ben_bpl_shd.g_rec_type,
348 	 p_effective_date		in date,
349 	 p_datetrack_mode		in varchar2,
350 	 p_validation_start_date	in date,
351 	 p_validation_end_date		in date) is
352 --
353   l_proc	varchar2(72) := g_package||'pre_insert';
354 --
355 --
356 --
357   Cursor C_Sel1 is select ben_bnft_prvdd_ldgr_f_s.nextval from sys.dual;
358 --
359 Begin
360   hr_utility.set_location('Entering:'||l_proc, 5);
361   --
362   -- Select the next sequence number
363   --
364   Open C_Sel1;
365   Fetch C_Sel1 Into p_rec.bnft_prvdd_ldgr_id;
366   Close C_Sel1;
367   --
368   hr_utility.set_location(' Leaving:'||l_proc, 10);
369 End pre_insert;
370 --
371 -- ----------------------------------------------------------------------------
372 -- |-----------------------------< post_insert >------------------------------|
373 -- ----------------------------------------------------------------------------
374 -- {Start Of Comments}
375 --
376 -- Description:
377 --   This private procedure contains any processing which is required after the
378 --   insert dml.
379 --
380 -- Prerequisites:
381 --   This is an internal procedure which is called from the ins procedure.
382 --
383 -- In Parameters:
384 --   A Pl/Sql record structre.
385 --
386 -- Post Success:
387 --   Processing continues.
388 --
389 -- Post Failure:
390 --   If an error has occurred, an error message and exception will be raised
391 --   but not handled.
392 --
393 -- Developer Implementation Notes:
394 --   Any post-processing required after the insert dml is issued should be
395 --   coded within this procedure. It is important to note that any 3rd party
396 --   maintenance should be reviewed before placing in this procedure.
397 --
398 -- Access Status:
399 --   Internal Row Handler Use Only.
400 --
401 -- {End Of Comments}
402 -- ----------------------------------------------------------------------------
403 Procedure post_insert
404 	(p_rec 			 in ben_bpl_shd.g_rec_type,
405 	 p_effective_date	 in date,
406 	 p_datetrack_mode	 in varchar2,
407 	 p_validation_start_date in date,
408 	 p_validation_end_date	 in date) is
409 --
410   l_proc	varchar2(72) := g_package||'post_insert';
411 --
412 Begin
413   hr_utility.set_location('Entering:'||l_proc, 5);
414 --
415   --
416   -- Start of API User Hook for post_insert.
417   --
418   begin
419     --
420     ben_bpl_rki.after_insert
421       (
422   p_bnft_prvdd_ldgr_id            =>p_rec.bnft_prvdd_ldgr_id
423  ,p_effective_start_date          =>p_rec.effective_start_date
424  ,p_effective_end_date            =>p_rec.effective_end_date
425  ,p_prtt_ro_of_unusd_amt_flag     =>p_rec.prtt_ro_of_unusd_amt_flag
426  ,p_frftd_val                     =>p_rec.frftd_val
427  ,p_prvdd_val                     =>p_rec.prvdd_val
428  ,p_used_val                      =>p_rec.used_val
429  ,p_bnft_prvdr_pool_id            =>p_rec.bnft_prvdr_pool_id
430  ,p_acty_base_rt_id               =>p_rec.acty_base_rt_id
431  ,p_per_in_ler_id               =>p_rec.per_in_ler_id
432  ,p_prtt_enrt_rslt_id             =>p_rec.prtt_enrt_rslt_id
433  ,p_business_group_id             =>p_rec.business_group_id
434  ,p_bpl_attribute_category        =>p_rec.bpl_attribute_category
435  ,p_bpl_attribute1                =>p_rec.bpl_attribute1
436  ,p_bpl_attribute2                =>p_rec.bpl_attribute2
437  ,p_bpl_attribute3                =>p_rec.bpl_attribute3
438  ,p_bpl_attribute4                =>p_rec.bpl_attribute4
439  ,p_bpl_attribute5                =>p_rec.bpl_attribute5
440  ,p_bpl_attribute6                =>p_rec.bpl_attribute6
441  ,p_bpl_attribute7                =>p_rec.bpl_attribute7
442  ,p_bpl_attribute8                =>p_rec.bpl_attribute8
443  ,p_bpl_attribute9                =>p_rec.bpl_attribute9
444  ,p_bpl_attribute10               =>p_rec.bpl_attribute10
445  ,p_bpl_attribute11               =>p_rec.bpl_attribute11
446  ,p_bpl_attribute12               =>p_rec.bpl_attribute12
447  ,p_bpl_attribute13               =>p_rec.bpl_attribute13
448  ,p_bpl_attribute14               =>p_rec.bpl_attribute14
449  ,p_bpl_attribute15               =>p_rec.bpl_attribute15
450  ,p_bpl_attribute16               =>p_rec.bpl_attribute16
451  ,p_bpl_attribute17               =>p_rec.bpl_attribute17
452  ,p_bpl_attribute18               =>p_rec.bpl_attribute18
453  ,p_bpl_attribute19               =>p_rec.bpl_attribute19
454  ,p_bpl_attribute20               =>p_rec.bpl_attribute20
455  ,p_bpl_attribute21               =>p_rec.bpl_attribute21
456  ,p_bpl_attribute22               =>p_rec.bpl_attribute22
457  ,p_bpl_attribute23               =>p_rec.bpl_attribute23
458  ,p_bpl_attribute24               =>p_rec.bpl_attribute24
459  ,p_bpl_attribute25               =>p_rec.bpl_attribute25
460  ,p_bpl_attribute26               =>p_rec.bpl_attribute26
461  ,p_bpl_attribute27               =>p_rec.bpl_attribute27
462  ,p_bpl_attribute28               =>p_rec.bpl_attribute28
463  ,p_bpl_attribute29               =>p_rec.bpl_attribute29
464  ,p_bpl_attribute30               =>p_rec.bpl_attribute30
465  ,p_object_version_number         =>p_rec.object_version_number
466  ,p_cash_recd_val                 =>p_rec.cash_recd_val
467  ,p_rld_up_val                    =>p_rec.rld_up_val
468  ,p_effective_date                =>p_effective_date
469  ,p_validation_start_date         =>p_validation_start_date
470  ,p_validation_end_date           =>p_validation_end_date
471 	,p_acty_ref_perd_cd              =>   p_rec.acty_ref_perd_cd
472 	,p_cmcd_frftd_val                =>   p_rec.cmcd_frftd_val
473 	,p_cmcd_prvdd_val                =>   p_rec.cmcd_prvdd_val
474 	,p_cmcd_rld_up_val               =>   p_rec.cmcd_rld_up_val
475 	,p_cmcd_used_val                 =>   p_rec.cmcd_used_val
476 	,p_cmcd_cash_recd_val            =>   p_rec.cmcd_cash_recd_val
477 	,p_cmcd_ref_perd_cd              =>   p_rec.cmcd_ref_perd_cd
478 	,p_ann_frftd_val                 =>   p_rec.ann_frftd_val
479 	,p_ann_prvdd_val                 =>   p_rec.ann_prvdd_val
480 	,p_ann_rld_up_val                =>   p_rec.ann_rld_up_val
481 	,p_ann_used_val                  =>   p_rec.ann_used_val
482 	,p_ann_cash_recd_val             =>   p_rec.ann_cash_recd_val
483       );
484     --
485   exception
486     --
487     when hr_api.cannot_find_prog_unit then
488       --
489       hr_api.cannot_find_prog_unit_error
490         (p_module_name => 'ben_bnft_prvdd_ldgr_f'
491         ,p_hook_type   => 'AI');
492       --
493   end;
494   --
495   -- End of API User Hook for post_insert.
496   --
497   --
498   hr_utility.set_location(' Leaving:'||l_proc, 10);
499 End post_insert;
500 --
501 -- ----------------------------------------------------------------------------
502 -- |-------------------------------< ins_lck >--------------------------------|
503 -- ----------------------------------------------------------------------------
504 -- {Start Of Comments}
505 --
506 -- Description:
507 --   The ins_lck process has one main function to perform. When inserting
508 --   a datetracked row, we must validate the DT mode.
509 --   be manipulated.
510 --
511 -- Prerequisites:
512 --   This procedure can only be called for the datetrack mode of INSERT.
513 --
514 -- In Parameters:
515 --
516 -- Post Success:
517 --   On successful completion of the ins_lck process the parental
518 --   datetracked rows will be locked providing the p_enforce_foreign_locking
519 --   argument value is TRUE.
520 --   If the p_enforce_foreign_locking argument value is FALSE then the
521 --   parential rows are not locked.
522 --
523 -- Post Failure:
524 --   The Lck process can fail for:
525 --   1) When attempting to lock the row the row could already be locked by
526 --      another user. This will raise the HR_Api.Object_Locked exception.
527 --   2) When attempting to the lock the parent which doesn't exist.
528 --      For the entity to be locked the parent must exist!
529 --
530 -- Developer Implementation Notes:
531 --   None.
532 --
533 -- Access Status:
534 --   Internal Row Handler Use Only.
535 --
536 -- {End Of Comments}
537 -- ----------------------------------------------------------------------------
538 Procedure ins_lck
539 	(p_effective_date	 in  date,
540 	 p_datetrack_mode	 in  varchar2,
541 	 p_rec	 		 in  ben_bpl_shd.g_rec_type,
542 	 p_validation_start_date out nocopy date,
543 	 p_validation_end_date	 out nocopy date) is
544 --
545   l_proc		  varchar2(72) := g_package||'ins_lck';
546   l_validation_start_date date;
547   l_validation_end_date	  date;
548 --
549 Begin
550   hr_utility.set_location('Entering:'||l_proc, 5);
551   --
552   -- Validate the datetrack mode mode getting the validation start
553   -- and end dates for the specified datetrack operation.
554   --
555   dt_api.validate_dt_mode
556 	(p_effective_date	   => p_effective_date,
557 	 p_datetrack_mode	   => p_datetrack_mode,
558 	 p_base_table_name	   => 'ben_bnft_prvdd_ldgr_f',
559 	 p_base_key_column	   => 'bnft_prvdd_ldgr_id',
560 	 p_base_key_value 	   => p_rec.bnft_prvdd_ldgr_id,
561 	 p_parent_table_name1      => 'ben_acty_base_rt_f',
562 	 p_parent_key_column1      => 'acty_base_rt_id',
563 	 p_parent_key_value1       => p_rec.acty_base_rt_id,
564 	 p_parent_table_name2      => 'ben_bnft_prvdr_pool_f',
565 	 p_parent_key_column2      => 'bnft_prvdr_pool_id',
566 	 p_parent_key_value2       => p_rec.bnft_prvdr_pool_id,
567 	 p_parent_table_name3      => 'ben_prtt_enrt_rslt_f',
568 	 p_parent_key_column3      => 'prtt_enrt_rslt_id',
569 	 p_parent_key_value3       => p_rec.prtt_enrt_rslt_id,
570          p_enforce_foreign_locking => false,
571 	 p_validation_start_date   => l_validation_start_date,
572  	 p_validation_end_date	   => l_validation_end_date);
573 
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_bpl_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_bpl_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_bnft_prvdd_ldgr_id           out nocopy number,
653   p_effective_start_date         out nocopy date,
654   p_effective_end_date           out nocopy date,
655   p_prtt_ro_of_unusd_amt_flag    in varchar2,
656   p_frftd_val                    in number           default null,
657   p_prvdd_val                    in number           default null,
658   p_used_val                     in number           default null,
659   p_bnft_prvdr_pool_id           in number           default null,
660   p_acty_base_rt_id              in number,
661   p_per_in_ler_id              in number,
662   p_prtt_enrt_rslt_id            in number           default null,
663   p_business_group_id            in number,
664   p_bpl_attribute_category       in varchar2         default null,
665   p_bpl_attribute1               in varchar2         default null,
666   p_bpl_attribute2               in varchar2         default null,
667   p_bpl_attribute3               in varchar2         default null,
668   p_bpl_attribute4               in varchar2         default null,
669   p_bpl_attribute5               in varchar2         default null,
670   p_bpl_attribute6               in varchar2         default null,
671   p_bpl_attribute7               in varchar2         default null,
672   p_bpl_attribute8               in varchar2         default null,
673   p_bpl_attribute9               in varchar2         default null,
674   p_bpl_attribute10              in varchar2         default null,
675   p_bpl_attribute11              in varchar2         default null,
676   p_bpl_attribute12              in varchar2         default null,
677   p_bpl_attribute13              in varchar2         default null,
678   p_bpl_attribute14              in varchar2         default null,
679   p_bpl_attribute15              in varchar2         default null,
680   p_bpl_attribute16              in varchar2         default null,
681   p_bpl_attribute17              in varchar2         default null,
682   p_bpl_attribute18              in varchar2         default null,
683   p_bpl_attribute19              in varchar2         default null,
684   p_bpl_attribute20              in varchar2         default null,
685   p_bpl_attribute21              in varchar2         default null,
686   p_bpl_attribute22              in varchar2         default null,
687   p_bpl_attribute23              in varchar2         default null,
688   p_bpl_attribute24              in varchar2         default null,
689   p_bpl_attribute25              in varchar2         default null,
690   p_bpl_attribute26              in varchar2         default null,
691   p_bpl_attribute27              in varchar2         default null,
692   p_bpl_attribute28              in varchar2         default null,
693   p_bpl_attribute29              in varchar2         default null,
694   p_bpl_attribute30              in varchar2         default null,
695   p_cash_recd_val                in number           default null,
696   p_rld_up_val                   in number           default null,
697   p_effective_date		 in date,
698 	p_acty_ref_perd_cd              in   varchar2 default null,
699 	p_cmcd_frftd_val                in   number default null,
700 	p_cmcd_prvdd_val                in   number default null,
701 	p_cmcd_rld_up_val               in   number default null,
702 	p_cmcd_used_val                 in   number default null,
703 	p_cmcd_cash_recd_val            in   number default null,
704 	p_cmcd_ref_perd_cd              in   varchar2 default null,
705 	p_ann_frftd_val                 in   number default null,
706 	p_ann_prvdd_val                 in   number default null,
707 	p_ann_rld_up_val                in   number default null,
708 	p_ann_used_val                  in   number default null,
709 	p_ann_cash_recd_val             in   number default null,
710   p_object_version_number        out nocopy number
711   ) is
712 --
713   l_rec		ben_bpl_shd.g_rec_type;
714   l_proc	varchar2(72) := g_package||'ins';
715 --
716 Begin
717   hr_utility.set_location('Entering:'||l_proc, 5);
718   --
719   -- Call conversion function to turn arguments into the
720   -- p_rec structure.
721   --
722   l_rec :=
723   ben_bpl_shd.convert_args
724   (
725   null,
726   null,
727   null,
728   p_prtt_ro_of_unusd_amt_flag,
729   p_frftd_val,
730   p_prvdd_val,
731   p_used_val,
732   p_bnft_prvdr_pool_id,
733   p_acty_base_rt_id,
734   p_per_in_ler_id,
735   p_prtt_enrt_rslt_id,
736   p_business_group_id,
737   p_bpl_attribute_category,
738   p_bpl_attribute1,
739   p_bpl_attribute2,
740   p_bpl_attribute3,
741   p_bpl_attribute4,
742   p_bpl_attribute5,
743   p_bpl_attribute6,
744   p_bpl_attribute7,
745   p_bpl_attribute8,
746   p_bpl_attribute9,
747   p_bpl_attribute10,
748   p_bpl_attribute11,
749   p_bpl_attribute12,
750   p_bpl_attribute13,
751   p_bpl_attribute14,
752   p_bpl_attribute15,
753   p_bpl_attribute16,
754   p_bpl_attribute17,
755   p_bpl_attribute18,
756   p_bpl_attribute19,
757   p_bpl_attribute20,
758   p_bpl_attribute21,
759   p_bpl_attribute22,
760   p_bpl_attribute23,
761   p_bpl_attribute24,
762   p_bpl_attribute25,
763   p_bpl_attribute26,
764   p_bpl_attribute27,
765   p_bpl_attribute28,
766   p_bpl_attribute29,
767   p_bpl_attribute30,
768   null,
769   p_cash_recd_val,
770   p_rld_up_val,
771   p_acty_ref_perd_cd,
772   p_cmcd_frftd_val,
773   p_cmcd_prvdd_val,
774   p_cmcd_rld_up_val,
775   p_cmcd_used_val,
776   p_cmcd_cash_recd_val,
777   p_cmcd_ref_perd_cd,
778   p_ann_frftd_val,
779   p_ann_prvdd_val,
780   p_ann_rld_up_val,
781   p_ann_used_val,
782   p_ann_cash_recd_val
783   );
784   --
785   -- Having converted the arguments into the ben_bpl_rec
786   -- plsql record structure we call the corresponding record
787   -- business process.
788   --
789   ins(l_rec, p_effective_date);
790   --
791   -- Set the OUT arguments.
792   --
793   p_bnft_prvdd_ldgr_id        	:= l_rec.bnft_prvdd_ldgr_id;
794   p_effective_start_date  	:= l_rec.effective_start_date;
795   p_effective_end_date    	:= l_rec.effective_end_date;
796   p_object_version_number 	:= l_rec.object_version_number;
797   --
798   --
799   hr_utility.set_location(' Leaving:'||l_proc, 10);
800 End ins;
801 --
802 end ben_bpl_ins;