DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_OPT_INS

Source


1 Package Body ben_opt_ins as
2 /* $Header: beoptrhi.pkb 120.0 2005/05/28 09:56:38 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_opt_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_opt_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_opt_f t
70     where  t.opt_id       = p_rec.opt_id
71     and    t.effective_start_date =
72              ben_opt_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_opt_f.created_by%TYPE;
77   l_creation_date       ben_opt_f.creation_date%TYPE;
78   l_last_update_date   	ben_opt_f.last_update_date%TYPE;
79   l_last_updated_by     ben_opt_f.last_updated_by%TYPE;
80   l_last_update_login   ben_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_opt_f',
90 	 p_base_key_column => 'opt_id',
91 	 p_base_key_value  => p_rec.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_opt_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_opt_f
132   --
133   insert into ben_opt_f
134   (	opt_id,
135 	effective_start_date,
136 	effective_end_date,
137 	name,
138 	cmbn_ptip_opt_id,
139 	business_group_id,
140 	opt_attribute_category,
141 	opt_attribute1,
142 	opt_attribute2,
143 	opt_attribute3,
144 	opt_attribute4,
145 	opt_attribute5,
146 	opt_attribute6,
147 	opt_attribute7,
148 	opt_attribute8,
149 	opt_attribute9,
150 	opt_attribute10,
151 	opt_attribute11,
152 	opt_attribute12,
153 	opt_attribute13,
154 	opt_attribute14,
155 	opt_attribute15,
156 	opt_attribute16,
157 	opt_attribute17,
158 	opt_attribute18,
159 	opt_attribute19,
160 	opt_attribute20,
161 	opt_attribute21,
162 	opt_attribute22,
163 	opt_attribute23,
164 	opt_attribute24,
165 	opt_attribute25,
166 	opt_attribute26,
167 	opt_attribute27,
168 	opt_attribute28,
169 	opt_attribute29,
170 	opt_attribute30,
171 	object_version_number,
172 	rqd_perd_enrt_nenrt_uom,
173 	rqd_perd_enrt_nenrt_val,
174 	rqd_perd_enrt_nenrt_rl,
175 	invk_wv_opt_flag,
176 	short_name,
177 	short_code,
178 	legislation_code,
179 	legislation_subgroup,
180         group_opt_id ,
181 	component_reason,
182         mapping_table_name,
183         mapping_table_pk_id,
184    	created_by,
185    	creation_date,
186    	last_update_date,
187    	last_updated_by,
188    	last_update_login
189   )
190   Values
191   (	p_rec.opt_id,
192 	p_rec.effective_start_date,
193 	p_rec.effective_end_date,
194 	p_rec.name,
195 	p_rec.cmbn_ptip_opt_id,
196 	p_rec.business_group_id,
197 	p_rec.opt_attribute_category,
198 	p_rec.opt_attribute1,
199 	p_rec.opt_attribute2,
200 	p_rec.opt_attribute3,
201 	p_rec.opt_attribute4,
202 	p_rec.opt_attribute5,
203 	p_rec.opt_attribute6,
204 	p_rec.opt_attribute7,
205 	p_rec.opt_attribute8,
206 	p_rec.opt_attribute9,
207 	p_rec.opt_attribute10,
208 	p_rec.opt_attribute11,
209 	p_rec.opt_attribute12,
210 	p_rec.opt_attribute13,
211 	p_rec.opt_attribute14,
212 	p_rec.opt_attribute15,
213 	p_rec.opt_attribute16,
217 	p_rec.opt_attribute20,
214 	p_rec.opt_attribute17,
215 	p_rec.opt_attribute18,
216 	p_rec.opt_attribute19,
218 	p_rec.opt_attribute21,
219 	p_rec.opt_attribute22,
220 	p_rec.opt_attribute23,
221 	p_rec.opt_attribute24,
222 	p_rec.opt_attribute25,
223 	p_rec.opt_attribute26,
224 	p_rec.opt_attribute27,
225 	p_rec.opt_attribute28,
226 	p_rec.opt_attribute29,
227 	p_rec.opt_attribute30,
228 	p_rec.object_version_number,
229 	p_rec.rqd_perd_enrt_nenrt_uom,
230 	p_rec.rqd_perd_enrt_nenrt_val,
231 	p_rec.rqd_perd_enrt_nenrt_rl,
232 	p_rec.invk_wv_opt_flag ,
233 	p_rec.short_name,
234 	p_rec.short_code,
235 	p_rec.legislation_code,
236 	p_rec.legislation_subgroup,
237 	p_rec.group_opt_id,
238 	p_rec.component_reason,
239         p_rec.mapping_table_name,
240         p_rec.mapping_table_pk_id,
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_opt_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_opt_shd.g_api_dml := false;   -- Unset the api dml status
255     ben_opt_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_opt_shd.g_api_dml := false;   -- Unset the api dml status
260     ben_opt_shd.constraint_error
261       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
262   When Others Then
263     ben_opt_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_opt_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_opt_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_opt_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.opt_id;
349   Close C_Sel1;
350   --
351   --
352   hr_utility.set_location(' Leaving:'||l_proc, 10);
353 End pre_insert;
354 --
355 -- ----------------------------------------------------------------------------
356 -- |-----------------------------< post_insert >------------------------------|
357 -- ----------------------------------------------------------------------------
358 -- {Start Of Comments}
359 --
360 -- Description:
361 --   This private procedure contains any processing which is required after the
362 --   insert dml.
363 --
364 -- Prerequisites:
365 --   This is an internal procedure which is called from the ins procedure.
366 --
367 -- In Parameters:
368 --   A Pl/Sql record structre.
369 --
370 -- Post Success:
371 --   Processing continues.
372 --
373 -- Post Failure:
374 --   If an error has occurred, an error message and exception will be raised
375 --   but not handled.
376 --
377 -- Developer Implementation Notes:
378 --   Any post-processing required after the insert dml is issued should be
379 --   coded within this procedure. It is important to note that any 3rd party
380 --   maintenance should be reviewed before placing in this procedure.
381 --
382 -- Access Status:
383 --   Internal Row Handler Use Only.
384 --
385 -- {End Of Comments}
386 -- ----------------------------------------------------------------------------
387 Procedure post_insert
388 	(p_rec 			 in ben_opt_shd.g_rec_type,
389 	 p_effective_date	 in date,
390 	 p_datetrack_mode	 in varchar2,
391 	 p_validation_start_date in date,
392 	 p_validation_end_date	 in date) is
393 --
394   l_proc	varchar2(72) := g_package||'post_insert';
395 --
396 Begin
397   hr_utility.set_location('Entering:'||l_proc, 5);
398 --
399 -- Added for GSP validations
400 pqh_gsp_ben_validations.opt_validations
401   	(  p_opt_id			=> p_rec.opt_id
402   	 , p_effective_date 		=> p_effective_date
403   	 , p_dml_operation 		=> 'I'
404   	 , p_business_group_id  	=> p_rec.business_group_id
405   	 , p_mapping_table_pk_id	=> p_rec.mapping_table_pk_id
406   	 );
407 
408   --
409   -- Start of API User Hook for post_insert.
410   --
411   begin
412     --
413     ben_opt_rki.after_insert
414       (
415   p_opt_id                        =>p_rec.opt_id
416  ,p_effective_start_date          =>p_rec.effective_start_date
417  ,p_effective_end_date            =>p_rec.effective_end_date
418  ,p_name                          =>p_rec.name
419  ,p_cmbn_ptip_opt_id              =>p_rec.cmbn_ptip_opt_id
420  ,p_business_group_id             =>p_rec.business_group_id
421  ,p_opt_attribute_category        =>p_rec.opt_attribute_category
422  ,p_opt_attribute1                =>p_rec.opt_attribute1
423  ,p_opt_attribute2                =>p_rec.opt_attribute2
424  ,p_opt_attribute3                =>p_rec.opt_attribute3
425  ,p_opt_attribute4                =>p_rec.opt_attribute4
426  ,p_opt_attribute5                =>p_rec.opt_attribute5
427  ,p_opt_attribute6                =>p_rec.opt_attribute6
428  ,p_opt_attribute7                =>p_rec.opt_attribute7
429  ,p_opt_attribute8                =>p_rec.opt_attribute8
430  ,p_opt_attribute9                =>p_rec.opt_attribute9
431  ,p_opt_attribute10               =>p_rec.opt_attribute10
432  ,p_opt_attribute11               =>p_rec.opt_attribute11
433  ,p_opt_attribute12               =>p_rec.opt_attribute12
434  ,p_opt_attribute13               =>p_rec.opt_attribute13
435  ,p_opt_attribute14               =>p_rec.opt_attribute14
439  ,p_opt_attribute18               =>p_rec.opt_attribute18
436  ,p_opt_attribute15               =>p_rec.opt_attribute15
437  ,p_opt_attribute16               =>p_rec.opt_attribute16
438  ,p_opt_attribute17               =>p_rec.opt_attribute17
440  ,p_opt_attribute19               =>p_rec.opt_attribute19
441  ,p_opt_attribute20               =>p_rec.opt_attribute20
442  ,p_opt_attribute21               =>p_rec.opt_attribute21
443  ,p_opt_attribute22               =>p_rec.opt_attribute22
444  ,p_opt_attribute23               =>p_rec.opt_attribute23
445  ,p_opt_attribute24               =>p_rec.opt_attribute24
446  ,p_opt_attribute25               =>p_rec.opt_attribute25
447  ,p_opt_attribute26               =>p_rec.opt_attribute26
448  ,p_opt_attribute27               =>p_rec.opt_attribute27
449  ,p_opt_attribute28               =>p_rec.opt_attribute28
450  ,p_opt_attribute29               =>p_rec.opt_attribute29
451  ,p_opt_attribute30               =>p_rec.opt_attribute30
452  ,p_object_version_number         =>p_rec.object_version_number
453  ,p_rqd_perd_enrt_nenrt_uom       =>p_rec.rqd_perd_enrt_nenrt_uom
454  ,p_rqd_perd_enrt_nenrt_val       =>p_rec.rqd_perd_enrt_nenrt_val
455  ,p_rqd_perd_enrt_nenrt_rl        =>p_rec.rqd_perd_enrt_nenrt_rl
456  ,p_invk_wv_opt_flag              =>p_rec.invk_wv_opt_flag
457  ,p_short_name                    =>p_rec.short_name
458  ,p_short_code                    =>p_rec.short_code
459  ,p_legislation_code              =>p_rec.legislation_code
460  ,p_legislation_subgroup          =>p_rec.legislation_subgroup
461  ,p_group_opt_id                  =>p_rec.group_opt_id
462  ,p_component_reason              =>p_rec.component_reason
463  ,p_mapping_table_name            =>p_rec.mapping_table_name
464  ,p_mapping_table_pk_id           =>p_rec.mapping_table_pk_id
465  ,p_effective_date                =>p_effective_date
466  ,p_validation_start_date         =>p_validation_start_date
467  ,p_validation_end_date           =>p_validation_end_date
468       );
469     --
470 
471     --
472   exception
473     --
474     when hr_api.cannot_find_prog_unit then
475       --
476       hr_api.cannot_find_prog_unit_error
477         (p_module_name => 'ben_opt_f'
478         ,p_hook_type   => 'AI');
479       --
480   end;
481   --
482   -- End of API User Hook for post_insert.
483   --
484   --
485   hr_utility.set_location(' Leaving:'||l_proc, 10);
486 End post_insert;
487 --
488 -- ----------------------------------------------------------------------------
489 -- |-------------------------------< ins_lck >--------------------------------|
490 -- ----------------------------------------------------------------------------
491 -- {Start Of Comments}
492 --
493 -- Description:
494 --   The ins_lck process has one main function to perform. When inserting
495 --   a datetracked row, we must validate the DT mode.
496 --   be manipulated.
497 --
498 -- Prerequisites:
499 --   This procedure can only be called for the datetrack mode of INSERT.
500 --
501 -- In Parameters:
502 --
503 -- Post Success:
504 --   On successful completion of the ins_lck process the parental
505 --   datetracked rows will be locked providing the p_enforce_foreign_locking
506 --   argument value is TRUE.
507 --   If the p_enforce_foreign_locking argument value is FALSE then the
508 --   parential rows are not locked.
509 --
510 -- Post Failure:
511 --   The Lck process can fail for:
512 --   1) When attempting to lock the row the row could already be locked by
513 --      another user. This will raise the HR_Api.Object_Locked exception.
514 --   2) When attempting to the lock the parent which doesn't exist.
515 --      For the entity to be locked the parent must exist!
516 --
517 -- Developer Implementation Notes:
518 --   None.
519 --
520 -- Access Status:
521 --   Internal Row Handler Use Only.
522 --
523 -- {End Of Comments}
524 -- ----------------------------------------------------------------------------
525 Procedure ins_lck
526 	(p_effective_date	 in  date,
527 	 p_datetrack_mode	 in  varchar2,
528 	 p_rec	 		 in  ben_opt_shd.g_rec_type,
529 	 p_validation_start_date out nocopy date,
530 	 p_validation_end_date	 out nocopy date) is
531 --
532   l_proc		  varchar2(72) := g_package||'ins_lck';
533   l_validation_start_date date;
534   l_validation_end_date	  date;
535 --
536 Begin
537   hr_utility.set_location('Entering:'||l_proc, 5);
538   --
539   -- Validate the datetrack mode mode getting the validation start
540   -- and end dates for the specified datetrack operation.
541   --
542   dt_api.validate_dt_mode
543 	(p_effective_date	   => p_effective_date,
544 	 p_datetrack_mode	   => p_datetrack_mode,
545 	 p_base_table_name	   => 'ben_opt_f',
546 	 p_base_key_column	   => 'opt_id',
547 	 p_base_key_value 	   => p_rec.opt_id,
548 	 p_parent_table_name1      => 'ben_cmbn_ptip_opt_f',
549 	 p_parent_key_column1      => 'cmbn_ptip_opt_id',
550 	 p_parent_key_value1       => p_rec.cmbn_ptip_opt_id,
551          p_enforce_foreign_locking => true,
552 	 p_validation_start_date   => l_validation_start_date,
553  	 p_validation_end_date	   => l_validation_end_date);
554   --
555   -- Set the validation start and end date OUT arguments
556   --
557   p_validation_start_date := l_validation_start_date;
558   p_validation_end_date   := l_validation_end_date;
559   --
560   hr_utility.set_location(' Leaving:'||l_proc, 10);
561 --
562 End ins_lck;
563 --
564 -- ----------------------------------------------------------------------------
565 -- |---------------------------------< ins >----------------------------------|
566 -- ----------------------------------------------------------------------------
567 Procedure ins
568   (
569   p_rec		   in out nocopy ben_opt_shd.g_rec_type,
573   l_proc			varchar2(72) := g_package||'ins';
570   p_effective_date in     date
571   ) is
572 --
574   l_datetrack_mode		varchar2(30) := 'INSERT';
575   l_validation_start_date	date;
576   l_validation_end_date		date;
577 --
578 Begin
579   hr_utility.set_location('Entering:'||l_proc, 5);
580   --
581   -- Call the lock operation
582   --
583   ins_lck
584 	(p_effective_date	 => p_effective_date,
585 	 p_datetrack_mode	 => l_datetrack_mode,
586 	 p_rec	 		 => p_rec,
587 	 p_validation_start_date => l_validation_start_date,
588 	 p_validation_end_date	 => l_validation_end_date);
589   --
590   -- Call the supporting insert validate operations
591   --
592   ben_opt_bus.insert_validate
593 	(p_rec			 => p_rec,
594 	 p_effective_date	 => p_effective_date,
595 	 p_datetrack_mode	 => l_datetrack_mode,
596 	 p_validation_start_date => l_validation_start_date,
597 	 p_validation_end_date	 => l_validation_end_date);
598   --
599   -- Call the supporting pre-insert operation
600   --
601   pre_insert
602  	(p_rec			 => p_rec,
603 	 p_effective_date	 => p_effective_date,
604 	 p_datetrack_mode	 => l_datetrack_mode,
605 	 p_validation_start_date => l_validation_start_date,
606 	 p_validation_end_date	 => l_validation_end_date);
607   --
608   -- Insert the row
609   --
610   insert_dml
611  	(p_rec			 => p_rec,
612 	 p_effective_date	 => p_effective_date,
613 	 p_datetrack_mode	 => l_datetrack_mode,
614 	 p_validation_start_date => l_validation_start_date,
615 	 p_validation_end_date	 => l_validation_end_date);
616   --
617   -- Call the supporting post-insert operation
618   --
619   post_insert
620  	(p_rec			 => p_rec,
621 	 p_effective_date	 => p_effective_date,
622 	 p_datetrack_mode	 => l_datetrack_mode,
623 	 p_validation_start_date => l_validation_start_date,
624 	 p_validation_end_date	 => l_validation_end_date);
625 end ins;
626 --
627 -- ----------------------------------------------------------------------------
628 -- |---------------------------------< ins >----------------------------------|
629 -- ----------------------------------------------------------------------------
630 Procedure ins
631   (
632   p_opt_id                       out nocopy number,
633   p_effective_start_date         out nocopy date,
634   p_effective_end_date           out nocopy date,
635   p_name                         in varchar2,
636   p_cmbn_ptip_opt_id             in number           default null,
637   p_business_group_id            in number,
638   p_opt_attribute_category       in varchar2         default null,
639   p_opt_attribute1               in varchar2         default null,
640   p_opt_attribute2               in varchar2         default null,
641   p_opt_attribute3               in varchar2         default null,
642   p_opt_attribute4               in varchar2         default null,
643   p_opt_attribute5               in varchar2         default null,
644   p_opt_attribute6               in varchar2         default null,
645   p_opt_attribute7               in varchar2         default null,
646   p_opt_attribute8               in varchar2         default null,
647   p_opt_attribute9               in varchar2         default null,
648   p_opt_attribute10              in varchar2         default null,
649   p_opt_attribute11              in varchar2         default null,
650   p_opt_attribute12              in varchar2         default null,
651   p_opt_attribute13              in varchar2         default null,
652   p_opt_attribute14              in varchar2         default null,
653   p_opt_attribute15              in varchar2         default null,
654   p_opt_attribute16              in varchar2         default null,
655   p_opt_attribute17              in varchar2         default null,
656   p_opt_attribute18              in varchar2         default null,
657   p_opt_attribute19              in varchar2         default null,
658   p_opt_attribute20              in varchar2         default null,
659   p_opt_attribute21              in varchar2         default null,
660   p_opt_attribute22              in varchar2         default null,
661   p_opt_attribute23              in varchar2         default null,
662   p_opt_attribute24              in varchar2         default null,
663   p_opt_attribute25              in varchar2         default null,
664   p_opt_attribute26              in varchar2         default null,
665   p_opt_attribute27              in varchar2         default null,
666   p_opt_attribute28              in varchar2         default null,
667   p_opt_attribute29              in varchar2         default null,
668   p_opt_attribute30              in varchar2         default null,
669   p_object_version_number        out nocopy number,
670   p_rqd_perd_enrt_nenrt_uom      in varchar2         default null,
671   p_rqd_perd_enrt_nenrt_val      in number           default null,
672   p_rqd_perd_enrt_nenrt_rl       in number           default null,
673   p_invk_wv_opt_flag             in varchar2         default null,
674   p_short_name		         in varchar2         default null,
675   p_short_code          	 in varchar2         default null,
676   p_legislation_code          	 in varchar2         default null,
677   p_legislation_subgroup       	 in varchar2         default null,
678   p_group_opt_id               	 in number           default null,
679   p_component_reason             in varchar2         default null,
680   p_mapping_table_name           in varchar2         default null,
681   p_mapping_table_pk_id          in number           default null,
682   p_effective_date		   in date
683   ) is
684 --
685   l_rec		ben_opt_shd.g_rec_type;
686   l_proc	varchar2(72) := g_package||'ins';
687 --
688 Begin
689   hr_utility.set_location('Entering:'||l_proc, 5);
690   --
691   -- Call conversion function to turn arguments into the
692   -- p_rec structure.
693   --
694   l_rec :=
695   ben_opt_shd.convert_args
696   (
697   null,
698   null,
699   null,
700   p_name,
701   p_cmbn_ptip_opt_id,
702   p_business_group_id,
703   p_opt_attribute_category,
704   p_opt_attribute1,
705   p_opt_attribute2,
706   p_opt_attribute3,
707   p_opt_attribute4,
708   p_opt_attribute5,
709   p_opt_attribute6,
710   p_opt_attribute7,
711   p_opt_attribute8,
712   p_opt_attribute9,
713   p_opt_attribute10,
714   p_opt_attribute11,
715   p_opt_attribute12,
716   p_opt_attribute13,
717   p_opt_attribute14,
718   p_opt_attribute15,
719   p_opt_attribute16,
720   p_opt_attribute17,
721   p_opt_attribute18,
722   p_opt_attribute19,
723   p_opt_attribute20,
724   p_opt_attribute21,
725   p_opt_attribute22,
726   p_opt_attribute23,
727   p_opt_attribute24,
728   p_opt_attribute25,
729   p_opt_attribute26,
730   p_opt_attribute27,
731   p_opt_attribute28,
732   p_opt_attribute29,
733   p_opt_attribute30,
734   null,
735   p_rqd_perd_enrt_nenrt_uom,
736   p_rqd_perd_enrt_nenrt_val,
737   p_rqd_perd_enrt_nenrt_rl,
738   p_invk_wv_opt_flag,
739   p_short_name,
740   p_short_code,
741   p_legislation_code,
742   p_legislation_subgroup,
743   p_group_opt_id       ,
744   p_component_reason,
745   p_mapping_table_name,
746   p_mapping_table_pk_id
747   );
748   --
749   -- Having converted the arguments into the ben_opt_rec
750   -- plsql record structure we call the corresponding record
751   -- business process.
752   --
753   ins(l_rec, p_effective_date);
754   --
755   -- Set the OUT arguments.
756   --
757   p_opt_id        	:= l_rec.opt_id;
758   p_effective_start_date  	:= l_rec.effective_start_date;
759   p_effective_end_date    	:= l_rec.effective_end_date;
760   p_object_version_number 	:= l_rec.object_version_number;
761   --
762   --
763   hr_utility.set_location(' Leaving:'||l_proc, 10);
764 End ins;
765 --
766 end ben_opt_ins;