DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PRD_INS

Source


1 Package Body ben_prd_ins as
2 /* $Header: beprdrhi.pkb 120.0.12010000.2 2008/08/05 15:20:11 ubhat ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_prd_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_prd_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_paird_rt_f t
70     where  t.paird_rt_id       = p_rec.paird_rt_id
71     and    t.effective_start_date =
72              ben_prd_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_paird_rt_f.created_by%TYPE;
77   l_creation_date       ben_paird_rt_f.creation_date%TYPE;
78   l_last_update_date   	ben_paird_rt_f.last_update_date%TYPE;
79   l_last_updated_by     ben_paird_rt_f.last_updated_by%TYPE;
80   l_last_update_login   ben_paird_rt_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_paird_rt_f',
90 	 p_base_key_column => 'paird_rt_id',
91 	 p_base_key_value  => p_rec.paird_rt_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_prd_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_paird_rt_f
132   --
133   insert into ben_paird_rt_f
134   (	paird_rt_id,
135 	effective_start_date,
136 	effective_end_date,
137 	use_parnt_ded_sched_flag,
138 	asn_on_chc_of_parnt_flag,
139 	use_parnt_prtl_mo_cd_flag,
140 	alloc_sme_as_parnt_flag,
141 	use_parnt_pymt_sched_flag,
142 	no_cmbnd_mx_amt_dfnd_flag,
143 	cmbnd_mx_amt,
144 	cmbnd_mn_amt,
145 	cmbnd_mx_pct_num,
146 	cmbnd_mn_pct_num,
147 	no_cmbnd_mn_amt_dfnd_flag,
148 	no_cmbnd_mn_pct_dfnd_flag,
149 	no_cmbnd_mx_pct_dfnd_flag,
150 	parnt_acty_base_rt_id,
151 	chld_acty_base_rt_id,
152 	business_group_id,
153 	prd_attribute_category,
154 	prd_attribute1,
155 	prd_attribute2,
156 	prd_attribute3,
157 	prd_attribute4,
158 	prd_attribute5,
159 	prd_attribute6,
160 	prd_attribute7,
161 	prd_attribute8,
162 	prd_attribute9,
163 	prd_attribute10,
164 	prd_attribute11,
165 	prd_attribute12,
166 	prd_attribute13,
167 	prd_attribute14,
168 	prd_attribute15,
169 	prd_attribute16,
170 	prd_attribute17,
171 	prd_attribute18,
172 	prd_attribute19,
173 	prd_attribute20,
174 	prd_attribute21,
175 	prd_attribute22,
176 	prd_attribute23,
177 	prd_attribute24,
178 	prd_attribute25,
179 	prd_attribute26,
180 	prd_attribute27,
181 	prd_attribute28,
182 	prd_attribute29,
183 	prd_attribute30,
184 	object_version_number
185    	, created_by,
186    	creation_date,
187    	last_update_date,
188    	last_updated_by,
189    	last_update_login
190   )
191   Values
192   (	p_rec.paird_rt_id,
193 	p_rec.effective_start_date,
194 	p_rec.effective_end_date,
195 	p_rec.use_parnt_ded_sched_flag,
196 	p_rec.asn_on_chc_of_parnt_flag,
197 	p_rec.use_parnt_prtl_mo_cd_flag,
198 	p_rec.alloc_sme_as_parnt_flag,
199 	p_rec.use_parnt_pymt_sched_flag,
200 	p_rec.no_cmbnd_mx_amt_dfnd_flag,
201 	p_rec.cmbnd_mx_amt,
202 	p_rec.cmbnd_mn_amt,
203 	p_rec.cmbnd_mx_pct_num,
204 	p_rec.cmbnd_mn_pct_num,
205 	p_rec.no_cmbnd_mn_amt_dfnd_flag,
206 	p_rec.no_cmbnd_mn_pct_dfnd_flag,
207 	p_rec.no_cmbnd_mx_pct_dfnd_flag,
208 	p_rec.parnt_acty_base_rt_id,
209 	p_rec.chld_acty_base_rt_id,
210 	p_rec.business_group_id,
211 	p_rec.prd_attribute_category,
212 	p_rec.prd_attribute1,
213 	p_rec.prd_attribute2,
214 	p_rec.prd_attribute3,
215 	p_rec.prd_attribute4,
216 	p_rec.prd_attribute5,
217 	p_rec.prd_attribute6,
218 	p_rec.prd_attribute7,
219 	p_rec.prd_attribute8,
220 	p_rec.prd_attribute9,
221 	p_rec.prd_attribute10,
222 	p_rec.prd_attribute11,
223 	p_rec.prd_attribute12,
224 	p_rec.prd_attribute13,
225 	p_rec.prd_attribute14,
226 	p_rec.prd_attribute15,
227 	p_rec.prd_attribute16,
228 	p_rec.prd_attribute17,
229 	p_rec.prd_attribute18,
230 	p_rec.prd_attribute19,
231 	p_rec.prd_attribute20,
232 	p_rec.prd_attribute21,
233 	p_rec.prd_attribute22,
234 	p_rec.prd_attribute23,
235 	p_rec.prd_attribute24,
236 	p_rec.prd_attribute25,
237 	p_rec.prd_attribute26,
238 	p_rec.prd_attribute27,
239 	p_rec.prd_attribute28,
240 	p_rec.prd_attribute29,
241 	p_rec.prd_attribute30,
242 	p_rec.object_version_number
243 	, l_created_by,
244    	l_creation_date,
245    	l_last_update_date,
246    	l_last_updated_by,
247    	l_last_update_login
248   );
249   --
250   ben_prd_shd.g_api_dml := false;   -- Unset the api dml status
251   hr_utility.set_location(' Leaving:'||l_proc, 15);
252 --
253 Exception
254   When hr_api.check_integrity_violated Then
255     -- A check constraint has been violated
256     ben_prd_shd.g_api_dml := false;   -- Unset the api dml status
257     ben_prd_shd.constraint_error
258       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
259   When hr_api.unique_integrity_violated Then
260     -- Unique integrity has been violated
261     ben_prd_shd.g_api_dml := false;   -- Unset the api dml status
262     ben_prd_shd.constraint_error
263       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
264   When Others Then
265     ben_prd_shd.g_api_dml := false;   -- Unset the api dml status
266     Raise;
267 End dt_insert_dml;
268 --
269 -- ----------------------------------------------------------------------------
270 -- |------------------------------< insert_dml >------------------------------|
271 -- ----------------------------------------------------------------------------
272 Procedure insert_dml
273 	(p_rec 			 in out nocopy ben_prd_shd.g_rec_type,
274 	 p_effective_date	 in	date,
275 	 p_datetrack_mode	 in	varchar2,
276 	 p_validation_start_date in	date,
277 	 p_validation_end_date	 in	date) is
278 --
279   l_proc	varchar2(72) := g_package||'insert_dml';
280 --
281 Begin
282   hr_utility.set_location('Entering:'||l_proc, 5);
283   --
284   dt_insert_dml(p_rec			=> p_rec,
285 		p_effective_date	=> p_effective_date,
286 		p_datetrack_mode	=> p_datetrack_mode,
287        		p_validation_start_date	=> p_validation_start_date,
288 		p_validation_end_date	=> p_validation_end_date);
289   --
290   hr_utility.set_location(' Leaving:'||l_proc, 10);
291 End insert_dml;
292 --
293 -- ----------------------------------------------------------------------------
294 -- |------------------------------< pre_insert >------------------------------|
295 -- ----------------------------------------------------------------------------
296 -- {Start Of Comments}
297 --
298 -- Description:
299 --   This private procedure contains any processing which is required before
300 --   the insert dml. Presently, if the entity has a corresponding primary
301 --   key which is maintained by an associating sequence, the primary key for
302 --   the entity will be populated with the next sequence value in
303 --   preparation for the insert dml.
304 --   Also, if comments are defined for this entity, the comments insert
305 --   logic will also be called, generating a comment_id if required.
306 --
307 -- Prerequisites:
308 --   This is an internal procedure which is called from the ins procedure.
309 --
310 -- In Parameters:
311 --   A Pl/Sql record structre.
312 --
313 -- Post Success:
314 --   Processing continues.
315 --
316 -- Post Failure:
317 --   If an error has occurred, an error message and exception will be raised
318 --   but not handled.
319 --
320 -- Developer Implementation Notes:
321 --   Any pre-processing required before the insert dml is issued should be
322 --   coded within this procedure. As stated above, a good example is the
323 --   generation of a primary key number via a corresponding sequence.
324 --   It is important to note that any 3rd party maintenance should be reviewed
325 --   before placing in this procedure.
326 --
327 -- Access Status:
328 --   Internal Row Handler Use Only.
329 --
330 -- {End Of Comments}
331 -- ----------------------------------------------------------------------------
332 Procedure pre_insert
333 	(p_rec  			in out nocopy ben_prd_shd.g_rec_type,
334 	 p_effective_date		in date,
335 	 p_datetrack_mode		in varchar2,
336 	 p_validation_start_date	in date,
337 	 p_validation_end_date		in date) is
338 --
339   l_proc	varchar2(72) := g_package||'pre_insert';
340   cursor c1 is select ben_paird_rt_f_s.nextval
341                from   sys.dual;
342 --
343 --
344 --
345 Begin
346   hr_utility.set_location('Entering:'||l_proc, 5);
347   --
348   --
349   open c1;
350   fetch c1 into p_rec.paird_rt_id;
351   close c1;
352   --
353   --
354   hr_utility.set_location(' Leaving:'||l_proc, 10);
355 End pre_insert;
356 --
357 -- ----------------------------------------------------------------------------
358 -- |-----------------------------< post_insert >------------------------------|
359 -- ----------------------------------------------------------------------------
360 -- {Start Of Comments}
361 --
362 -- Description:
363 --   This private procedure contains any processing which is required after the
364 --   insert dml.
365 --
366 -- Prerequisites:
367 --   This is an internal procedure which is called from the ins procedure.
368 --
369 -- In Parameters:
370 --   A Pl/Sql record structre.
371 --
372 -- Post Success:
373 --   Processing continues.
374 --
375 -- Post Failure:
376 --   If an error has occurred, an error message and exception will be raised
377 --   but not handled.
378 --
379 -- Developer Implementation Notes:
380 --   Any post-processing required after the insert dml is issued should be
381 --   coded within this procedure. It is important to note that any 3rd party
382 --   maintenance should be reviewed before placing in this procedure.
383 --
384 -- Access Status:
385 --   Internal Row Handler Use Only.
386 --
387 -- {End Of Comments}
388 -- ----------------------------------------------------------------------------
389 Procedure post_insert
390 	(p_rec 			 in ben_prd_shd.g_rec_type,
391 	 p_effective_date	 in date,
392 	 p_datetrack_mode	 in varchar2,
393 	 p_validation_start_date in date,
394 	 p_validation_end_date	 in date) is
395 --
396   l_proc	varchar2(72) := g_package||'post_insert';
397 --
398 Begin
399   hr_utility.set_location('Entering:'||l_proc, 5);
400 --
401   --
402   -- Start of API User Hook for post_insert.
403   --
404   begin
405     --
406     ben_prd_rki.after_insert
407       (
408   p_paird_rt_id                   =>p_rec.paird_rt_id
409  ,p_effective_start_date          =>p_rec.effective_start_date
410  ,p_effective_end_date            =>p_rec.effective_end_date
411  ,p_use_parnt_ded_sched_flag      =>p_rec.use_parnt_ded_sched_flag
412  ,p_asn_on_chc_of_parnt_flag      =>p_rec.asn_on_chc_of_parnt_flag
413  ,p_use_parnt_prtl_mo_cd_flag     =>p_rec.use_parnt_prtl_mo_cd_flag
414  ,p_alloc_sme_as_parnt_flag       =>p_rec.alloc_sme_as_parnt_flag
415  ,p_use_parnt_pymt_sched_flag     =>p_rec.use_parnt_pymt_sched_flag
416  ,p_no_cmbnd_mx_amt_dfnd_flag     =>p_rec.no_cmbnd_mx_amt_dfnd_flag
417  ,p_cmbnd_mx_amt                  =>p_rec.cmbnd_mx_amt
418  ,p_cmbnd_mn_amt                  =>p_rec.cmbnd_mn_amt
419  ,p_cmbnd_mx_pct_num              =>p_rec.cmbnd_mx_pct_num
420  ,p_cmbnd_mn_pct_num              =>p_rec.cmbnd_mn_pct_num
421  ,p_no_cmbnd_mn_amt_dfnd_flag     =>p_rec.no_cmbnd_mn_amt_dfnd_flag
422  ,p_no_cmbnd_mn_pct_dfnd_flag     =>p_rec.no_cmbnd_mn_pct_dfnd_flag
423  ,p_no_cmbnd_mx_pct_dfnd_flag     =>p_rec.no_cmbnd_mx_pct_dfnd_flag
424  ,p_parnt_acty_base_rt_id         =>p_rec.parnt_acty_base_rt_id
425  ,p_chld_acty_base_rt_id          =>p_rec.chld_acty_base_rt_id
426  ,p_business_group_id             =>p_rec.business_group_id
427  ,p_prd_attribute_category        =>p_rec.prd_attribute_category
428  ,p_prd_attribute1                =>p_rec.prd_attribute1
429  ,p_prd_attribute2                =>p_rec.prd_attribute2
430  ,p_prd_attribute3                =>p_rec.prd_attribute3
431  ,p_prd_attribute4                =>p_rec.prd_attribute4
432  ,p_prd_attribute5                =>p_rec.prd_attribute5
433  ,p_prd_attribute6                =>p_rec.prd_attribute6
434  ,p_prd_attribute7                =>p_rec.prd_attribute7
435  ,p_prd_attribute8                =>p_rec.prd_attribute8
436  ,p_prd_attribute9                =>p_rec.prd_attribute9
437  ,p_prd_attribute10               =>p_rec.prd_attribute10
438  ,p_prd_attribute11               =>p_rec.prd_attribute11
439  ,p_prd_attribute12               =>p_rec.prd_attribute12
440  ,p_prd_attribute13               =>p_rec.prd_attribute13
441  ,p_prd_attribute14               =>p_rec.prd_attribute14
442  ,p_prd_attribute15               =>p_rec.prd_attribute15
443  ,p_prd_attribute16               =>p_rec.prd_attribute16
444  ,p_prd_attribute17               =>p_rec.prd_attribute17
445  ,p_prd_attribute18               =>p_rec.prd_attribute18
446  ,p_prd_attribute19               =>p_rec.prd_attribute19
447  ,p_prd_attribute20               =>p_rec.prd_attribute20
448  ,p_prd_attribute21               =>p_rec.prd_attribute21
449  ,p_prd_attribute22               =>p_rec.prd_attribute22
450  ,p_prd_attribute23               =>p_rec.prd_attribute23
451  ,p_prd_attribute24               =>p_rec.prd_attribute24
452  ,p_prd_attribute25               =>p_rec.prd_attribute25
453  ,p_prd_attribute26               =>p_rec.prd_attribute26
454  ,p_prd_attribute27               =>p_rec.prd_attribute27
455  ,p_prd_attribute28               =>p_rec.prd_attribute28
456  ,p_prd_attribute29               =>p_rec.prd_attribute29
457  ,p_prd_attribute30               =>p_rec.prd_attribute30
458  ,p_object_version_number         =>p_rec.object_version_number
459  ,p_effective_date                =>p_effective_date
460  ,p_validation_start_date         =>p_validation_start_date
461  ,p_validation_end_date           =>p_validation_end_date
462       );
463     --
464   exception
465     --
466     when hr_api.cannot_find_prog_unit then
467       --
468       hr_api.cannot_find_prog_unit_error
469         (p_module_name => 'ben_paird_rt_f'
470         ,p_hook_type   => 'AI');
471       --
472   end;
473   --
474   -- End of API User Hook for post_insert.
475   --
476   --
477   hr_utility.set_location(' Leaving:'||l_proc, 10);
478 End post_insert;
479 --
480 -- ----------------------------------------------------------------------------
481 -- |-------------------------------< ins_lck >--------------------------------|
482 -- ----------------------------------------------------------------------------
483 -- {Start Of Comments}
484 --
485 -- Description:
486 --   The ins_lck process has one main function to perform. When inserting
487 --   a datetracked row, we must validate the DT mode.
488 --   be manipulated.
489 --
490 -- Prerequisites:
491 --   This procedure can only be called for the datetrack mode of INSERT.
492 --
493 -- In Parameters:
494 --
495 -- Post Success:
496 --   On successful completion of the ins_lck process the parental
497 --   datetracked rows will be locked providing the p_enforce_foreign_locking
498 --   argument value is TRUE.
499 --   If the p_enforce_foreign_locking argument value is FALSE then the
500 --   parential rows are not locked.
501 --
502 -- Post Failure:
503 --   The Lck process can fail for:
504 --   1) When attempting to lock the row the row could already be locked by
505 --      another user. This will raise the HR_Api.Object_Locked exception.
506 --   2) When attempting to the lock the parent which doesn't exist.
507 --      For the entity to be locked the parent must exist!
508 --
509 -- Developer Implementation Notes:
510 --   None.
511 --
512 -- Access Status:
513 --   Internal Row Handler Use Only.
514 --
515 -- {End Of Comments}
516 -- ----------------------------------------------------------------------------
517 Procedure ins_lck
518 	(p_effective_date	 in  date,
519 	 p_datetrack_mode	 in  varchar2,
520 	 p_rec	 		 in  ben_prd_shd.g_rec_type,
521 	 p_validation_start_date out nocopy date,
522 	 p_validation_end_date	 out nocopy date) is
523 --
524   l_proc		  varchar2(72) := g_package||'ins_lck';
525   l_validation_start_date date;
526   l_validation_end_date	  date;
527 --
528 Begin
529   hr_utility.set_location('Entering:'||l_proc, 5);
530   --
531   -- Validate the datetrack mode mode getting the validation start
532   -- and end dates for the specified datetrack operation.
533   --
534   dt_api.validate_dt_mode
535 	(p_effective_date	   => p_effective_date,
536 	 p_datetrack_mode	   => p_datetrack_mode,
537 	 p_base_table_name	   => 'ben_paird_rt_f',
538 	 p_base_key_column	   => 'paird_rt_id',
539 	 p_base_key_value 	   => p_rec.paird_rt_id,
540 	 p_parent_table_name1      => 'ben_acty_base_rt_f',
541 	 p_parent_key_column1      => 'acty_base_rt_id',
542 	 p_parent_key_value1       => p_rec.parnt_acty_base_rt_id,
543 	 p_parent_table_name2      => 'ben_acty_base_rt_f',
544 	 p_parent_key_column2      => 'acty_base_rt_id',
545 	 p_parent_key_value2       => p_rec.chld_acty_base_rt_id,
546          p_enforce_foreign_locking => true,
547 	 p_validation_start_date   => l_validation_start_date,
548  	 p_validation_end_date	   => l_validation_end_date);
549   --
550   -- Set the validation start and end date OUT arguments
551   --
552   p_validation_start_date := l_validation_start_date;
553   p_validation_end_date   := l_validation_end_date;
554   --
555   hr_utility.set_location(' Leaving:'||l_proc, 10);
556 --
557 End ins_lck;
558 --
559 -- ----------------------------------------------------------------------------
560 -- |---------------------------------< ins >----------------------------------|
561 -- ----------------------------------------------------------------------------
562 Procedure ins
563   (
564   p_rec		   in out nocopy ben_prd_shd.g_rec_type,
565   p_effective_date in     date
566   ) is
567 --
568   l_proc			varchar2(72) := g_package||'ins';
569   l_datetrack_mode		varchar2(30) := 'INSERT';
570   l_validation_start_date	date;
571   l_validation_end_date		date;
572 --
573 Begin
574   hr_utility.set_location('Entering:'||l_proc, 5);
575   --
576   -- Call the lock operation
577   --
578   ins_lck
579 	(p_effective_date	 => p_effective_date,
580 	 p_datetrack_mode	 => l_datetrack_mode,
581 	 p_rec	 		 => p_rec,
582 	 p_validation_start_date => l_validation_start_date,
583 	 p_validation_end_date	 => l_validation_end_date);
584   --
585   -- Call the supporting insert validate operations
586   --
587   ben_prd_bus.insert_validate
588 	(p_rec			 => p_rec,
589 	 p_effective_date	 => p_effective_date,
590 	 p_datetrack_mode	 => l_datetrack_mode,
591 	 p_validation_start_date => l_validation_start_date,
592 	 p_validation_end_date	 => l_validation_end_date);
593   --
594   -- Call the supporting pre-insert operation
595   --
596   pre_insert
597  	(p_rec			 => p_rec,
598 	 p_effective_date	 => p_effective_date,
599 	 p_datetrack_mode	 => l_datetrack_mode,
600 	 p_validation_start_date => l_validation_start_date,
601 	 p_validation_end_date	 => l_validation_end_date);
602   --
603   -- Insert the row
604   --
605   insert_dml
606  	(p_rec			 => p_rec,
607 	 p_effective_date	 => p_effective_date,
608 	 p_datetrack_mode	 => l_datetrack_mode,
609 	 p_validation_start_date => l_validation_start_date,
610 	 p_validation_end_date	 => l_validation_end_date);
611   --
612   -- Call the supporting post-insert operation
613   --
614   post_insert
615  	(p_rec			 => p_rec,
616 	 p_effective_date	 => p_effective_date,
617 	 p_datetrack_mode	 => l_datetrack_mode,
618 	 p_validation_start_date => l_validation_start_date,
619 	 p_validation_end_date	 => l_validation_end_date);
620 end ins;
621 --
622 -- ----------------------------------------------------------------------------
623 -- |---------------------------------< ins >----------------------------------|
624 -- ----------------------------------------------------------------------------
625 Procedure ins
626   (
627   p_paird_rt_id                  out nocopy number,
628   p_effective_start_date         out nocopy date,
629   p_effective_end_date           out nocopy date,
630   p_use_parnt_ded_sched_flag     in varchar2,
631   p_asn_on_chc_of_parnt_flag     in varchar2,
632   p_use_parnt_prtl_mo_cd_flag    in varchar2,
633   p_alloc_sme_as_parnt_flag      in varchar2,
634   p_use_parnt_pymt_sched_flag    in varchar2,
635   p_no_cmbnd_mx_amt_dfnd_flag    in varchar2,
636   p_cmbnd_mx_amt                 in number           default null,
637   p_cmbnd_mn_amt                 in number           default null,
638   p_cmbnd_mx_pct_num             in number           default null,
639   p_cmbnd_mn_pct_num             in number           default null,
640   p_no_cmbnd_mn_amt_dfnd_flag    in varchar2,
641   p_no_cmbnd_mn_pct_dfnd_flag    in varchar2,
642   p_no_cmbnd_mx_pct_dfnd_flag    in varchar2,
643   p_parnt_acty_base_rt_id        in number,
644   p_chld_acty_base_rt_id         in number,
645   p_business_group_id            in number,
646   p_prd_attribute_category       in varchar2         default null,
647   p_prd_attribute1               in varchar2         default null,
648   p_prd_attribute2               in varchar2         default null,
649   p_prd_attribute3               in varchar2         default null,
650   p_prd_attribute4               in varchar2         default null,
651   p_prd_attribute5               in varchar2         default null,
652   p_prd_attribute6               in varchar2         default null,
653   p_prd_attribute7               in varchar2         default null,
654   p_prd_attribute8               in varchar2         default null,
655   p_prd_attribute9               in varchar2         default null,
656   p_prd_attribute10              in varchar2         default null,
657   p_prd_attribute11              in varchar2         default null,
658   p_prd_attribute12              in varchar2         default null,
659   p_prd_attribute13              in varchar2         default null,
660   p_prd_attribute14              in varchar2         default null,
661   p_prd_attribute15              in varchar2         default null,
662   p_prd_attribute16              in varchar2         default null,
663   p_prd_attribute17              in varchar2         default null,
664   p_prd_attribute18              in varchar2         default null,
665   p_prd_attribute19              in varchar2         default null,
666   p_prd_attribute20              in varchar2         default null,
667   p_prd_attribute21              in varchar2         default null,
668   p_prd_attribute22              in varchar2         default null,
669   p_prd_attribute23              in varchar2         default null,
670   p_prd_attribute24              in varchar2         default null,
671   p_prd_attribute25              in varchar2         default null,
672   p_prd_attribute26              in varchar2         default null,
673   p_prd_attribute27              in varchar2         default null,
674   p_prd_attribute28              in varchar2         default null,
675   p_prd_attribute29              in varchar2         default null,
676   p_prd_attribute30              in varchar2         default null,
677   p_object_version_number        out nocopy number,
678   p_effective_date		 in date
679   ) is
680 --
681   l_rec		ben_prd_shd.g_rec_type;
682   l_proc	varchar2(72) := g_package||'ins';
683 --
684 Begin
685   hr_utility.set_location('Entering:'||l_proc, 5);
686   --
687   -- Call conversion function to turn arguments into the
688   -- p_rec structure.
689   --
690   l_rec :=
691   ben_prd_shd.convert_args
692   (
693   null,
694   null,
695   null,
696   p_use_parnt_ded_sched_flag,
697   p_asn_on_chc_of_parnt_flag,
698   p_use_parnt_prtl_mo_cd_flag,
699   p_alloc_sme_as_parnt_flag,
700   p_use_parnt_pymt_sched_flag,
701   p_no_cmbnd_mx_amt_dfnd_flag,
702   p_cmbnd_mx_amt,
703   p_cmbnd_mn_amt,
704   p_cmbnd_mx_pct_num,
705   p_cmbnd_mn_pct_num,
706   p_no_cmbnd_mn_amt_dfnd_flag,
707   p_no_cmbnd_mn_pct_dfnd_flag,
708   p_no_cmbnd_mx_pct_dfnd_flag,
709   p_parnt_acty_base_rt_id,
710   p_chld_acty_base_rt_id,
711   p_business_group_id,
712   p_prd_attribute_category,
713   p_prd_attribute1,
714   p_prd_attribute2,
715   p_prd_attribute3,
716   p_prd_attribute4,
717   p_prd_attribute5,
718   p_prd_attribute6,
719   p_prd_attribute7,
720   p_prd_attribute8,
721   p_prd_attribute9,
722   p_prd_attribute10,
723   p_prd_attribute11,
724   p_prd_attribute12,
725   p_prd_attribute13,
726   p_prd_attribute14,
727   p_prd_attribute15,
728   p_prd_attribute16,
729   p_prd_attribute17,
730   p_prd_attribute18,
731   p_prd_attribute19,
732   p_prd_attribute20,
733   p_prd_attribute21,
734   p_prd_attribute22,
735   p_prd_attribute23,
736   p_prd_attribute24,
737   p_prd_attribute25,
738   p_prd_attribute26,
739   p_prd_attribute27,
740   p_prd_attribute28,
741   p_prd_attribute29,
742   p_prd_attribute30,
743   null
744   );
745   --
746   -- Having converted the arguments into the ben_prd_rec
747   -- plsql record structure we call the corresponding record
748   -- business process.
749   --
750      ins(l_rec, p_effective_date);
751   --
752   -- Set the OUT arguments.
753   --
754   p_paird_rt_id          	:= l_rec.paird_rt_id;
755   p_effective_start_date  	:= l_rec.effective_start_date;
756   p_effective_end_date    	:= l_rec.effective_end_date;
757   p_object_version_number 	:= l_rec.object_version_number;
758   --
759   --
760   hr_utility.set_location(' Leaving:'||l_proc, 10);
761 End ins;
762 --
763 end ben_prd_ins;