DBA Data[Home] [Help]
Skip to content

PACKAGE BODY: APPS.BEN_CCT_INS

Source


1 Package Body ben_cct_ins as
2 /* $Header: becctrhi.pkb 120.0.12020000.4 2012/07/03 11:57:28 amnaraya ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_cct_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_cct_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_cm_typ_f t
70     where  t.cm_typ_id       = p_rec.cm_typ_id
71     and    t.effective_start_date =
72              ben_cct_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_cm_typ_f.created_by%TYPE;
77   l_creation_date       ben_cm_typ_f.creation_date%TYPE;
78   l_last_update_date   	ben_cm_typ_f.last_update_date%TYPE;
79   l_last_updated_by     ben_cm_typ_f.last_updated_by%TYPE;
80   l_last_update_login   ben_cm_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_cm_typ_f',
90 	 p_base_key_column => 'cm_typ_id',
91 	 p_base_key_value  => p_rec.cm_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       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_cct_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_cm_typ_f
132   --
133   insert into ben_cm_typ_f
134   (	cm_typ_id,
135 	effective_start_date,
136 	effective_end_date,
137 	name,
138 	desc_txt,
139 	inactive_flag,
140 	cm_typ_rl,
141 	cm_usg_cd,
142 	whnvr_trgrd_flag,
143 	shrt_name,
144 	pc_kit_cd,
145 	trk_mlg_flag,
146 	mx_num_avlbl_val,
147 	to_be_sent_dt_cd,
148 	to_be_sent_dt_rl,
149 	inspn_rqd_flag,
150 	inspn_rqd_rl,
151 	rcpent_cd,
152 	parnt_cm_typ_id,
153 	business_group_id,
154 	cct_attribute_category,
155 	cct_attribute1,
156 	cct_attribute10,
157 	cct_attribute11,
158 	cct_attribute12,
159 	cct_attribute13,
160 	cct_attribute14,
161 	cct_attribute15,
162 	cct_attribute16,
163 	cct_attribute17,
164 	cct_attribute18,
165 	cct_attribute19,
166 	cct_attribute2,
167 	cct_attribute20,
168 	cct_attribute21,
169 	cct_attribute22,
170 	cct_attribute23,
171 	cct_attribute24,
172 	cct_attribute25,
173 	cct_attribute26,
174 	cct_attribute27,
175 	cct_attribute28,
176 	cct_attribute29,
177 	cct_attribute3,
178 	cct_attribute30,
179 	cct_attribute4,
180 	cct_attribute5,
181 	cct_attribute6,
182 	cct_attribute7,
183 	cct_attribute8,
184 	cct_attribute9,
185 	object_version_number
186    	, created_by,
187    	creation_date,
188    	last_update_date,
189    	last_updated_by,
190    	last_update_login
191   )
192   Values
193   (	p_rec.cm_typ_id,
194 	p_rec.effective_start_date,
195 	p_rec.effective_end_date,
196 	p_rec.name,
197 	p_rec.desc_txt,
198 	p_rec.inactive_flag,
199 	p_rec.cm_typ_rl,
200 	p_rec.cm_usg_cd,
201 	p_rec.whnvr_trgrd_flag,
202 	p_rec.shrt_name,
203 	p_rec.pc_kit_cd,
204 	p_rec.trk_mlg_flag,
205 	p_rec.mx_num_avlbl_val,
206 	p_rec.to_be_sent_dt_cd,
207 	p_rec.to_be_sent_dt_rl,
208 	p_rec.inspn_rqd_flag,
209 	p_rec.inspn_rqd_rl,
210 	p_rec.rcpent_cd,
211 	p_rec.parnt_cm_typ_id,
212 	p_rec.business_group_id,
213 	p_rec.cct_attribute_category,
214 	p_rec.cct_attribute1,
215 	p_rec.cct_attribute10,
216 	p_rec.cct_attribute11,
217 	p_rec.cct_attribute12,
218 	p_rec.cct_attribute13,
219 	p_rec.cct_attribute14,
220 	p_rec.cct_attribute15,
221 	p_rec.cct_attribute16,
222 	p_rec.cct_attribute17,
223 	p_rec.cct_attribute18,
224 	p_rec.cct_attribute19,
225 	p_rec.cct_attribute2,
226 	p_rec.cct_attribute20,
227 	p_rec.cct_attribute21,
228 	p_rec.cct_attribute22,
229 	p_rec.cct_attribute23,
230 	p_rec.cct_attribute24,
231 	p_rec.cct_attribute25,
232 	p_rec.cct_attribute26,
233 	p_rec.cct_attribute27,
234 	p_rec.cct_attribute28,
235 	p_rec.cct_attribute29,
236 	p_rec.cct_attribute3,
237 	p_rec.cct_attribute30,
238 	p_rec.cct_attribute4,
239 	p_rec.cct_attribute5,
240 	p_rec.cct_attribute6,
241 	p_rec.cct_attribute7,
242 	p_rec.cct_attribute8,
243 	p_rec.cct_attribute9,
244 	p_rec.object_version_number
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   --  Insert into MLS table.
253   --
254     insert into ben_cm_typ_f_tl (
255     cm_typ_id,
256     effective_start_date,
257     effective_end_date,
258     shrt_name,
259     name,
260     language,
261     source_lang,
262     last_update_date,
263     last_updated_by,
264     last_update_login,
265     created_by,
266     creation_date
267   )
268   select
269     p_rec.cm_typ_id,
270     p_rec.effective_start_date,
271     p_rec.effective_end_date,
272     p_rec.shrt_name,
273     p_rec.name,
274     l.language_code,
275     userenv('LANG'),
276     l_last_update_date,
277     l_last_updated_by,
278     l_last_update_login,
279     fnd_global.user_id,
280     sysdate
281   from fnd_languages l
282   where l.installed_flag in ('I', 'B')
283   and not exists
284     (select null
285     from ben_cm_typ_f_tl t
286     where t.cm_typ_id = p_rec.cm_typ_id
287     and   t.effective_start_date = p_rec.effective_start_date
288     and   t.language = l.language_code);
289   --
290   ben_cct_shd.g_api_dml := false;   -- Unset the api dml status
291   hr_utility.set_location(' Leaving:'||l_proc, 15);
292 --
293 Exception
294   When hr_api.check_integrity_violated Then
295     -- A check constraint has been violated
296     ben_cct_shd.g_api_dml := false;   -- Unset the api dml status
297     ben_cct_shd.constraint_error
298       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
299   When hr_api.unique_integrity_violated Then
300     -- Unique integrity has been violated
301     ben_cct_shd.g_api_dml := false;   -- Unset the api dml status
302     ben_cct_shd.constraint_error
303       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
304   When Others Then
305     ben_cct_shd.g_api_dml := false;   -- Unset the api dml status
306     Raise;
307 End dt_insert_dml;
308 --
309 -- ----------------------------------------------------------------------------
310 -- |------------------------------< insert_dml >------------------------------|
311 -- ----------------------------------------------------------------------------
312 Procedure insert_dml
313 	(p_rec 			 in out nocopy ben_cct_shd.g_rec_type,
314 	 p_effective_date	 in	date,
315 	 p_datetrack_mode	 in	varchar2,
316 	 p_validation_start_date in	date,
317 	 p_validation_end_date	 in	date) is
318 --
319   l_proc	varchar2(72) := g_package||'insert_dml';
320 --
321 Begin
322   hr_utility.set_location('Entering:'||l_proc, 5);
323   --
324   dt_insert_dml(p_rec			=> p_rec,
325 		p_effective_date	=> p_effective_date,
326 		p_datetrack_mode	=> p_datetrack_mode,
327        		p_validation_start_date	=> p_validation_start_date,
328 		p_validation_end_date	=> p_validation_end_date);
329   --
330   hr_utility.set_location(' Leaving:'||l_proc, 10);
331 End insert_dml;
332 --
333 -- ----------------------------------------------------------------------------
334 -- |------------------------------< pre_insert >------------------------------|
335 -- ----------------------------------------------------------------------------
336 -- {Start Of Comments}
337 --
338 -- Description:
339 --   This private procedure contains any processing which is required before
340 --   the insert dml. Presently, if the entity has a corresponding primary
341 --   key which is maintained by an associating sequence, the primary key for
342 --   the entity will be populated with the next sequence value in
343 --   preparation for the insert dml.
344 --   Also, if comments are defined for this entity, the comments insert
345 --   logic will also be called, generating a comment_id if required.
346 --
347 -- Prerequisites:
348 --   This is an internal procedure which is called from the ins procedure.
349 --
350 -- In Parameters:
351 --   A Pl/Sql record structre.
352 --
353 -- Post Success:
354 --   Processing continues.
355 --
356 -- Post Failure:
357 --   If an error has occurred, an error message and exception will be raised
358 --   but not handled.
359 --
360 -- Developer Implementation Notes:
361 --   Any pre-processing required before the insert dml is issued should be
362 --   coded within this procedure. As stated above, a good example is the
363 --   generation of a primary key number via a corresponding sequence.
364 --   It is important to note that any 3rd party maintenance should be reviewed
365 --   before placing in this procedure.
366 --
367 -- Access Status:
368 --   Internal Row Handler Use Only.
369 --
370 -- {End Of Comments}
371 -- ----------------------------------------------------------------------------
372 Procedure pre_insert
373 	(p_rec  			in out nocopy ben_cct_shd.g_rec_type,
374 	 p_effective_date		in date,
375 	 p_datetrack_mode		in varchar2,
376 	 p_validation_start_date	in date,
377 	 p_validation_end_date		in date) is
378 --
379   l_proc	varchar2(72) := g_package||'pre_insert';
380 --
381   Cursor C_Sel1 is select ben_cm_typ_s.nextval from sys.dual;
382 --
383 Begin
384   hr_utility.set_location('Entering:'||l_proc, 5);
385   --
386   --
387   -- Select the next sequence number
388   --
389   Open C_Sel1;
390   Fetch C_Sel1 Into p_rec.cm_typ_id;
391   Close C_Sel1;
392   --
393   --
394   hr_utility.set_location(' Leaving:'||l_proc, 10);
395 End pre_insert;
396 --
397 -- ----------------------------------------------------------------------------
398 -- |-----------------------------< post_insert >------------------------------|
399 -- ----------------------------------------------------------------------------
400 -- {Start Of Comments}
401 --
402 -- Description:
403 --   This private procedure contains any processing which is required after the
404 --   insert dml.
405 --
406 -- Prerequisites:
407 --   This is an internal procedure which is called from the ins procedure.
408 --
409 -- In Parameters:
410 --   A Pl/Sql record structre.
411 --
412 -- Post Success:
413 --   Processing continues.
414 --
415 -- Post Failure:
416 --   If an error has occurred, an error message and exception will be raised
417 --   but not handled.
418 --
419 -- Developer Implementation Notes:
420 --   Any post-processing required after the insert dml is issued should be
421 --   coded within this procedure. It is important to note that any 3rd party
422 --   maintenance should be reviewed before placing in this procedure.
423 --
424 -- Access Status:
425 --   Internal Row Handler Use Only.
426 --
427 -- {End Of Comments}
428 -- ----------------------------------------------------------------------------
429 Procedure post_insert
430 	(p_rec 			 in ben_cct_shd.g_rec_type,
431 	 p_effective_date	 in date,
432 	 p_datetrack_mode	 in varchar2,
433 	 p_validation_start_date in date,
434 	 p_validation_end_date	 in date) is
435 --
436   l_proc	varchar2(72) := g_package||'post_insert';
437 --
438 Begin
439   hr_utility.set_location('Entering:'||l_proc, 5);
440 --
441   --
442   -- Start of API User Hook for post_insert.
443   --
444   begin
445     --
446     ben_cct_rki.after_insert
447       (p_cm_typ_id                     =>p_rec.cm_typ_id
448       ,p_effective_start_date          =>p_rec.effective_start_date
449       ,p_effective_end_date            =>p_rec.effective_end_date
450       ,p_name                          =>p_rec.name
451       ,p_desc_txt                      =>p_rec.desc_txt
452       ,p_inactive_flag                    =>p_rec.inactive_flag
453       ,p_cm_typ_rl                     =>p_rec.cm_typ_rl
454       ,p_cm_usg_cd                     =>p_rec.cm_usg_cd
455       ,p_whnvr_trgrd_flag              =>p_rec.whnvr_trgrd_flag
456       ,p_shrt_name                     =>p_rec.shrt_name
457       ,p_pc_kit_cd                     =>p_rec.pc_kit_cd
458       ,p_trk_mlg_flag                  =>p_rec.trk_mlg_flag
459       ,p_mx_num_avlbl_val              =>p_rec.mx_num_avlbl_val
460       ,p_to_be_sent_dt_cd              =>p_rec.to_be_sent_dt_cd
461       ,p_to_be_sent_dt_rl              =>p_rec.to_be_sent_dt_rl
462       ,p_inspn_rqd_flag                =>p_rec.inspn_rqd_flag
463       ,p_inspn_rqd_rl                  =>p_rec.inspn_rqd_rl
464       ,p_rcpent_cd                     =>p_rec.rcpent_cd
465       ,p_parnt_cm_typ_id               =>p_rec.parnt_cm_typ_id
466       ,p_business_group_id             =>p_rec.business_group_id
467       ,p_cct_attribute_category        =>p_rec.cct_attribute_category
468       ,p_cct_attribute1                =>p_rec.cct_attribute1
469       ,p_cct_attribute10               =>p_rec.cct_attribute10
470       ,p_cct_attribute11               =>p_rec.cct_attribute11
471       ,p_cct_attribute12               =>p_rec.cct_attribute12
472       ,p_cct_attribute13               =>p_rec.cct_attribute13
473       ,p_cct_attribute14               =>p_rec.cct_attribute14
474       ,p_cct_attribute15               =>p_rec.cct_attribute15
475       ,p_cct_attribute16               =>p_rec.cct_attribute16
476       ,p_cct_attribute17               =>p_rec.cct_attribute17
477       ,p_cct_attribute18               =>p_rec.cct_attribute18
478       ,p_cct_attribute19               =>p_rec.cct_attribute19
479       ,p_cct_attribute2                =>p_rec.cct_attribute2
480       ,p_cct_attribute20               =>p_rec.cct_attribute20
481       ,p_cct_attribute21               =>p_rec.cct_attribute21
482       ,p_cct_attribute22               =>p_rec.cct_attribute22
483       ,p_cct_attribute23               =>p_rec.cct_attribute23
484       ,p_cct_attribute24               =>p_rec.cct_attribute24
485       ,p_cct_attribute25               =>p_rec.cct_attribute25
486       ,p_cct_attribute26               =>p_rec.cct_attribute26
487       ,p_cct_attribute27               =>p_rec.cct_attribute27
488       ,p_cct_attribute28               =>p_rec.cct_attribute28
489       ,p_cct_attribute29               =>p_rec.cct_attribute29
490       ,p_cct_attribute3                =>p_rec.cct_attribute3
491       ,p_cct_attribute30               =>p_rec.cct_attribute30
492       ,p_cct_attribute4                =>p_rec.cct_attribute4
493       ,p_cct_attribute5                =>p_rec.cct_attribute5
494       ,p_cct_attribute6                =>p_rec.cct_attribute6
495       ,p_cct_attribute7                =>p_rec.cct_attribute7
496       ,p_cct_attribute8                =>p_rec.cct_attribute8
497       ,p_cct_attribute9                =>p_rec.cct_attribute9
498       ,p_object_version_number         =>p_rec.object_version_number
499       ,p_effective_date                =>p_effective_date
500       ,p_validation_start_date         =>p_validation_start_date
501       ,p_validation_end_date           =>p_validation_end_date);
502     --
503   exception
504     --
505     when hr_api.cannot_find_prog_unit then
506       --
507       hr_api.cannot_find_prog_unit_error
508         (p_module_name => 'ben_cm_typ_f'
509         ,p_hook_type   => 'AI');
510       --
511   end;
512   --
513   -- End of API User Hook for post_insert.
514   --
515   --
516   hr_utility.set_location(' Leaving:'||l_proc, 10);
517 End post_insert;
518 --
519 -- ----------------------------------------------------------------------------
520 -- |-------------------------------< ins_lck >--------------------------------|
521 -- ----------------------------------------------------------------------------
522 -- {Start Of Comments}
523 --
524 -- Description:
525 --   The ins_lck process has one main function to perform. When inserting
526 --   a datetracked row, we must validate the DT mode.
527 --   be manipulated.
528 --
529 -- Prerequisites:
530 --   This procedure can only be called for the datetrack mode of INSERT.
531 --
532 -- In Parameters:
533 --
534 -- Post Success:
535 --   On successful completion of the ins_lck process the parental
536 --   datetracked rows will be locked providing the p_enforce_foreign_locking
537 --   argument value is TRUE.
538 --   If the p_enforce_foreign_locking argument value is FALSE then the
539 --   parential rows are not locked.
540 --
541 -- Post Failure:
542 --   The Lck process can fail for:
543 --   1) When attempting to lock the row the row could already be locked by
544 --      another user. This will raise the HR_Api.Object_Locked exception.
545 --   2) When attempting to the lock the parent which doesn't exist.
546 --      For the entity to be locked the parent must exist!
547 --
548 -- Developer Implementation Notes:
549 --   None.
550 --
551 -- Access Status:
552 --   Internal Row Handler Use Only.
553 --
554 -- {End Of Comments}
555 -- ----------------------------------------------------------------------------
556 Procedure ins_lck
557 	(p_effective_date	 in  date,
558 	 p_datetrack_mode	 in  varchar2,
559 	 p_rec	 		 in  ben_cct_shd.g_rec_type,
560 	 p_validation_start_date out nocopy date,
561 	 p_validation_end_date	 out nocopy date) is
562 --
563   l_proc		  varchar2(72) := g_package||'ins_lck';
564   l_validation_start_date date;
565   l_validation_end_date	  date;
566 --
567 Begin
568   hr_utility.set_location('Entering:'||l_proc, 5);
569   --
570   -- Validate the datetrack mode mode getting the validation start
571   -- and end dates for the specified datetrack operation.
572   --
573   dt_api.validate_dt_mode
574 	(p_effective_date	   => p_effective_date,
575 	 p_datetrack_mode	   => p_datetrack_mode,
576 	 p_base_table_name	   => 'ben_cm_typ_f',
577 	 p_base_key_column	   => 'cm_typ_id',
578 	 p_base_key_value 	   => p_rec.cm_typ_id,
579 	 p_parent_table_name1      => 'ben_cm_typ_f',
580 	 p_parent_key_column1      => 'cm_typ_id',
581 	 p_parent_key_value1       => p_rec.parnt_cm_typ_id,
582          p_enforce_foreign_locking => true,
583 	 p_validation_start_date   => l_validation_start_date,
584  	 p_validation_end_date	   => l_validation_end_date);
585   --
586   -- Set the validation start and end date OUT arguments
587   --
588   p_validation_start_date := l_validation_start_date;
589   p_validation_end_date   := l_validation_end_date;
590   --
591   hr_utility.set_location(' Leaving:'||l_proc, 10);
592 --
593 End ins_lck;
594 --
595 -- ----------------------------------------------------------------------------
596 -- |---------------------------------< ins >----------------------------------|
597 -- ----------------------------------------------------------------------------
598 Procedure ins
599   (
600   p_rec		   in out nocopy ben_cct_shd.g_rec_type,
601   p_effective_date in     date
602   ) is
603 --
604   l_proc			varchar2(72) := g_package||'ins';
605   l_datetrack_mode		varchar2(30) := 'INSERT';
606   l_validation_start_date	date;
607   l_validation_end_date		date;
608 --
609 Begin
610   hr_utility.set_location('Entering:'||l_proc, 5);
611   --
612   -- Call the lock operation
613   --
614   ins_lck
615 	(p_effective_date	 => p_effective_date,
616 	 p_datetrack_mode	 => l_datetrack_mode,
617 	 p_rec	 		 => p_rec,
618 	 p_validation_start_date => l_validation_start_date,
619 	 p_validation_end_date	 => l_validation_end_date);
620   --
621   -- Call the supporting insert validate operations
622   --
623   ben_cct_bus.insert_validate
624 	(p_rec			 => p_rec,
625 	 p_effective_date	 => p_effective_date,
626 	 p_datetrack_mode	 => l_datetrack_mode,
627 	 p_validation_start_date => l_validation_start_date,
628 	 p_validation_end_date	 => l_validation_end_date);
629   --
630   -- Call the supporting pre-insert operation
631   --
632   pre_insert
633  	(p_rec			 => p_rec,
634 	 p_effective_date	 => p_effective_date,
635 	 p_datetrack_mode	 => l_datetrack_mode,
636 	 p_validation_start_date => l_validation_start_date,
637 	 p_validation_end_date	 => l_validation_end_date);
638   --
639   -- Insert the row
640   --
641   insert_dml
642  	(p_rec			 => p_rec,
643 	 p_effective_date	 => p_effective_date,
644 	 p_datetrack_mode	 => l_datetrack_mode,
645 	 p_validation_start_date => l_validation_start_date,
646 	 p_validation_end_date	 => l_validation_end_date);
647   --
648   -- Call the supporting post-insert operation
649   --
650   post_insert
651  	(p_rec			 => p_rec,
652 	 p_effective_date	 => p_effective_date,
653 	 p_datetrack_mode	 => l_datetrack_mode,
654 	 p_validation_start_date => l_validation_start_date,
655 	 p_validation_end_date	 => l_validation_end_date);
656 end ins;
657 --
658 -- ----------------------------------------------------------------------------
659 -- |---------------------------------< ins >----------------------------------|
660 -- ----------------------------------------------------------------------------
661 Procedure ins
662   (
663   p_cm_typ_id                    out nocopy number,
664   p_effective_start_date         out nocopy date,
665   p_effective_end_date           out nocopy date,
666   p_name                         in varchar2,
667   p_desc_txt                     in varchar2         default null,
668   p_inactive_flag                   in varchar2         default null,
669   p_cm_typ_rl                    in number           default null,
670   p_cm_usg_cd                    in varchar2         default null,
671   p_whnvr_trgrd_flag             in varchar2,
672   p_shrt_name                    in varchar2         default null,
673   p_pc_kit_cd                    in varchar2         default null,
674   p_trk_mlg_flag                 in varchar2,
675   p_mx_num_avlbl_val             in number           default null,
676   p_to_be_sent_dt_cd             in varchar2,
677   p_to_be_sent_dt_rl             in number           default null,
678   p_inspn_rqd_flag               in varchar2,
679   p_inspn_rqd_rl                 in number           default null,
680   p_rcpent_cd                    in varchar2         default null,
681   p_parnt_cm_typ_id              in number           default null,
682   p_business_group_id            in number,
683   p_cct_attribute_category       in varchar2         default null,
684   p_cct_attribute1               in varchar2         default null,
685   p_cct_attribute10              in varchar2         default null,
686   p_cct_attribute11              in varchar2         default null,
687   p_cct_attribute12              in varchar2         default null,
688   p_cct_attribute13              in varchar2         default null,
689   p_cct_attribute14              in varchar2         default null,
690   p_cct_attribute15              in varchar2         default null,
691   p_cct_attribute16              in varchar2         default null,
692   p_cct_attribute17              in varchar2         default null,
693   p_cct_attribute18              in varchar2         default null,
694   p_cct_attribute19              in varchar2         default null,
695   p_cct_attribute2               in varchar2         default null,
696   p_cct_attribute20              in varchar2         default null,
697   p_cct_attribute21              in varchar2         default null,
698   p_cct_attribute22              in varchar2         default null,
699   p_cct_attribute23              in varchar2         default null,
700   p_cct_attribute24              in varchar2         default null,
701   p_cct_attribute25              in varchar2         default null,
702   p_cct_attribute26              in varchar2         default null,
703   p_cct_attribute27              in varchar2         default null,
704   p_cct_attribute28              in varchar2         default null,
705   p_cct_attribute29              in varchar2         default null,
706   p_cct_attribute3               in varchar2         default null,
707   p_cct_attribute30              in varchar2         default null,
708   p_cct_attribute4               in varchar2         default null,
709   p_cct_attribute5               in varchar2         default null,
710   p_cct_attribute6               in varchar2         default null,
711   p_cct_attribute7               in varchar2         default null,
712   p_cct_attribute8               in varchar2         default null,
713   p_cct_attribute9               in varchar2         default null,
714   p_object_version_number        out nocopy number,
715   p_effective_date		 in date
716   ) is
717 --
718   l_rec		ben_cct_shd.g_rec_type;
719   l_proc	varchar2(72) := g_package||'ins';
720 --
721 Begin
722   hr_utility.set_location('Entering:'||l_proc, 5);
723   --
724   -- Call conversion function to turn arguments into the
725   -- p_rec structure.
726   --
727   l_rec :=
728   ben_cct_shd.convert_args
729   (
730   null,
731   null,
732   null,
733   p_name,
734   p_desc_txt,
735   p_inactive_flag,
736   p_cm_typ_rl,
737   p_cm_usg_cd,
738   p_whnvr_trgrd_flag,
739   p_shrt_name,
740   p_pc_kit_cd,
741   p_trk_mlg_flag,
742   p_mx_num_avlbl_val,
743   p_to_be_sent_dt_cd,
744   p_to_be_sent_dt_rl,
745   p_inspn_rqd_flag,
746   p_inspn_rqd_rl,
747   p_rcpent_cd,
748   p_parnt_cm_typ_id,
749   p_business_group_id,
750   p_cct_attribute_category,
751   p_cct_attribute1,
752   p_cct_attribute10,
753   p_cct_attribute11,
754   p_cct_attribute12,
755   p_cct_attribute13,
756   p_cct_attribute14,
757   p_cct_attribute15,
758   p_cct_attribute16,
759   p_cct_attribute17,
760   p_cct_attribute18,
761   p_cct_attribute19,
762   p_cct_attribute2,
763   p_cct_attribute20,
764   p_cct_attribute21,
765   p_cct_attribute22,
766   p_cct_attribute23,
767   p_cct_attribute24,
768   p_cct_attribute25,
769   p_cct_attribute26,
770   p_cct_attribute27,
771   p_cct_attribute28,
772   p_cct_attribute29,
773   p_cct_attribute3,
774   p_cct_attribute30,
775   p_cct_attribute4,
776   p_cct_attribute5,
777   p_cct_attribute6,
778   p_cct_attribute7,
779   p_cct_attribute8,
780   p_cct_attribute9,
781   null
782   );
783   --
784   -- Having converted the arguments into the ben_cct_rec
785   -- plsql record structure we call the corresponding record
786   -- business process.
787   --
788   ins(l_rec, p_effective_date);
789   --
790   -- Set the OUT arguments.
791   --
792   p_cm_typ_id        	:= l_rec.cm_typ_id;
793   p_effective_start_date  	:= l_rec.effective_start_date;
794   p_effective_end_date    	:= l_rec.effective_end_date;
795   p_object_version_number 	:= l_rec.object_version_number;
796   --
797   --
798   hr_utility.set_location(' Leaving:'||l_proc, 10);
799 End ins;
800 --
801 end ben_cct_ins;