DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CCP_INS

Source


1 Package Body ben_ccp_ins as
2 /* $Header: beccprhi.pkb 120.1 2005/11/21 04:51:30 rbingi noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_ccp_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_ccp_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_cvrd_dpnt_ctfn_prvdd_f t
70     where  t.cvrd_dpnt_ctfn_prvdd_id       = p_rec.cvrd_dpnt_ctfn_prvdd_id
71     and    t.effective_start_date =
72              ben_ccp_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_cvrd_dpnt_ctfn_prvdd_f.created_by%TYPE;
77   l_creation_date       ben_cvrd_dpnt_ctfn_prvdd_f.creation_date%TYPE;
78   l_last_update_date   	ben_cvrd_dpnt_ctfn_prvdd_f.last_update_date%TYPE;
79   l_last_updated_by     ben_cvrd_dpnt_ctfn_prvdd_f.last_updated_by%TYPE;
80   l_last_update_login   ben_cvrd_dpnt_ctfn_prvdd_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_cvrd_dpnt_ctfn_prvdd_f',
90 	 p_base_key_column => 'cvrd_dpnt_ctfn_prvdd_id',
91 	 p_base_key_value  => p_rec.cvrd_dpnt_ctfn_prvdd_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_ccp_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_cvrd_dpnt_ctfn_prvdd_f
132   --
133   insert into ben_cvrd_dpnt_ctfn_prvdd_f
134   (	cvrd_dpnt_ctfn_prvdd_id,
135 	effective_start_date,
136 	effective_end_date,
137 	dpnt_dsgn_ctfn_typ_cd,
138 	dpnt_dsgn_ctfn_rqd_flag,
139 	dpnt_dsgn_ctfn_recd_dt,
140 	elig_cvrd_dpnt_id,
141 	prtt_enrt_actn_id,
142 	business_group_id,
143 	ccp_attribute_category,
144 	ccp_attribute1,
145 	ccp_attribute2,
146 	ccp_attribute3,
147 	ccp_attribute4,
148 	ccp_attribute5,
149 	ccp_attribute6,
150 	ccp_attribute7,
151 	ccp_attribute8,
152 	ccp_attribute9,
153 	ccp_attribute10,
154 	ccp_attribute11,
155 	ccp_attribute12,
156 	ccp_attribute13,
157 	ccp_attribute14,
158 	ccp_attribute15,
159 	ccp_attribute16,
160 	ccp_attribute17,
161 	ccp_attribute18,
162 	ccp_attribute19,
163 	ccp_attribute20,
164 	ccp_attribute21,
165 	ccp_attribute22,
166 	ccp_attribute23,
167 	ccp_attribute24,
168 	ccp_attribute25,
169 	ccp_attribute26,
170 	ccp_attribute27,
171 	ccp_attribute28,
172 	ccp_attribute29,
173 	ccp_attribute30,
174 	request_id,
175 	program_application_id,
176 	program_id,
177 	program_update_date,
178 	object_version_number
179    	, created_by,
180    	creation_date,
181    	last_update_date,
182    	last_updated_by,
183    	last_update_login
184   )
185   Values
186   (	p_rec.cvrd_dpnt_ctfn_prvdd_id,
187 	p_rec.effective_start_date,
188 	p_rec.effective_end_date,
189 	p_rec.dpnt_dsgn_ctfn_typ_cd,
190 	p_rec.dpnt_dsgn_ctfn_rqd_flag,
191 	p_rec.dpnt_dsgn_ctfn_recd_dt,
192 	p_rec.elig_cvrd_dpnt_id,
193 	p_rec.prtt_enrt_actn_id,
194 	p_rec.business_group_id,
195 	p_rec.ccp_attribute_category,
196 	p_rec.ccp_attribute1,
197 	p_rec.ccp_attribute2,
198 	p_rec.ccp_attribute3,
199 	p_rec.ccp_attribute4,
200 	p_rec.ccp_attribute5,
201 	p_rec.ccp_attribute6,
202 	p_rec.ccp_attribute7,
203 	p_rec.ccp_attribute8,
204 	p_rec.ccp_attribute9,
205 	p_rec.ccp_attribute10,
206 	p_rec.ccp_attribute11,
207 	p_rec.ccp_attribute12,
208 	p_rec.ccp_attribute13,
209 	p_rec.ccp_attribute14,
210 	p_rec.ccp_attribute15,
211 	p_rec.ccp_attribute16,
212 	p_rec.ccp_attribute17,
213 	p_rec.ccp_attribute18,
214 	p_rec.ccp_attribute19,
215 	p_rec.ccp_attribute20,
216 	p_rec.ccp_attribute21,
217 	p_rec.ccp_attribute22,
218 	p_rec.ccp_attribute23,
219 	p_rec.ccp_attribute24,
220 	p_rec.ccp_attribute25,
221 	p_rec.ccp_attribute26,
222 	p_rec.ccp_attribute27,
223 	p_rec.ccp_attribute28,
224 	p_rec.ccp_attribute29,
225 	p_rec.ccp_attribute30,
226 	p_rec.request_id,
227 	p_rec.program_application_id,
228 	p_rec.program_id,
229 	p_rec.program_update_date,
230 	p_rec.object_version_number
231 	, l_created_by,
232    	l_creation_date,
233    	l_last_update_date,
234    	l_last_updated_by,
235    	l_last_update_login
236   );
237   --
238   ben_ccp_shd.g_api_dml := false;   -- Unset the api dml status
239   hr_utility.set_location(' Leaving:'||l_proc, 15);
240 --
241 Exception
242   When hr_api.check_integrity_violated Then
243     -- A check constraint has been violated
244     ben_ccp_shd.g_api_dml := false;   -- Unset the api dml status
245     ben_ccp_shd.constraint_error
246       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
247   When hr_api.unique_integrity_violated Then
248     -- Unique integrity has been violated
249     ben_ccp_shd.g_api_dml := false;   -- Unset the api dml status
250     ben_ccp_shd.constraint_error
251       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
252   When Others Then
253     ben_ccp_shd.g_api_dml := false;   -- Unset the api dml status
254     Raise;
255 End dt_insert_dml;
256 --
257 -- ----------------------------------------------------------------------------
258 -- |------------------------------< insert_dml >------------------------------|
259 -- ----------------------------------------------------------------------------
260 Procedure insert_dml
261 	(p_rec 			 in out nocopy ben_ccp_shd.g_rec_type,
262 	 p_effective_date	 in	date,
263 	 p_datetrack_mode	 in	varchar2,
264 	 p_validation_start_date in	date,
265 	 p_validation_end_date	 in	date) is
266 --
267   l_proc	varchar2(72) := g_package||'insert_dml';
268 --
269 Begin
270   hr_utility.set_location('Entering:'||l_proc, 5);
271   --
272   dt_insert_dml(p_rec			=> p_rec,
273 		p_effective_date	=> p_effective_date,
274 		p_datetrack_mode	=> p_datetrack_mode,
275        		p_validation_start_date	=> p_validation_start_date,
276 		p_validation_end_date	=> p_validation_end_date);
277   --
278   hr_utility.set_location(' Leaving:'||l_proc, 10);
279 End insert_dml;
280 --
281 -- ----------------------------------------------------------------------------
282 -- |------------------------------< pre_insert >------------------------------|
283 -- ----------------------------------------------------------------------------
284 -- {Start Of Comments}
285 --
286 -- Description:
287 --   This private procedure contains any processing which is required before
288 --   the insert dml. Presently, if the entity has a corresponding primary
289 --   key which is maintained by an associating sequence, the primary key for
290 --   the entity will be populated with the next sequence value in
291 --   preparation for the insert dml.
292 --   Also, if comments are defined for this entity, the comments insert
293 --   logic will also be called, generating a comment_id if required.
294 --
295 -- Prerequisites:
296 --   This is an internal procedure which is called from the ins procedure.
297 --
298 -- In Parameters:
299 --   A Pl/Sql record structre.
300 --
301 -- Post Success:
302 --   Processing continues.
303 --
304 -- Post Failure:
305 --   If an error has occurred, an error message and exception will be raised
306 --   but not handled.
307 --
308 -- Developer Implementation Notes:
309 --   Any pre-processing required before the insert dml is issued should be
310 --   coded within this procedure. As stated above, a good example is the
311 --   generation of a primary key number via a corresponding sequence.
312 --   It is important to note that any 3rd party maintenance should be reviewed
313 --   before placing in this procedure.
314 --
315 -- Access Status:
316 --   Internal Row Handler Use Only.
317 --
318 -- {End Of Comments}
319 -- ----------------------------------------------------------------------------
320 Procedure pre_insert
321 	(p_rec  			in out nocopy ben_ccp_shd.g_rec_type,
322 	 p_effective_date		in date,
323 	 p_datetrack_mode		in varchar2,
324 	 p_validation_start_date	in date,
325 	 p_validation_end_date		in date) is
326 --
327   l_proc	varchar2(72) := g_package||'pre_insert';
328 --
329 --
330   cursor c1 is
331     select ben_cvrd_dpnt_ctfn_prvdd_f_s.nextval
332     from sys.dual;
333 --
334 --
335 --
336 Begin
337   hr_utility.set_location('Entering:'||l_proc, 5);
338   --
339   --
340   --
341   open c1;
342   fetch c1 into p_rec.cvrd_dpnt_ctfn_prvdd_id;
343   close c1;
344   --
345   --
346   hr_utility.set_location(' Leaving:'||l_proc, 10);
347 End pre_insert;
348 --
349 -- ----------------------------------------------------------------------------
350 -- |-----------------------------< post_insert >------------------------------|
351 -- ----------------------------------------------------------------------------
352 -- {Start Of Comments}
353 --
354 -- Description:
355 --   This private procedure contains any processing which is required after the
356 --   insert dml.
357 --
358 -- Prerequisites:
359 --   This is an internal procedure which is called from the ins procedure.
360 --
361 -- In Parameters:
362 --   A Pl/Sql record structre.
363 --
364 -- Post Success:
365 --   Processing continues.
366 --
367 -- Post Failure:
368 --   If an error has occurred, an error message and exception will be raised
369 --   but not handled.
370 --
371 -- Developer Implementation Notes:
372 --   Any post-processing required after the insert dml is issued should be
373 --   coded within this procedure. It is important to note that any 3rd party
374 --   maintenance should be reviewed before placing in this procedure.
375 --
376 -- Access Status:
377 --   Internal Row Handler Use Only.
378 --
379 -- {End Of Comments}
380 -- ----------------------------------------------------------------------------
381 Procedure post_insert
382 	(p_rec 			 in ben_ccp_shd.g_rec_type,
383 	 p_effective_date	 in date,
384 	 p_datetrack_mode	 in varchar2,
385 	 p_validation_start_date in date,
386 	 p_validation_end_date	 in date) is
387 --
388   l_proc	varchar2(72) := g_package||'post_insert';
389 --
390 Begin
391   hr_utility.set_location('Entering:'||l_proc, 5);
392 --
393   --
394   -- Start of API User Hook for post_insert.
395   --
396   begin
397     --
398     ben_ccp_rki.after_insert
399       (
400   p_cvrd_dpnt_ctfn_prvdd_id       =>p_rec.cvrd_dpnt_ctfn_prvdd_id
401  ,p_effective_start_date          =>p_rec.effective_start_date
402  ,p_effective_end_date            =>p_rec.effective_end_date
403  ,p_dpnt_dsgn_ctfn_typ_cd         =>p_rec.dpnt_dsgn_ctfn_typ_cd
404  ,p_dpnt_dsgn_ctfn_rqd_flag       =>p_rec.dpnt_dsgn_ctfn_rqd_flag
405  ,p_dpnt_dsgn_ctfn_recd_dt        =>p_rec.dpnt_dsgn_ctfn_recd_dt
406  ,p_elig_cvrd_dpnt_id             =>p_rec.elig_cvrd_dpnt_id
407  ,p_prtt_enrt_actn_id             =>p_rec.prtt_enrt_actn_id
408  ,p_business_group_id             =>p_rec.business_group_id
409  ,p_ccp_attribute_category        =>p_rec.ccp_attribute_category
410  ,p_ccp_attribute1                =>p_rec.ccp_attribute1
411  ,p_ccp_attribute2                =>p_rec.ccp_attribute2
412  ,p_ccp_attribute3                =>p_rec.ccp_attribute3
413  ,p_ccp_attribute4                =>p_rec.ccp_attribute4
414  ,p_ccp_attribute5                =>p_rec.ccp_attribute5
415  ,p_ccp_attribute6                =>p_rec.ccp_attribute6
416  ,p_ccp_attribute7                =>p_rec.ccp_attribute7
417  ,p_ccp_attribute8                =>p_rec.ccp_attribute8
418  ,p_ccp_attribute9                =>p_rec.ccp_attribute9
419  ,p_ccp_attribute10               =>p_rec.ccp_attribute10
420  ,p_ccp_attribute11               =>p_rec.ccp_attribute11
421  ,p_ccp_attribute12               =>p_rec.ccp_attribute12
422  ,p_ccp_attribute13               =>p_rec.ccp_attribute13
423  ,p_ccp_attribute14               =>p_rec.ccp_attribute14
424  ,p_ccp_attribute15               =>p_rec.ccp_attribute15
425  ,p_ccp_attribute16               =>p_rec.ccp_attribute16
426  ,p_ccp_attribute17               =>p_rec.ccp_attribute17
427  ,p_ccp_attribute18               =>p_rec.ccp_attribute18
428  ,p_ccp_attribute19               =>p_rec.ccp_attribute19
429  ,p_ccp_attribute20               =>p_rec.ccp_attribute20
430  ,p_ccp_attribute21               =>p_rec.ccp_attribute21
431  ,p_ccp_attribute22               =>p_rec.ccp_attribute22
432  ,p_ccp_attribute23               =>p_rec.ccp_attribute23
433  ,p_ccp_attribute24               =>p_rec.ccp_attribute24
434  ,p_ccp_attribute25               =>p_rec.ccp_attribute25
435  ,p_ccp_attribute26               =>p_rec.ccp_attribute26
436  ,p_ccp_attribute27               =>p_rec.ccp_attribute27
437  ,p_ccp_attribute28               =>p_rec.ccp_attribute28
438  ,p_ccp_attribute29               =>p_rec.ccp_attribute29
439  ,p_ccp_attribute30               =>p_rec.ccp_attribute30
440  ,p_request_id                    =>p_rec.request_id
441  ,p_program_application_id        =>p_rec.program_application_id
442  ,p_program_id                    =>p_rec.program_id
443  ,p_program_update_date           =>p_rec.program_update_date
444  ,p_object_version_number         =>p_rec.object_version_number
445  ,p_effective_date                =>p_effective_date
446  ,p_validation_start_date         =>p_validation_start_date
447  ,p_validation_end_date           =>p_validation_end_date
448       );
449     --
450   exception
451     --
452     when hr_api.cannot_find_prog_unit then
453       --
454       hr_api.cannot_find_prog_unit_error
455         (p_module_name => 'ben_cvrd_dpnt_ctfn_prvdd_f'
456         ,p_hook_type   => 'AI');
457       --
458   end;
459   --
460   -- End of API User Hook for post_insert.
461   --
462   --
463   hr_utility.set_location(' Leaving:'||l_proc, 10);
464 End post_insert;
465 --
466 -- ----------------------------------------------------------------------------
467 -- |-------------------------------< ins_lck >--------------------------------|
468 -- ----------------------------------------------------------------------------
469 -- {Start Of Comments}
470 --
471 -- Description:
472 --   The ins_lck process has one main function to perform. When inserting
473 --   a datetracked row, we must validate the DT mode.
474 --   be manipulated.
475 --
476 -- Prerequisites:
477 --   This procedure can only be called for the datetrack mode of INSERT.
478 --
479 -- In Parameters:
480 --
481 -- Post Success:
482 --   On successful completion of the ins_lck process the parental
483 --   datetracked rows will be locked providing the p_enforce_foreign_locking
484 --   argument value is TRUE.
485 --   If the p_enforce_foreign_locking argument value is FALSE then the
486 --   parential rows are not locked.
487 --
488 -- Post Failure:
489 --   The Lck process can fail for:
490 --   1) When attempting to lock the row the row could already be locked by
491 --      another user. This will raise the HR_Api.Object_Locked exception.
492 --   2) When attempting to the lock the parent which doesn't exist.
493 --      For the entity to be locked the parent must exist!
494 --
495 -- Developer Implementation Notes:
496 --   None.
497 --
498 -- Access Status:
499 --   Internal Row Handler Use Only.
500 --
501 -- {End Of Comments}
502 -- ----------------------------------------------------------------------------
503 Procedure ins_lck
504 	(p_effective_date	 in  date,
505 	 p_datetrack_mode	 in  varchar2,
506 	 p_rec	 		 in  ben_ccp_shd.g_rec_type,
507 	 p_validation_start_date out nocopy date,
508 	 p_validation_end_date	 out nocopy date) is
509 --
510   l_proc		  varchar2(72) := g_package||'ins_lck';
511   l_validation_start_date date;
512   l_validation_end_date	  date;
513 --
514 Begin
515   hr_utility.set_location('Entering:'||l_proc, 5);
516   --
517   -- Validate the datetrack mode mode getting the validation start
518   -- and end dates for the specified datetrack operation.
519   --
520   dt_api.validate_dt_mode
521 	(p_effective_date	   => p_effective_date,
522 	 p_datetrack_mode	   => p_datetrack_mode,
523 	 p_base_table_name	   => 'ben_cvrd_dpnt_ctfn_prvdd_f',
524 	 p_base_key_column	   => 'cvrd_dpnt_ctfn_prvdd_id',
525 	 p_base_key_value 	   => p_rec.cvrd_dpnt_ctfn_prvdd_id,
526 	 p_parent_table_name1      => 'ben_elig_cvrd_dpnt_f',
527 	 p_parent_key_column1      => 'elig_cvrd_dpnt_id',
528 	 p_parent_key_value1       => p_rec.elig_cvrd_dpnt_id,
529 	 p_parent_table_name2      => 'ben_prtt_enrt_actn_f',
530 	 p_parent_key_column2      => 'prtt_enrt_actn_id',
531 	 p_parent_key_value2       => p_rec.prtt_enrt_actn_id,
532          p_enforce_foreign_locking => false,
533 	 p_validation_start_date   => l_validation_start_date,
534  	 p_validation_end_date	   => l_validation_end_date);
535   --
536   -- Set the validation start and end date OUT arguments
537   --
538   p_validation_start_date := l_validation_start_date;
539   p_validation_end_date   := l_validation_end_date;
540   --
541   hr_utility.set_location(' Leaving:'||l_proc, 10);
542 --
543 End ins_lck;
544 --
545 -- ----------------------------------------------------------------------------
546 -- |---------------------------------< ins >----------------------------------|
547 -- ----------------------------------------------------------------------------
548 Procedure ins
549   (
550   p_rec		   in out nocopy ben_ccp_shd.g_rec_type,
551   p_effective_date in     date
552   ) is
553 --
554   l_proc			varchar2(72) := g_package||'ins';
555   l_datetrack_mode		varchar2(30) := 'INSERT';
556   l_validation_start_date	date;
557   l_validation_end_date		date;
558 --
559 Begin
560   hr_utility.set_location('Entering:'||l_proc, 5);
561   --
562   -- Call the lock operation
563   --
564   ins_lck
565 	(p_effective_date	 => p_effective_date,
566 	 p_datetrack_mode	 => l_datetrack_mode,
567 	 p_rec	 		 => p_rec,
568 	 p_validation_start_date => l_validation_start_date,
569 	 p_validation_end_date	 => l_validation_end_date);
570   --
571   -- Call the supporting insert validate operations
572   --
573   ben_ccp_bus.insert_validate
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   --
580   -- Call the supporting pre-insert operation
581   --
582   pre_insert
583  	(p_rec			 => p_rec,
584 	 p_effective_date	 => p_effective_date,
585 	 p_datetrack_mode	 => l_datetrack_mode,
586 	 p_validation_start_date => l_validation_start_date,
587 	 p_validation_end_date	 => l_validation_end_date);
588   --
589   -- Insert the row
590   --
591   insert_dml
592  	(p_rec			 => p_rec,
593 	 p_effective_date	 => p_effective_date,
594 	 p_datetrack_mode	 => l_datetrack_mode,
595 	 p_validation_start_date => l_validation_start_date,
596 	 p_validation_end_date	 => l_validation_end_date);
597   --
598   -- Call the supporting post-insert operation
599   --
600   post_insert
601  	(p_rec			 => p_rec,
602 	 p_effective_date	 => p_effective_date,
603 	 p_datetrack_mode	 => l_datetrack_mode,
604 	 p_validation_start_date => l_validation_start_date,
605 	 p_validation_end_date	 => l_validation_end_date);
606 end ins;
607 --
608 -- ----------------------------------------------------------------------------
609 -- |---------------------------------< ins >----------------------------------|
610 -- ----------------------------------------------------------------------------
611 Procedure ins
612   (
613   p_cvrd_dpnt_ctfn_prvdd_id      out nocopy number,
614   p_effective_start_date         out nocopy date,
615   p_effective_end_date           out nocopy date,
616   p_dpnt_dsgn_ctfn_typ_cd        in varchar2,
617   p_dpnt_dsgn_ctfn_rqd_flag      in varchar2,
618   p_dpnt_dsgn_ctfn_recd_dt       in date             default null,
619   p_elig_cvrd_dpnt_id            in number,
620   p_prtt_enrt_actn_id            in number,
621   p_business_group_id            in number,
622   p_ccp_attribute_category       in varchar2         default null,
623   p_ccp_attribute1               in varchar2         default null,
624   p_ccp_attribute2               in varchar2         default null,
625   p_ccp_attribute3               in varchar2         default null,
626   p_ccp_attribute4               in varchar2         default null,
627   p_ccp_attribute5               in varchar2         default null,
628   p_ccp_attribute6               in varchar2         default null,
629   p_ccp_attribute7               in varchar2         default null,
630   p_ccp_attribute8               in varchar2         default null,
631   p_ccp_attribute9               in varchar2         default null,
632   p_ccp_attribute10              in varchar2         default null,
633   p_ccp_attribute11              in varchar2         default null,
634   p_ccp_attribute12              in varchar2         default null,
635   p_ccp_attribute13              in varchar2         default null,
636   p_ccp_attribute14              in varchar2         default null,
637   p_ccp_attribute15              in varchar2         default null,
638   p_ccp_attribute16              in varchar2         default null,
639   p_ccp_attribute17              in varchar2         default null,
640   p_ccp_attribute18              in varchar2         default null,
641   p_ccp_attribute19              in varchar2         default null,
642   p_ccp_attribute20              in varchar2         default null,
643   p_ccp_attribute21              in varchar2         default null,
644   p_ccp_attribute22              in varchar2         default null,
645   p_ccp_attribute23              in varchar2         default null,
646   p_ccp_attribute24              in varchar2         default null,
647   p_ccp_attribute25              in varchar2         default null,
648   p_ccp_attribute26              in varchar2         default null,
649   p_ccp_attribute27              in varchar2         default null,
650   p_ccp_attribute28              in varchar2         default null,
651   p_ccp_attribute29              in varchar2         default null,
652   p_ccp_attribute30              in varchar2         default null,
653   p_request_id                   in number           default null,
654   p_program_application_id       in number           default null,
655   p_program_id                   in number           default null,
656   p_program_update_date          in date             default null,
657   p_object_version_number        out nocopy number,
658   p_effective_date		 in date
659   ) is
660 --
661   l_rec		ben_ccp_shd.g_rec_type;
662   l_proc	varchar2(72) := g_package||'ins';
663 --
664 Begin
665   hr_utility.set_location('Entering:'||l_proc, 5);
666   --
667   -- Call conversion function to turn arguments into the
668   -- p_rec structure.
669   --
670   l_rec :=
671   ben_ccp_shd.convert_args
672   (
673   null,
674   null,
675   null,
676   p_dpnt_dsgn_ctfn_typ_cd,
677   p_dpnt_dsgn_ctfn_rqd_flag,
678   p_dpnt_dsgn_ctfn_recd_dt,
679   p_elig_cvrd_dpnt_id,
680   p_prtt_enrt_actn_id,
681   p_business_group_id,
682   p_ccp_attribute_category,
683   p_ccp_attribute1,
684   p_ccp_attribute2,
685   p_ccp_attribute3,
686   p_ccp_attribute4,
687   p_ccp_attribute5,
688   p_ccp_attribute6,
689   p_ccp_attribute7,
690   p_ccp_attribute8,
691   p_ccp_attribute9,
692   p_ccp_attribute10,
693   p_ccp_attribute11,
694   p_ccp_attribute12,
695   p_ccp_attribute13,
696   p_ccp_attribute14,
697   p_ccp_attribute15,
698   p_ccp_attribute16,
699   p_ccp_attribute17,
700   p_ccp_attribute18,
701   p_ccp_attribute19,
702   p_ccp_attribute20,
703   p_ccp_attribute21,
704   p_ccp_attribute22,
705   p_ccp_attribute23,
706   p_ccp_attribute24,
707   p_ccp_attribute25,
708   p_ccp_attribute26,
709   p_ccp_attribute27,
710   p_ccp_attribute28,
711   p_ccp_attribute29,
712   p_ccp_attribute30,
713   p_request_id,
714   p_program_application_id,
715   p_program_id,
716   p_program_update_date,
717   null
718   );
719   --
720   -- Having converted the arguments into the ben_ccp_rec
721   -- plsql record structure we call the corresponding record
722   -- business process.
723   --
724   ins(l_rec, p_effective_date);
725   --
726   -- Set the OUT arguments.
727   --
728   p_cvrd_dpnt_ctfn_prvdd_id        	:= l_rec.cvrd_dpnt_ctfn_prvdd_id;
729   p_effective_start_date  	:= l_rec.effective_start_date;
730   p_effective_end_date    	:= l_rec.effective_end_date;
731   p_object_version_number 	:= l_rec.object_version_number;
732   --
733   --
734   hr_utility.set_location(' Leaving:'||l_proc, 10);
735 End ins;
736 --
737 end ben_ccp_ins;
738