DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_LDC_INS

Source


1 Package Body ben_ldc_ins as
2 /* $Header: beldcrhi.pkb 120.1 2007/07/04 12:37:38 rtagarra noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_ldc_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_ldc_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_chg_dpnt_cvg_f t
70     where  t.ler_chg_dpnt_cvg_id       = p_rec.ler_chg_dpnt_cvg_id
71     and    t.effective_start_date =
72              ben_ldc_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_chg_dpnt_cvg_f.created_by%TYPE;
77   l_creation_date       ben_ler_chg_dpnt_cvg_f.creation_date%TYPE;
78   l_last_update_date   	ben_ler_chg_dpnt_cvg_f.last_update_date%TYPE;
79   l_last_updated_by     ben_ler_chg_dpnt_cvg_f.last_updated_by%TYPE;
80   l_last_update_login   ben_ler_chg_dpnt_cvg_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_chg_dpnt_cvg_f',
90 	 p_base_key_column => 'ler_chg_dpnt_cvg_id',
91 	 p_base_key_value  => p_rec.ler_chg_dpnt_cvg_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       fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
116       fnd_message.set_token('PROCEDURE', l_proc);
117       fnd_message.set_token('STEP','10');
118       fnd_message.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_ldc_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_ler_chg_dpnt_cvg_f
132   --
133   insert into ben_ler_chg_dpnt_cvg_f
134   (	ler_chg_dpnt_cvg_id,
135 	effective_start_date,
136 	effective_end_date,
137 	pl_id,
138 	pgm_id,
139 	business_group_id,
140 	ler_id,
141 	ptip_id,
142 	add_rmv_cvg_cd,
143 	cvg_eff_end_cd,
144 	cvg_eff_strt_cd,
145 	ler_chg_dpnt_cvg_rl,
146 	ler_chg_dpnt_cvg_cd,
147 	cvg_eff_strt_rl,
148 	cvg_eff_end_rl,
149 	ldc_attribute_category,
150 	ldc_attribute1,
151 	ldc_attribute2,
152 	ldc_attribute3,
153 	ldc_attribute4,
154 	ldc_attribute5,
155 	ldc_attribute6,
156 	ldc_attribute7,
157 	ldc_attribute8,
158 	ldc_attribute9,
159 	ldc_attribute10,
160 	ldc_attribute11,
161 	ldc_attribute12,
162 	ldc_attribute13,
163 	ldc_attribute14,
164 	ldc_attribute15,
165 	ldc_attribute16,
166 	ldc_attribute17,
167 	ldc_attribute18,
168 	ldc_attribute19,
169 	ldc_attribute20,
170 	ldc_attribute21,
171 	ldc_attribute22,
172 	ldc_attribute23,
173 	ldc_attribute24,
174 	ldc_attribute25,
175 	ldc_attribute26,
176 	ldc_attribute27,
177 	ldc_attribute28,
178 	ldc_attribute29,
179 	ldc_attribute30,
180         susp_if_ctfn_not_prvd_flag,
181         ctfn_determine_cd,
182 	object_version_number
183    	, created_by,
184    	creation_date,
185    	last_update_date,
186    	last_updated_by,
187    	last_update_login
188   )
189   Values
190   (	p_rec.ler_chg_dpnt_cvg_id,
191 	p_rec.effective_start_date,
192 	p_rec.effective_end_date,
193 	p_rec.pl_id,
194 	p_rec.pgm_id,
195 	p_rec.business_group_id,
196 	p_rec.ler_id,
197 	p_rec.ptip_id,
198 	p_rec.add_rmv_cvg_cd,
199 	p_rec.cvg_eff_end_cd,
200 	p_rec.cvg_eff_strt_cd,
201 	p_rec.ler_chg_dpnt_cvg_rl,
202 	p_rec.ler_chg_dpnt_cvg_cd,
203 	p_rec.cvg_eff_strt_rl,
204 	p_rec.cvg_eff_end_rl,
205 	p_rec.ldc_attribute_category,
206 	p_rec.ldc_attribute1,
207 	p_rec.ldc_attribute2,
208 	p_rec.ldc_attribute3,
209 	p_rec.ldc_attribute4,
210 	p_rec.ldc_attribute5,
211 	p_rec.ldc_attribute6,
212 	p_rec.ldc_attribute7,
213 	p_rec.ldc_attribute8,
214 	p_rec.ldc_attribute9,
215 	p_rec.ldc_attribute10,
216 	p_rec.ldc_attribute11,
217 	p_rec.ldc_attribute12,
218 	p_rec.ldc_attribute13,
219 	p_rec.ldc_attribute14,
220 	p_rec.ldc_attribute15,
221 	p_rec.ldc_attribute16,
222 	p_rec.ldc_attribute17,
223 	p_rec.ldc_attribute18,
224 	p_rec.ldc_attribute19,
225 	p_rec.ldc_attribute20,
226 	p_rec.ldc_attribute21,
227 	p_rec.ldc_attribute22,
228 	p_rec.ldc_attribute23,
229 	p_rec.ldc_attribute24,
230 	p_rec.ldc_attribute25,
231 	p_rec.ldc_attribute26,
232 	p_rec.ldc_attribute27,
233 	p_rec.ldc_attribute28,
234 	p_rec.ldc_attribute29,
235 	p_rec.ldc_attribute30,
236         p_rec.susp_if_ctfn_not_prvd_flag,
237         p_rec.ctfn_determine_cd,
238 	p_rec.object_version_number
239 	, l_created_by,
240    	l_creation_date,
241    	l_last_update_date,
242    	l_last_updated_by,
243    	l_last_update_login
244   );
245   --
246   ben_ldc_shd.g_api_dml := false;   -- Unset the api dml status
247   hr_utility.set_location(' Leaving:'||l_proc, 15);
248 --
249 Exception
250   When hr_api.check_integrity_violated Then
251     -- A check constraint has been violated
252     ben_ldc_shd.g_api_dml := false;   -- Unset the api dml status
253     ben_ldc_shd.constraint_error
254       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
255   When hr_api.unique_integrity_violated Then
256     -- Unique integrity has been violated
257     ben_ldc_shd.g_api_dml := false;   -- Unset the api dml status
258     ben_ldc_shd.constraint_error
259       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
260   When Others Then
261     ben_ldc_shd.g_api_dml := false;   -- Unset the api dml status
262     Raise;
263 End dt_insert_dml;
264 --
265 -- ----------------------------------------------------------------------------
266 -- |------------------------------< insert_dml >------------------------------|
267 -- ----------------------------------------------------------------------------
268 Procedure insert_dml
269 	(p_rec 			 in out nocopy ben_ldc_shd.g_rec_type,
270 	 p_effective_date	 in	date,
271 	 p_datetrack_mode	 in	varchar2,
272 	 p_validation_start_date in	date,
273 	 p_validation_end_date	 in	date) is
274 --
275   l_proc	varchar2(72) := g_package||'insert_dml';
276 --
277 Begin
278   hr_utility.set_location('Entering:'||l_proc, 5);
279   --
280   dt_insert_dml(p_rec			=> p_rec,
281 		p_effective_date	=> p_effective_date,
282 		p_datetrack_mode	=> p_datetrack_mode,
283        		p_validation_start_date	=> p_validation_start_date,
284 		p_validation_end_date	=> p_validation_end_date);
285   --
286   hr_utility.set_location(' Leaving:'||l_proc, 10);
287 End insert_dml;
288 --
289 -- ----------------------------------------------------------------------------
290 -- |------------------------------< pre_insert >------------------------------|
291 -- ----------------------------------------------------------------------------
292 -- {Start Of Comments}
293 --
294 -- Description:
295 --   This private procedure contains any processing which is required before
296 --   the insert dml. Presently, if the entity has a corresponding primary
297 --   key which is maintained by an associating sequence, the primary key for
298 --   the entity will be populated with the next sequence value in
299 --   preparation for the insert dml.
300 --   Also, if comments are defined for this entity, the comments insert
301 --   logic will also be called, generating a comment_id if required.
302 --
303 -- Prerequisites:
304 --   This is an internal procedure which is called from the ins procedure.
305 --
306 -- In Parameters:
307 --   A Pl/Sql record structre.
308 --
309 -- Post Success:
310 --   Processing continues.
311 --
312 -- Post Failure:
313 --   If an error has occurred, an error message and exception will be raised
314 --   but not handled.
315 --
316 -- Developer Implementation Notes:
317 --   Any pre-processing required before the insert dml is issued should be
318 --   coded within this procedure. As stated above, a good example is the
319 --   generation of a primary key number via a corresponding sequence.
320 --   It is important to note that any 3rd party maintenance should be reviewed
321 --   before placing in this procedure.
322 --
323 -- Access Status:
324 --   Internal Row Handler Use Only.
325 --
326 -- {End Of Comments}
327 -- ----------------------------------------------------------------------------
328 Procedure pre_insert
329 	(p_rec  			in out nocopy ben_ldc_shd.g_rec_type,
330 	 p_effective_date		in date,
331 	 p_datetrack_mode		in varchar2,
332 	 p_validation_start_date	in date,
333 	 p_validation_end_date		in date) is
334 --
335   l_proc	varchar2(72) := g_package||'pre_insert';
336 --
337  Cursor C_Sel1 is select ben_ler_chg_dpnt_cvg_f_s.nextval from sys.dual;
338 --
339 --
340 Begin
341   hr_utility.set_location('Entering:'||l_proc, 5);
342   --
343   -- Select the next sequence number
344   --
345   Open C_Sel1;
346   Fetch C_Sel1 Into p_rec.ler_chg_dpnt_cvg_id;
347   Close C_Sel1;
348   -- --
349   hr_utility.set_location(' Leaving:'||l_proc, 10);
350 End pre_insert;
351 --
352 -- ----------------------------------------------------------------------------
353 -- |-----------------------------< post_insert >------------------------------|
354 -- ----------------------------------------------------------------------------
355 -- {Start Of Comments}
356 --
357 -- Description:
358 --   This private procedure contains any processing which is required after the
359 --   insert dml.
360 --
361 -- Prerequisites:
362 --   This is an internal procedure which is called from the ins procedure.
363 --
364 -- In Parameters:
365 --   A Pl/Sql record structre.
366 --
367 -- Post Success:
368 --   Processing continues.
369 --
370 -- Post Failure:
371 --   If an error has occurred, an error message and exception will be raised
372 --   but not handled.
373 --
374 -- Developer Implementation Notes:
375 --   Any post-processing required after the insert dml is issued should be
376 --   coded within this procedure. It is important to note that any 3rd party
377 --   maintenance should be reviewed before placing in this procedure.
378 --
379 -- Access Status:
380 --   Internal Row Handler Use Only.
381 --
382 -- {End Of Comments}
383 -- ----------------------------------------------------------------------------
384 Procedure post_insert
385 	(p_rec 			 in ben_ldc_shd.g_rec_type,
386 	 p_effective_date	 in date,
387 	 p_datetrack_mode	 in varchar2,
388 	 p_validation_start_date in date,
389 	 p_validation_end_date	 in date) is
390 --
391   l_proc	varchar2(72) := g_package||'post_insert';
392 --
393 Begin
394   hr_utility.set_location('Entering:'||l_proc, 5);
395 --
396   --
397   -- Start of API User Hook for post_insert.
398   --
399   begin
400     --
401     ben_ldc_rki.after_insert
402       (
403   p_ler_chg_dpnt_cvg_id           =>p_rec.ler_chg_dpnt_cvg_id
404  ,p_effective_start_date          =>p_rec.effective_start_date
405  ,p_effective_end_date            =>p_rec.effective_end_date
406  ,p_pl_id                         =>p_rec.pl_id
407  ,p_pgm_id                        =>p_rec.pgm_id
408  ,p_business_group_id             =>p_rec.business_group_id
409  ,p_ler_id                        =>p_rec.ler_id
410  ,p_ptip_id                       =>p_rec.ptip_id
411  ,p_add_rmv_cvg_cd                =>p_rec.add_rmv_cvg_cd
412  ,p_cvg_eff_end_cd                =>p_rec.cvg_eff_end_cd
413  ,p_cvg_eff_strt_cd               =>p_rec.cvg_eff_strt_cd
414  ,p_ler_chg_dpnt_cvg_rl           =>p_rec.ler_chg_dpnt_cvg_rl
415  ,p_ler_chg_dpnt_cvg_cd           =>p_rec.ler_chg_dpnt_cvg_cd
416  ,p_cvg_eff_strt_rl               =>p_rec.cvg_eff_strt_rl
417  ,p_cvg_eff_end_rl                =>p_rec.cvg_eff_end_rl
418  ,p_ldc_attribute_category        =>p_rec.ldc_attribute_category
419  ,p_ldc_attribute1                =>p_rec.ldc_attribute1
420  ,p_ldc_attribute2                =>p_rec.ldc_attribute2
421  ,p_ldc_attribute3                =>p_rec.ldc_attribute3
422  ,p_ldc_attribute4                =>p_rec.ldc_attribute4
423  ,p_ldc_attribute5                =>p_rec.ldc_attribute5
424  ,p_ldc_attribute6                =>p_rec.ldc_attribute6
425  ,p_ldc_attribute7                =>p_rec.ldc_attribute7
426  ,p_ldc_attribute8                =>p_rec.ldc_attribute8
427  ,p_ldc_attribute9                =>p_rec.ldc_attribute9
428  ,p_ldc_attribute10               =>p_rec.ldc_attribute10
429  ,p_ldc_attribute11               =>p_rec.ldc_attribute11
430  ,p_ldc_attribute12               =>p_rec.ldc_attribute12
431  ,p_ldc_attribute13               =>p_rec.ldc_attribute13
432  ,p_ldc_attribute14               =>p_rec.ldc_attribute14
433  ,p_ldc_attribute15               =>p_rec.ldc_attribute15
434  ,p_ldc_attribute16               =>p_rec.ldc_attribute16
435  ,p_ldc_attribute17               =>p_rec.ldc_attribute17
436  ,p_ldc_attribute18               =>p_rec.ldc_attribute18
437  ,p_ldc_attribute19               =>p_rec.ldc_attribute19
438  ,p_ldc_attribute20               =>p_rec.ldc_attribute20
439  ,p_ldc_attribute21               =>p_rec.ldc_attribute21
440  ,p_ldc_attribute22               =>p_rec.ldc_attribute22
441  ,p_ldc_attribute23               =>p_rec.ldc_attribute23
442  ,p_ldc_attribute24               =>p_rec.ldc_attribute24
443  ,p_ldc_attribute25               =>p_rec.ldc_attribute25
444  ,p_ldc_attribute26               =>p_rec.ldc_attribute26
445  ,p_ldc_attribute27               =>p_rec.ldc_attribute27
446  ,p_ldc_attribute28               =>p_rec.ldc_attribute28
447  ,p_ldc_attribute29               =>p_rec.ldc_attribute29
448  ,p_ldc_attribute30               =>p_rec.ldc_attribute30
449  ,p_susp_if_ctfn_not_prvd_flag    =>p_rec.susp_if_ctfn_not_prvd_flag
450  ,p_ctfn_determine_cd             =>p_rec.ctfn_determine_cd
451  ,p_object_version_number         =>p_rec.object_version_number
452  ,p_effective_date                =>p_effective_date
453  ,p_validation_start_date         =>p_validation_start_date
454  ,p_validation_end_date           =>p_validation_end_date
455       );
456     --
457   exception
458     --
459     when hr_api.cannot_find_prog_unit then
460       --
461       hr_api.cannot_find_prog_unit_error
462         (p_module_name => 'ben_ler_chg_dpnt_cvg_f'
463         ,p_hook_type   => 'AI');
464       --
465   end;
466   --
467   -- End of API User Hook for post_insert.
468   --
469   --
470   hr_utility.set_location(' Leaving:'||l_proc, 10);
471 End post_insert;
472 --
473 -- ----------------------------------------------------------------------------
474 -- |-------------------------------< ins_lck >--------------------------------|
475 -- ----------------------------------------------------------------------------
476 -- {Start Of Comments}
477 --
478 -- Description:
479 --   The ins_lck process has one main function to perform. When inserting
480 --   a datetracked row, we must validate the DT mode.
481 --   be manipulated.
482 --
483 -- Prerequisites:
484 --   This procedure can only be called for the datetrack mode of INSERT.
485 --
486 -- In Parameters:
487 --
488 -- Post Success:
489 --   On successful completion of the ins_lck process the parental
490 --   datetracked rows will be locked providing the p_enforce_foreign_locking
491 --   argument value is TRUE.
492 --   If the p_enforce_foreign_locking argument value is FALSE then the
493 --   parential rows are not locked.
494 --
495 -- Post Failure:
496 --   The Lck process can fail for:
497 --   1) When attempting to lock the row the row could already be locked by
498 --      another user. This will raise the HR_Api.Object_Locked exception.
499 --   2) When attempting to the lock the parent which doesn't exist.
500 --      For the entity to be locked the parent must exist!
501 --
502 -- Developer Implementation Notes:
503 --   None.
504 --
505 -- Access Status:
506 --   Internal Row Handler Use Only.
507 --
508 -- {End Of Comments}
509 -- ----------------------------------------------------------------------------
510 Procedure ins_lck
511 	(p_effective_date	 in  date,
512 	 p_datetrack_mode	 in  varchar2,
513 	 p_rec	 		 in  ben_ldc_shd.g_rec_type,
514 	 p_validation_start_date out nocopy date,
515 	 p_validation_end_date	 out nocopy date) is
516 --
517   l_proc		  varchar2(72) := g_package||'ins_lck';
518   l_validation_start_date date;
519   l_validation_end_date	  date;
520 --
521 Begin
522   hr_utility.set_location('Entering:'||l_proc, 5);
523   --
524   -- Validate the datetrack mode mode getting the validation start
525   -- and end dates for the specified datetrack operation.
526   --
527   dt_api.validate_dt_mode
528 	(p_effective_date	   => p_effective_date,
529 	 p_datetrack_mode	   => p_datetrack_mode,
530 	 p_base_table_name	   => 'ben_ler_chg_dpnt_cvg_f',
531 	 p_base_key_column	   => 'ler_chg_dpnt_cvg_id',
532 	 p_base_key_value 	   => p_rec.ler_chg_dpnt_cvg_id,
533 	 p_parent_table_name1      => 'ff_formulas_f',
534 	 p_parent_key_column1      => 'formula_id',
535 	 p_parent_key_value1       => p_rec.ler_chg_dpnt_cvg_rl,
536 	 p_parent_table_name2      => 'ff_formulas_f',
537 	 p_parent_key_column2      => 'formula_id',
538 	 p_parent_key_value2       => p_rec.cvg_eff_strt_rl,
539 	 p_parent_table_name3      => 'ff_formulas_f',
540 	 p_parent_key_column3      => 'formula_id',
541 	 p_parent_key_value3       => p_rec.cvg_eff_end_rl,
542 	 p_parent_table_name4      => 'ben_ptip_f',
543 	 p_parent_key_column4      => 'ptip_id',
544 	 p_parent_key_value4       => p_rec.ptip_id,
545 	 p_parent_table_name5      => 'ben_ler_f',
546 	 p_parent_key_column5      => 'ler_id',
547 	 p_parent_key_value5       => p_rec.ler_id,
548 	 p_parent_table_name6      => 'ben_pl_f',
549 	 p_parent_key_column6      => 'pl_id',
550 	 p_parent_key_value6       => p_rec.pl_id,
551 	 p_parent_table_name7      => 'ben_pgm_f',
552 	 p_parent_key_column7      => 'pgm_id',
553 	 p_parent_key_value7       => p_rec.pgm_id,
554          p_enforce_foreign_locking => false, --true,  -- Bug 6161907
555 	 p_validation_start_date   => l_validation_start_date,
556  	 p_validation_end_date	   => l_validation_end_date);
557   --
558   -- Set the validation start and end date OUT arguments
559   --
560   p_validation_start_date := l_validation_start_date;
561   p_validation_end_date   := l_validation_end_date;
562   --
563   hr_utility.set_location(' Leaving:'||l_proc, 10);
564 --
565 End ins_lck;
566 --
567 -- ----------------------------------------------------------------------------
568 -- |---------------------------------< ins >----------------------------------|
569 -- ----------------------------------------------------------------------------
570 Procedure ins
571   (
572   p_rec		   in out nocopy ben_ldc_shd.g_rec_type,
573   p_effective_date in     date
574   ) is
575 --
576   l_proc			varchar2(72) := g_package||'ins';
577   l_datetrack_mode		varchar2(30) := 'INSERT';
578   l_validation_start_date	date;
579   l_validation_end_date		date;
580 --
581 Begin
582   hr_utility.set_location('Entering:'||l_proc, 5);
583   --
584   -- Call the lock operation
585   --
586   ins_lck
587 	(p_effective_date	 => p_effective_date,
588 	 p_datetrack_mode	 => l_datetrack_mode,
589 	 p_rec	 		 => p_rec,
590 	 p_validation_start_date => l_validation_start_date,
591 	 p_validation_end_date	 => l_validation_end_date);
592   --
593   -- Call the supporting insert validate operations
594   --
595   ben_ldc_bus.insert_validate
596 	(p_rec			 => p_rec,
597 	 p_effective_date	 => p_effective_date,
598 	 p_datetrack_mode	 => l_datetrack_mode,
599 	 p_validation_start_date => l_validation_start_date,
600 	 p_validation_end_date	 => l_validation_end_date);
601   --
602   -- Call the supporting pre-insert operation
603   --
604   pre_insert
605  	(p_rec			 => p_rec,
606 	 p_effective_date	 => p_effective_date,
607 	 p_datetrack_mode	 => l_datetrack_mode,
608 	 p_validation_start_date => l_validation_start_date,
609 	 p_validation_end_date	 => l_validation_end_date);
610   --
611   -- Insert the row
612   --
613   insert_dml
614  	(p_rec			 => p_rec,
615 	 p_effective_date	 => p_effective_date,
616 	 p_datetrack_mode	 => l_datetrack_mode,
617 	 p_validation_start_date => l_validation_start_date,
618 	 p_validation_end_date	 => l_validation_end_date);
619   --
620   -- Call the supporting post-insert operation
621   --
622   post_insert
623  	(p_rec			 => p_rec,
624 	 p_effective_date	 => p_effective_date,
625 	 p_datetrack_mode	 => l_datetrack_mode,
626 	 p_validation_start_date => l_validation_start_date,
627 	 p_validation_end_date	 => l_validation_end_date);
628 end ins;
629 --
630 -- ----------------------------------------------------------------------------
631 -- |---------------------------------< ins >----------------------------------|
632 -- ----------------------------------------------------------------------------
633 Procedure ins
634   (
635   p_ler_chg_dpnt_cvg_id          out nocopy number,
636   p_effective_start_date         out nocopy date,
637   p_effective_end_date           out nocopy date,
638   p_pl_id                        in number           default null,
639   p_pgm_id                       in number           default null,
640   p_business_group_id            in number,
641   p_ler_id                       in number           default null,
642   p_ptip_id                      in number           default null,
643   p_add_rmv_cvg_cd               in varchar2,
644   p_cvg_eff_end_cd               in varchar2         default null,
645   p_cvg_eff_strt_cd              in varchar2         default null,
646   p_ler_chg_dpnt_cvg_rl          in number           default null,
647   p_ler_chg_dpnt_cvg_cd          in varchar2         default null,
648   p_cvg_eff_strt_rl              in number           default null,
649   p_cvg_eff_end_rl               in number           default null,
650   p_ldc_attribute_category       in varchar2         default null,
651   p_ldc_attribute1               in varchar2         default null,
652   p_ldc_attribute2               in varchar2         default null,
653   p_ldc_attribute3               in varchar2         default null,
654   p_ldc_attribute4               in varchar2         default null,
655   p_ldc_attribute5               in varchar2         default null,
656   p_ldc_attribute6               in varchar2         default null,
657   p_ldc_attribute7               in varchar2         default null,
658   p_ldc_attribute8               in varchar2         default null,
659   p_ldc_attribute9               in varchar2         default null,
660   p_ldc_attribute10              in varchar2         default null,
661   p_ldc_attribute11              in varchar2         default null,
662   p_ldc_attribute12              in varchar2         default null,
663   p_ldc_attribute13              in varchar2         default null,
664   p_ldc_attribute14              in varchar2         default null,
665   p_ldc_attribute15              in varchar2         default null,
666   p_ldc_attribute16              in varchar2         default null,
667   p_ldc_attribute17              in varchar2         default null,
668   p_ldc_attribute18              in varchar2         default null,
669   p_ldc_attribute19              in varchar2         default null,
670   p_ldc_attribute20              in varchar2         default null,
671   p_ldc_attribute21              in varchar2         default null,
672   p_ldc_attribute22              in varchar2         default null,
673   p_ldc_attribute23              in varchar2         default null,
674   p_ldc_attribute24              in varchar2         default null,
675   p_ldc_attribute25              in varchar2         default null,
676   p_ldc_attribute26              in varchar2         default null,
677   p_ldc_attribute27              in varchar2         default null,
678   p_ldc_attribute28              in varchar2         default null,
679   p_ldc_attribute29              in varchar2         default null,
680   p_ldc_attribute30              in varchar2         default null,
681   p_susp_if_ctfn_not_prvd_flag   in varchar2         default 'Y',
682   p_ctfn_determine_cd            in varchar2         default null,
683   p_object_version_number        out nocopy number,
684   p_effective_date		 in date
685   ) is
686 --
687   l_rec		ben_ldc_shd.g_rec_type;
688   l_proc	varchar2(72) := g_package||'ins';
689 --
690 Begin
691   hr_utility.set_location('Entering:'||l_proc, 5);
692   --
693   -- Call conversion function to turn arguments into the
694   -- p_rec structure.
695   --
696   l_rec :=
697   ben_ldc_shd.convert_args
698   (
699   null,
700   null,
701   null,
702   p_pl_id,
703   p_pgm_id,
704   p_business_group_id,
705   p_ler_id,
706   p_ptip_id,
707   p_add_rmv_cvg_cd,
708   p_cvg_eff_end_cd,
709   p_cvg_eff_strt_cd,
710   p_ler_chg_dpnt_cvg_rl,
711   p_ler_chg_dpnt_cvg_cd,
712   p_cvg_eff_strt_rl,
713   p_cvg_eff_end_rl,
714   p_ldc_attribute_category,
715   p_ldc_attribute1,
716   p_ldc_attribute2,
717   p_ldc_attribute3,
718   p_ldc_attribute4,
719   p_ldc_attribute5,
720   p_ldc_attribute6,
721   p_ldc_attribute7,
722   p_ldc_attribute8,
723   p_ldc_attribute9,
724   p_ldc_attribute10,
725   p_ldc_attribute11,
726   p_ldc_attribute12,
727   p_ldc_attribute13,
728   p_ldc_attribute14,
729   p_ldc_attribute15,
730   p_ldc_attribute16,
731   p_ldc_attribute17,
732   p_ldc_attribute18,
733   p_ldc_attribute19,
734   p_ldc_attribute20,
735   p_ldc_attribute21,
736   p_ldc_attribute22,
737   p_ldc_attribute23,
738   p_ldc_attribute24,
739   p_ldc_attribute25,
740   p_ldc_attribute26,
741   p_ldc_attribute27,
742   p_ldc_attribute28,
743   p_ldc_attribute29,
744   p_ldc_attribute30,
745   p_susp_if_ctfn_not_prvd_flag,
746   p_ctfn_determine_cd,
747   null
748   );
749   --
750   -- Having converted the arguments into the ben_ldc_rec
751   -- plsql record structure we call the corresponding record
752   -- business process.
753   --
754   ins(l_rec, p_effective_date);
755   --
756   -- Set the OUT arguments.
757   --
758   p_ler_chg_dpnt_cvg_id        	:= l_rec.ler_chg_dpnt_cvg_id;
759   p_effective_start_date  	:= l_rec.effective_start_date;
760   p_effective_end_date    	:= l_rec.effective_end_date;
761   p_object_version_number 	:= l_rec.object_version_number;
762   --
763   --
764   hr_utility.set_location(' Leaving:'||l_proc, 10);
765 End ins;
766 --
767 end ben_ldc_ins;