DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_REG_INS

Source


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