DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CCM_INS

Source


1 Package Body ben_ccm_ins as
2 /* $Header: beccmrhi.pkb 120.5 2006/03/22 02:53:46 rgajula noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_ccm_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_ccm_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_cvg_amt_calc_mthd_f t
70     where  t.cvg_amt_calc_mthd_id       = p_rec.cvg_amt_calc_mthd_id
71     and    t.effective_start_date =
72              ben_ccm_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_cvg_amt_calc_mthd_f.created_by%TYPE;
77   l_creation_date       ben_cvg_amt_calc_mthd_f.creation_date%TYPE;
78   l_last_update_date   	ben_cvg_amt_calc_mthd_f.last_update_date%TYPE;
79   l_last_updated_by     ben_cvg_amt_calc_mthd_f.last_updated_by%TYPE;
80   l_last_update_login   ben_cvg_amt_calc_mthd_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_cvg_amt_calc_mthd_f',
90 	 p_base_key_column => 'cvg_amt_calc_mthd_id',
91 	 p_base_key_value  => p_rec.cvg_amt_calc_mthd_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_ccm_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_cvg_amt_calc_mthd_f
132   --
133   insert into ben_cvg_amt_calc_mthd_f
134   (	cvg_amt_calc_mthd_id,
135 	effective_start_date,
136 	effective_end_date,
137 	name,
138 	incrmt_val,
139 	mx_val,
140 	mn_val,
141 	no_mx_val_dfnd_flag,
142 	no_mn_val_dfnd_flag,
143 	rndg_cd,
144 	rndg_rl,
145         lwr_lmt_val,
146         lwr_lmt_calc_rl,
147         upr_lmt_val,
148         upr_lmt_calc_rl,
149 	val,
150 	val_ovrid_alwd_flag,
151 	val_calc_rl,
152 	uom,
153 	nnmntry_uom,
154 	bndry_perd_cd,
155 	bnft_typ_cd,
156 	cvg_mlt_cd,
157 	rt_typ_cd,
158         dflt_val,
159         entr_val_at_enrt_flag,
160         dflt_flag,
161 	comp_lvl_fctr_id,
162 	oipl_id,
163 	pl_id,
164 	plip_id,
165 	business_group_id,
166 	ccm_attribute_category,
167 	ccm_attribute1,
168 	ccm_attribute2,
169 	ccm_attribute3,
170 	ccm_attribute4,
171 	ccm_attribute5,
172 	ccm_attribute6,
173 	ccm_attribute7,
174 	ccm_attribute8,
175 	ccm_attribute9,
176 	ccm_attribute10,
177 	ccm_attribute11,
178 	ccm_attribute12,
179 	ccm_attribute13,
180 	ccm_attribute14,
181 	ccm_attribute15,
182 	ccm_attribute16,
183 	ccm_attribute17,
184 	ccm_attribute18,
185 	ccm_attribute19,
186 	ccm_attribute20,
187 	ccm_attribute21,
188 	ccm_attribute22,
189 	ccm_attribute23,
190 	ccm_attribute24,
191 	ccm_attribute25,
192 	ccm_attribute26,
193 	ccm_attribute27,
194 	ccm_attribute28,
195 	ccm_attribute29,
196 	ccm_attribute30,
197 	object_version_number
198    	, created_by,
199    	creation_date,
200    	last_update_date,
201    	last_updated_by,
202    	last_update_login
203   )
204   Values
205   (	p_rec.cvg_amt_calc_mthd_id,
206 	p_rec.effective_start_date,
207 	p_rec.effective_end_date,
208 	p_rec.name,
209 	p_rec.incrmt_val,
210 	p_rec.mx_val,
211 	p_rec.mn_val,
212 	p_rec.no_mx_val_dfnd_flag,
213 	p_rec.no_mn_val_dfnd_flag,
214 	p_rec.rndg_cd,
215 	p_rec.rndg_rl,
216         p_rec.lwr_lmt_val,
217         p_rec.lwr_lmt_calc_rl,
218         p_rec.upr_lmt_val,
219         p_rec.upr_lmt_calc_rl,
220 	p_rec.val,
221 	p_rec.val_ovrid_alwd_flag,
222 	p_rec.val_calc_rl,
223 	p_rec.uom,
224 	p_rec.nnmntry_uom,
225 	p_rec.bndry_perd_cd,
226 	p_rec.bnft_typ_cd,
227 	p_rec.cvg_mlt_cd,
228 	p_rec.rt_typ_cd,
229         p_rec.dflt_val,
230         p_rec.entr_val_at_enrt_flag,
231         p_rec.dflt_flag,
232 	p_rec.comp_lvl_fctr_id,
233 	p_rec.oipl_id,
234 	p_rec.pl_id,
235 	p_rec.plip_id,
236 	p_rec.business_group_id,
237 	p_rec.ccm_attribute_category,
238 	p_rec.ccm_attribute1,
239 	p_rec.ccm_attribute2,
240 	p_rec.ccm_attribute3,
241 	p_rec.ccm_attribute4,
242 	p_rec.ccm_attribute5,
243 	p_rec.ccm_attribute6,
244 	p_rec.ccm_attribute7,
245 	p_rec.ccm_attribute8,
246 	p_rec.ccm_attribute9,
247 	p_rec.ccm_attribute10,
248 	p_rec.ccm_attribute11,
249 	p_rec.ccm_attribute12,
250 	p_rec.ccm_attribute13,
251 	p_rec.ccm_attribute14,
252 	p_rec.ccm_attribute15,
253 	p_rec.ccm_attribute16,
254 	p_rec.ccm_attribute17,
255 	p_rec.ccm_attribute18,
256 	p_rec.ccm_attribute19,
257 	p_rec.ccm_attribute20,
258 	p_rec.ccm_attribute21,
259 	p_rec.ccm_attribute22,
260 	p_rec.ccm_attribute23,
261 	p_rec.ccm_attribute24,
262 	p_rec.ccm_attribute25,
263 	p_rec.ccm_attribute26,
264 	p_rec.ccm_attribute27,
265 	p_rec.ccm_attribute28,
266 	p_rec.ccm_attribute29,
267 	p_rec.ccm_attribute30,
268 	p_rec.object_version_number
269 	, l_created_by,
270    	l_creation_date,
271    	l_last_update_date,
272    	l_last_updated_by,
273    	l_last_update_login
274   );
275   --
276   ben_ccm_shd.g_api_dml := false;   -- Unset the api dml status
277   hr_utility.set_location(' Leaving:'||l_proc, 15);
278 --
279 Exception
280   When hr_api.check_integrity_violated Then
281     -- A check constraint has been violated
282     ben_ccm_shd.g_api_dml := false;   -- Unset the api dml status
283     ben_ccm_shd.constraint_error
284       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
285   When hr_api.unique_integrity_violated Then
286     -- Unique integrity has been violated
287     ben_ccm_shd.g_api_dml := false;   -- Unset the api dml status
288     ben_ccm_shd.constraint_error
289       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
290   When Others Then
291     ben_ccm_shd.g_api_dml := false;   -- Unset the api dml status
292     Raise;
293 End dt_insert_dml;
294 --
295 -- ----------------------------------------------------------------------------
296 -- |------------------------------< insert_dml >------------------------------|
297 -- ----------------------------------------------------------------------------
298 Procedure insert_dml
299 	(p_rec 			 in out nocopy ben_ccm_shd.g_rec_type,
300 	 p_effective_date	 in	date,
301 	 p_datetrack_mode	 in	varchar2,
302 	 p_validation_start_date in	date,
303 	 p_validation_end_date	 in	date) is
304 --
305   l_proc	varchar2(72) := g_package||'insert_dml';
306 --
307 Begin
308   hr_utility.set_location('Entering:'||l_proc, 5);
309   --
310   dt_insert_dml(p_rec			=> p_rec,
311 		p_effective_date	=> p_effective_date,
312 		p_datetrack_mode	=> p_datetrack_mode,
313        		p_validation_start_date	=> p_validation_start_date,
314 		p_validation_end_date	=> p_validation_end_date);
315   --
316   hr_utility.set_location(' Leaving:'||l_proc, 10);
317 End insert_dml;
318 --
319 -- ----------------------------------------------------------------------------
320 -- |------------------------------< pre_insert >------------------------------|
321 -- ----------------------------------------------------------------------------
322 -- {Start Of Comments}
323 --
324 -- Description:
325 --   This private procedure contains any processing which is required before
326 --   the insert dml. Presently, if the entity has a corresponding primary
327 --   key which is maintained by an associating sequence, the primary key for
328 --   the entity will be populated with the next sequence value in
329 --   preparation for the insert dml.
330 --   Also, if comments are defined for this entity, the comments insert
331 --   logic will also be called, generating a comment_id if required.
332 --
333 -- Prerequisites:
334 --   This is an internal procedure which is called from the ins procedure.
335 --
336 -- In Parameters:
337 --   A Pl/Sql record structre.
338 --
339 -- Post Success:
340 --   Processing continues.
341 --
342 -- Post Failure:
343 --   If an error has occurred, an error message and exception will be raised
344 --   but not handled.
345 --
346 -- Developer Implementation Notes:
347 --   Any pre-processing required before the insert dml is issued should be
348 --   coded within this procedure. As stated above, a good example is the
349 --   generation of a primary key number via a corresponding sequence.
350 --   It is important to note that any 3rd party maintenance should be reviewed
351 --   before placing in this procedure.
352 --
353 -- Access Status:
354 --   Internal Row Handler Use Only.
355 --
356 -- {End Of Comments}
357 -- ----------------------------------------------------------------------------
358 Procedure pre_insert
359 	(p_rec  			in out nocopy ben_ccm_shd.g_rec_type,
360 	 p_effective_date		in date,
361 	 p_datetrack_mode		in varchar2,
362 	 p_validation_start_date	in date,
363 	 p_validation_end_date		in date) is
364 --
365   l_proc	varchar2(72) := g_package||'pre_insert';
366 --
367   Cursor C_Sel1 is select ben_cvg_amt_calc_mthd_f_s.nextval from sys.dual;
368 --
369 Begin
370   hr_utility.set_location('Entering:'||l_proc, 5);
371   --
372   -- Select the next sequence number
373   --
374   Open C_Sel1;
375   Fetch C_Sel1 Into p_rec.cvg_amt_calc_mthd_id;
376   Close C_Sel1;
377   --
378   hr_utility.set_location(' Leaving:'||l_proc, 10);
379 End pre_insert;
380 --
381 -- ----------------------------------------------------------------------------
382 -- |-----------------------------< post_insert >------------------------------|
383 -- ----------------------------------------------------------------------------
384 -- {Start Of Comments}
385 --
386 -- Description:
387 --   This private procedure contains any processing which is required after the
388 --   insert dml.
389 --
390 -- Prerequisites:
391 --   This is an internal procedure which is called from the ins procedure.
392 --
393 -- In Parameters:
394 --   A Pl/Sql record structre.
395 --
396 -- Post Success:
397 --   Processing continues.
398 --
399 -- Post Failure:
400 --   If an error has occurred, an error message and exception will be raised
401 --   but not handled.
402 --
403 -- Developer Implementation Notes:
404 --   Any post-processing required after the insert dml is issued should be
405 --   coded within this procedure. It is important to note that any 3rd party
406 --   maintenance should be reviewed before placing in this procedure.
407 --
408 -- Access Status:
409 --   Internal Row Handler Use Only.
410 --
411 -- {End Of Comments}
412 -- ----------------------------------------------------------------------------
413 Procedure post_insert
414 	(p_rec 			 in ben_ccm_shd.g_rec_type,
415 	 p_effective_date	 in date,
416 	 p_datetrack_mode	 in varchar2,
417 	 p_validation_start_date in date,
418 	 p_validation_end_date	 in date) is
419 --
420   l_proc	varchar2(72) := g_package||'post_insert';
421 --
422 Begin
423   hr_utility.set_location('Entering:'||l_proc, 5);
424 --
425   --
426   -- Start of API User Hook for post_insert.
427   --
428   begin
429     --
430     ben_ccm_rki.after_insert
431       (
432   p_cvg_amt_calc_mthd_id          =>p_rec.cvg_amt_calc_mthd_id
433  ,p_effective_start_date          =>p_rec.effective_start_date
434  ,p_effective_end_date            =>p_rec.effective_end_date
435  ,p_name                          =>p_rec.name
436  ,p_incrmt_val                    =>p_rec.incrmt_val
437  ,p_mx_val                        =>p_rec.mx_val
438  ,p_mn_val                        =>p_rec.mn_val
439  ,p_no_mx_val_dfnd_flag           =>p_rec.no_mx_val_dfnd_flag
440  ,p_no_mn_val_dfnd_flag           =>p_rec.no_mn_val_dfnd_flag
441  ,p_rndg_cd                       =>p_rec.rndg_cd
442  ,p_rndg_rl                       =>p_rec.rndg_rl
446  ,p_upr_lmt_calc_rl               =>p_rec.upr_lmt_calc_rl
443  ,p_lwr_lmt_val                   =>p_rec.lwr_lmt_val
444  ,p_lwr_lmt_calc_rl               =>p_rec.lwr_lmt_calc_rl
445  ,p_upr_lmt_val                   =>p_rec.upr_lmt_val
447  ,p_val                           =>p_rec.val
448  ,p_val_ovrid_alwd_flag           =>p_rec.val_ovrid_alwd_flag
449  ,p_val_calc_rl                   =>p_rec.val_calc_rl
450  ,p_uom                           =>p_rec.uom
451  ,p_nnmntry_uom                   =>p_rec.nnmntry_uom
452  ,p_bndry_perd_cd                 =>p_rec.bndry_perd_cd
453  ,p_bnft_typ_cd                   =>p_rec.bnft_typ_cd
454  ,p_cvg_mlt_cd                    =>p_rec.cvg_mlt_cd
455  ,p_rt_typ_cd                     =>p_rec.rt_typ_cd
456  ,p_dflt_val                      =>p_rec.dflt_val
457  ,p_entr_val_at_enrt_flag         =>p_rec.entr_val_at_enrt_flag
458  ,p_dflt_flag                     =>p_rec.dflt_flag
459  ,p_comp_lvl_fctr_id              =>p_rec.comp_lvl_fctr_id
460  ,p_oipl_id                       =>p_rec.oipl_id
461  ,p_pl_id                         =>p_rec.pl_id
462  ,p_plip_id                       =>p_rec.plip_id
463  ,p_business_group_id             =>p_rec.business_group_id
464  ,p_ccm_attribute_category        =>p_rec.ccm_attribute_category
465  ,p_ccm_attribute1                =>p_rec.ccm_attribute1
466  ,p_ccm_attribute2                =>p_rec.ccm_attribute2
467  ,p_ccm_attribute3                =>p_rec.ccm_attribute3
468  ,p_ccm_attribute4                =>p_rec.ccm_attribute4
469  ,p_ccm_attribute5                =>p_rec.ccm_attribute5
470  ,p_ccm_attribute6                =>p_rec.ccm_attribute6
471  ,p_ccm_attribute7                =>p_rec.ccm_attribute7
472  ,p_ccm_attribute8                =>p_rec.ccm_attribute8
473  ,p_ccm_attribute9                =>p_rec.ccm_attribute9
474  ,p_ccm_attribute10               =>p_rec.ccm_attribute10
475  ,p_ccm_attribute11               =>p_rec.ccm_attribute11
476  ,p_ccm_attribute12               =>p_rec.ccm_attribute12
477  ,p_ccm_attribute13               =>p_rec.ccm_attribute13
478  ,p_ccm_attribute14               =>p_rec.ccm_attribute14
479  ,p_ccm_attribute15               =>p_rec.ccm_attribute15
480  ,p_ccm_attribute16               =>p_rec.ccm_attribute16
481  ,p_ccm_attribute17               =>p_rec.ccm_attribute17
482  ,p_ccm_attribute18               =>p_rec.ccm_attribute18
483  ,p_ccm_attribute19               =>p_rec.ccm_attribute19
484  ,p_ccm_attribute20               =>p_rec.ccm_attribute20
485  ,p_ccm_attribute21               =>p_rec.ccm_attribute21
486  ,p_ccm_attribute22               =>p_rec.ccm_attribute22
487  ,p_ccm_attribute23               =>p_rec.ccm_attribute23
488  ,p_ccm_attribute24               =>p_rec.ccm_attribute24
489  ,p_ccm_attribute25               =>p_rec.ccm_attribute25
490  ,p_ccm_attribute26               =>p_rec.ccm_attribute26
491  ,p_ccm_attribute27               =>p_rec.ccm_attribute27
492  ,p_ccm_attribute28               =>p_rec.ccm_attribute28
493  ,p_ccm_attribute29               =>p_rec.ccm_attribute29
494  ,p_ccm_attribute30               =>p_rec.ccm_attribute30
495  ,p_object_version_number         =>p_rec.object_version_number
496  ,p_effective_date                =>p_effective_date
497  ,p_validation_start_date         =>p_validation_start_date
498  ,p_validation_end_date           =>p_validation_end_date
499       );
500     --
501   exception
502     --
503     when hr_api.cannot_find_prog_unit then
504       --
505       hr_api.cannot_find_prog_unit_error
506         (p_module_name => 'ben_cvg_amt_calc_mthd_f'
507         ,p_hook_type   => 'AI');
508       --
509   end;
510   --
511   -- End of API User Hook for post_insert.
512   --
513   --
514   hr_utility.set_location(' Leaving:'||l_proc, 10);
515 End post_insert;
516 --
517 -- ----------------------------------------------------------------------------
518 -- |-------------------------------< ins_lck >--------------------------------|
519 -- ----------------------------------------------------------------------------
520 -- {Start Of Comments}
521 --
522 -- Description:
523 --   The ins_lck process has one main function to perform. When inserting
524 --   a datetracked row, we must validate the DT mode.
525 --   be manipulated.
526 --
527 -- Prerequisites:
528 --   This procedure can only be called for the datetrack mode of INSERT.
529 --
530 -- In Parameters:
531 --
532 -- Post Success:
533 --   On successful completion of the ins_lck process the parental
534 --   datetracked rows will be locked providing the p_enforce_foreign_locking
535 --   argument value is TRUE.
536 --   If the p_enforce_foreign_locking argument value is FALSE then the
537 --   parential rows are not locked.
538 --
539 -- Post Failure:
540 --   The Lck process can fail for:
541 --   1) When attempting to lock the row the row could already be locked by
542 --      another user. This will raise the HR_Api.Object_Locked exception.
543 --   2) When attempting to the lock the parent which doesn't exist.
544 --      For the entity to be locked the parent must exist!
545 --
546 -- Developer Implementation Notes:
547 --   None.
548 --
549 -- Access Status:
550 --   Internal Row Handler Use Only.
551 --
552 -- {End Of Comments}
553 -- ----------------------------------------------------------------------------
554 Procedure ins_lck
555 	(p_effective_date	 in  date,
559 	 p_validation_end_date	 out nocopy date) is
556 	 p_datetrack_mode	 in  varchar2,
557 	 p_rec	 		 in  ben_ccm_shd.g_rec_type,
558 	 p_validation_start_date out nocopy date,
560 --
561   l_proc		  varchar2(72) := g_package||'ins_lck';
562   l_validation_start_date date;
563   l_validation_end_date	  date;
564 --
565 Begin
566   hr_utility.set_location('Entering:'||l_proc, 5);
567   --
568   -- Validate the datetrack mode mode getting the validation start
569   -- and end dates for the specified datetrack operation.
570   --
571   dt_api.validate_dt_mode
572 	(p_effective_date	   => p_effective_date,
573 	 p_datetrack_mode	   => p_datetrack_mode,
574 	 p_base_table_name	   => 'ben_cvg_amt_calc_mthd_f',
575 	 p_base_key_column	   => 'cvg_amt_calc_mthd_id',
576 	 p_base_key_value 	   => p_rec.cvg_amt_calc_mthd_id,
577 	 p_parent_table_name1      => 'ben_oipl_f',
578 	 p_parent_key_column1      => 'oipl_id',
579 	 p_parent_key_value1       => p_rec.oipl_id,
580 	 p_parent_table_name2      => 'ben_pl_f',
581 	 p_parent_key_column2      => 'pl_id',
582 	 p_parent_key_value2       => p_rec.pl_id,
583 	 p_parent_table_name3      => 'ben_plip_f',
584 	 p_parent_key_column3      => 'plip_id',
585 	 p_parent_key_value3       => p_rec.plip_id,
586          p_enforce_foreign_locking => true,
587 	 p_validation_start_date   => l_validation_start_date,
588  	 p_validation_end_date	   => l_validation_end_date);
589   --
590   -- Set the validation start and end date OUT arguments
591   --
592   p_validation_start_date := l_validation_start_date;
593   p_validation_end_date   := l_validation_end_date;
594   --
595   hr_utility.set_location(' Leaving:'||l_proc, 10);
596 --
597 End ins_lck;
598 --
599 -- ----------------------------------------------------------------------------
600 -- |---------------------------------< ins >----------------------------------|
601 -- ----------------------------------------------------------------------------
602 Procedure ins
603   (
604   p_rec		   in out nocopy ben_ccm_shd.g_rec_type,
605   p_effective_date in     date
606   ) is
607 --
608   l_proc			varchar2(72) := g_package||'ins';
609   l_datetrack_mode		varchar2(30) := 'INSERT';
610   l_validation_start_date	date;
611   l_validation_end_date		date;
612 --
613 Begin
614   hr_utility.set_location('Entering:'||l_proc, 5);
615   --
616   -- Call the lock operation
617   --
618   ins_lck
619 	(p_effective_date	 => p_effective_date,
620 	 p_datetrack_mode	 => l_datetrack_mode,
621 	 p_rec	 		 => p_rec,
622 	 p_validation_start_date => l_validation_start_date,
623 	 p_validation_end_date	 => l_validation_end_date);
624   --
625   -- Call the supporting insert validate operations
626   --
627   ben_ccm_bus.insert_validate
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 pre-insert operation
635   --
636   pre_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   --
643   -- Insert the row
644   --
645   insert_dml
646  	(p_rec			 => p_rec,
647 	 p_effective_date	 => p_effective_date,
648 	 p_datetrack_mode	 => l_datetrack_mode,
649 	 p_validation_start_date => l_validation_start_date,
650 	 p_validation_end_date	 => l_validation_end_date);
651   --
652   -- Call the supporting post-insert operation
653   --
654   post_insert
655  	(p_rec			 => p_rec,
656 	 p_effective_date	 => p_effective_date,
657 	 p_datetrack_mode	 => l_datetrack_mode,
658 	 p_validation_start_date => l_validation_start_date,
659 	 p_validation_end_date	 => l_validation_end_date);
660 end ins;
661 --
662 -- ----------------------------------------------------------------------------
663 -- |---------------------------------< ins >----------------------------------|
664 -- ----------------------------------------------------------------------------
665 Procedure ins
666   (
667   p_cvg_amt_calc_mthd_id         out nocopy number,
668   p_effective_start_date         out nocopy date,
669   p_effective_end_date           out nocopy date,
670   p_name                         in varchar2,
671   p_incrmt_val                   in number           default null,
672   p_mx_val                       in number           default null,
673   p_mn_val                       in number           default null,
674   p_no_mx_val_dfnd_flag          in varchar2,
675   p_no_mn_val_dfnd_flag          in varchar2,
676   p_rndg_cd                      in varchar2         default null,
677   p_rndg_rl                      in number           default null,
678   p_lwr_lmt_val                  in number           default null,
679   p_lwr_lmt_calc_rl              in number           default null,
680   p_upr_lmt_val                  in number           default null,
681   p_upr_lmt_calc_rl              in number           default null,
685   p_uom                          in varchar2         default null,
682   p_val                          in number           default null,
683   p_val_ovrid_alwd_flag          in varchar2,
684   p_val_calc_rl                  in number           default null,
686   p_nnmntry_uom                  in varchar2         default null,
687   p_bndry_perd_cd                in varchar2         default null,
688   p_bnft_typ_cd                  in varchar2         default null,
689   p_cvg_mlt_cd                   in varchar2         default null,
690   p_rt_typ_cd                    in varchar2         default null,
691   p_dflt_val                     in number           default null,
692   p_entr_val_at_enrt_flag        in varchar2,
693   p_dflt_flag                    in varchar2,
694   p_comp_lvl_fctr_id             in number           default null,
695   p_oipl_id                      in number           default null,
696   p_pl_id                        in number           default null,
697   p_plip_id                      in number           default null,
698   p_business_group_id            in number,
699   p_ccm_attribute_category       in varchar2         default null,
700   p_ccm_attribute1               in varchar2         default null,
701   p_ccm_attribute2               in varchar2         default null,
702   p_ccm_attribute3               in varchar2         default null,
703   p_ccm_attribute4               in varchar2         default null,
704   p_ccm_attribute5               in varchar2         default null,
705   p_ccm_attribute6               in varchar2         default null,
706   p_ccm_attribute7               in varchar2         default null,
707   p_ccm_attribute8               in varchar2         default null,
708   p_ccm_attribute9               in varchar2         default null,
709   p_ccm_attribute10              in varchar2         default null,
710   p_ccm_attribute11              in varchar2         default null,
711   p_ccm_attribute12              in varchar2         default null,
712   p_ccm_attribute13              in varchar2         default null,
713   p_ccm_attribute14              in varchar2         default null,
714   p_ccm_attribute15              in varchar2         default null,
715   p_ccm_attribute16              in varchar2         default null,
716   p_ccm_attribute17              in varchar2         default null,
717   p_ccm_attribute18              in varchar2         default null,
718   p_ccm_attribute19              in varchar2         default null,
719   p_ccm_attribute20              in varchar2         default null,
720   p_ccm_attribute21              in varchar2         default null,
721   p_ccm_attribute22              in varchar2         default null,
722   p_ccm_attribute23              in varchar2         default null,
723   p_ccm_attribute24              in varchar2         default null,
724   p_ccm_attribute25              in varchar2         default null,
725   p_ccm_attribute26              in varchar2         default null,
726   p_ccm_attribute27              in varchar2         default null,
727   p_ccm_attribute28              in varchar2         default null,
728   p_ccm_attribute29              in varchar2         default null,
729   p_ccm_attribute30              in varchar2         default null,
730   p_object_version_number        out nocopy number,
731   p_effective_date		 in date
732   ) is
733 --
734   l_rec		ben_ccm_shd.g_rec_type;
735   l_proc	varchar2(72) := g_package||'ins';
736 --
737 Begin
738   hr_utility.set_location('Entering:'||l_proc, 5);
739   --
740   -- Call conversion function to turn arguments into the
741   -- p_rec structure.
742   --
743   l_rec :=
744   ben_ccm_shd.convert_args
745   (
746   null,
747   null,
748   null,
749   p_name,
750   p_incrmt_val,
751   p_mx_val,
752   p_mn_val,
753   p_no_mx_val_dfnd_flag,
754   p_no_mn_val_dfnd_flag,
755   p_rndg_cd,
756   p_rndg_rl,
757   p_lwr_lmt_val,
758   p_lwr_lmt_calc_rl,
759   p_upr_lmt_val,
760   p_upr_lmt_calc_rl,
761   p_val,
762   p_val_ovrid_alwd_flag,
763   p_val_calc_rl,
764   p_uom,
765   p_nnmntry_uom,
766   p_bndry_perd_cd,
767   p_bnft_typ_cd,
768   p_cvg_mlt_cd,
769   p_rt_typ_cd,
770   p_dflt_val,
771   p_entr_val_at_enrt_flag,
772   p_dflt_flag,
773   p_comp_lvl_fctr_id,
774   p_oipl_id,
775   p_pl_id,
776   p_plip_id,
777   p_business_group_id,
778   p_ccm_attribute_category,
779   p_ccm_attribute1,
780   p_ccm_attribute2,
781   p_ccm_attribute3,
782   p_ccm_attribute4,
783   p_ccm_attribute5,
784   p_ccm_attribute6,
785   p_ccm_attribute7,
786   p_ccm_attribute8,
787   p_ccm_attribute9,
788   p_ccm_attribute10,
789   p_ccm_attribute11,
790   p_ccm_attribute12,
791   p_ccm_attribute13,
792   p_ccm_attribute14,
793   p_ccm_attribute15,
794   p_ccm_attribute16,
795   p_ccm_attribute17,
796   p_ccm_attribute18,
797   p_ccm_attribute19,
798   p_ccm_attribute20,
799   p_ccm_attribute21,
800   p_ccm_attribute22,
801   p_ccm_attribute23,
802   p_ccm_attribute24,
803   p_ccm_attribute25,
804   p_ccm_attribute26,
805   p_ccm_attribute27,
806   p_ccm_attribute28,
807   p_ccm_attribute29,
808   p_ccm_attribute30,
809   null
810   );
811   --
812   -- Having converted the arguments into the ben_ccm_rec
813   -- plsql record structure we call the corresponding record
814   -- business process.
815   --
816   ins(l_rec, p_effective_date);
817   --
818   -- Set the OUT arguments.
819   --
820   p_cvg_amt_calc_mthd_id        	:= l_rec.cvg_amt_calc_mthd_id;
821   p_effective_start_date  	:= l_rec.effective_start_date;
822   p_effective_end_date    	:= l_rec.effective_end_date;
823   p_object_version_number 	:= l_rec.object_version_number;
824   --
825   --
826   hr_utility.set_location(' Leaving:'||l_proc, 10);
827 End ins;
828 --
829 end ben_ccm_ins;