DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CPT_INS

Source


1 Package Body ben_cpt_ins as
2 /* $Header: becptrhi.pkb 115.5 2002/12/13 06:20:31 hmani ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_cpt_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_cpt_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_cmbn_ptip_opt_f t
70     where  t.cmbn_ptip_opt_id       = p_rec.cmbn_ptip_opt_id
71     and    t.effective_start_date =
72              ben_cpt_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_cmbn_ptip_opt_f.created_by%TYPE;
77   l_creation_date       ben_cmbn_ptip_opt_f.creation_date%TYPE;
78   l_last_update_date   	ben_cmbn_ptip_opt_f.last_update_date%TYPE;
79   l_last_updated_by     ben_cmbn_ptip_opt_f.last_updated_by%TYPE;
80   l_last_update_login   ben_cmbn_ptip_opt_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_cmbn_ptip_opt_f',
90 	 p_base_key_column => 'cmbn_ptip_opt_id',
91 	 p_base_key_value  => p_rec.cmbn_ptip_opt_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_cpt_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_cmbn_ptip_opt_f
132   --
133   insert into ben_cmbn_ptip_opt_f
134   (	cmbn_ptip_opt_id,
135 	effective_start_date,
136 	effective_end_date,
137 	name,
138 	business_group_id,
139 	cpt_attribute_category,
140 	cpt_attribute1,
141 	cpt_attribute2,
142 	cpt_attribute3,
143 	cpt_attribute4,
144 	cpt_attribute5,
145 	cpt_attribute6,
146 	cpt_attribute7,
147 	cpt_attribute8,
148 	cpt_attribute9,
149 	cpt_attribute10,
150 	cpt_attribute11,
151 	cpt_attribute12,
152 	cpt_attribute13,
153 	cpt_attribute14,
154 	cpt_attribute15,
155 	cpt_attribute16,
156 	cpt_attribute17,
157 	cpt_attribute18,
158 	cpt_attribute19,
159 	cpt_attribute20,
160 	cpt_attribute21,
161 	cpt_attribute22,
162 	cpt_attribute23,
163 	cpt_attribute24,
164 	cpt_attribute25,
165 	cpt_attribute26,
166 	cpt_attribute27,
167 	cpt_attribute28,
168 	cpt_attribute29,
169 	cpt_attribute30,
170 	object_version_number,
171 	ptip_id ,
172         pgm_id ,
173         opt_id,
174    	created_by,
175    	creation_date,
176    	last_update_date,
177    	last_updated_by,
178    	last_update_login
179   )
180   Values
181   (	p_rec.cmbn_ptip_opt_id,
182 	p_rec.effective_start_date,
183 	p_rec.effective_end_date,
184 	p_rec.name,
185 	p_rec.business_group_id,
186 	p_rec.cpt_attribute_category,
187 	p_rec.cpt_attribute1,
188 	p_rec.cpt_attribute2,
189 	p_rec.cpt_attribute3,
190 	p_rec.cpt_attribute4,
191 	p_rec.cpt_attribute5,
192 	p_rec.cpt_attribute6,
193 	p_rec.cpt_attribute7,
194 	p_rec.cpt_attribute8,
195 	p_rec.cpt_attribute9,
196 	p_rec.cpt_attribute10,
197 	p_rec.cpt_attribute11,
198 	p_rec.cpt_attribute12,
199 	p_rec.cpt_attribute13,
200 	p_rec.cpt_attribute14,
201 	p_rec.cpt_attribute15,
202 	p_rec.cpt_attribute16,
203 	p_rec.cpt_attribute17,
204 	p_rec.cpt_attribute18,
205 	p_rec.cpt_attribute19,
206 	p_rec.cpt_attribute20,
207 	p_rec.cpt_attribute21,
208 	p_rec.cpt_attribute22,
209 	p_rec.cpt_attribute23,
210 	p_rec.cpt_attribute24,
211 	p_rec.cpt_attribute25,
212 	p_rec.cpt_attribute26,
213 	p_rec.cpt_attribute27,
214 	p_rec.cpt_attribute28,
215 	p_rec.cpt_attribute29,
216 	p_rec.cpt_attribute30,
217 	p_rec.object_version_number,
218 	p_rec.ptip_id,
219         p_rec.pgm_id,
220         p_rec.opt_id,
221 	l_created_by,
222    	l_creation_date,
223    	l_last_update_date,
224    	l_last_updated_by,
225    	l_last_update_login
226   );
227   --
228   ben_cpt_shd.g_api_dml := false;   -- Unset the api dml status
229   hr_utility.set_location(' Leaving:'||l_proc, 15);
230 --
231 Exception
232   When hr_api.check_integrity_violated Then
233     -- A check constraint has been violated
234     ben_cpt_shd.g_api_dml := false;   -- Unset the api dml status
235     ben_cpt_shd.constraint_error
236       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
237   When hr_api.unique_integrity_violated Then
238     -- Unique integrity has been violated
239     ben_cpt_shd.g_api_dml := false;   -- Unset the api dml status
240     ben_cpt_shd.constraint_error
241       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
242   When Others Then
243     ben_cpt_shd.g_api_dml := false;   -- Unset the api dml status
244     Raise;
245 End dt_insert_dml;
246 --
247 -- ----------------------------------------------------------------------------
248 -- |------------------------------< insert_dml >------------------------------|
249 -- ----------------------------------------------------------------------------
250 Procedure insert_dml
251 	(p_rec 			 in out nocopy ben_cpt_shd.g_rec_type,
252 	 p_effective_date	 in	date,
253 	 p_datetrack_mode	 in	varchar2,
254 	 p_validation_start_date in	date,
255 	 p_validation_end_date	 in	date) is
256 --
257   l_proc	varchar2(72) := g_package||'insert_dml';
258 --
259 Begin
260   hr_utility.set_location('Entering:'||l_proc, 5);
261   --
262   dt_insert_dml(p_rec			=> p_rec,
263 		p_effective_date	=> p_effective_date,
264 		p_datetrack_mode	=> p_datetrack_mode,
265        		p_validation_start_date	=> p_validation_start_date,
266 		p_validation_end_date	=> p_validation_end_date);
267   --
268   hr_utility.set_location(' Leaving:'||l_proc, 10);
269 End insert_dml;
270 --
271 -- ----------------------------------------------------------------------------
272 -- |------------------------------< pre_insert >------------------------------|
273 -- ----------------------------------------------------------------------------
274 -- {Start Of Comments}
275 --
276 -- Description:
277 --   This private procedure contains any processing which is required before
278 --   the insert dml. Presently, if the entity has a corresponding primary
279 --   key which is maintained by an associating sequence, the primary key for
280 --   the entity will be populated with the next sequence value in
281 --   preparation for the insert dml.
282 --   Also, if comments are defined for this entity, the comments insert
283 --   logic will also be called, generating a comment_id if required.
284 --
285 -- Prerequisites:
286 --   This is an internal procedure which is called from the ins procedure.
287 --
288 -- In Parameters:
289 --   A Pl/Sql record structre.
290 --
291 -- Post Success:
292 --   Processing continues.
293 --
294 -- Post Failure:
295 --   If an error has occurred, an error message and exception will be raised
296 --   but not handled.
297 --
298 -- Developer Implementation Notes:
299 --   Any pre-processing required before the insert dml is issued should be
300 --   coded within this procedure. As stated above, a good example is the
301 --   generation of a primary key number via a corresponding sequence.
302 --   It is important to note that any 3rd party maintenance should be reviewed
303 --   before placing in this procedure.
304 --
305 -- Access Status:
306 --   Internal Row Handler Use Only.
307 --
308 -- {End Of Comments}
309 -- ----------------------------------------------------------------------------
310 Procedure pre_insert
311 	(p_rec  			in out nocopy ben_cpt_shd.g_rec_type,
312 	 p_effective_date		in date,
313 	 p_datetrack_mode		in varchar2,
314 	 p_validation_start_date	in date,
315 	 p_validation_end_date		in date) is
316 --
317   l_proc	varchar2(72) := g_package||'pre_insert';
318 --
319 cursor C_Sel1 is select ben_cmbn_ptip_opt_f_s.nextval from sys.dual;
320 --
321 Begin
322   hr_utility.set_location('Entering:'||l_proc, 5);
323   --
324   -- Select the next sequence number
325   --
326   Open C_Sel1;
327   Fetch C_Sel1 Into p_rec.cmbn_ptip_opt_id;
328   Close C_Sel1;
329   --
330   hr_utility.set_location(' Leaving:'||l_proc, 10);
331 End pre_insert;
332 --
333 -- ----------------------------------------------------------------------------
334 -- |-----------------------------< post_insert >------------------------------|
335 -- ----------------------------------------------------------------------------
336 -- {Start Of Comments}
337 --
338 -- Description:
339 --   This private procedure contains any processing which is required after the
340 --   insert dml.
341 --
342 -- Prerequisites:
343 --   This is an internal procedure which is called from the ins procedure.
344 --
345 -- In Parameters:
346 --   A Pl/Sql record structre.
347 --
348 -- Post Success:
349 --   Processing continues.
350 --
351 -- Post Failure:
352 --   If an error has occurred, an error message and exception will be raised
353 --   but not handled.
354 --
355 -- Developer Implementation Notes:
356 --   Any post-processing required after the insert dml is issued should be
357 --   coded within this procedure. It is important to note that any 3rd party
358 --   maintenance should be reviewed before placing in this procedure.
359 --
360 -- Access Status:
361 --   Internal Row Handler Use Only.
362 --
363 -- {End Of Comments}
364 -- ----------------------------------------------------------------------------
365 Procedure post_insert
366 	(p_rec 			 in ben_cpt_shd.g_rec_type,
367 	 p_effective_date	 in date,
368 	 p_datetrack_mode	 in varchar2,
369 	 p_validation_start_date in date,
370 	 p_validation_end_date	 in date) is
371 --
372   l_proc	varchar2(72) := g_package||'post_insert';
373 --
374 Begin
375   hr_utility.set_location('Entering:'||l_proc, 5);
376 --
377   --
378   -- Start of API User Hook for post_insert.
379   --
380   begin
381     --
382     ben_cpt_rki.after_insert
383       (
384   p_cmbn_ptip_opt_id              =>p_rec.cmbn_ptip_opt_id
385  ,p_effective_start_date          =>p_rec.effective_start_date
386  ,p_effective_end_date            =>p_rec.effective_end_date
387  ,p_name                          =>p_rec.name
388  ,p_business_group_id             =>p_rec.business_group_id
389  ,p_cpt_attribute_category        =>p_rec.cpt_attribute_category
393  ,p_cpt_attribute4                =>p_rec.cpt_attribute4
390  ,p_cpt_attribute1                =>p_rec.cpt_attribute1
391  ,p_cpt_attribute2                =>p_rec.cpt_attribute2
392  ,p_cpt_attribute3                =>p_rec.cpt_attribute3
394  ,p_cpt_attribute5                =>p_rec.cpt_attribute5
395  ,p_cpt_attribute6                =>p_rec.cpt_attribute6
396  ,p_cpt_attribute7                =>p_rec.cpt_attribute7
397  ,p_cpt_attribute8                =>p_rec.cpt_attribute8
398  ,p_cpt_attribute9                =>p_rec.cpt_attribute9
399  ,p_cpt_attribute10               =>p_rec.cpt_attribute10
400  ,p_cpt_attribute11               =>p_rec.cpt_attribute11
401  ,p_cpt_attribute12               =>p_rec.cpt_attribute12
402  ,p_cpt_attribute13               =>p_rec.cpt_attribute13
403  ,p_cpt_attribute14               =>p_rec.cpt_attribute14
404  ,p_cpt_attribute15               =>p_rec.cpt_attribute15
405  ,p_cpt_attribute16               =>p_rec.cpt_attribute16
406  ,p_cpt_attribute17               =>p_rec.cpt_attribute17
407  ,p_cpt_attribute18               =>p_rec.cpt_attribute18
408  ,p_cpt_attribute19               =>p_rec.cpt_attribute19
409  ,p_cpt_attribute20               =>p_rec.cpt_attribute20
410  ,p_cpt_attribute21               =>p_rec.cpt_attribute21
411  ,p_cpt_attribute22               =>p_rec.cpt_attribute22
412  ,p_cpt_attribute23               =>p_rec.cpt_attribute23
413  ,p_cpt_attribute24               =>p_rec.cpt_attribute24
414  ,p_cpt_attribute25               =>p_rec.cpt_attribute25
415  ,p_cpt_attribute26               =>p_rec.cpt_attribute26
416  ,p_cpt_attribute27               =>p_rec.cpt_attribute27
417  ,p_cpt_attribute28               =>p_rec.cpt_attribute28
418  ,p_cpt_attribute29               =>p_rec.cpt_attribute29
419  ,p_cpt_attribute30               =>p_rec.cpt_attribute30
420  ,p_object_version_number         =>p_rec.object_version_number
421  ,p_ptip_id                       =>p_rec.ptip_id
422  ,p_pgm_id                        =>p_rec.pgm_id
423  ,p_opt_id                        =>p_rec.opt_id
424  ,p_effective_date                =>p_effective_date
425  ,p_validation_start_date         =>p_validation_start_date
426  ,p_validation_end_date           =>p_validation_end_date
427       );
428     --
429   exception
430     --
431     when hr_api.cannot_find_prog_unit then
432       --
433       hr_api.cannot_find_prog_unit_error
434         (p_module_name => 'ben_cmbn_ptip_opt_f'
435         ,p_hook_type   => 'AI');
436       --
437   end;
438   --
439   -- End of API User Hook for post_insert.
440   --
441   --
442   hr_utility.set_location(' Leaving:'||l_proc, 10);
443 End post_insert;
444 --
445 -- ----------------------------------------------------------------------------
446 -- |-------------------------------< ins_lck >--------------------------------|
447 -- ----------------------------------------------------------------------------
448 -- {Start Of Comments}
449 --
450 -- Description:
451 --   The ins_lck process has one main function to perform. When inserting
452 --   a datetracked row, we must validate the DT mode.
453 --   be manipulated.
454 --
455 -- Prerequisites:
456 --   This procedure can only be called for the datetrack mode of INSERT.
457 --
458 -- In Parameters:
459 --
460 -- Post Success:
461 --   On successful completion of the ins_lck process the parental
462 --   datetracked rows will be locked providing the p_enforce_foreign_locking
463 --   argument value is TRUE.
464 --   If the p_enforce_foreign_locking argument value is FALSE then the
465 --   parential rows are not locked.
466 --
467 -- Post Failure:
468 --   The Lck process can fail for:
469 --   1) When attempting to lock the row the row could already be locked by
470 --      another user. This will raise the HR_Api.Object_Locked exception.
471 --   2) When attempting to the lock the parent which doesn't exist.
472 --      For the entity to be locked the parent must exist!
473 --
474 -- Developer Implementation Notes:
475 --   None.
476 --
477 -- Access Status:
478 --   Internal Row Handler Use Only.
479 --
480 -- {End Of Comments}
481 -- ----------------------------------------------------------------------------
482 Procedure ins_lck
483 	(p_effective_date	 in  date,
484 	 p_datetrack_mode	 in  varchar2,
485 	 p_rec	 		 in  ben_cpt_shd.g_rec_type,
486 	 p_validation_start_date out nocopy date,
487 	 p_validation_end_date	 out nocopy date) is
488 --
489   l_proc		  varchar2(72) := g_package||'ins_lck';
490   l_validation_start_date date;
491   l_validation_end_date	  date;
492 --
493 Begin
494   hr_utility.set_location('Entering:'||l_proc, 5);
495   --
496   -- Validate the datetrack mode mode getting the validation start
497   -- and end dates for the specified datetrack operation.
498   --
499   dt_api.validate_dt_mode
500 	(p_effective_date	   => p_effective_date,
501 	 p_datetrack_mode	   => p_datetrack_mode,
502 	 p_base_table_name	   => 'ben_cmbn_ptip_opt_f',
503 	 p_base_key_column	   => 'cmbn_ptip_opt_id',
504 	 p_base_key_value 	   => p_rec.cmbn_ptip_opt_id,
505          p_enforce_foreign_locking => true,
506 	 p_validation_start_date   => l_validation_start_date,
507  	 p_validation_end_date	   => l_validation_end_date);
508   --
509   -- Set the validation start and end date OUT arguments
510   --
511   p_validation_start_date := l_validation_start_date;
515 --
512   p_validation_end_date   := l_validation_end_date;
513   --
514   hr_utility.set_location(' Leaving:'||l_proc, 10);
516 End ins_lck;
517 --
518 -- ----------------------------------------------------------------------------
519 -- |---------------------------------< ins >----------------------------------|
520 -- ----------------------------------------------------------------------------
521 Procedure ins
522   (
523   p_rec		   in out nocopy ben_cpt_shd.g_rec_type,
524   p_effective_date in     date
525   ) is
526 --
527   l_proc			varchar2(72) := g_package||'ins';
528   l_datetrack_mode		varchar2(30) := 'INSERT';
529   l_validation_start_date	date;
530   l_validation_end_date		date;
531 --
532 Begin
533   hr_utility.set_location('Entering:'||l_proc, 5);
534   --
535   -- Call the lock operation
536   --
537   ins_lck
538 	(p_effective_date	 => p_effective_date,
539 	 p_datetrack_mode	 => l_datetrack_mode,
540 	 p_rec	 		 => p_rec,
541 	 p_validation_start_date => l_validation_start_date,
542 	 p_validation_end_date	 => l_validation_end_date);
543   --
544   -- Call the supporting insert validate operations
545   --
546   ben_cpt_bus.insert_validate
547 	(p_rec			 => p_rec,
548 	 p_effective_date	 => p_effective_date,
549 	 p_datetrack_mode	 => l_datetrack_mode,
550 	 p_validation_start_date => l_validation_start_date,
551 	 p_validation_end_date	 => l_validation_end_date);
552   --
553   -- Call the supporting pre-insert operation
554   --
555   pre_insert
556  	(p_rec			 => p_rec,
557 	 p_effective_date	 => p_effective_date,
558 	 p_datetrack_mode	 => l_datetrack_mode,
559 	 p_validation_start_date => l_validation_start_date,
560 	 p_validation_end_date	 => l_validation_end_date);
561   --
562   -- Insert the row
563   --
564   insert_dml
565  	(p_rec			 => p_rec,
566 	 p_effective_date	 => p_effective_date,
567 	 p_datetrack_mode	 => l_datetrack_mode,
568 	 p_validation_start_date => l_validation_start_date,
569 	 p_validation_end_date	 => l_validation_end_date);
570   --
571   -- Call the supporting post-insert operation
572   --
573   post_insert
574  	(p_rec			 => p_rec,
575 	 p_effective_date	 => p_effective_date,
576 	 p_datetrack_mode	 => l_datetrack_mode,
577 	 p_validation_start_date => l_validation_start_date,
578 	 p_validation_end_date	 => l_validation_end_date);
579 end ins;
580 --
581 -- ----------------------------------------------------------------------------
582 -- |---------------------------------< ins >----------------------------------|
583 -- ----------------------------------------------------------------------------
584 Procedure ins
585   (
586   p_cmbn_ptip_opt_id             out nocopy number,
587   p_effective_start_date         out nocopy date,
588   p_effective_end_date           out nocopy date,
589   p_name                         in varchar2,
590   p_business_group_id            in number,
591   p_cpt_attribute_category       in varchar2         default null,
592   p_cpt_attribute1               in varchar2         default null,
593   p_cpt_attribute2               in varchar2         default null,
594   p_cpt_attribute3               in varchar2         default null,
595   p_cpt_attribute4               in varchar2         default null,
596   p_cpt_attribute5               in varchar2         default null,
597   p_cpt_attribute6               in varchar2         default null,
598   p_cpt_attribute7               in varchar2         default null,
599   p_cpt_attribute8               in varchar2         default null,
600   p_cpt_attribute9               in varchar2         default null,
601   p_cpt_attribute10              in varchar2         default null,
602   p_cpt_attribute11              in varchar2         default null,
603   p_cpt_attribute12              in varchar2         default null,
604   p_cpt_attribute13              in varchar2         default null,
605   p_cpt_attribute14              in varchar2         default null,
606   p_cpt_attribute15              in varchar2         default null,
607   p_cpt_attribute16              in varchar2         default null,
608   p_cpt_attribute17              in varchar2         default null,
609   p_cpt_attribute18              in varchar2         default null,
610   p_cpt_attribute19              in varchar2         default null,
611   p_cpt_attribute20              in varchar2         default null,
612   p_cpt_attribute21              in varchar2         default null,
613   p_cpt_attribute22              in varchar2         default null,
614   p_cpt_attribute23              in varchar2         default null,
615   p_cpt_attribute24              in varchar2         default null,
616   p_cpt_attribute25              in varchar2         default null,
617   p_cpt_attribute26              in varchar2         default null,
618   p_cpt_attribute27              in varchar2         default null,
619   p_cpt_attribute28              in varchar2         default null,
620   p_cpt_attribute29              in varchar2         default null,
621   p_cpt_attribute30              in varchar2         default null,
622   p_object_version_number        out nocopy number,
623   p_ptip_id                      in number,
624   p_pgm_id                       in number,
625   p_opt_id                       in number,
626   p_effective_date		 in date
627   ) is
628 --
629   l_rec		ben_cpt_shd.g_rec_type;
630   l_proc	varchar2(72) := g_package||'ins';
631 --
632 Begin
633   hr_utility.set_location('Entering:'||l_proc, 5);
634   --
635   -- Call conversion function to turn arguments into the
636   -- p_rec structure.
637   --
638   l_rec :=
639   ben_cpt_shd.convert_args
640   (
641   null,
642   null,
643   null,
644   p_name,
645   p_business_group_id,
646   p_cpt_attribute_category,
647   p_cpt_attribute1,
648   p_cpt_attribute2,
649   p_cpt_attribute3,
650   p_cpt_attribute4,
651   p_cpt_attribute5,
652   p_cpt_attribute6,
653   p_cpt_attribute7,
654   p_cpt_attribute8,
655   p_cpt_attribute9,
656   p_cpt_attribute10,
657   p_cpt_attribute11,
658   p_cpt_attribute12,
659   p_cpt_attribute13,
660   p_cpt_attribute14,
661   p_cpt_attribute15,
662   p_cpt_attribute16,
663   p_cpt_attribute17,
664   p_cpt_attribute18,
665   p_cpt_attribute19,
666   p_cpt_attribute20,
667   p_cpt_attribute21,
668   p_cpt_attribute22,
669   p_cpt_attribute23,
670   p_cpt_attribute24,
671   p_cpt_attribute25,
672   p_cpt_attribute26,
673   p_cpt_attribute27,
674   p_cpt_attribute28,
675   p_cpt_attribute29,
676   p_cpt_attribute30,
677   null,
678   p_ptip_id,
679   p_pgm_id,
680   p_opt_id
681   );
682   --
683   -- Having converted the arguments into the ben_cpt_rec
684   -- plsql record structure we call the corresponding record
685   -- business process.
686   --
687   ins(l_rec, p_effective_date);
688   --
689   -- Set the OUT arguments.
690   --
691   p_cmbn_ptip_opt_id        	:= l_rec.cmbn_ptip_opt_id;
692   p_effective_start_date  	:= l_rec.effective_start_date;
693   p_effective_end_date    	:= l_rec.effective_end_date;
694   p_object_version_number 	:= l_rec.object_version_number;
695   --
696   --
697   hr_utility.set_location(' Leaving:'||l_proc, 10);
698 End ins;
699 --
700 end ben_cpt_ins;