DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_LBR_INS

Source


1 Package Body ben_lbr_ins as
2 /* $Header: belbrrhi.pkb 120.0 2005/05/28 03:16:53 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_lbr_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_lbr_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_ler_bnft_rstrn_f t
70     where  t.ler_bnft_rstrn_id       = p_rec.ler_bnft_rstrn_id
71     and    t.effective_start_date =
72              ben_lbr_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_ler_bnft_rstrn_f.created_by%TYPE;
77   l_creation_date       ben_ler_bnft_rstrn_f.creation_date%TYPE;
78   l_last_update_date   	ben_ler_bnft_rstrn_f.last_update_date%TYPE;
79   l_last_updated_by     ben_ler_bnft_rstrn_f.last_updated_by%TYPE;
80   l_last_update_login   ben_ler_bnft_rstrn_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_ler_bnft_rstrn_f',
90 	 p_base_key_column => 'ler_bnft_rstrn_id',
91 	 p_base_key_value  => p_rec.ler_bnft_rstrn_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_lbr_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_ler_bnft_rstrn_f
132   --
133   insert into ben_ler_bnft_rstrn_f
134   (	ler_bnft_rstrn_id,
135 	effective_start_date,
136 	effective_end_date,
137 	no_mx_cvg_amt_apls_flag,
138 	no_mn_cvg_incr_apls_flag,
139 	no_mx_cvg_incr_apls_flag,
140 	mx_cvg_incr_wcf_alwd_amt,
141 	mx_cvg_incr_alwd_amt,
142 	mx_cvg_alwd_amt,
143 	mx_cvg_mlt_incr_num,
144 	mx_cvg_mlt_incr_wcf_num,
145 	mx_cvg_rl,
146 	mx_cvg_wcfn_amt,
147 	mx_cvg_wcfn_mlt_num,
148 	mn_cvg_amt,
149 	mn_cvg_rl,
150 	cvg_incr_r_decr_only_cd,
151         unsspnd_enrt_cd,
152         dflt_to_asn_pndg_ctfn_cd,
153         dflt_to_asn_pndg_ctfn_rl,
154 	ler_id,
155 	pl_id,
156 	business_group_id,
157 	plip_id,
158 	lbr_attribute_category,
159 	lbr_attribute1,
160 	lbr_attribute2,
161 	lbr_attribute3,
162 	lbr_attribute4,
163 	lbr_attribute5,
164 	lbr_attribute6,
165 	lbr_attribute7,
166 	lbr_attribute8,
167 	lbr_attribute9,
168 	lbr_attribute10,
169 	lbr_attribute11,
170 	lbr_attribute12,
171 	lbr_attribute13,
172 	lbr_attribute14,
173 	lbr_attribute15,
174 	lbr_attribute16,
175 	lbr_attribute17,
176 	lbr_attribute18,
177 	lbr_attribute19,
178 	lbr_attribute20,
179 	lbr_attribute21,
180 	lbr_attribute22,
181 	lbr_attribute23,
182 	lbr_attribute24,
183 	lbr_attribute25,
184 	lbr_attribute26,
185 	lbr_attribute27,
186 	lbr_attribute28,
187 	lbr_attribute29,
188 	lbr_attribute30,
189         susp_if_ctfn_not_prvd_flag,
190         ctfn_determine_cd,
191 	object_version_number
192    	, created_by,
193    	creation_date,
194    	last_update_date,
195    	last_updated_by,
196    	last_update_login
197   )
198   Values
199   (	p_rec.ler_bnft_rstrn_id,
200 	p_rec.effective_start_date,
201 	p_rec.effective_end_date,
202 	p_rec.no_mx_cvg_amt_apls_flag,
203 	p_rec.no_mn_cvg_incr_apls_flag,
204 	p_rec.no_mx_cvg_incr_apls_flag,
205 	p_rec.mx_cvg_incr_wcf_alwd_amt,
206 	p_rec.mx_cvg_incr_alwd_amt,
207 	p_rec.mx_cvg_alwd_amt,
208 	p_rec.mx_cvg_mlt_incr_num,
209 	p_rec.mx_cvg_mlt_incr_wcf_num,
210 	p_rec.mx_cvg_rl,
211 	p_rec.mx_cvg_wcfn_amt,
212 	p_rec.mx_cvg_wcfn_mlt_num,
213 	p_rec.mn_cvg_amt,
214 	p_rec.mn_cvg_rl,
215 	p_rec.cvg_incr_r_decr_only_cd,
216         p_rec.unsspnd_enrt_cd,
217         p_rec.dflt_to_asn_pndg_ctfn_cd,
218         p_rec.dflt_to_asn_pndg_ctfn_rl,
219 	p_rec.ler_id,
220 	p_rec.pl_id,
221 	p_rec.business_group_id,
222 	p_rec.plip_id,
223 	p_rec.lbr_attribute_category,
224 	p_rec.lbr_attribute1,
225 	p_rec.lbr_attribute2,
226 	p_rec.lbr_attribute3,
227 	p_rec.lbr_attribute4,
228 	p_rec.lbr_attribute5,
229 	p_rec.lbr_attribute6,
230 	p_rec.lbr_attribute7,
231 	p_rec.lbr_attribute8,
232 	p_rec.lbr_attribute9,
233 	p_rec.lbr_attribute10,
234 	p_rec.lbr_attribute11,
235 	p_rec.lbr_attribute12,
236 	p_rec.lbr_attribute13,
237 	p_rec.lbr_attribute14,
238 	p_rec.lbr_attribute15,
239 	p_rec.lbr_attribute16,
240 	p_rec.lbr_attribute17,
241 	p_rec.lbr_attribute18,
242 	p_rec.lbr_attribute19,
243 	p_rec.lbr_attribute20,
244 	p_rec.lbr_attribute21,
245 	p_rec.lbr_attribute22,
246 	p_rec.lbr_attribute23,
247 	p_rec.lbr_attribute24,
248 	p_rec.lbr_attribute25,
249 	p_rec.lbr_attribute26,
250 	p_rec.lbr_attribute27,
251 	p_rec.lbr_attribute28,
252 	p_rec.lbr_attribute29,
253 	p_rec.lbr_attribute30,
254         p_rec.susp_if_ctfn_not_prvd_flag,
255         p_rec.ctfn_determine_cd,
256 	p_rec.object_version_number
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_lbr_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_lbr_shd.g_api_dml := false;   -- Unset the api dml status
271     ben_lbr_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_lbr_shd.g_api_dml := false;   -- Unset the api dml status
276     ben_lbr_shd.constraint_error
277       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
278   When Others Then
279     ben_lbr_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_lbr_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_lbr_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   cursor c1 is
356     select ben_ler_bnft_rstrn_f_s.nextval
357     from   sys.dual;
358 --
359 --
360 Begin
361   hr_utility.set_location('Entering:'||l_proc, 5);
362   --
363   --
364   open c1;
365     fetch c1 into p_rec.ler_bnft_rstrn_id;
366   close c1;
367   --
368   --
369   hr_utility.set_location(' Leaving:'||l_proc, 10);
370 End pre_insert;
371 --
372 -- ----------------------------------------------------------------------------
373 -- |-----------------------------< post_insert >------------------------------|
374 -- ----------------------------------------------------------------------------
375 -- {Start Of Comments}
376 --
377 -- Description:
378 --   This private procedure contains any processing which is required after the
379 --   insert dml.
380 --
381 -- Prerequisites:
382 --   This is an internal procedure which is called from the ins procedure.
383 --
384 -- In Parameters:
385 --   A Pl/Sql record structre.
386 --
387 -- Post Success:
388 --   Processing continues.
389 --
390 -- Post Failure:
391 --   If an error has occurred, an error message and exception will be raised
392 --   but not handled.
393 --
394 -- Developer Implementation Notes:
395 --   Any post-processing required after the insert dml is issued should be
396 --   coded within this procedure. It is important to note that any 3rd party
397 --   maintenance should be reviewed before placing in this procedure.
398 --
399 -- Access Status:
400 --   Internal Row Handler Use Only.
401 --
402 -- {End Of Comments}
403 -- ----------------------------------------------------------------------------
404 Procedure post_insert
405 	(p_rec 			 in ben_lbr_shd.g_rec_type,
406 	 p_effective_date	 in date,
407 	 p_datetrack_mode	 in varchar2,
408 	 p_validation_start_date in date,
409 	 p_validation_end_date	 in date) is
410 --
411   l_proc	varchar2(72) := g_package||'post_insert';
412 --
413 Begin
414   hr_utility.set_location('Entering:'||l_proc, 5);
415 --
416   --
417   -- Start of API User Hook for post_insert.
418   --
422       (
419   begin
420     --
421     ben_lbr_rki.after_insert
423   p_ler_bnft_rstrn_id             =>p_rec.ler_bnft_rstrn_id
424  ,p_effective_start_date          =>p_rec.effective_start_date
425  ,p_effective_end_date            =>p_rec.effective_end_date
426  ,p_no_mx_cvg_amt_apls_flag       =>p_rec.no_mx_cvg_amt_apls_flag
427  ,p_no_mn_cvg_incr_apls_flag      =>p_rec.no_mn_cvg_incr_apls_flag
428  ,p_no_mx_cvg_incr_apls_flag      =>p_rec.no_mx_cvg_incr_apls_flag
429  ,p_mx_cvg_incr_wcf_alwd_amt      =>p_rec.mx_cvg_incr_wcf_alwd_amt
430  ,p_mx_cvg_incr_alwd_amt          =>p_rec.mx_cvg_incr_alwd_amt
431  ,p_mx_cvg_alwd_amt               =>p_rec.mx_cvg_alwd_amt
432  ,p_mx_cvg_mlt_incr_num           =>p_rec.mx_cvg_mlt_incr_num
433  ,p_mx_cvg_mlt_incr_wcf_num       =>p_rec.mx_cvg_mlt_incr_wcf_num
434  ,p_mx_cvg_rl                     =>p_rec.mx_cvg_rl
435  ,p_mx_cvg_wcfn_amt               =>p_rec.mx_cvg_wcfn_amt
436  ,p_mx_cvg_wcfn_mlt_num           =>p_rec.mx_cvg_wcfn_mlt_num
437  ,p_mn_cvg_amt                    =>p_rec.mn_cvg_amt
438  ,p_mn_cvg_rl                     =>p_rec.mn_cvg_rl
439  ,p_cvg_incr_r_decr_only_cd       =>p_rec.cvg_incr_r_decr_only_cd
440  ,p_unsspnd_enrt_cd               =>p_rec.unsspnd_enrt_cd
441  ,p_dflt_to_asn_pndg_ctfn_cd      =>p_rec.dflt_to_asn_pndg_ctfn_cd
442  ,p_dflt_to_asn_pndg_ctfn_rl      =>p_rec.dflt_to_asn_pndg_ctfn_rl
443  ,p_ler_id                        =>p_rec.ler_id
444  ,p_pl_id                         =>p_rec.pl_id
445  ,p_business_group_id             =>p_rec.business_group_id
446  ,p_plip_id                       =>p_rec.plip_id
447  ,p_lbr_attribute_category        =>p_rec.lbr_attribute_category
448  ,p_lbr_attribute1                =>p_rec.lbr_attribute1
449  ,p_lbr_attribute2                =>p_rec.lbr_attribute2
450  ,p_lbr_attribute3                =>p_rec.lbr_attribute3
451  ,p_lbr_attribute4                =>p_rec.lbr_attribute4
452  ,p_lbr_attribute5                =>p_rec.lbr_attribute5
453  ,p_lbr_attribute6                =>p_rec.lbr_attribute6
454  ,p_lbr_attribute7                =>p_rec.lbr_attribute7
455  ,p_lbr_attribute8                =>p_rec.lbr_attribute8
456  ,p_lbr_attribute9                =>p_rec.lbr_attribute9
457  ,p_lbr_attribute10               =>p_rec.lbr_attribute10
458  ,p_lbr_attribute11               =>p_rec.lbr_attribute11
459  ,p_lbr_attribute12               =>p_rec.lbr_attribute12
460  ,p_lbr_attribute13               =>p_rec.lbr_attribute13
461  ,p_lbr_attribute14               =>p_rec.lbr_attribute14
462  ,p_lbr_attribute15               =>p_rec.lbr_attribute15
463  ,p_lbr_attribute16               =>p_rec.lbr_attribute16
464  ,p_lbr_attribute17               =>p_rec.lbr_attribute17
465  ,p_lbr_attribute18               =>p_rec.lbr_attribute18
466  ,p_lbr_attribute19               =>p_rec.lbr_attribute19
467  ,p_lbr_attribute20               =>p_rec.lbr_attribute20
468  ,p_lbr_attribute21               =>p_rec.lbr_attribute21
469  ,p_lbr_attribute22               =>p_rec.lbr_attribute22
470  ,p_lbr_attribute23               =>p_rec.lbr_attribute23
471  ,p_lbr_attribute24               =>p_rec.lbr_attribute24
472  ,p_lbr_attribute25               =>p_rec.lbr_attribute25
473  ,p_lbr_attribute26               =>p_rec.lbr_attribute26
474  ,p_lbr_attribute27               =>p_rec.lbr_attribute27
475  ,p_lbr_attribute28               =>p_rec.lbr_attribute28
476  ,p_lbr_attribute29               =>p_rec.lbr_attribute29
477  ,p_lbr_attribute30               =>p_rec.lbr_attribute30
478  ,p_susp_if_ctfn_not_prvd_flag    =>p_rec.susp_if_ctfn_not_prvd_flag
479  ,p_ctfn_determine_cd             =>p_rec.ctfn_determine_cd
480  ,p_object_version_number         =>p_rec.object_version_number
481  ,p_effective_date                =>p_effective_date
482  ,p_validation_start_date         =>p_validation_start_date
483  ,p_validation_end_date           =>p_validation_end_date
484       );
485     --
486   exception
487     --
488     when hr_api.cannot_find_prog_unit then
489       --
490       hr_api.cannot_find_prog_unit_error
491         (p_module_name => 'ben_ler_bnft_rstrn_f'
492         ,p_hook_type   => 'AI');
493       --
494   end;
495   --
496   -- End of API User Hook for post_insert.
497   --
498   --
499   hr_utility.set_location(' Leaving:'||l_proc, 10);
500 End post_insert;
501 --
502 -- ----------------------------------------------------------------------------
503 -- |-------------------------------< ins_lck >--------------------------------|
504 -- ----------------------------------------------------------------------------
505 -- {Start Of Comments}
506 --
507 -- Description:
508 --   The ins_lck process has one main function to perform. When inserting
509 --   a datetracked row, we must validate the DT mode.
510 --   be manipulated.
511 --
512 -- Prerequisites:
513 --   This procedure can only be called for the datetrack mode of INSERT.
514 --
515 -- In Parameters:
516 --
517 -- Post Success:
518 --   On successful completion of the ins_lck process the parental
519 --   datetracked rows will be locked providing the p_enforce_foreign_locking
520 --   argument value is TRUE.
521 --   If the p_enforce_foreign_locking argument value is FALSE then the
522 --   parential rows are not locked.
523 --
524 -- Post Failure:
525 --   The Lck process can fail for:
526 --   1) When attempting to lock the row the row could already be locked by
527 --      another user. This will raise the HR_Api.Object_Locked exception.
531 -- Developer Implementation Notes:
528 --   2) When attempting to the lock the parent which doesn't exist.
529 --      For the entity to be locked the parent must exist!
530 --
532 --   None.
533 --
534 -- Access Status:
535 --   Internal Row Handler Use Only.
536 --
537 -- {End Of Comments}
538 -- ----------------------------------------------------------------------------
539 Procedure ins_lck
540 	(p_effective_date	 in  date,
541 	 p_datetrack_mode	 in  varchar2,
542 	 p_rec	 		 in  ben_lbr_shd.g_rec_type,
543 	 p_validation_start_date out nocopy date,
544 	 p_validation_end_date	 out nocopy date) is
545 --
546   l_proc		  varchar2(72) := g_package||'ins_lck';
547   l_validation_start_date date;
548   l_validation_end_date	  date;
549 --
550 Begin
551   hr_utility.set_location('Entering:'||l_proc, 5);
552   --
553   -- Validate the datetrack mode mode getting the validation start
554   -- and end dates for the specified datetrack operation.
555   --
556   dt_api.validate_dt_mode
557 	(p_effective_date	   => p_effective_date,
558 	 p_datetrack_mode	   => p_datetrack_mode,
559 	 p_base_table_name	   => 'ben_ler_bnft_rstrn_f',
560 	 p_base_key_column	   => 'ler_bnft_rstrn_id',
561 	 p_base_key_value 	   => p_rec.ler_bnft_rstrn_id,
562 	 p_parent_table_name1      => 'ben_ler_f',
563 	 p_parent_key_column1      => 'ler_id',
564 	 p_parent_key_value1       => p_rec.ler_id,
565 	 p_parent_table_name2      => 'ben_pl_f',
566 	 p_parent_key_column2      => 'pl_id',
567 	 p_parent_key_value2       => p_rec.pl_id,
568          p_enforce_foreign_locking => true,
569 	 p_validation_start_date   => l_validation_start_date,
570  	 p_validation_end_date	   => l_validation_end_date);
571   --
572   -- Set the validation start and end date OUT arguments
573   --
574   p_validation_start_date := l_validation_start_date;
575   p_validation_end_date   := l_validation_end_date;
576   --
577   hr_utility.set_location(' Leaving:'||l_proc, 10);
578 --
579 End ins_lck;
580 --
581 -- ----------------------------------------------------------------------------
582 -- |---------------------------------< ins >----------------------------------|
583 -- ----------------------------------------------------------------------------
584 Procedure ins
585   (
586   p_rec		   in out nocopy ben_lbr_shd.g_rec_type,
587   p_effective_date in     date
588   ) is
589 --
590   l_proc			varchar2(72) := g_package||'ins';
591   l_datetrack_mode		varchar2(30) := 'INSERT';
592   l_validation_start_date	date;
593   l_validation_end_date		date;
594 --
595 Begin
596   hr_utility.set_location('Entering:'||l_proc, 5);
597   --
598   -- Call the lock operation
599   --
600   ins_lck
601 	(p_effective_date	 => p_effective_date,
602 	 p_datetrack_mode	 => l_datetrack_mode,
603 	 p_rec	 		 => p_rec,
604 	 p_validation_start_date => l_validation_start_date,
605 	 p_validation_end_date	 => l_validation_end_date);
606   --
607   -- Call the supporting insert validate operations
608   --
609   ben_lbr_bus.insert_validate
610 	(p_rec			 => p_rec,
611 	 p_effective_date	 => p_effective_date,
612 	 p_datetrack_mode	 => l_datetrack_mode,
613 	 p_validation_start_date => l_validation_start_date,
614 	 p_validation_end_date	 => l_validation_end_date);
615   --
616   -- Call the supporting pre-insert operation
617   --
618   pre_insert
619  	(p_rec			 => p_rec,
620 	 p_effective_date	 => p_effective_date,
621 	 p_datetrack_mode	 => l_datetrack_mode,
622 	 p_validation_start_date => l_validation_start_date,
623 	 p_validation_end_date	 => l_validation_end_date);
624   --
625   -- Insert the row
626   --
627   insert_dml
628  	(p_rec			 => p_rec,
629 	 p_effective_date	 => p_effective_date,
630 	 p_datetrack_mode	 => l_datetrack_mode,
631 	 p_validation_start_date => l_validation_start_date,
632 	 p_validation_end_date	 => l_validation_end_date);
633   --
634   -- Call the supporting post-insert operation
635   --
636   post_insert
637  	(p_rec			 => p_rec,
638 	 p_effective_date	 => p_effective_date,
639 	 p_datetrack_mode	 => l_datetrack_mode,
640 	 p_validation_start_date => l_validation_start_date,
641 	 p_validation_end_date	 => l_validation_end_date);
642 end ins;
643 --
644 -- ----------------------------------------------------------------------------
645 -- |---------------------------------< ins >----------------------------------|
646 -- ----------------------------------------------------------------------------
647 Procedure ins
648   (
649   p_ler_bnft_rstrn_id            out nocopy number,
650   p_effective_start_date         out nocopy date,
651   p_effective_end_date           out nocopy date,
652   p_no_mx_cvg_amt_apls_flag      in varchar2,
653   p_no_mn_cvg_incr_apls_flag     in varchar2,
654   p_no_mx_cvg_incr_apls_flag     in varchar2,
655   p_mx_cvg_incr_wcf_alwd_amt     in number  ,
656   p_mx_cvg_incr_alwd_amt         in number  ,
657   p_mx_cvg_alwd_amt              in number  ,
658   p_mx_cvg_mlt_incr_num          in number  ,
659   p_mx_cvg_mlt_incr_wcf_num      in number  ,
660   p_mx_cvg_rl                    in number  ,
661   p_mx_cvg_wcfn_amt              in number  ,
665   p_cvg_incr_r_decr_only_cd      in varchar2,
662   p_mx_cvg_wcfn_mlt_num          in number  ,
663   p_mn_cvg_amt                   in number  ,
664   p_mn_cvg_rl                    in number  ,
666   p_unsspnd_enrt_cd              in varchar2,
667   p_dflt_to_asn_pndg_ctfn_cd     in varchar2,
668   p_dflt_to_asn_pndg_ctfn_rl     in number  ,
669   p_ler_id                       in number,
670   p_pl_id                        in number,
671   p_business_group_id            in number,
672   p_plip_id                      in number,
673   p_lbr_attribute_category       in varchar2,
674   p_lbr_attribute1               in varchar2,
675   p_lbr_attribute2               in varchar2,
676   p_lbr_attribute3               in varchar2,
677   p_lbr_attribute4               in varchar2,
678   p_lbr_attribute5               in varchar2,
679   p_lbr_attribute6               in varchar2,
680   p_lbr_attribute7               in varchar2,
681   p_lbr_attribute8               in varchar2,
682   p_lbr_attribute9               in varchar2,
683   p_lbr_attribute10              in varchar2,
684   p_lbr_attribute11              in varchar2,
685   p_lbr_attribute12              in varchar2,
686   p_lbr_attribute13              in varchar2,
687   p_lbr_attribute14              in varchar2,
688   p_lbr_attribute15              in varchar2,
689   p_lbr_attribute16              in varchar2,
690   p_lbr_attribute17              in varchar2,
691   p_lbr_attribute18              in varchar2,
692   p_lbr_attribute19              in varchar2,
693   p_lbr_attribute20              in varchar2,
694   p_lbr_attribute21              in varchar2,
695   p_lbr_attribute22              in varchar2,
696   p_lbr_attribute23              in varchar2,
697   p_lbr_attribute24              in varchar2,
698   p_lbr_attribute25              in varchar2,
699   p_lbr_attribute26              in varchar2,
700   p_lbr_attribute27              in varchar2,
701   p_lbr_attribute28              in varchar2,
702   p_lbr_attribute29              in varchar2,
703   p_lbr_attribute30              in varchar2,
704   p_susp_if_ctfn_not_prvd_flag   in varchar2,
705   p_ctfn_determine_cd            in varchar2,
706   p_object_version_number        out nocopy number,
707   p_effective_date		 in date
708   ) is
709 --
710   l_rec		ben_lbr_shd.g_rec_type;
711   l_proc	varchar2(72) := g_package||'ins';
712 --
713 Begin
714   hr_utility.set_location('Entering:'||l_proc, 5);
715   --
716   -- Call conversion function to turn arguments into the
717   -- p_rec structure.
718   --
719   l_rec :=
720   ben_lbr_shd.convert_args
721   (
722   null,
723   null,
724   null,
725   p_no_mx_cvg_amt_apls_flag,
726   p_no_mn_cvg_incr_apls_flag,
727   p_no_mx_cvg_incr_apls_flag,
728   p_mx_cvg_incr_wcf_alwd_amt,
729   p_mx_cvg_incr_alwd_amt,
730   p_mx_cvg_alwd_amt,
731   p_mx_cvg_mlt_incr_num,
732   p_mx_cvg_mlt_incr_wcf_num,
733   p_mx_cvg_rl,
734   p_mx_cvg_wcfn_amt,
735   p_mx_cvg_wcfn_mlt_num,
736   p_mn_cvg_amt,
737   p_mn_cvg_rl,
738   p_cvg_incr_r_decr_only_cd,
739   p_unsspnd_enrt_cd,
740   p_dflt_to_asn_pndg_ctfn_cd,
741   p_dflt_to_asn_pndg_ctfn_rl,
742   p_ler_id,
743   p_pl_id,
744   p_business_group_id,
745   p_plip_id,
746   p_lbr_attribute_category,
747   p_lbr_attribute1,
748   p_lbr_attribute2,
749   p_lbr_attribute3,
750   p_lbr_attribute4,
751   p_lbr_attribute5,
752   p_lbr_attribute6,
753   p_lbr_attribute7,
754   p_lbr_attribute8,
755   p_lbr_attribute9,
756   p_lbr_attribute10,
757   p_lbr_attribute11,
758   p_lbr_attribute12,
759   p_lbr_attribute13,
760   p_lbr_attribute14,
761   p_lbr_attribute15,
762   p_lbr_attribute16,
763   p_lbr_attribute17,
764   p_lbr_attribute18,
765   p_lbr_attribute19,
766   p_lbr_attribute20,
767   p_lbr_attribute21,
768   p_lbr_attribute22,
769   p_lbr_attribute23,
770   p_lbr_attribute24,
771   p_lbr_attribute25,
772   p_lbr_attribute26,
773   p_lbr_attribute27,
774   p_lbr_attribute28,
775   p_lbr_attribute29,
776   p_lbr_attribute30,
777   p_susp_if_ctfn_not_prvd_flag,
778   p_ctfn_determine_cd,
779   null
780   );
781   --
782   -- Having converted the arguments into the ben_lbr_rec
783   -- plsql record structure we call the corresponding record
784   -- business process.
785   --
786   ins(l_rec, p_effective_date);
787   --
788   -- Set the OUT arguments.
789   --
790   p_ler_bnft_rstrn_id        	:= l_rec.ler_bnft_rstrn_id;
791   p_effective_start_date  	:= l_rec.effective_start_date;
792   p_effective_end_date    	:= l_rec.effective_end_date;
793   p_object_version_number 	:= l_rec.object_version_number;
794   --
795   --
796   hr_utility.set_location(' Leaving:'||l_proc, 10);
797 End ins;
798 --
799 end ben_lbr_ins;