DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PRM_INS

Source


1 Package Body ben_prm_ins as
2 /* $Header: beprmrhi.pkb 115.6 2002/12/30 10:49:28 rpgupta ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_prm_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_prm_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_prtt_prem_by_mo_f t
70     where  t.prtt_prem_by_mo_id       = p_rec.prtt_prem_by_mo_id
71     and    t.effective_start_date =
72              ben_prm_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_prtt_prem_by_mo_f.created_by%TYPE;
77   l_creation_date       ben_prtt_prem_by_mo_f.creation_date%TYPE;
78   l_last_update_date   	ben_prtt_prem_by_mo_f.last_update_date%TYPE;
79   l_last_updated_by     ben_prtt_prem_by_mo_f.last_updated_by%TYPE;
80   l_last_update_login   ben_prtt_prem_by_mo_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_prtt_prem_by_mo_f',
90 	 p_base_key_column => 'prtt_prem_by_mo_id',
91 	 p_base_key_value  => p_rec.prtt_prem_by_mo_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_prm_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_prtt_prem_by_mo_f
132   --
133   insert into ben_prtt_prem_by_mo_f
134   (	prtt_prem_by_mo_id,
135 	effective_start_date,
136 	effective_end_date,
137 	mnl_adj_flag,
138 	mo_num,
139 	yr_num,
140 	antcpd_prtt_cntr_uom,
141 	antcpd_prtt_cntr_val,
142 	val,
143 	cr_val,
144 	cr_mnl_adj_flag,
145 	alctd_val_flag,
146 	uom,
147 	prtt_prem_id,
148 	cost_allocation_keyflex_id,
149 	business_group_id,
150 	prm_attribute_category,
151 	prm_attribute1,
152 	prm_attribute2,
153 	prm_attribute3,
154 	prm_attribute4,
155 	prm_attribute5,
156 	prm_attribute6,
157 	prm_attribute7,
158 	prm_attribute8,
159 	prm_attribute9,
160 	prm_attribute10,
161 	prm_attribute11,
162 	prm_attribute12,
163 	prm_attribute13,
164 	prm_attribute14,
165 	prm_attribute15,
166 	prm_attribute16,
167 	prm_attribute17,
168 	prm_attribute18,
169 	prm_attribute19,
170 	prm_attribute20,
171 	prm_attribute21,
172 	prm_attribute22,
173 	prm_attribute23,
174 	prm_attribute24,
175 	prm_attribute25,
176 	prm_attribute26,
177 	prm_attribute27,
178 	prm_attribute28,
179 	prm_attribute29,
180 	prm_attribute30,
181 	object_version_number,
182 	request_id,
183 	program_application_id,
184 	program_id,
185 	program_update_date
186    	, created_by,
187    	creation_date,
188    	last_update_date,
189    	last_updated_by,
190    	last_update_login
191   )
192   Values
193   (	p_rec.prtt_prem_by_mo_id,
194 	p_rec.effective_start_date,
195 	p_rec.effective_end_date,
196 	p_rec.mnl_adj_flag,
197 	p_rec.mo_num,
198 	p_rec.yr_num,
199 	p_rec.antcpd_prtt_cntr_uom,
200 	p_rec.antcpd_prtt_cntr_val,
201 	p_rec.val,
202 	p_rec.cr_val,
203 	p_rec.cr_mnl_adj_flag,
204 	p_rec.alctd_val_flag,
205 	p_rec.uom,
206 	p_rec.prtt_prem_id,
207 	p_rec.cost_allocation_keyflex_id,
208 	p_rec.business_group_id,
209 	p_rec.prm_attribute_category,
210 	p_rec.prm_attribute1,
211 	p_rec.prm_attribute2,
212 	p_rec.prm_attribute3,
213 	p_rec.prm_attribute4,
214 	p_rec.prm_attribute5,
215 	p_rec.prm_attribute6,
216 	p_rec.prm_attribute7,
217 	p_rec.prm_attribute8,
218 	p_rec.prm_attribute9,
219 	p_rec.prm_attribute10,
220 	p_rec.prm_attribute11,
221 	p_rec.prm_attribute12,
222 	p_rec.prm_attribute13,
223 	p_rec.prm_attribute14,
224 	p_rec.prm_attribute15,
225 	p_rec.prm_attribute16,
226 	p_rec.prm_attribute17,
227 	p_rec.prm_attribute18,
228 	p_rec.prm_attribute19,
229 	p_rec.prm_attribute20,
230 	p_rec.prm_attribute21,
231 	p_rec.prm_attribute22,
232 	p_rec.prm_attribute23,
233 	p_rec.prm_attribute24,
234 	p_rec.prm_attribute25,
235 	p_rec.prm_attribute26,
236 	p_rec.prm_attribute27,
237 	p_rec.prm_attribute28,
238 	p_rec.prm_attribute29,
239 	p_rec.prm_attribute30,
240 	p_rec.object_version_number,
241 	p_rec.request_id,
242 	p_rec.program_application_id,
243 	p_rec.program_id,
244 	p_rec.program_update_date
245 	, l_created_by,
246    	l_creation_date,
247    	l_last_update_date,
248    	l_last_updated_by,
249    	l_last_update_login
250   );
251   --
252   ben_prm_shd.g_api_dml := false;   -- Unset the api dml status
253   hr_utility.set_location(' Leaving:'||l_proc, 15);
254 --
255 Exception
256   When hr_api.check_integrity_violated Then
257     -- A check constraint has been violated
258     ben_prm_shd.g_api_dml := false;   -- Unset the api dml status
259     ben_prm_shd.constraint_error
260       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
261   When hr_api.unique_integrity_violated Then
262     -- Unique integrity has been violated
263     ben_prm_shd.g_api_dml := false;   -- Unset the api dml status
264     ben_prm_shd.constraint_error
265       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
266   When Others Then
267     ben_prm_shd.g_api_dml := false;   -- Unset the api dml status
268     Raise;
269 End dt_insert_dml;
270 --
271 -- ----------------------------------------------------------------------------
272 -- |------------------------------< insert_dml >------------------------------|
273 -- ----------------------------------------------------------------------------
274 Procedure insert_dml
275 	(p_rec 			 in out nocopy ben_prm_shd.g_rec_type,
276 	 p_effective_date	 in	date,
277 	 p_datetrack_mode	 in	varchar2,
278 	 p_validation_start_date in	date,
279 	 p_validation_end_date	 in	date) is
280 --
281   l_proc	varchar2(72) := g_package||'insert_dml';
282 --
283 Begin
284   hr_utility.set_location('Entering:'||l_proc, 5);
285   --
286   dt_insert_dml(p_rec			=> p_rec,
287 		p_effective_date	=> p_effective_date,
288 		p_datetrack_mode	=> p_datetrack_mode,
289        		p_validation_start_date	=> p_validation_start_date,
290 		p_validation_end_date	=> p_validation_end_date);
291   --
292   hr_utility.set_location(' Leaving:'||l_proc, 10);
293 End insert_dml;
294 --
295 -- ----------------------------------------------------------------------------
296 -- |------------------------------< pre_insert >------------------------------|
297 -- ----------------------------------------------------------------------------
298 -- {Start Of Comments}
299 --
300 -- Description:
301 --   This private procedure contains any processing which is required before
302 --   the insert dml. Presently, if the entity has a corresponding primary
303 --   key which is maintained by an associating sequence, the primary key for
304 --   the entity will be populated with the next sequence value in
305 --   preparation for the insert dml.
306 --   Also, if comments are defined for this entity, the comments insert
307 --   logic will also be called, generating a comment_id if required.
308 --
309 -- Prerequisites:
310 --   This is an internal procedure which is called from the ins procedure.
311 --
312 -- In Parameters:
313 --   A Pl/Sql record structre.
314 --
315 -- Post Success:
316 --   Processing continues.
317 --
318 -- Post Failure:
319 --   If an error has occurred, an error message and exception will be raised
320 --   but not handled.
321 --
322 -- Developer Implementation Notes:
323 --   Any pre-processing required before the insert dml is issued should be
324 --   coded within this procedure. As stated above, a good example is the
325 --   generation of a primary key number via a corresponding sequence.
326 --   It is important to note that any 3rd party maintenance should be reviewed
327 --   before placing in this procedure.
328 --
329 -- Access Status:
330 --   Internal Row Handler Use Only.
331 --
332 -- {End Of Comments}
333 -- ----------------------------------------------------------------------------
334 Procedure pre_insert
335 	(p_rec  			in out nocopy ben_prm_shd.g_rec_type,
336 	 p_effective_date		in date,
337 	 p_datetrack_mode		in varchar2,
338 	 p_validation_start_date	in date,
339 	 p_validation_end_date		in date) is
340 --
341   l_proc	varchar2(72) := g_package||'pre_insert';
342 --
343 --
344   cursor c1 is select ben_prtt_prem_by_mo_f_s.nextval from sys.dual;
345 --
346 Begin
347   hr_utility.set_location('Entering:'||l_proc, 5);
348   --
349   open c1;
350   fetch c1 into p_rec.prtt_prem_by_mo_id;
351   close c1;
352   --
353   hr_utility.set_location(' Leaving:'||l_proc, 10);
354 End pre_insert;
355 --
356 -- ----------------------------------------------------------------------------
357 -- |-----------------------------< post_insert >------------------------------|
358 -- ----------------------------------------------------------------------------
359 -- {Start Of Comments}
360 --
361 -- Description:
362 --   This private procedure contains any processing which is required after the
363 --   insert dml.
364 --
365 -- Prerequisites:
366 --   This is an internal procedure which is called from the ins procedure.
367 --
368 -- In Parameters:
369 --   A Pl/Sql record structre.
370 --
371 -- Post Success:
372 --   Processing continues.
373 --
374 -- Post Failure:
375 --   If an error has occurred, an error message and exception will be raised
376 --   but not handled.
377 --
378 -- Developer Implementation Notes:
379 --   Any post-processing required after the insert dml is issued should be
380 --   coded within this procedure. It is important to note that any 3rd party
381 --   maintenance should be reviewed before placing in this procedure.
382 --
383 -- Access Status:
384 --   Internal Row Handler Use Only.
385 --
386 -- {End Of Comments}
387 -- ----------------------------------------------------------------------------
388 Procedure post_insert
389 	(p_rec 			 in ben_prm_shd.g_rec_type,
390 	 p_effective_date	 in date,
391 	 p_datetrack_mode	 in varchar2,
392 	 p_validation_start_date in date,
393 	 p_validation_end_date	 in date) is
394 --
395   l_proc	varchar2(72) := g_package||'post_insert';
396   l_new_rec           ben_ext_chlg.g_prem_mo_rec_type;
397   l_old_rec           ben_ext_chlg.g_prem_mo_rec_type;
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_prm_rki.after_insert
408       (
409   p_prtt_prem_by_mo_id            =>p_rec.prtt_prem_by_mo_id
410  ,p_effective_start_date          =>p_rec.effective_start_date
411  ,p_effective_end_date            =>p_rec.effective_end_date
412  ,p_mnl_adj_flag                  =>p_rec.mnl_adj_flag
413  ,p_mo_num                        =>p_rec.mo_num
414  ,p_yr_num                        =>p_rec.yr_num
415  ,p_antcpd_prtt_cntr_uom          =>p_rec.antcpd_prtt_cntr_uom
416  ,p_antcpd_prtt_cntr_val          =>p_rec.antcpd_prtt_cntr_val
417  ,p_val                           =>p_rec.val
418  ,p_cr_val                        =>p_rec.cr_val
419  ,p_cr_mnl_adj_flag               =>p_rec.cr_mnl_adj_flag
420  ,p_alctd_val_flag                =>p_rec.alctd_val_flag
421  ,p_uom                           =>p_rec.uom
422  ,p_prtt_prem_id                  =>p_rec.prtt_prem_id
423  ,p_cost_allocation_keyflex_id    =>p_rec.cost_allocation_keyflex_id
424  ,p_business_group_id             =>p_rec.business_group_id
425  ,p_prm_attribute_category        =>p_rec.prm_attribute_category
426  ,p_prm_attribute1                =>p_rec.prm_attribute1
427  ,p_prm_attribute2                =>p_rec.prm_attribute2
428  ,p_prm_attribute3                =>p_rec.prm_attribute3
429  ,p_prm_attribute4                =>p_rec.prm_attribute4
430  ,p_prm_attribute5                =>p_rec.prm_attribute5
431  ,p_prm_attribute6                =>p_rec.prm_attribute6
435  ,p_prm_attribute10               =>p_rec.prm_attribute10
432  ,p_prm_attribute7                =>p_rec.prm_attribute7
433  ,p_prm_attribute8                =>p_rec.prm_attribute8
434  ,p_prm_attribute9                =>p_rec.prm_attribute9
436  ,p_prm_attribute11               =>p_rec.prm_attribute11
437  ,p_prm_attribute12               =>p_rec.prm_attribute12
438  ,p_prm_attribute13               =>p_rec.prm_attribute13
439  ,p_prm_attribute14               =>p_rec.prm_attribute14
440  ,p_prm_attribute15               =>p_rec.prm_attribute15
441  ,p_prm_attribute16               =>p_rec.prm_attribute16
442  ,p_prm_attribute17               =>p_rec.prm_attribute17
443  ,p_prm_attribute18               =>p_rec.prm_attribute18
444  ,p_prm_attribute19               =>p_rec.prm_attribute19
445  ,p_prm_attribute20               =>p_rec.prm_attribute20
446  ,p_prm_attribute21               =>p_rec.prm_attribute21
447  ,p_prm_attribute22               =>p_rec.prm_attribute22
448  ,p_prm_attribute23               =>p_rec.prm_attribute23
449  ,p_prm_attribute24               =>p_rec.prm_attribute24
450  ,p_prm_attribute25               =>p_rec.prm_attribute25
451  ,p_prm_attribute26               =>p_rec.prm_attribute26
452  ,p_prm_attribute27               =>p_rec.prm_attribute27
453  ,p_prm_attribute28               =>p_rec.prm_attribute28
454  ,p_prm_attribute29               =>p_rec.prm_attribute29
455  ,p_prm_attribute30               =>p_rec.prm_attribute30
456  ,p_object_version_number         =>p_rec.object_version_number
457  ,p_request_id                    =>p_rec.request_id
458  ,p_program_application_id        =>p_rec.program_application_id
459  ,p_program_id                    =>p_rec.program_id
460  ,p_program_update_date           =>p_rec.program_update_date
461  ,p_effective_date                =>p_effective_date
462  ,p_validation_start_date         =>p_validation_start_date
463  ,p_validation_end_date           =>p_validation_end_date
464       );
465  --
466  -- call the change log  event
467     l_new_rec.prtt_prem_id            := p_rec.prtt_prem_id ;
468     l_new_rec.val                     := p_rec.val ;
469     l_new_rec.effective_start_date    := p_rec.effective_start_date;
470     l_new_rec.effective_end_date      := p_rec.effective_end_date;
471     l_new_rec.business_group_id       := p_rec.business_group_id ;
472     l_new_rec.mo_num                  := p_rec.mo_num ;
473     l_new_rec.yr_num                  := p_rec.yr_num ;
474     l_new_rec.cr_val                  := p_rec.cr_val ;
475     l_new_rec.uom                     := p_rec.uom    ;
476     l_new_rec.update_mode             := 'INSERT'     ;
477 
478     ben_ext_chlg.log_prem_mo_chg
479       (p_event     =>  'INSERT'
480       ,p_old_rec   =>  l_old_rec
481       ,p_new_rec   =>  l_new_rec
482       ) ;
483 
484   exception
485     --
486     when hr_api.cannot_find_prog_unit then
487       --
488       hr_api.cannot_find_prog_unit_error
489         (p_module_name => 'ben_prtt_prem_by_mo_f'
490         ,p_hook_type   => 'AI');
491       --
492   end;
493   --
494   -- End of API User Hook for post_insert.
495   --
496   --
497   hr_utility.set_location(' Leaving:'||l_proc, 10);
498 End post_insert;
499 --
500 -- ----------------------------------------------------------------------------
501 -- |-------------------------------< ins_lck >--------------------------------|
502 -- ----------------------------------------------------------------------------
503 -- {Start Of Comments}
504 --
505 -- Description:
506 --   The ins_lck process has one main function to perform. When inserting
507 --   a datetracked row, we must validate the DT mode.
508 --   be manipulated.
509 --
510 -- Prerequisites:
511 --   This procedure can only be called for the datetrack mode of INSERT.
512 --
513 -- In Parameters:
514 --
515 -- Post Success:
516 --   On successful completion of the ins_lck process the parental
517 --   datetracked rows will be locked providing the p_enforce_foreign_locking
518 --   argument value is TRUE.
519 --   If the p_enforce_foreign_locking argument value is FALSE then the
520 --   parential rows are not locked.
521 --
522 -- Post Failure:
523 --   The Lck process can fail for:
524 --   1) When attempting to lock the row the row could already be locked by
525 --      another user. This will raise the HR_Api.Object_Locked exception.
526 --   2) When attempting to the lock the parent which doesn't exist.
527 --      For the entity to be locked the parent must exist!
528 --
529 -- Developer Implementation Notes:
530 --   None.
531 --
532 -- Access Status:
533 --   Internal Row Handler Use Only.
534 --
535 -- {End Of Comments}
536 -- ----------------------------------------------------------------------------
537 Procedure ins_lck
538 	(p_effective_date	 in  date,
539 	 p_datetrack_mode	 in  varchar2,
540 	 p_rec	 		 in  ben_prm_shd.g_rec_type,
541 	 p_validation_start_date out nocopy date,
542 	 p_validation_end_date	 out nocopy date) is
543 --
544   l_proc		  varchar2(72) := g_package||'ins_lck';
545   l_validation_start_date date;
546   l_validation_end_date	  date;
547 --
548 Begin
549   hr_utility.set_location('Entering:'||l_proc, 5);
550   --
551   -- Validate the datetrack mode mode getting the validation start
552   -- and end dates for the specified datetrack operation.
553   --
554   dt_api.validate_dt_mode
555 	(p_effective_date	   => p_effective_date,
559 	 p_base_key_value 	   => p_rec.prtt_prem_by_mo_id,
556 	 p_datetrack_mode	   => p_datetrack_mode,
557 	 p_base_table_name	   => 'ben_prtt_prem_by_mo_f',
558 	 p_base_key_column	   => 'prtt_prem_by_mo_id',
560 	 p_parent_table_name1      => 'ben_prtt_prem_f',
561 	 p_parent_key_column1      => 'prtt_prem_id',
562 	 p_parent_key_value1       => p_rec.prtt_prem_id,
563          p_enforce_foreign_locking => false,
564 	 p_validation_start_date   => l_validation_start_date,
565  	 p_validation_end_date	   => l_validation_end_date);
566   --
567   -- Set the validation start and end date OUT arguments
568   --
569   p_validation_start_date := l_validation_start_date;
570   p_validation_end_date   := l_validation_end_date;
571   --
572   hr_utility.set_location(' Leaving:'||l_proc, 10);
573 --
574 End ins_lck;
575 --
576 -- ----------------------------------------------------------------------------
577 -- |---------------------------------< ins >----------------------------------|
578 -- ----------------------------------------------------------------------------
579 Procedure ins
580   (
581   p_rec		   in out nocopy ben_prm_shd.g_rec_type,
582   p_effective_date in     date
583   ) is
584 --
585   l_proc			varchar2(72) := g_package||'ins';
586   l_datetrack_mode		varchar2(30) := 'INSERT';
587   l_validation_start_date	date;
588   l_validation_end_date		date;
589 --
590 Begin
591   hr_utility.set_location('Entering:'||l_proc, 5);
592   --
593   -- Call the lock operation
594   --
595   ins_lck
596 	(p_effective_date	 => p_effective_date,
597 	 p_datetrack_mode	 => l_datetrack_mode,
598 	 p_rec	 		 => p_rec,
599 	 p_validation_start_date => l_validation_start_date,
600 	 p_validation_end_date	 => l_validation_end_date);
601   --
602   -- Call the supporting insert validate operations
603   --
604   ben_prm_bus.insert_validate
605 	(p_rec			 => p_rec,
606 	 p_effective_date	 => p_effective_date,
607 	 p_datetrack_mode	 => l_datetrack_mode,
608 	 p_validation_start_date => l_validation_start_date,
609 	 p_validation_end_date	 => l_validation_end_date);
610   --
611   -- Call the supporting pre-insert operation
612   --
613   pre_insert
614  	(p_rec			 => p_rec,
615 	 p_effective_date	 => p_effective_date,
616 	 p_datetrack_mode	 => l_datetrack_mode,
617 	 p_validation_start_date => l_validation_start_date,
618 	 p_validation_end_date	 => l_validation_end_date);
619   --
620   -- Insert the row
621   --
622   insert_dml
623  	(p_rec			 => p_rec,
624 	 p_effective_date	 => p_effective_date,
625 	 p_datetrack_mode	 => l_datetrack_mode,
626 	 p_validation_start_date => l_validation_start_date,
627 	 p_validation_end_date	 => l_validation_end_date);
628   --
629   -- Call the supporting post-insert operation
630   --
631   post_insert
632  	(p_rec			 => p_rec,
633 	 p_effective_date	 => p_effective_date,
634 	 p_datetrack_mode	 => l_datetrack_mode,
635 	 p_validation_start_date => l_validation_start_date,
636 	 p_validation_end_date	 => l_validation_end_date);
637 end ins;
638 --
639 -- ----------------------------------------------------------------------------
640 -- |---------------------------------< ins >----------------------------------|
641 -- ----------------------------------------------------------------------------
642 Procedure ins
643   (
644   p_prtt_prem_by_mo_id           out nocopy number,
645   p_effective_start_date         out nocopy date,
646   p_effective_end_date           out nocopy date,
647   p_mnl_adj_flag                 in varchar2,
648   p_mo_num                       in number           default null,
649   p_yr_num                       in number           default null,
650   p_antcpd_prtt_cntr_uom         in varchar2         default null,
651   p_antcpd_prtt_cntr_val         in number           default null,
652   p_val                          in number           default null,
653   p_cr_val                       in number           default null,
654   p_cr_mnl_adj_flag              in varchar2,
655   p_alctd_val_flag               in varchar2,
656   p_uom                          in varchar2         default null,
657   p_prtt_prem_id                 in number,
658   p_cost_allocation_keyflex_id   in number           default null,
659   p_business_group_id            in number,
660   p_prm_attribute_category       in varchar2         default null,
661   p_prm_attribute1               in varchar2         default null,
662   p_prm_attribute2               in varchar2         default null,
663   p_prm_attribute3               in varchar2         default null,
664   p_prm_attribute4               in varchar2         default null,
665   p_prm_attribute5               in varchar2         default null,
666   p_prm_attribute6               in varchar2         default null,
667   p_prm_attribute7               in varchar2         default null,
668   p_prm_attribute8               in varchar2         default null,
669   p_prm_attribute9               in varchar2         default null,
670   p_prm_attribute10              in varchar2         default null,
671   p_prm_attribute11              in varchar2         default null,
672   p_prm_attribute12              in varchar2         default null,
676   p_prm_attribute16              in varchar2         default null,
673   p_prm_attribute13              in varchar2         default null,
674   p_prm_attribute14              in varchar2         default null,
675   p_prm_attribute15              in varchar2         default null,
677   p_prm_attribute17              in varchar2         default null,
678   p_prm_attribute18              in varchar2         default null,
679   p_prm_attribute19              in varchar2         default null,
680   p_prm_attribute20              in varchar2         default null,
681   p_prm_attribute21              in varchar2         default null,
682   p_prm_attribute22              in varchar2         default null,
683   p_prm_attribute23              in varchar2         default null,
684   p_prm_attribute24              in varchar2         default null,
685   p_prm_attribute25              in varchar2         default null,
686   p_prm_attribute26              in varchar2         default null,
687   p_prm_attribute27              in varchar2         default null,
688   p_prm_attribute28              in varchar2         default null,
689   p_prm_attribute29              in varchar2         default null,
690   p_prm_attribute30              in varchar2         default null,
691   p_object_version_number        out nocopy number,
692   p_request_id                   in number           default null,
693   p_program_application_id       in number           default null,
694   p_program_id                   in number           default null,
695   p_program_update_date          in date             default null,
696   p_effective_date		 in date
697   ) is
698 --
699   l_rec		ben_prm_shd.g_rec_type;
700   l_proc	varchar2(72) := g_package||'ins';
701 --
702 Begin
703   hr_utility.set_location('Entering:'||l_proc, 5);
704   --
705   -- Call conversion function to turn arguments into the
706   -- p_rec structure.
707   --
708   l_rec :=
709   ben_prm_shd.convert_args
710   (
711   null,
712   null,
713   null,
714   p_mnl_adj_flag,
715   p_mo_num,
716   p_yr_num,
717   p_antcpd_prtt_cntr_uom,
718   p_antcpd_prtt_cntr_val,
719   p_val,
720   p_cr_val,
721   p_cr_mnl_adj_flag,
722   p_alctd_val_flag,
723   p_uom,
724   p_prtt_prem_id,
725   p_cost_allocation_keyflex_id,
726   p_business_group_id,
727   p_prm_attribute_category,
728   p_prm_attribute1,
729   p_prm_attribute2,
730   p_prm_attribute3,
731   p_prm_attribute4,
732   p_prm_attribute5,
733   p_prm_attribute6,
734   p_prm_attribute7,
735   p_prm_attribute8,
736   p_prm_attribute9,
737   p_prm_attribute10,
738   p_prm_attribute11,
739   p_prm_attribute12,
740   p_prm_attribute13,
741   p_prm_attribute14,
742   p_prm_attribute15,
743   p_prm_attribute16,
744   p_prm_attribute17,
745   p_prm_attribute18,
746   p_prm_attribute19,
747   p_prm_attribute20,
748   p_prm_attribute21,
749   p_prm_attribute22,
750   p_prm_attribute23,
751   p_prm_attribute24,
752   p_prm_attribute25,
753   p_prm_attribute26,
754   p_prm_attribute27,
755   p_prm_attribute28,
756   p_prm_attribute29,
757   p_prm_attribute30,
758   null,
759   p_request_id,
760   p_program_application_id,
761   p_program_id,
762   p_program_update_date
763   );
764   --
765   -- Having converted the arguments into the ben_prm_rec
766   -- plsql record structure we call the corresponding record
767   -- business process.
768   --
769   ins(l_rec, p_effective_date);
770   --
771   -- Set the OUT arguments.
772   --
773   p_prtt_prem_by_mo_id        	:= l_rec.prtt_prem_by_mo_id;
774   p_effective_start_date  	:= l_rec.effective_start_date;
775   p_effective_end_date    	:= l_rec.effective_end_date;
776   p_object_version_number 	:= l_rec.object_version_number;
777   --
778   --
779   hr_utility.set_location(' Leaving:'||l_proc, 10);
780 End ins;
781 --
782 end ben_prm_ins;