DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_BPR_INS

Source


1 Package Body ben_bpr_ins as
2 /* $Header: bebprrhi.pkb 120.1 2008/01/10 09:55:47 rtagarra noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_bpr_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_bpr_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_pool_rlovr_rqmt_f t
70     where  t.bnft_pool_rlovr_rqmt_id       = p_rec.bnft_pool_rlovr_rqmt_id
71     and    t.effective_start_date =
72              ben_bpr_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_pool_rlovr_rqmt_f.created_by%TYPE;
77   l_creation_date       ben_bnft_pool_rlovr_rqmt_f.creation_date%TYPE;
78   l_last_update_date   	ben_bnft_pool_rlovr_rqmt_f.last_update_date%TYPE;
79   l_last_updated_by     ben_bnft_pool_rlovr_rqmt_f.last_updated_by%TYPE;
80   l_last_update_login   ben_bnft_pool_rlovr_rqmt_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_pool_rlovr_rqmt_f',
90 	 p_base_key_column => 'bnft_pool_rlovr_rqmt_id',
91 	 p_base_key_value  => p_rec.bnft_pool_rlovr_rqmt_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_bpr_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_bnft_pool_rlovr_rqmt_f
132   --
133   insert into ben_bnft_pool_rlovr_rqmt_f
134   (	bnft_pool_rlovr_rqmt_id,
135 	effective_start_date,
136 	effective_end_date,
137 	no_mn_rlovr_pct_dfnd_flag,
138 	no_mx_rlovr_pct_dfnd_flag,
139 	no_mn_rlovr_val_dfnd_flag,
140 	no_mx_rlovr_val_dfnd_flag,
141 	rlovr_val_incrmt_num,
142 	rlovr_val_rl,
143 	mn_rlovr_val,
144 	mx_rlovr_val,
145 	val_rndg_cd,
146 	val_rndg_rl,
147 	pct_rndg_cd,
148 	pct_rndg_rl,
149         prtt_elig_rlovr_rl,
150 	mx_rchd_dflt_ordr_num,
151 	pct_rlovr_incrmt_num,
152 	mn_rlovr_pct_num,
153 	mx_rlovr_pct_num,
154         crs_rlovr_procg_cd,
155         mx_pct_ttl_crs_cn_roll_num,
156 	bnft_prvdr_pool_id,
157 	acty_base_rt_id,
158 	business_group_id,
159 	bpr_attribute_category,
160 	bpr_attribute1,
161 	bpr_attribute2,
162 	bpr_attribute3,
163 	bpr_attribute4,
164 	bpr_attribute5,
165 	bpr_attribute6,
166 	bpr_attribute7,
167 	bpr_attribute8,
168 	bpr_attribute9,
169 	bpr_attribute10,
170 	bpr_attribute11,
171 	bpr_attribute12,
172 	bpr_attribute13,
173 	bpr_attribute14,
174 	bpr_attribute15,
175 	bpr_attribute16,
176 	bpr_attribute17,
177 	bpr_attribute18,
178 	bpr_attribute19,
179 	bpr_attribute20,
180 	bpr_attribute21,
181 	bpr_attribute22,
182 	bpr_attribute23,
183 	bpr_attribute24,
184 	bpr_attribute25,
185 	bpr_attribute26,
186 	bpr_attribute27,
187 	bpr_attribute28,
188 	bpr_attribute29,
189 	bpr_attribute30,
190 	object_version_number
191    	, created_by,
192    	creation_date,
193    	last_update_date,
194    	last_updated_by,
195    	last_update_login
196   )
197   Values
198   (	p_rec.bnft_pool_rlovr_rqmt_id,
199 	p_rec.effective_start_date,
200 	p_rec.effective_end_date,
201 	p_rec.no_mn_rlovr_pct_dfnd_flag,
202 	p_rec.no_mx_rlovr_pct_dfnd_flag,
203 	p_rec.no_mn_rlovr_val_dfnd_flag,
204 	p_rec.no_mx_rlovr_val_dfnd_flag,
205 	p_rec.rlovr_val_incrmt_num,
206 	p_rec.rlovr_val_rl,
207 	p_rec.mn_rlovr_val,
208 	p_rec.mx_rlovr_val,
209 	p_rec.val_rndg_cd,
210 	p_rec.val_rndg_rl,
211 	p_rec.pct_rndg_cd,
212 	p_rec.pct_rndg_rl,
213         p_rec.prtt_elig_rlovr_rl,
214 	p_rec.mx_rchd_dflt_ordr_num,
215 	p_rec.pct_rlovr_incrmt_num,
216 	p_rec.mn_rlovr_pct_num,
217 	p_rec.mx_rlovr_pct_num,
218         p_rec.crs_rlovr_procg_cd,
219         p_rec.mx_pct_ttl_crs_cn_roll_num,
220 	p_rec.bnft_prvdr_pool_id,
221 	p_rec.acty_base_rt_id,
222 	p_rec.business_group_id,
223 	p_rec.bpr_attribute_category,
224 	p_rec.bpr_attribute1,
225 	p_rec.bpr_attribute2,
226 	p_rec.bpr_attribute3,
227 	p_rec.bpr_attribute4,
228 	p_rec.bpr_attribute5,
229 	p_rec.bpr_attribute6,
230 	p_rec.bpr_attribute7,
231 	p_rec.bpr_attribute8,
232 	p_rec.bpr_attribute9,
233 	p_rec.bpr_attribute10,
234 	p_rec.bpr_attribute11,
235 	p_rec.bpr_attribute12,
236 	p_rec.bpr_attribute13,
237 	p_rec.bpr_attribute14,
238 	p_rec.bpr_attribute15,
239 	p_rec.bpr_attribute16,
240 	p_rec.bpr_attribute17,
241 	p_rec.bpr_attribute18,
242 	p_rec.bpr_attribute19,
243 	p_rec.bpr_attribute20,
244 	p_rec.bpr_attribute21,
245 	p_rec.bpr_attribute22,
246 	p_rec.bpr_attribute23,
247 	p_rec.bpr_attribute24,
248 	p_rec.bpr_attribute25,
249 	p_rec.bpr_attribute26,
250 	p_rec.bpr_attribute27,
251 	p_rec.bpr_attribute28,
252 	p_rec.bpr_attribute29,
253 	p_rec.bpr_attribute30,
254 	p_rec.object_version_number
255 	, l_created_by,
256    	l_creation_date,
257    	l_last_update_date,
258    	l_last_updated_by,
259    	l_last_update_login
260   );
261   --
262   ben_bpr_shd.g_api_dml := false;   -- Unset the api dml status
263   hr_utility.set_location(' Leaving:'||l_proc, 15);
264 --
265 Exception
266   When hr_api.check_integrity_violated Then
267     -- A check constraint has been violated
268     ben_bpr_shd.g_api_dml := false;   -- Unset the api dml status
269     ben_bpr_shd.constraint_error
270       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
271   When hr_api.unique_integrity_violated Then
272     -- Unique integrity has been violated
273     ben_bpr_shd.g_api_dml := false;   -- Unset the api dml status
274     ben_bpr_shd.constraint_error
275       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
276   When Others Then
277     ben_bpr_shd.g_api_dml := false;   -- Unset the api dml status
278     Raise;
279 End dt_insert_dml;
280 --
281 -- ----------------------------------------------------------------------------
282 -- |------------------------------< insert_dml >------------------------------|
283 -- ----------------------------------------------------------------------------
284 Procedure insert_dml
285 	(p_rec 			 in out nocopy ben_bpr_shd.g_rec_type,
286 	 p_effective_date	 in	date,
287 	 p_datetrack_mode	 in	varchar2,
288 	 p_validation_start_date in	date,
289 	 p_validation_end_date	 in	date) is
290 --
291   l_proc	varchar2(72) := g_package||'insert_dml';
292 --
293 Begin
294   hr_utility.set_location('Entering:'||l_proc, 5);
295   --
296   dt_insert_dml(p_rec			=> p_rec,
297 		p_effective_date	=> p_effective_date,
298 		p_datetrack_mode	=> p_datetrack_mode,
299        		p_validation_start_date	=> p_validation_start_date,
300 		p_validation_end_date	=> p_validation_end_date);
301   --
302   hr_utility.set_location(' Leaving:'||l_proc, 10);
303 End insert_dml;
304 --
305 -- ----------------------------------------------------------------------------
306 -- |------------------------------< pre_insert >------------------------------|
307 -- ----------------------------------------------------------------------------
308 -- {Start Of Comments}
309 --
310 -- Description:
311 --   This private procedure contains any processing which is required before
312 --   the insert dml. Presently, if the entity has a corresponding primary
313 --   key which is maintained by an associating sequence, the primary key for
314 --   the entity will be populated with the next sequence value in
315 --   preparation for the insert dml.
316 --   Also, if comments are defined for this entity, the comments insert
317 --   logic will also be called, generating a comment_id if required.
318 --
319 -- Prerequisites:
320 --   This is an internal procedure which is called from the ins procedure.
321 --
322 -- In Parameters:
323 --   A Pl/Sql record structre.
324 --
325 -- Post Success:
326 --   Processing continues.
327 --
328 -- Post Failure:
329 --   If an error has occurred, an error message and exception will be raised
330 --   but not handled.
331 --
332 -- Developer Implementation Notes:
333 --   Any pre-processing required before the insert dml is issued should be
334 --   coded within this procedure. As stated above, a good example is the
335 --   generation of a primary key number via a corresponding sequence.
336 --   It is important to note that any 3rd party maintenance should be reviewed
337 --   before placing in this procedure.
338 --
339 -- Access Status:
340 --   Internal Row Handler Use Only.
341 --
342 -- {End Of Comments}
343 -- ----------------------------------------------------------------------------
344 Procedure pre_insert
345 	(p_rec  			in out nocopy ben_bpr_shd.g_rec_type,
346 	 p_effective_date		in date,
347 	 p_datetrack_mode		in varchar2,
348 	 p_validation_start_date	in date,
349 	 p_validation_end_date		in date) is
350 --
351   l_proc	varchar2(72) := g_package||'pre_insert';
352 --
353   CURSOR c1 is
354     select ben_bnft_pool_rlovr_rqmt_f_s.nextval
355     from   sys.dual;
356 --
357 Begin
358   hr_utility.set_location('Entering:'||l_proc, 5);
359   --
360   open c1;
361   fetch c1 into p_rec.bnft_pool_rlovr_rqmt_id;
362   close c1;
363   --
364   hr_utility.set_location(' Leaving:'||l_proc, 10);
365 End pre_insert;
366 --
367 -- ----------------------------------------------------------------------------
368 -- |-----------------------------< post_insert >------------------------------|
369 -- ----------------------------------------------------------------------------
370 -- {Start Of Comments}
371 --
372 -- Description:
373 --   This private procedure contains any processing which is required after the
374 --   insert dml.
375 --
376 -- Prerequisites:
377 --   This is an internal procedure which is called from the ins procedure.
378 --
379 -- In Parameters:
380 --   A Pl/Sql record structre.
381 --
382 -- Post Success:
383 --   Processing continues.
384 --
385 -- Post Failure:
386 --   If an error has occurred, an error message and exception will be raised
387 --   but not handled.
388 --
389 -- Developer Implementation Notes:
390 --   Any post-processing required after the insert dml is issued should be
391 --   coded within this procedure. It is important to note that any 3rd party
392 --   maintenance should be reviewed before placing in this procedure.
393 --
394 -- Access Status:
395 --   Internal Row Handler Use Only.
396 --
397 -- {End Of Comments}
398 -- ----------------------------------------------------------------------------
399 Procedure post_insert
400 	(p_rec 			 in ben_bpr_shd.g_rec_type,
401 	 p_effective_date	 in date,
402 	 p_datetrack_mode	 in varchar2,
403 	 p_validation_start_date in date,
404 	 p_validation_end_date	 in date) is
405 --
406   l_proc	varchar2(72) := g_package||'post_insert';
407 --
408 Begin
409   hr_utility.set_location('Entering:'||l_proc, 5);
410 --
411   --
412   -- Start of API User Hook for post_insert.
413   --
414   begin
415     --
416     ben_bpr_rki.after_insert
417       (
418   p_bnft_pool_rlovr_rqmt_id       =>p_rec.bnft_pool_rlovr_rqmt_id
419  ,p_effective_start_date          =>p_rec.effective_start_date
420  ,p_effective_end_date            =>p_rec.effective_end_date
421  ,p_no_mn_rlovr_pct_dfnd_flag     =>p_rec.no_mn_rlovr_pct_dfnd_flag
422  ,p_no_mx_rlovr_pct_dfnd_flag     =>p_rec.no_mx_rlovr_pct_dfnd_flag
423  ,p_no_mn_rlovr_val_dfnd_flag     =>p_rec.no_mn_rlovr_val_dfnd_flag
424  ,p_no_mx_rlovr_val_dfnd_flag     =>p_rec.no_mx_rlovr_val_dfnd_flag
425  ,p_rlovr_val_incrmt_num          =>p_rec.rlovr_val_incrmt_num
426  ,p_rlovr_val_rl                  =>p_rec.rlovr_val_rl
427  ,p_mn_rlovr_val                  =>p_rec.mn_rlovr_val
428  ,p_mx_rlovr_val                  =>p_rec.mx_rlovr_val
429  ,p_val_rndg_cd                   =>p_rec.val_rndg_cd
430  ,p_val_rndg_rl                   =>p_rec.val_rndg_rl
431  ,p_pct_rndg_cd                   =>p_rec.pct_rndg_cd
432  ,p_pct_rndg_rl                   =>p_rec.pct_rndg_rl
433  ,p_prtt_elig_rlovr_rl            =>p_rec.prtt_elig_rlovr_rl
434  ,p_mx_rchd_dflt_ordr_num         =>p_rec.mx_rchd_dflt_ordr_num
435  ,p_pct_rlovr_incrmt_num          =>p_rec.pct_rlovr_incrmt_num
436  ,p_mn_rlovr_pct_num              =>p_rec.mn_rlovr_pct_num
437  ,p_mx_rlovr_pct_num              =>p_rec.mx_rlovr_pct_num
438  ,p_crs_rlovr_procg_cd            =>p_rec.crs_rlovr_procg_cd
439  ,p_mx_pct_ttl_crs_cn_roll_num    =>p_rec.mx_pct_ttl_crs_cn_roll_num
440  ,p_bnft_prvdr_pool_id            =>p_rec.bnft_prvdr_pool_id
441  ,p_acty_base_rt_id               =>p_rec.acty_base_rt_id
442  ,p_business_group_id             =>p_rec.business_group_id
443  ,p_bpr_attribute_category        =>p_rec.bpr_attribute_category
444  ,p_bpr_attribute1                =>p_rec.bpr_attribute1
445  ,p_bpr_attribute2                =>p_rec.bpr_attribute2
446  ,p_bpr_attribute3                =>p_rec.bpr_attribute3
447  ,p_bpr_attribute4                =>p_rec.bpr_attribute4
448  ,p_bpr_attribute5                =>p_rec.bpr_attribute5
449  ,p_bpr_attribute6                =>p_rec.bpr_attribute6
450  ,p_bpr_attribute7                =>p_rec.bpr_attribute7
451  ,p_bpr_attribute8                =>p_rec.bpr_attribute8
452  ,p_bpr_attribute9                =>p_rec.bpr_attribute9
453  ,p_bpr_attribute10               =>p_rec.bpr_attribute10
454  ,p_bpr_attribute11               =>p_rec.bpr_attribute11
455  ,p_bpr_attribute12               =>p_rec.bpr_attribute12
456  ,p_bpr_attribute13               =>p_rec.bpr_attribute13
457  ,p_bpr_attribute14               =>p_rec.bpr_attribute14
458  ,p_bpr_attribute15               =>p_rec.bpr_attribute15
459  ,p_bpr_attribute16               =>p_rec.bpr_attribute16
460  ,p_bpr_attribute17               =>p_rec.bpr_attribute17
461  ,p_bpr_attribute18               =>p_rec.bpr_attribute18
462  ,p_bpr_attribute19               =>p_rec.bpr_attribute19
463  ,p_bpr_attribute20               =>p_rec.bpr_attribute20
464  ,p_bpr_attribute21               =>p_rec.bpr_attribute21
465  ,p_bpr_attribute22               =>p_rec.bpr_attribute22
466  ,p_bpr_attribute23               =>p_rec.bpr_attribute23
467  ,p_bpr_attribute24               =>p_rec.bpr_attribute24
468  ,p_bpr_attribute25               =>p_rec.bpr_attribute25
469  ,p_bpr_attribute26               =>p_rec.bpr_attribute26
470  ,p_bpr_attribute27               =>p_rec.bpr_attribute27
471  ,p_bpr_attribute28               =>p_rec.bpr_attribute28
472  ,p_bpr_attribute29               =>p_rec.bpr_attribute29
473  ,p_bpr_attribute30               =>p_rec.bpr_attribute30
474  ,p_object_version_number         =>p_rec.object_version_number
475  ,p_effective_date                =>p_effective_date
476  ,p_validation_start_date         =>p_validation_start_date
477  ,p_validation_end_date           =>p_validation_end_date
478       );
479     --
480   exception
481     --
482     when hr_api.cannot_find_prog_unit then
483       --
484       hr_api.cannot_find_prog_unit_error
485         (p_module_name => 'ben_bnft_pool_rlovr_rqmt_f'
486         ,p_hook_type   => 'AI');
487       --
488   end;
489   --
490   -- End of API User Hook for post_insert.
491   --
492   --
493   hr_utility.set_location(' Leaving:'||l_proc, 10);
494 End post_insert;
495 --
496 -- ----------------------------------------------------------------------------
497 -- |-------------------------------< ins_lck >--------------------------------|
498 -- ----------------------------------------------------------------------------
499 -- {Start Of Comments}
500 --
501 -- Description:
502 --   The ins_lck process has one main function to perform. When inserting
503 --   a datetracked row, we must validate the DT mode.
504 --   be manipulated.
505 --
506 -- Prerequisites:
507 --   This procedure can only be called for the datetrack mode of INSERT.
508 --
509 -- In Parameters:
510 --
511 -- Post Success:
512 --   On successful completion of the ins_lck process the parental
513 --   datetracked rows will be locked providing the p_enforce_foreign_locking
514 --   argument value is TRUE.
515 --   If the p_enforce_foreign_locking argument value is FALSE then the
516 --   parential rows are not locked.
517 --
518 -- Post Failure:
519 --   The Lck process can fail for:
520 --   1) When attempting to lock the row the row could already be locked by
521 --      another user. This will raise the HR_Api.Object_Locked exception.
522 --   2) When attempting to the lock the parent which doesn't exist.
523 --      For the entity to be locked the parent must exist!
524 --
525 -- Developer Implementation Notes:
526 --   None.
527 --
528 -- Access Status:
529 --   Internal Row Handler Use Only.
530 --
531 -- {End Of Comments}
532 -- ----------------------------------------------------------------------------
533 Procedure ins_lck
534 	(p_effective_date	 in  date,
535 	 p_datetrack_mode	 in  varchar2,
536 	 p_rec	 		 in  ben_bpr_shd.g_rec_type,
537 	 p_validation_start_date out nocopy date,
538 	 p_validation_end_date	 out nocopy date) is
539 --
540   l_proc		  varchar2(72) := g_package||'ins_lck';
541   l_validation_start_date date;
542   l_validation_end_date	  date;
543 --
544 Begin
545   hr_utility.set_location('Entering:'||l_proc, 5);
546   --
547   -- Validate the datetrack mode mode getting the validation start
548   -- and end dates for the specified datetrack operation.
549   --
550   dt_api.validate_dt_mode
551 	(p_effective_date	   => p_effective_date,
552 	 p_datetrack_mode	   => p_datetrack_mode,
553 	 p_base_table_name	   => 'ben_bnft_pool_rlovr_rqmt_f',
554 	 p_base_key_column	   => 'bnft_pool_rlovr_rqmt_id',
555 	 p_base_key_value 	   => p_rec.bnft_pool_rlovr_rqmt_id,
556 	 p_parent_table_name1      => 'ben_acty_base_rt_f',
557 	 p_parent_key_column1      => 'acty_base_rt_id',
558 	 p_parent_key_value1       => p_rec.acty_base_rt_id,
559 	 p_parent_table_name2      => 'ben_bnft_prvdr_pool_f',
560 	 p_parent_key_column2      => 'bnft_prvdr_pool_id',
561 	 p_parent_key_value2       => p_rec.bnft_prvdr_pool_id,
562          p_enforce_foreign_locking => true,
563 	 p_validation_start_date   => l_validation_start_date,
564  	 p_validation_end_date	   => l_validation_end_date);
565   --
566   -- Set the validation start and end date OUT arguments
567   --
568   p_validation_start_date := l_validation_start_date;
569   p_validation_end_date   := l_validation_end_date;
570   --
571   hr_utility.set_location(' Leaving:'||l_proc, 10);
572 --
573 End ins_lck;
574 --
575 -- ----------------------------------------------------------------------------
576 -- |---------------------------------< ins >----------------------------------|
577 -- ----------------------------------------------------------------------------
578 Procedure ins
579   (
580   p_rec		   in out nocopy ben_bpr_shd.g_rec_type,
581   p_effective_date in     date
582   ) is
583 --
584   l_proc			varchar2(72) := g_package||'ins';
585   l_datetrack_mode		varchar2(30) := 'INSERT';
586   l_validation_start_date	date;
587   l_validation_end_date		date;
588 --
589 Begin
590   hr_utility.set_location('Entering:'||l_proc, 5);
591   --
592   -- Call the lock operation
593   --
594   ins_lck
595 	(p_effective_date	 => p_effective_date,
596 	 p_datetrack_mode	 => l_datetrack_mode,
597 	 p_rec	 		 => p_rec,
598 	 p_validation_start_date => l_validation_start_date,
599 	 p_validation_end_date	 => l_validation_end_date);
600   --
601   -- Call the supporting insert validate operations
602   --
603   ben_bpr_bus.insert_validate
604 	(p_rec			 => p_rec,
605 	 p_effective_date	 => p_effective_date,
606 	 p_datetrack_mode	 => l_datetrack_mode,
607 	 p_validation_start_date => l_validation_start_date,
608 	 p_validation_end_date	 => l_validation_end_date);
609   --
610   -- Call the supporting pre-insert operation
611   --
612   pre_insert
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   -- Insert the row
620   --
621   insert_dml
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   -- Call the supporting post-insert operation
629   --
630   post_insert
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 end ins;
637 --
638 -- ----------------------------------------------------------------------------
639 -- |---------------------------------< ins >----------------------------------|
640 -- ----------------------------------------------------------------------------
641 Procedure ins
642   (
643   p_bnft_pool_rlovr_rqmt_id      out nocopy number,
644   p_effective_start_date         out nocopy date,
645   p_effective_end_date           out nocopy date,
646   p_no_mn_rlovr_pct_dfnd_flag    in varchar2,
647   p_no_mx_rlovr_pct_dfnd_flag    in varchar2,
648   p_no_mn_rlovr_val_dfnd_flag    in varchar2,
649   p_no_mx_rlovr_val_dfnd_flag    in varchar2,
650   p_rlovr_val_incrmt_num         in number           default null,
651   p_rlovr_val_rl                 in number           default null,
652   p_mn_rlovr_val                 in number           default null,
653   p_mx_rlovr_val                 in number           default null,
654   p_val_rndg_cd                  in varchar2         default null,
655   p_val_rndg_rl                  in number           default null,
656   p_pct_rndg_cd                  in varchar2         default null,
657   p_pct_rndg_rl                  in number           default null,
658   p_prtt_elig_rlovr_rl           in number           default null,
659   p_mx_rchd_dflt_ordr_num        in number           default null,
660   p_pct_rlovr_incrmt_num         in number           default null,
661   p_mn_rlovr_pct_num             in number           default null,
662   p_mx_rlovr_pct_num             in number           default null,
663   p_crs_rlovr_procg_cd           in varchar2         default null,
664   p_mx_pct_ttl_crs_cn_roll_num   in number           default null,
665   p_bnft_prvdr_pool_id           in number,
666   p_acty_base_rt_id              in number,
667   p_business_group_id            in number,
668   p_bpr_attribute_category       in varchar2         default null,
669   p_bpr_attribute1               in varchar2         default null,
670   p_bpr_attribute2               in varchar2         default null,
671   p_bpr_attribute3               in varchar2         default null,
672   p_bpr_attribute4               in varchar2         default null,
673   p_bpr_attribute5               in varchar2         default null,
674   p_bpr_attribute6               in varchar2         default null,
675   p_bpr_attribute7               in varchar2         default null,
676   p_bpr_attribute8               in varchar2         default null,
677   p_bpr_attribute9               in varchar2         default null,
678   p_bpr_attribute10              in varchar2         default null,
679   p_bpr_attribute11              in varchar2         default null,
680   p_bpr_attribute12              in varchar2         default null,
681   p_bpr_attribute13              in varchar2         default null,
682   p_bpr_attribute14              in varchar2         default null,
683   p_bpr_attribute15              in varchar2         default null,
684   p_bpr_attribute16              in varchar2         default null,
685   p_bpr_attribute17              in varchar2         default null,
686   p_bpr_attribute18              in varchar2         default null,
687   p_bpr_attribute19              in varchar2         default null,
688   p_bpr_attribute20              in varchar2         default null,
689   p_bpr_attribute21              in varchar2         default null,
690   p_bpr_attribute22              in varchar2         default null,
691   p_bpr_attribute23              in varchar2         default null,
692   p_bpr_attribute24              in varchar2         default null,
693   p_bpr_attribute25              in varchar2         default null,
694   p_bpr_attribute26              in varchar2         default null,
695   p_bpr_attribute27              in varchar2         default null,
696   p_bpr_attribute28              in varchar2         default null,
697   p_bpr_attribute29              in varchar2         default null,
698   p_bpr_attribute30              in varchar2         default null,
699   p_object_version_number        out nocopy number,
700   p_effective_date		 in date
701   ) is
702 --
703   l_rec		ben_bpr_shd.g_rec_type;
704   l_proc	varchar2(72) := g_package||'ins';
705 --
706 Begin
707   hr_utility.set_location('Entering:'||l_proc, 5);
708   --
709   -- Call conversion function to turn arguments into the
710   -- p_rec structure.
711   --
712   l_rec :=
713   ben_bpr_shd.convert_args
714   (
715   null,
716   null,
717   null,
718   p_no_mn_rlovr_pct_dfnd_flag,
719   p_no_mx_rlovr_pct_dfnd_flag,
720   p_no_mn_rlovr_val_dfnd_flag,
721   p_no_mx_rlovr_val_dfnd_flag,
722   p_rlovr_val_incrmt_num,
723   p_rlovr_val_rl,
724   p_mn_rlovr_val,
725   p_mx_rlovr_val,
726   p_val_rndg_cd,
727   p_val_rndg_rl,
728   p_pct_rndg_cd,
729   p_pct_rndg_rl,
730   p_prtt_elig_rlovr_rl,
731   p_mx_rchd_dflt_ordr_num,
732   p_pct_rlovr_incrmt_num,
733   p_mn_rlovr_pct_num,
734   p_mx_rlovr_pct_num,
735   p_crs_rlovr_procg_cd,
736   p_mx_pct_ttl_crs_cn_roll_num,
737   p_bnft_prvdr_pool_id,
738   p_acty_base_rt_id,
739   p_business_group_id,
740   p_bpr_attribute_category,
741   p_bpr_attribute1,
742   p_bpr_attribute2,
743   p_bpr_attribute3,
744   p_bpr_attribute4,
745   p_bpr_attribute5,
746   p_bpr_attribute6,
747   p_bpr_attribute7,
748   p_bpr_attribute8,
749   p_bpr_attribute9,
750   p_bpr_attribute10,
751   p_bpr_attribute11,
752   p_bpr_attribute12,
753   p_bpr_attribute13,
754   p_bpr_attribute14,
755   p_bpr_attribute15,
756   p_bpr_attribute16,
757   p_bpr_attribute17,
758   p_bpr_attribute18,
759   p_bpr_attribute19,
760   p_bpr_attribute20,
761   p_bpr_attribute21,
762   p_bpr_attribute22,
763   p_bpr_attribute23,
764   p_bpr_attribute24,
765   p_bpr_attribute25,
766   p_bpr_attribute26,
767   p_bpr_attribute27,
768   p_bpr_attribute28,
769   p_bpr_attribute29,
770   p_bpr_attribute30,
771   null
772   );
773   --
774   -- Having converted the arguments into the ben_bpr_rec
775   -- plsql record structure we call the corresponding record
776   -- business process.
777   --
778   ins(l_rec, p_effective_date);
779   --
780   -- Set the OUT arguments.
781   --
782   p_bnft_pool_rlovr_rqmt_id        	:= l_rec.bnft_pool_rlovr_rqmt_id;
783   p_effective_start_date  	:= l_rec.effective_start_date;
784   p_effective_end_date    	:= l_rec.effective_end_date;
785   p_object_version_number 	:= l_rec.object_version_number;
786   --
787   --
788   hr_utility.set_location(' Leaving:'||l_proc, 10);
789 End ins;
790 --
791 end ben_bpr_ins;