DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_MTR_INS

Source


1 Package Body ben_mtr_ins as
2 /* $Header: bemtrrhi.pkb 115.12 2002/12/16 17:39:10 glingapp ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_mtr_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_mtr_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_mtchg_rt_f t
70     where  t.mtchg_rt_id       = p_rec.mtchg_rt_id
71     and    t.effective_start_date =
72              ben_mtr_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_mtchg_rt_f.created_by%TYPE;
77   l_creation_date       ben_mtchg_rt_f.creation_date%TYPE;
78   l_last_update_date   	ben_mtchg_rt_f.last_update_date%TYPE;
79   l_last_updated_by     ben_mtchg_rt_f.last_updated_by%TYPE;
80   l_last_update_login   ben_mtchg_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_mtchg_rt_f',
90 	 p_base_key_column => 'mtchg_rt_id',
91 	 p_base_key_value  => p_rec.mtchg_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_mtr_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_mtchg_rt_f
132   --
133   insert into ben_mtchg_rt_f
134   (	mtchg_rt_id,
135 	effective_start_date,
136 	effective_end_date,
137 	acty_base_rt_id,
138 	comp_lvl_fctr_id,
139 	ordr_num,
140 	from_pct_val,
141 	to_pct_val,
142 	pct_val,
143 	mx_amt_of_py_num,
144 	mx_pct_of_py_num,
145 	mx_mtch_amt,
146 	mn_mtch_amt,
147 	mtchg_rt_calc_rl,
148 	no_mx_mtch_amt_flag,
149 	no_mx_pct_of_py_num_flag,
150 	cntnu_mtch_aftr_mx_rl_flag,
151 	no_mx_amt_of_py_num_flag,
152 	business_group_id,
153 	mtr_attribute_category,
154 	mtr_attribute1,
155 	mtr_attribute2,
156 	mtr_attribute3,
157 	mtr_attribute4,
158 	mtr_attribute5,
159 	mtr_attribute6,
160 	mtr_attribute7,
161 	mtr_attribute8,
162 	mtr_attribute9,
163 	mtr_attribute10,
164 	mtr_attribute11,
165 	mtr_attribute12,
166 	mtr_attribute13,
167 	mtr_attribute14,
168 	mtr_attribute15,
169 	mtr_attribute16,
170 	mtr_attribute17,
171 	mtr_attribute18,
172 	mtr_attribute19,
173 	mtr_attribute20,
174 	mtr_attribute21,
175 	mtr_attribute22,
176 	mtr_attribute23,
177 	mtr_attribute24,
178 	mtr_attribute25,
179 	mtr_attribute26,
180 	mtr_attribute27,
181 	mtr_attribute28,
182 	mtr_attribute29,
183 	mtr_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.mtchg_rt_id,
193 	p_rec.effective_start_date,
194 	p_rec.effective_end_date,
195 	p_rec.acty_base_rt_id,
196 	p_rec.comp_lvl_fctr_id,
197 	p_rec.ordr_num,
198 	p_rec.from_pct_val,
199 	p_rec.to_pct_val,
200 	p_rec.pct_val,
201 	p_rec.mx_amt_of_py_num,
202 	p_rec.mx_pct_of_py_num,
203 	p_rec.mx_mtch_amt,
204 	p_rec.mn_mtch_amt,
205 	p_rec.mtchg_rt_calc_rl,
206 	p_rec.no_mx_mtch_amt_flag,
207 	p_rec.no_mx_pct_of_py_num_flag,
208 	p_rec.cntnu_mtch_aftr_mx_rl_flag,
209 	p_rec.no_mx_amt_of_py_num_flag,
210 	p_rec.business_group_id,
211 	p_rec.mtr_attribute_category,
212 	p_rec.mtr_attribute1,
213 	p_rec.mtr_attribute2,
214 	p_rec.mtr_attribute3,
215 	p_rec.mtr_attribute4,
216 	p_rec.mtr_attribute5,
217 	p_rec.mtr_attribute6,
218 	p_rec.mtr_attribute7,
219 	p_rec.mtr_attribute8,
220 	p_rec.mtr_attribute9,
221 	p_rec.mtr_attribute10,
222 	p_rec.mtr_attribute11,
223 	p_rec.mtr_attribute12,
224 	p_rec.mtr_attribute13,
225 	p_rec.mtr_attribute14,
226 	p_rec.mtr_attribute15,
227 	p_rec.mtr_attribute16,
228 	p_rec.mtr_attribute17,
229 	p_rec.mtr_attribute18,
230 	p_rec.mtr_attribute19,
231 	p_rec.mtr_attribute20,
232 	p_rec.mtr_attribute21,
233 	p_rec.mtr_attribute22,
234 	p_rec.mtr_attribute23,
235 	p_rec.mtr_attribute24,
236 	p_rec.mtr_attribute25,
237 	p_rec.mtr_attribute26,
238 	p_rec.mtr_attribute27,
239 	p_rec.mtr_attribute28,
240 	p_rec.mtr_attribute29,
241 	p_rec.mtr_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_mtr_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_mtr_shd.g_api_dml := false;   -- Unset the api dml status
257     ben_mtr_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_mtr_shd.g_api_dml := false;   -- Unset the api dml status
262     ben_mtr_shd.constraint_error
263       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
264   When Others Then
265     ben_mtr_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_mtr_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_mtr_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 --
341  cursor c1 is
342         select BEN_MTCHG_RT_F_S.nextval
343         from   sys.dual;
344 --
345 --
346 Begin
347   hr_utility.set_location('Entering:'||l_proc, 5);
348   --
349   open c1;
350   fetch c1 into p_rec.mtchg_rt_id;
351   close c1;
352   --
353   --
354   --
355   hr_utility.set_location(' Leaving:'||l_proc, 10);
356 End pre_insert;
357 --
358 -- ----------------------------------------------------------------------------
359 -- |-----------------------------< post_insert >------------------------------|
360 -- ----------------------------------------------------------------------------
361 -- {Start Of Comments}
362 --
363 -- Description:
364 --   This private procedure contains any processing which is required after the
365 --   insert dml.
366 --
367 -- Prerequisites:
368 --   This is an internal procedure which is called from the ins procedure.
369 --
370 -- In Parameters:
371 --   A Pl/Sql record structre.
372 --
373 -- Post Success:
374 --   Processing continues.
375 --
376 -- Post Failure:
377 --   If an error has occurred, an error message and exception will be raised
378 --   but not handled.
379 --
380 -- Developer Implementation Notes:
381 --   Any post-processing required after the insert dml is issued should be
382 --   coded within this procedure. It is important to note that any 3rd party
383 --   maintenance should be reviewed before placing in this procedure.
384 --
385 -- Access Status:
386 --   Internal Row Handler Use Only.
387 --
388 -- {End Of Comments}
389 -- ----------------------------------------------------------------------------
390 Procedure post_insert
391 	(p_rec 			 in ben_mtr_shd.g_rec_type,
392 	 p_effective_date	 in date,
393 	 p_datetrack_mode	 in varchar2,
394 	 p_validation_start_date in date,
395 	 p_validation_end_date	 in date) is
396 --
397   l_proc	varchar2(72) := g_package||'post_insert';
398 --
399 Begin
400   hr_utility.set_location('Entering:'||l_proc, 5);
401 --
402   --
403   -- Start of API User Hook for post_insert.
404   --
405   begin
406     --
407     ben_mtr_rki.after_insert
408       (
409   p_mtchg_rt_id                   =>p_rec.mtchg_rt_id
410  ,p_effective_start_date          =>p_rec.effective_start_date
411  ,p_effective_end_date            =>p_rec.effective_end_date
412  ,p_acty_base_rt_id               =>p_rec.acty_base_rt_id
413  ,p_comp_lvl_fctr_id              =>p_rec.comp_lvl_fctr_id
414  ,p_ordr_num                      =>p_rec.ordr_num
415  ,p_from_pct_val                  =>p_rec.from_pct_val
416  ,p_to_pct_val                    =>p_rec.to_pct_val
417  ,p_pct_val                       =>p_rec.pct_val
418  ,p_mx_amt_of_py_num              =>p_rec.mx_amt_of_py_num
419  ,p_mx_pct_of_py_num              =>p_rec.mx_pct_of_py_num
420  ,p_mx_mtch_amt                   =>p_rec.mx_mtch_amt
421  ,p_mn_mtch_amt                   =>p_rec.mn_mtch_amt
422  ,p_mtchg_rt_calc_rl              =>p_rec.mtchg_rt_calc_rl
423  ,p_no_mx_mtch_amt_flag           =>p_rec.no_mx_mtch_amt_flag
424  ,p_no_mx_pct_of_py_num_flag      =>p_rec.no_mx_pct_of_py_num_flag
425  ,p_cntnu_mtch_aftr_mx_rl_flag    =>p_rec.cntnu_mtch_aftr_mx_rl_flag
426  ,p_no_mx_amt_of_py_num_flag      =>p_rec.no_mx_amt_of_py_num_flag
427  ,p_business_group_id             =>p_rec.business_group_id
428  ,p_mtr_attribute_category        =>p_rec.mtr_attribute_category
429  ,p_mtr_attribute1                =>p_rec.mtr_attribute1
430  ,p_mtr_attribute2                =>p_rec.mtr_attribute2
431  ,p_mtr_attribute3                =>p_rec.mtr_attribute3
432  ,p_mtr_attribute4                =>p_rec.mtr_attribute4
433  ,p_mtr_attribute5                =>p_rec.mtr_attribute5
434  ,p_mtr_attribute6                =>p_rec.mtr_attribute6
435  ,p_mtr_attribute7                =>p_rec.mtr_attribute7
436  ,p_mtr_attribute8                =>p_rec.mtr_attribute8
437  ,p_mtr_attribute9                =>p_rec.mtr_attribute9
438  ,p_mtr_attribute10               =>p_rec.mtr_attribute10
439  ,p_mtr_attribute11               =>p_rec.mtr_attribute11
440  ,p_mtr_attribute12               =>p_rec.mtr_attribute12
441  ,p_mtr_attribute13               =>p_rec.mtr_attribute13
442  ,p_mtr_attribute14               =>p_rec.mtr_attribute14
443  ,p_mtr_attribute15               =>p_rec.mtr_attribute15
444  ,p_mtr_attribute16               =>p_rec.mtr_attribute16
445  ,p_mtr_attribute17               =>p_rec.mtr_attribute17
446  ,p_mtr_attribute18               =>p_rec.mtr_attribute18
447  ,p_mtr_attribute19               =>p_rec.mtr_attribute19
448  ,p_mtr_attribute20               =>p_rec.mtr_attribute20
449  ,p_mtr_attribute21               =>p_rec.mtr_attribute21
450  ,p_mtr_attribute22               =>p_rec.mtr_attribute22
451  ,p_mtr_attribute23               =>p_rec.mtr_attribute23
452  ,p_mtr_attribute24               =>p_rec.mtr_attribute24
453  ,p_mtr_attribute25               =>p_rec.mtr_attribute25
454  ,p_mtr_attribute26               =>p_rec.mtr_attribute26
455  ,p_mtr_attribute27               =>p_rec.mtr_attribute27
456  ,p_mtr_attribute28               =>p_rec.mtr_attribute28
457  ,p_mtr_attribute29               =>p_rec.mtr_attribute29
458  ,p_mtr_attribute30               =>p_rec.mtr_attribute30
459  ,p_object_version_number         =>p_rec.object_version_number
460  ,p_effective_date                =>p_effective_date
461  ,p_validation_start_date         =>p_validation_start_date
462  ,p_validation_end_date           =>p_validation_end_date
463       );
464     --
465   exception
466     --
467     when hr_api.cannot_find_prog_unit then
468       --
469       hr_api.cannot_find_prog_unit_error
470         (p_module_name => 'ben_mtchg_rt_f'
471         ,p_hook_type   => 'AI');
472       --
473   end;
474   --
475   -- End of API User Hook for post_insert.
476   --
477   --
478   hr_utility.set_location(' Leaving:'||l_proc, 10);
479 End post_insert;
480 --
481 -- ----------------------------------------------------------------------------
482 -- |-------------------------------< ins_lck >--------------------------------|
483 -- ----------------------------------------------------------------------------
484 -- {Start Of Comments}
485 --
486 -- Description:
487 --   The ins_lck process has one main function to perform. When inserting
488 --   a datetracked row, we must validate the DT mode.
489 --   be manipulated.
490 --
491 -- Prerequisites:
492 --   This procedure can only be called for the datetrack mode of INSERT.
493 --
494 -- In Parameters:
495 --
496 -- Post Success:
497 --   On successful completion of the ins_lck process the parental
498 --   datetracked rows will be locked providing the p_enforce_foreign_locking
499 --   argument value is TRUE.
500 --   If the p_enforce_foreign_locking argument value is FALSE then the
501 --   parential rows are not locked.
502 --
503 -- Post Failure:
504 --   The Lck process can fail for:
505 --   1) When attempting to lock the row the row could already be locked by
506 --      another user. This will raise the HR_Api.Object_Locked exception.
507 --   2) When attempting to the lock the parent which doesn't exist.
508 --      For the entity to be locked the parent must exist!
509 --
510 -- Developer Implementation Notes:
511 --   None.
512 --
513 -- Access Status:
514 --   Internal Row Handler Use Only.
515 --
516 -- {End Of Comments}
517 -- ----------------------------------------------------------------------------
518 Procedure ins_lck
519 	(p_effective_date	 in  date,
520 	 p_datetrack_mode	 in  varchar2,
521 	 p_rec	 		 in  ben_mtr_shd.g_rec_type,
522 	 p_validation_start_date out nocopy date,
523 	 p_validation_end_date	 out nocopy date) is
524 --
525   l_proc		  varchar2(72) := g_package||'ins_lck';
526   l_validation_start_date date;
527   l_validation_end_date	  date;
528 --
529 Begin
530   hr_utility.set_location('Entering:'||l_proc, 5);
531   --
532   -- Validate the datetrack mode mode getting the validation start
533   -- and end dates for the specified datetrack operation.
534   --
535   dt_api.validate_dt_mode
536 	(p_effective_date	   => p_effective_date,
537 	 p_datetrack_mode	   => p_datetrack_mode,
538 	 p_base_table_name	   => 'ben_mtchg_rt_f',
539 	 p_base_key_column	   => 'mtchg_rt_id',
540 	 p_base_key_value 	   => p_rec.mtchg_rt_id,
541 	 p_parent_table_name1      => 'ben_acty_base_rt_f',
542 	 p_parent_key_column1      => 'acty_base_rt_id',
543 	 p_parent_key_value1       => p_rec.acty_base_rt_id,
544          p_enforce_foreign_locking => true,
545 	 p_validation_start_date   => l_validation_start_date,
546  	 p_validation_end_date	   => l_validation_end_date);
547   --
548   -- Set the validation start and end date OUT arguments
549   --
550   p_validation_start_date := l_validation_start_date;
551   p_validation_end_date   := l_validation_end_date;
552   --
553   hr_utility.set_location(' Leaving:'||l_proc, 10);
554 --
555 End ins_lck;
556 --
557 -- ----------------------------------------------------------------------------
558 -- |---------------------------------< ins >----------------------------------|
559 -- ----------------------------------------------------------------------------
560 Procedure ins
561   (
562   p_rec		   in out nocopy ben_mtr_shd.g_rec_type,
563   p_effective_date in     date
564   ) is
565 --
566   l_proc			varchar2(72) := g_package||'ins';
567   l_datetrack_mode		varchar2(30) := 'INSERT';
568   l_validation_start_date	date;
569   l_validation_end_date		date;
570 --
571 Begin
572   hr_utility.set_location('Entering:'||l_proc, 5);
573   --
574   -- Call the lock operation
575   --
576   ins_lck
577 	(p_effective_date	 => p_effective_date,
578 	 p_datetrack_mode	 => l_datetrack_mode,
579 	 p_rec	 		 => p_rec,
580 	 p_validation_start_date => l_validation_start_date,
581 	 p_validation_end_date	 => l_validation_end_date);
582   --
583   -- Call the supporting insert validate operations
584   --
585   ben_mtr_bus.insert_validate
586 	(p_rec			 => p_rec,
587 	 p_effective_date	 => p_effective_date,
588 	 p_datetrack_mode	 => l_datetrack_mode,
589 	 p_validation_start_date => l_validation_start_date,
590 	 p_validation_end_date	 => l_validation_end_date);
591   --
592   -- Call the supporting pre-insert operation
593   --
594   pre_insert
595  	(p_rec			 => p_rec,
596 	 p_effective_date	 => p_effective_date,
597 	 p_datetrack_mode	 => l_datetrack_mode,
598 	 p_validation_start_date => l_validation_start_date,
599 	 p_validation_end_date	 => l_validation_end_date);
600   --
601   -- Insert the row
602   --
603   insert_dml
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 post-insert operation
611   --
612   post_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 end ins;
619 --
620 -- ----------------------------------------------------------------------------
621 -- |---------------------------------< ins >----------------------------------|
622 -- ----------------------------------------------------------------------------
623 Procedure ins
624   (
625   p_mtchg_rt_id                  out nocopy number,
626   p_effective_start_date         out nocopy date,
627   p_effective_end_date           out nocopy date,
628   p_acty_base_rt_id              in number           default null,
629   p_comp_lvl_fctr_id             in number,
630   p_ordr_num                     in number,
631   p_from_pct_val                 in number           default null,
632   p_to_pct_val                   in number           default null,
633   p_pct_val                      in number           default null,
634   p_mx_amt_of_py_num             in number           default null,
635   p_mx_pct_of_py_num             in number           default null,
636   p_mx_mtch_amt                  in number           default null,
637   p_mn_mtch_amt                  in number           default null,
638   p_mtchg_rt_calc_rl             in number           default null,
639   p_no_mx_mtch_amt_flag          in varchar2,
640   p_no_mx_pct_of_py_num_flag     in varchar2,
641   p_cntnu_mtch_aftr_mx_rl_flag   in varchar2,
642   p_no_mx_amt_of_py_num_flag     in varchar2,
643   p_business_group_id            in number,
644   p_mtr_attribute_category       in varchar2         default null,
645   p_mtr_attribute1               in varchar2         default null,
646   p_mtr_attribute2               in varchar2         default null,
647   p_mtr_attribute3               in varchar2         default null,
648   p_mtr_attribute4               in varchar2         default null,
649   p_mtr_attribute5               in varchar2         default null,
650   p_mtr_attribute6               in varchar2         default null,
651   p_mtr_attribute7               in varchar2         default null,
652   p_mtr_attribute8               in varchar2         default null,
653   p_mtr_attribute9               in varchar2         default null,
654   p_mtr_attribute10              in varchar2         default null,
655   p_mtr_attribute11              in varchar2         default null,
656   p_mtr_attribute12              in varchar2         default null,
657   p_mtr_attribute13              in varchar2         default null,
658   p_mtr_attribute14              in varchar2         default null,
659   p_mtr_attribute15              in varchar2         default null,
660   p_mtr_attribute16              in varchar2         default null,
661   p_mtr_attribute17              in varchar2         default null,
662   p_mtr_attribute18              in varchar2         default null,
663   p_mtr_attribute19              in varchar2         default null,
664   p_mtr_attribute20              in varchar2         default null,
665   p_mtr_attribute21              in varchar2         default null,
666   p_mtr_attribute22              in varchar2         default null,
667   p_mtr_attribute23              in varchar2         default null,
668   p_mtr_attribute24              in varchar2         default null,
669   p_mtr_attribute25              in varchar2         default null,
670   p_mtr_attribute26              in varchar2         default null,
671   p_mtr_attribute27              in varchar2         default null,
672   p_mtr_attribute28              in varchar2         default null,
673   p_mtr_attribute29              in varchar2         default null,
674   p_mtr_attribute30              in varchar2         default null,
675   p_object_version_number        out nocopy number,
676   p_effective_date		 in date
677   ) is
678 --
679   l_rec		ben_mtr_shd.g_rec_type;
680   l_proc	varchar2(72) := g_package||'ins';
681 --
682 Begin
683   hr_utility.set_location('Entering:'||l_proc, 5);
684   --
685   -- Call conversion function to turn arguments into the
686   -- p_rec structure.
687   --
688   l_rec :=
689   ben_mtr_shd.convert_args
690   (
691   null,
692   null,
693   null,
694   p_acty_base_rt_id,
695   p_comp_lvl_fctr_id,
696   p_ordr_num,
697   p_from_pct_val,
698   p_to_pct_val,
699   p_pct_val,
700   p_mx_amt_of_py_num,
701   p_mx_pct_of_py_num,
702   p_mx_mtch_amt,
703   p_mn_mtch_amt,
704   p_mtchg_rt_calc_rl,
705   p_no_mx_mtch_amt_flag,
706   p_no_mx_pct_of_py_num_flag,
707   p_cntnu_mtch_aftr_mx_rl_flag,
708   p_no_mx_amt_of_py_num_flag,
709   p_business_group_id,
710   p_mtr_attribute_category,
711   p_mtr_attribute1,
712   p_mtr_attribute2,
713   p_mtr_attribute3,
714   p_mtr_attribute4,
715   p_mtr_attribute5,
716   p_mtr_attribute6,
717   p_mtr_attribute7,
718   p_mtr_attribute8,
719   p_mtr_attribute9,
720   p_mtr_attribute10,
721   p_mtr_attribute11,
722   p_mtr_attribute12,
723   p_mtr_attribute13,
724   p_mtr_attribute14,
725   p_mtr_attribute15,
726   p_mtr_attribute16,
727   p_mtr_attribute17,
728   p_mtr_attribute18,
729   p_mtr_attribute19,
730   p_mtr_attribute20,
731   p_mtr_attribute21,
732   p_mtr_attribute22,
733   p_mtr_attribute23,
734   p_mtr_attribute24,
735   p_mtr_attribute25,
736   p_mtr_attribute26,
737   p_mtr_attribute27,
738   p_mtr_attribute28,
739   p_mtr_attribute29,
740   p_mtr_attribute30,
741   null
742   );
743   --
744   -- Having converted the arguments into the ben_mtr_rec
745   -- plsql record structure we call the corresponding record
746   -- business process.
747   --
748   ins(l_rec, p_effective_date);
749   --
750   -- Set the OUT arguments.
751   --
752   p_mtchg_rt_id        	:= l_rec.mtchg_rt_id;
753   p_effective_start_date  	:= l_rec.effective_start_date;
754   p_effective_end_date    	:= l_rec.effective_end_date;
755   p_object_version_number 	:= l_rec.object_version_number;
756   --
757   --
758   hr_utility.set_location(' Leaving:'||l_proc, 10);
759 End ins;
760 --
761 end ben_mtr_ins;