DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PTP_INS

Source


1 Package Body ben_ptp_ins as
2 /* $Header: beptprhi.pkb 120.1 2005/06/02 03:22:51 bmanyam noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_ptp_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_ptp_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_pl_typ_f t
70     where  t.pl_typ_id       = p_rec.pl_typ_id
71     and    t.effective_start_date =
72              ben_ptp_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_pl_typ_f.created_by%TYPE;
77   l_creation_date       ben_pl_typ_f.creation_date%TYPE;
78   l_last_update_date   	ben_pl_typ_f.last_update_date%TYPE;
79   l_last_updated_by     ben_pl_typ_f.last_updated_by%TYPE;
80   l_last_update_login   ben_pl_typ_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_pl_typ_f',
90 	 p_base_key_column => 'pl_typ_id',
91 	 p_base_key_value  => p_rec.pl_typ_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_ptp_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_pl_typ_f
132   --
133   insert into ben_pl_typ_f
134   (	pl_typ_id,
135 	effective_start_date,
136 	effective_end_date,
137 	name,
138 	mx_enrl_alwd_num,
139 	mn_enrl_rqd_num,
140 	pl_typ_stat_cd,
141 	opt_typ_cd,
142         opt_dsply_fmt_cd,
143         comp_typ_cd,
144 	ivr_ident,
145 	no_mx_enrl_num_dfnd_flag,
146 	no_mn_enrl_num_dfnd_flag,
147 	business_group_id,
148 	ptp_attribute_category,
149 	ptp_attribute1,
150 	ptp_attribute2,
151 	ptp_attribute3,
152 	ptp_attribute4,
153 	ptp_attribute5,
154 	ptp_attribute6,
155 	ptp_attribute7,
156 	ptp_attribute8,
157 	ptp_attribute9,
158 	ptp_attribute10,
159 	ptp_attribute11,
160 	ptp_attribute12,
161 	ptp_attribute13,
162 	ptp_attribute14,
163 	ptp_attribute15,
164 	ptp_attribute16,
165 	ptp_attribute17,
166 	ptp_attribute18,
167 	ptp_attribute19,
168 	ptp_attribute20,
169 	ptp_attribute21,
170 	ptp_attribute22,
171 	ptp_attribute23,
172 	ptp_attribute24,
173 	ptp_attribute25,
174 	ptp_attribute26,
175 	ptp_attribute27,
176 	ptp_attribute28,
177 	ptp_attribute29,
178 	ptp_attribute30,
179 	short_name,		/*FHR*/
180 	short_code,		/*FHR*/
181 		legislation_code,
182 		legislation_subgroup,
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.pl_typ_id,
192 	p_rec.effective_start_date,
193 	p_rec.effective_end_date,
194 	p_rec.name,
195 	p_rec.mx_enrl_alwd_num,
196 	p_rec.mn_enrl_rqd_num,
197 	p_rec.pl_typ_stat_cd,
198 	p_rec.opt_typ_cd,
199         p_rec.opt_dsply_fmt_cd,
200         p_rec.comp_typ_cd,
201 	p_rec.ivr_ident,
202 	p_rec.no_mx_enrl_num_dfnd_flag,
203 	p_rec.no_mn_enrl_num_dfnd_flag,
204 	p_rec.business_group_id,
205 	p_rec.ptp_attribute_category,
206 	p_rec.ptp_attribute1,
207 	p_rec.ptp_attribute2,
208 	p_rec.ptp_attribute3,
209 	p_rec.ptp_attribute4,
210 	p_rec.ptp_attribute5,
211 	p_rec.ptp_attribute6,
212 	p_rec.ptp_attribute7,
213 	p_rec.ptp_attribute8,
214 	p_rec.ptp_attribute9,
215 	p_rec.ptp_attribute10,
216 	p_rec.ptp_attribute11,
217 	p_rec.ptp_attribute12,
218 	p_rec.ptp_attribute13,
219 	p_rec.ptp_attribute14,
220 	p_rec.ptp_attribute15,
221 	p_rec.ptp_attribute16,
222 	p_rec.ptp_attribute17,
223 	p_rec.ptp_attribute18,
224 	p_rec.ptp_attribute19,
225 	p_rec.ptp_attribute20,
226 	p_rec.ptp_attribute21,
227 	p_rec.ptp_attribute22,
228 	p_rec.ptp_attribute23,
229 	p_rec.ptp_attribute24,
230 	p_rec.ptp_attribute25,
231 	p_rec.ptp_attribute26,
232 	p_rec.ptp_attribute27,
233 	p_rec.ptp_attribute28,
234 	p_rec.ptp_attribute29,
235 	p_rec.ptp_attribute30,
236 	p_rec.short_name,		/*FHR*/
237 	p_rec.short_code, 		/*FHR*/
238 		p_rec.legislation_code,
239 		p_rec.legislation_subgroup,
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_ptp_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_ptp_shd.g_api_dml := false;   -- Unset the api dml status
255     ben_ptp_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_ptp_shd.g_api_dml := false;   -- Unset the api dml status
260     ben_ptp_shd.constraint_error
261       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
262   When Others Then
263     ben_ptp_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_ptp_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_ptp_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 --
339   Cursor C_Sel1 is select ben_pl_typ_f_s.nextval from sys.dual;
340 --
341 Begin
342   hr_utility.set_location('Entering:'||l_proc, 5);
343   --
344   --
345   -- Select the next sequence number
346   --
347   Open C_Sel1;
348   Fetch C_Sel1 Into p_rec.pl_typ_id;
349   Close C_Sel1;
350   --
351   hr_utility.set_location(' Leaving:'||l_proc, 10);
352 End pre_insert;
353 --
354 -- ----------------------------------------------------------------------------
355 -- |-----------------------------< post_insert >------------------------------|
356 -- ----------------------------------------------------------------------------
357 -- {Start Of Comments}
358 --
359 -- Description:
360 --   This private procedure contains any processing which is required after the
361 --   insert dml.
362 --
363 -- Prerequisites:
364 --   This is an internal procedure which is called from the ins procedure.
365 --
366 -- In Parameters:
367 --   A Pl/Sql record structre.
368 --
369 -- Post Success:
370 --   Processing continues.
371 --
372 -- Post Failure:
373 --   If an error has occurred, an error message and exception will be raised
374 --   but not handled.
375 --
376 -- Developer Implementation Notes:
377 --   Any post-processing required after the insert dml is issued should be
378 --   coded within this procedure. It is important to note that any 3rd party
379 --   maintenance should be reviewed before placing in this procedure.
380 --
381 -- Access Status:
382 --   Internal Row Handler Use Only.
383 --
384 -- {End Of Comments}
385 -- ----------------------------------------------------------------------------
386 Procedure post_insert
387 	(p_rec 			 in ben_ptp_shd.g_rec_type,
388 	 p_effective_date	 in date,
389 	 p_datetrack_mode	 in varchar2,
390 	 p_validation_start_date in date,
391 	 p_validation_end_date	 in date) is
392 --
393   l_proc	varchar2(72) := g_package||'post_insert';
394 --
395 Begin
396   hr_utility.set_location('Entering:'||l_proc, 5);
397 --
398   --
399   -- Start of API User Hook for post_insert.
400   --
401   begin
402     --
403     ben_ptp_rki.after_insert
404       (
405   p_pl_typ_id                     =>p_rec.pl_typ_id
406  ,p_effective_start_date          =>p_rec.effective_start_date
407  ,p_effective_end_date            =>p_rec.effective_end_date
408  ,p_name                          =>p_rec.name
409  ,p_mx_enrl_alwd_num              =>p_rec.mx_enrl_alwd_num
410  ,p_mn_enrl_rqd_num               =>p_rec.mn_enrl_rqd_num
411  ,p_pl_typ_stat_cd                =>p_rec.pl_typ_stat_cd
412  ,p_opt_typ_cd                    =>p_rec.opt_typ_cd
413  ,p_opt_dsply_fmt_cd              =>p_rec.opt_dsply_fmt_cd
414  ,p_comp_typ_cd                   =>p_rec.comp_typ_cd
415  ,p_ivr_ident                     =>p_rec.ivr_ident
416  ,p_no_mx_enrl_num_dfnd_flag      =>p_rec.no_mx_enrl_num_dfnd_flag
417  ,p_no_mn_enrl_num_dfnd_flag      =>p_rec.no_mn_enrl_num_dfnd_flag
418  ,p_business_group_id             =>p_rec.business_group_id
419  ,p_ptp_attribute_category        =>p_rec.ptp_attribute_category
420  ,p_ptp_attribute1                =>p_rec.ptp_attribute1
421  ,p_ptp_attribute2                =>p_rec.ptp_attribute2
422  ,p_ptp_attribute3                =>p_rec.ptp_attribute3
423  ,p_ptp_attribute4                =>p_rec.ptp_attribute4
424  ,p_ptp_attribute5                =>p_rec.ptp_attribute5
425  ,p_ptp_attribute6                =>p_rec.ptp_attribute6
426  ,p_ptp_attribute7                =>p_rec.ptp_attribute7
427  ,p_ptp_attribute8                =>p_rec.ptp_attribute8
428  ,p_ptp_attribute9                =>p_rec.ptp_attribute9
429  ,p_ptp_attribute10               =>p_rec.ptp_attribute10
430  ,p_ptp_attribute11               =>p_rec.ptp_attribute11
431  ,p_ptp_attribute12               =>p_rec.ptp_attribute12
432  ,p_ptp_attribute13               =>p_rec.ptp_attribute13
433  ,p_ptp_attribute14               =>p_rec.ptp_attribute14
434  ,p_ptp_attribute15               =>p_rec.ptp_attribute15
435  ,p_ptp_attribute16               =>p_rec.ptp_attribute16
436  ,p_ptp_attribute17               =>p_rec.ptp_attribute17
437  ,p_ptp_attribute18               =>p_rec.ptp_attribute18
438  ,p_ptp_attribute19               =>p_rec.ptp_attribute19
439  ,p_ptp_attribute20               =>p_rec.ptp_attribute20
440  ,p_ptp_attribute21               =>p_rec.ptp_attribute21
441  ,p_ptp_attribute22               =>p_rec.ptp_attribute22
442  ,p_ptp_attribute23               =>p_rec.ptp_attribute23
443  ,p_ptp_attribute24               =>p_rec.ptp_attribute24
444  ,p_ptp_attribute25               =>p_rec.ptp_attribute25
445  ,p_ptp_attribute26               =>p_rec.ptp_attribute26
446  ,p_ptp_attribute27               =>p_rec.ptp_attribute27
447  ,p_ptp_attribute28               =>p_rec.ptp_attribute28
448  ,p_ptp_attribute29               =>p_rec.ptp_attribute29
449  ,p_ptp_attribute30               =>p_rec.ptp_attribute30
450  ,p_short_name			  =>p_rec.short_name		--FHR
451  ,p_short_code			  =>p_rec.short_code		--FHR
452   ,p_legislation_code			  =>p_rec.legislation_code
453   ,p_legislation_subgroup			  =>p_rec.legislation_subgroup
454  ,p_object_version_number         =>p_rec.object_version_number
455  ,p_effective_date                =>p_effective_date
456  ,p_validation_start_date         =>p_validation_start_date
457  ,p_validation_end_date           =>p_validation_end_date
458       );
459     --
460   exception
461     --
462     when hr_api.cannot_find_prog_unit then
463       --
464       hr_api.cannot_find_prog_unit_error
465         (p_module_name => 'ben_pl_typ_f'
466         ,p_hook_type   => 'AI');
467       --
468   end;
469   --
470   -- End of API User Hook for post_insert.
471   --
472   --
473   hr_utility.set_location(' Leaving:'||l_proc, 10);
474 End post_insert;
475 --
476 -- ----------------------------------------------------------------------------
477 -- |-------------------------------< ins_lck >--------------------------------|
478 -- ----------------------------------------------------------------------------
479 -- {Start Of Comments}
480 --
481 -- Description:
482 --   The ins_lck process has one main function to perform. When inserting
483 --   a datetracked row, we must validate the DT mode.
484 --   be manipulated.
485 --
486 -- Prerequisites:
487 --   This procedure can only be called for the datetrack mode of INSERT.
488 --
489 -- In Parameters:
490 --
491 -- Post Success:
492 --   On successful completion of the ins_lck process the parental
493 --   datetracked rows will be locked providing the p_enforce_foreign_locking
494 --   argument value is TRUE.
495 --   If the p_enforce_foreign_locking argument value is FALSE then the
496 --   parential rows are not locked.
497 --
498 -- Post Failure:
499 --   The Lck process can fail for:
500 --   1) When attempting to lock the row the row could already be locked by
501 --      another user. This will raise the HR_Api.Object_Locked exception.
502 --   2) When attempting to the lock the parent which doesn't exist.
503 --      For the entity to be locked the parent must exist!
504 --
505 -- Developer Implementation Notes:
506 --   None.
507 --
508 -- Access Status:
509 --   Internal Row Handler Use Only.
510 --
511 -- {End Of Comments}
512 -- ----------------------------------------------------------------------------
513 Procedure ins_lck
514 	(p_effective_date	 in  date,
515 	 p_datetrack_mode	 in  varchar2,
516 	 p_rec	 		 in  ben_ptp_shd.g_rec_type,
517 	 p_validation_start_date out nocopy date,
518 	 p_validation_end_date	 out nocopy date) is
519 --
520   l_proc		  varchar2(72) := g_package||'ins_lck';
521   l_validation_start_date date;
522   l_validation_end_date	  date;
523 --
524 Begin
525   hr_utility.set_location('Entering:'||l_proc, 5);
526   --
527   -- Validate the datetrack mode mode getting the validation start
528   -- and end dates for the specified datetrack operation.
529   --
530   dt_api.validate_dt_mode
531 	(p_effective_date	   => p_effective_date,
532 	 p_datetrack_mode	   => p_datetrack_mode,
533 	 p_base_table_name	   => 'ben_pl_typ_f',
534 	 p_base_key_column	   => 'pl_typ_id',
535 	 p_base_key_value 	   => p_rec.pl_typ_id,
536          p_enforce_foreign_locking => true,
537 	 p_validation_start_date   => l_validation_start_date,
538  	 p_validation_end_date	   => l_validation_end_date);
539   --
540   -- Set the validation start and end date OUT arguments
541   --
542   p_validation_start_date := l_validation_start_date;
543   p_validation_end_date   := l_validation_end_date;
544   --
545   hr_utility.set_location(' Leaving:'||l_proc, 10);
546 --
547 End ins_lck;
548 --
549 -- ----------------------------------------------------------------------------
550 -- |---------------------------------< ins >----------------------------------|
551 -- ----------------------------------------------------------------------------
552 Procedure ins
553   (
554   p_rec		   in out nocopy ben_ptp_shd.g_rec_type,
555   p_effective_date in     date
556   ) is
557 --
558   l_proc			varchar2(72) := g_package||'ins';
559   l_datetrack_mode		varchar2(30) := 'INSERT';
560   l_validation_start_date	date;
561   l_validation_end_date		date;
562 --
563 Begin
564   hr_utility.set_location('Entering:'||l_proc, 5);
565   --
566   -- Call the lock operation
567   --
568   ins_lck
569 	(p_effective_date	 => p_effective_date,
570 	 p_datetrack_mode	 => l_datetrack_mode,
571 	 p_rec	 		 => p_rec,
572 	 p_validation_start_date => l_validation_start_date,
573 	 p_validation_end_date	 => l_validation_end_date);
574   --
575   -- Call the supporting insert validate operations
576   --
577   ben_ptp_bus.insert_validate
578 	(p_rec			 => p_rec,
579 	 p_effective_date	 => p_effective_date,
580 	 p_datetrack_mode	 => l_datetrack_mode,
581 	 p_validation_start_date => l_validation_start_date,
582 	 p_validation_end_date	 => l_validation_end_date);
583   --
584   -- Call the supporting pre-insert operation
585   --
586   pre_insert
587  	(p_rec			 => p_rec,
588 	 p_effective_date	 => p_effective_date,
589 	 p_datetrack_mode	 => l_datetrack_mode,
590 	 p_validation_start_date => l_validation_start_date,
591 	 p_validation_end_date	 => l_validation_end_date);
592   --
593   -- Insert the row
594   --
595   insert_dml
596  	(p_rec			 => p_rec,
597 	 p_effective_date	 => p_effective_date,
598 	 p_datetrack_mode	 => l_datetrack_mode,
599 	 p_validation_start_date => l_validation_start_date,
600 	 p_validation_end_date	 => l_validation_end_date);
601   --
602   -- Call the supporting post-insert operation
603   --
604   post_insert
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 end ins;
611 --
612 -- ----------------------------------------------------------------------------
613 -- |---------------------------------< ins >----------------------------------|
614 -- ----------------------------------------------------------------------------
615 Procedure ins
616   (
617   p_pl_typ_id                    out nocopy number,
618   p_effective_start_date         out nocopy date,
619   p_effective_end_date           out nocopy date,
620   p_name                         in varchar2,
621   p_mx_enrl_alwd_num             in number           default null,
622   p_mn_enrl_rqd_num              in number           default null,
623   p_pl_typ_stat_cd               in varchar2         default null,
624   p_opt_typ_cd                   in varchar2         default null,
625   p_opt_dsply_fmt_cd             in varchar2         default null,
626   p_comp_typ_cd                  in varchar2         default null,
627   p_ivr_ident                    in varchar2         default null,
628   p_no_mx_enrl_num_dfnd_flag     in varchar2         default null,
629   p_no_mn_enrl_num_dfnd_flag     in varchar2         default null,
630   p_business_group_id            in number           default null,
631   p_ptp_attribute_category       in varchar2         default null,
632   p_ptp_attribute1               in varchar2         default null,
633   p_ptp_attribute2               in varchar2         default null,
634   p_ptp_attribute3               in varchar2         default null,
635   p_ptp_attribute4               in varchar2         default null,
636   p_ptp_attribute5               in varchar2         default null,
637   p_ptp_attribute6               in varchar2         default null,
638   p_ptp_attribute7               in varchar2         default null,
639   p_ptp_attribute8               in varchar2         default null,
640   p_ptp_attribute9               in varchar2         default null,
641   p_ptp_attribute10              in varchar2         default null,
642   p_ptp_attribute11              in varchar2         default null,
643   p_ptp_attribute12              in varchar2         default null,
644   p_ptp_attribute13              in varchar2         default null,
645   p_ptp_attribute14              in varchar2         default null,
646   p_ptp_attribute15              in varchar2         default null,
647   p_ptp_attribute16              in varchar2         default null,
648   p_ptp_attribute17              in varchar2         default null,
649   p_ptp_attribute18              in varchar2         default null,
650   p_ptp_attribute19              in varchar2         default null,
651   p_ptp_attribute20              in varchar2         default null,
652   p_ptp_attribute21              in varchar2         default null,
653   p_ptp_attribute22              in varchar2         default null,
654   p_ptp_attribute23              in varchar2         default null,
655   p_ptp_attribute24              in varchar2         default null,
656   p_ptp_attribute25              in varchar2         default null,
657   p_ptp_attribute26              in varchar2         default null,
658   p_ptp_attribute27              in varchar2         default null,
659   p_ptp_attribute28              in varchar2         default null,
660   p_ptp_attribute29              in varchar2         default null,
661   p_ptp_attribute30              in varchar2         default null,
662   p_short_name			 in varchar2         default null, 	--FHR
663   p_short_code			 in varchar2         default null, 	--FHR
664     p_legislation_code			 in varchar2         default null,
665     p_legislation_subgroup			 in varchar2         default null,
666   p_object_version_number        out nocopy number,
667   p_effective_date		 in date
668   ) is
669 --
670   l_rec		ben_ptp_shd.g_rec_type;
671   l_proc	varchar2(72) := g_package||'ins';
672 --
673 Begin
674   hr_utility.set_location('Entering:'||l_proc, 5);
675   --
676   -- Call conversion function to turn arguments into the
677   -- p_rec structure.
678   --
679   l_rec :=
680   ben_ptp_shd.convert_args
681   (
682   null,
683   null,
684   null,
685   p_name,
686   p_mx_enrl_alwd_num,
687   p_mn_enrl_rqd_num,
688   p_pl_typ_stat_cd,
689   p_opt_typ_cd,
690   p_opt_dsply_fmt_cd,
691   p_comp_typ_cd,
692   p_ivr_ident,
693   p_no_mx_enrl_num_dfnd_flag,
694   p_no_mn_enrl_num_dfnd_flag,
695   p_business_group_id,
696   p_ptp_attribute_category,
697   p_ptp_attribute1,
698   p_ptp_attribute2,
699   p_ptp_attribute3,
700   p_ptp_attribute4,
701   p_ptp_attribute5,
702   p_ptp_attribute6,
703   p_ptp_attribute7,
704   p_ptp_attribute8,
705   p_ptp_attribute9,
706   p_ptp_attribute10,
707   p_ptp_attribute11,
708   p_ptp_attribute12,
709   p_ptp_attribute13,
710   p_ptp_attribute14,
711   p_ptp_attribute15,
712   p_ptp_attribute16,
713   p_ptp_attribute17,
714   p_ptp_attribute18,
715   p_ptp_attribute19,
716   p_ptp_attribute20,
717   p_ptp_attribute21,
718   p_ptp_attribute22,
719   p_ptp_attribute23,
720   p_ptp_attribute24,
721   p_ptp_attribute25,
722   p_ptp_attribute26,
723   p_ptp_attribute27,
724   p_ptp_attribute28,
725   p_ptp_attribute29,
726   p_ptp_attribute30,
727   p_short_name,		--FHR
728   p_short_code, 	--FHR
729     p_legislation_code,
730     p_legislation_subgroup,
731   null
732   );
733   --
734   -- Having converted the arguments into the ben_ptp_rec
735   -- plsql record structure we call the corresponding record
736   -- business process.
737   --
738   ins(l_rec, p_effective_date);
739   --
740   -- Set the OUT arguments.
741   --
742   p_pl_typ_id        	:= l_rec.pl_typ_id;
743   p_effective_start_date  	:= l_rec.effective_start_date;
744   p_effective_end_date    	:= l_rec.effective_end_date;
745   p_object_version_number 	:= l_rec.object_version_number;
746   --
747   --
748   hr_utility.set_location(' Leaving:'||l_proc, 10);
749 End ins;
750 --
751 end ben_ptp_ins;