DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_VMR_INS

Source


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