DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PBB_INS

Source


1 Package Body ben_pbb_ins as
2 /* $Header: bepbbrhi.pkb 115.14 2004/02/03 10:38:48 pbodla ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_pbb_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_pbb_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_per_bnfts_bal_f t
70     where  t.per_bnfts_bal_id       = p_rec.per_bnfts_bal_id
71     and    t.effective_start_date =
72              ben_pbb_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_per_bnfts_bal_f.created_by%TYPE;
77   l_creation_date       ben_per_bnfts_bal_f.creation_date%TYPE;
78   l_last_update_date   	ben_per_bnfts_bal_f.last_update_date%TYPE;
79   l_last_updated_by     ben_per_bnfts_bal_f.last_updated_by%TYPE;
80   l_last_update_login   ben_per_bnfts_bal_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_per_bnfts_bal_f',
90 	 p_base_key_column => 'per_bnfts_bal_id',
91 	 p_base_key_value  => p_rec.per_bnfts_bal_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_pbb_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_per_bnfts_bal_f
132   --
133   insert into ben_per_bnfts_bal_f
134   (	per_bnfts_bal_id,
135 	effective_start_date,
136 	effective_end_date,
137 	val,
138 	bnfts_bal_id,
139 	person_id,
140 	business_group_id,
141 	pbb_attribute_category,
142 	pbb_attribute1,
143 	pbb_attribute2,
144 	pbb_attribute3,
145 	pbb_attribute4,
146 	pbb_attribute5,
147 	pbb_attribute6,
148 	pbb_attribute7,
149 	pbb_attribute8,
150 	pbb_attribute9,
151 	pbb_attribute10,
152 	pbb_attribute11,
153 	pbb_attribute12,
154 	pbb_attribute13,
155 	pbb_attribute14,
156 	pbb_attribute15,
157 	pbb_attribute16,
158 	pbb_attribute17,
159 	pbb_attribute18,
160 	pbb_attribute19,
161 	pbb_attribute20,
162 	pbb_attribute21,
163 	pbb_attribute22,
164 	pbb_attribute23,
165 	pbb_attribute24,
166 	pbb_attribute25,
167 	pbb_attribute26,
168 	pbb_attribute27,
169 	pbb_attribute28,
170 	pbb_attribute29,
171 	pbb_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.per_bnfts_bal_id,
181 	p_rec.effective_start_date,
182 	p_rec.effective_end_date,
183 	p_rec.val,
184 	p_rec.bnfts_bal_id,
185 	p_rec.person_id,
186 	p_rec.business_group_id,
187 	p_rec.pbb_attribute_category,
188 	p_rec.pbb_attribute1,
189 	p_rec.pbb_attribute2,
190 	p_rec.pbb_attribute3,
191 	p_rec.pbb_attribute4,
192 	p_rec.pbb_attribute5,
193 	p_rec.pbb_attribute6,
194 	p_rec.pbb_attribute7,
195 	p_rec.pbb_attribute8,
196 	p_rec.pbb_attribute9,
197 	p_rec.pbb_attribute10,
198 	p_rec.pbb_attribute11,
199 	p_rec.pbb_attribute12,
200 	p_rec.pbb_attribute13,
201 	p_rec.pbb_attribute14,
202 	p_rec.pbb_attribute15,
203 	p_rec.pbb_attribute16,
204 	p_rec.pbb_attribute17,
205 	p_rec.pbb_attribute18,
206 	p_rec.pbb_attribute19,
207 	p_rec.pbb_attribute20,
208 	p_rec.pbb_attribute21,
209 	p_rec.pbb_attribute22,
210 	p_rec.pbb_attribute23,
211 	p_rec.pbb_attribute24,
212 	p_rec.pbb_attribute25,
213 	p_rec.pbb_attribute26,
214 	p_rec.pbb_attribute27,
215 	p_rec.pbb_attribute28,
216 	p_rec.pbb_attribute29,
217 	p_rec.pbb_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   ben_pbb_shd.g_api_dml := false;   -- Unset the api dml status
227   hr_utility.set_location(' Leaving:'||l_proc, 15);
228 --
229 Exception
230   When hr_api.check_integrity_violated Then
231     -- A check constraint has been violated
232     ben_pbb_shd.g_api_dml := false;   -- Unset the api dml status
233     ben_pbb_shd.constraint_error
234       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
235   When hr_api.unique_integrity_violated Then
236     -- Unique integrity has been violated
237     ben_pbb_shd.g_api_dml := false;   -- Unset the api dml status
238     ben_pbb_shd.constraint_error
239       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
240   When Others Then
241     ben_pbb_shd.g_api_dml := false;   -- Unset the api dml status
242     Raise;
243 End dt_insert_dml;
244 --
245 -- ----------------------------------------------------------------------------
246 -- |------------------------------< insert_dml >------------------------------|
247 -- ----------------------------------------------------------------------------
248 Procedure insert_dml
249 	(p_rec 			 in out nocopy ben_pbb_shd.g_rec_type,
250 	 p_effective_date	 in	date,
251 	 p_datetrack_mode	 in	varchar2,
252 	 p_validation_start_date in	date,
253 	 p_validation_end_date	 in	date) is
254 --
255   l_proc	varchar2(72) := g_package||'insert_dml';
256 --
257 Begin
258   hr_utility.set_location('Entering:'||l_proc, 5);
259   --
260   dt_insert_dml(p_rec			=> p_rec,
261 		p_effective_date	=> p_effective_date,
262 		p_datetrack_mode	=> p_datetrack_mode,
263        		p_validation_start_date	=> p_validation_start_date,
264 		p_validation_end_date	=> p_validation_end_date);
265   --
266   hr_utility.set_location(' Leaving:'||l_proc, 10);
267 End insert_dml;
268 --
269 -- ----------------------------------------------------------------------------
270 -- |------------------------------< pre_insert >------------------------------|
271 -- ----------------------------------------------------------------------------
272 -- {Start Of Comments}
273 --
274 -- Description:
275 --   This private procedure contains any processing which is required before
276 --   the insert dml. Presently, if the entity has a corresponding primary
277 --   key which is maintained by an associating sequence, the primary key for
278 --   the entity will be populated with the next sequence value in
279 --   preparation for the insert dml.
280 --   Also, if comments are defined for this entity, the comments insert
281 --   logic will also be called, generating a comment_id if required.
282 --
283 -- Prerequisites:
284 --   This is an internal procedure which is called from the ins procedure.
285 --
286 -- In Parameters:
287 --   A Pl/Sql record structre.
288 --
289 -- Post Success:
290 --   Processing continues.
291 --
292 -- Post Failure:
293 --   If an error has occurred, an error message and exception will be raised
294 --   but not handled.
295 --
296 -- Developer Implementation Notes:
297 --   Any pre-processing required before the insert dml is issued should be
298 --   coded within this procedure. As stated above, a good example is the
299 --   generation of a primary key number via a corresponding sequence.
300 --   It is important to note that any 3rd party maintenance should be reviewed
301 --   before placing in this procedure.
302 --
303 -- Access Status:
304 --   Internal Row Handler Use Only.
305 --
306 -- {End Of Comments}
307 -- ----------------------------------------------------------------------------
308 Procedure pre_insert
309 	(p_rec  			in out nocopy ben_pbb_shd.g_rec_type,
310 	 p_effective_date		in date,
311 	 p_datetrack_mode		in varchar2,
312 	 p_validation_start_date	in date,
313 	 p_validation_end_date		in date) is
314 --
315   l_proc	varchar2(72) := g_package||'pre_insert';
316   cursor c1 is
317     select ben_per_bnfts_bal_f_s.nextval
318     from sys.dual;
319 --
320 --
321 --
322 Begin
323   hr_utility.set_location('Entering:'||l_proc, 5);
324   --
325   open c1;
326   --
327     fetch c1 into p_rec.per_bnfts_bal_id;
328   --
329   close c1;
330   --
331   hr_utility.set_location(' Leaving:'||l_proc, 10);
332 End pre_insert;
333 --
334 -- ----------------------------------------------------------------------------
335 -- |-----------------------------< post_insert >------------------------------|
336 -- ----------------------------------------------------------------------------
337 -- {Start Of Comments}
338 --
339 -- Description:
340 --   This private procedure contains any processing which is required after the
341 --   insert dml.
342 --
343 -- Prerequisites:
344 --   This is an internal procedure which is called from the ins procedure.
345 --
346 -- In Parameters:
347 --   A Pl/Sql record structre.
348 --
349 -- Post Success:
350 --   Processing continues.
351 --
352 -- Post Failure:
353 --   If an error has occurred, an error message and exception will be raised
354 --   but not handled.
355 --
356 -- Developer Implementation Notes:
357 --   Any post-processing required after the insert dml is issued should be
358 --   coded within this procedure. It is important to note that any 3rd party
359 --   maintenance should be reviewed before placing in this procedure.
360 --
361 -- Access Status:
362 --   Internal Row Handler Use Only.
363 --
364 -- {End Of Comments}
365 -- ----------------------------------------------------------------------------
366 Procedure post_insert
367 	(p_rec 			 in ben_pbb_shd.g_rec_type,
368 	 p_effective_date	 in date,
369 	 p_datetrack_mode	 in varchar2,
370 	 p_validation_start_date in date,
371 	 p_validation_end_date	 in date) is
372 --
373   l_proc	varchar2(72) := g_package||'post_insert';
374   l_session_id  fnd_sessions.session_id%type;
375   l_sess_effective_date date;
376   --
377   -- Bug : 2166235
378   --
379   cursor c_fnd_session is
380      select session_id, effective_date
381      from fnd_sessions
382      where session_id = userenv('SESSIONID');
383 --
384 Begin
385   hr_utility.set_location('Entering:'||l_proc, 5);
386 --
387  open c_fnd_session;
388  fetch c_fnd_session into l_session_id, l_sess_effective_date;
389  --
390  if c_fnd_session%notfound then
391      --
392      insert into fnd_sessions (SESSION_ID, effective_date)
393       values (userenv('SESSIONID'), trunc(p_effective_date));
394      --
395  else
396      --
397      update fnd_sessions set effective_date = trunc(p_effective_date)
398      where  SESSION_ID = userenv('SESSIONID');
399      --
400  end if;
401  close c_fnd_session;
402  --
403  ben_dt_trgr_handle.bnfts_bal
404     (p_rowid                 => null
405     ,p_per_bnfts_bal_id      => p_rec.per_bnfts_bal_id
406     ,p_business_group_id     => p_rec.business_group_id
407     ,p_person_id             => p_rec.person_id
408     ,p_effective_start_date  => p_rec.effective_start_date
409     ,p_effective_end_date    => p_rec.effective_end_date
410     ,p_val                   => p_rec.val
411     ,p_bnfts_bal_id          => p_rec.bnfts_bal_id
412     );
413   --
414   if l_sess_effective_date is not null then
415      --
416      update fnd_sessions set effective_date = l_sess_effective_date
417      where  SESSION_ID = userenv('SESSIONID');
418      --
419   end if;
420   --
421   --
422   -- Start of API User Hook for post_insert.
423   --
424   begin
425     --
426     ben_pbb_rki.after_insert
427       (
428   p_per_bnfts_bal_id              =>p_rec.per_bnfts_bal_id
429  ,p_effective_start_date          =>p_rec.effective_start_date
430  ,p_effective_end_date            =>p_rec.effective_end_date
431  ,p_val                           =>p_rec.val
432  ,p_bnfts_bal_id                  =>p_rec.bnfts_bal_id
433  ,p_person_id                     =>p_rec.person_id
434  ,p_business_group_id             =>p_rec.business_group_id
435  ,p_pbb_attribute_category        =>p_rec.pbb_attribute_category
436  ,p_pbb_attribute1                =>p_rec.pbb_attribute1
437  ,p_pbb_attribute2                =>p_rec.pbb_attribute2
438  ,p_pbb_attribute3                =>p_rec.pbb_attribute3
439  ,p_pbb_attribute4                =>p_rec.pbb_attribute4
440  ,p_pbb_attribute5                =>p_rec.pbb_attribute5
441  ,p_pbb_attribute6                =>p_rec.pbb_attribute6
442  ,p_pbb_attribute7                =>p_rec.pbb_attribute7
443  ,p_pbb_attribute8                =>p_rec.pbb_attribute8
444  ,p_pbb_attribute9                =>p_rec.pbb_attribute9
445  ,p_pbb_attribute10               =>p_rec.pbb_attribute10
446  ,p_pbb_attribute11               =>p_rec.pbb_attribute11
447  ,p_pbb_attribute12               =>p_rec.pbb_attribute12
448  ,p_pbb_attribute13               =>p_rec.pbb_attribute13
449  ,p_pbb_attribute14               =>p_rec.pbb_attribute14
450  ,p_pbb_attribute15               =>p_rec.pbb_attribute15
451  ,p_pbb_attribute16               =>p_rec.pbb_attribute16
452  ,p_pbb_attribute17               =>p_rec.pbb_attribute17
453  ,p_pbb_attribute18               =>p_rec.pbb_attribute18
454  ,p_pbb_attribute19               =>p_rec.pbb_attribute19
455  ,p_pbb_attribute20               =>p_rec.pbb_attribute20
456  ,p_pbb_attribute21               =>p_rec.pbb_attribute21
457  ,p_pbb_attribute22               =>p_rec.pbb_attribute22
458  ,p_pbb_attribute23               =>p_rec.pbb_attribute23
459  ,p_pbb_attribute24               =>p_rec.pbb_attribute24
460  ,p_pbb_attribute25               =>p_rec.pbb_attribute25
461  ,p_pbb_attribute26               =>p_rec.pbb_attribute26
462  ,p_pbb_attribute27               =>p_rec.pbb_attribute27
463  ,p_pbb_attribute28               =>p_rec.pbb_attribute28
464  ,p_pbb_attribute29               =>p_rec.pbb_attribute29
465  ,p_pbb_attribute30               =>p_rec.pbb_attribute30
466  ,p_object_version_number         =>p_rec.object_version_number
467  ,p_effective_date                =>p_effective_date
468  ,p_validation_start_date         =>p_validation_start_date
469  ,p_validation_end_date           =>p_validation_end_date
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_per_bnfts_bal_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_pbb_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_per_bnfts_bal_f',
546 	 p_base_key_column	   => 'per_bnfts_bal_id',
547 	 p_base_key_value 	   => p_rec.per_bnfts_bal_id,
548 	 p_parent_table_name1      => 'ben_bnfts_bal_f',
549 	 p_parent_key_column1      => 'bnfts_bal_id',
550 	 p_parent_key_value1       => p_rec.bnfts_bal_id,
551          p_enforce_foreign_locking => ben_person_bnfts_bal_api.g_lock_row,
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_pbb_shd.g_rec_type,
570   p_effective_date in     date
571   ) is
572 --
573   l_proc			varchar2(72) := g_package||'ins';
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_pbb_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_per_bnfts_bal_id             out nocopy number,
633   p_effective_start_date         out nocopy date,
634   p_effective_end_date           out nocopy date,
635   p_val                          in number           default null,
636   p_bnfts_bal_id                 in number,
637   p_person_id                    in number           default null,
638   p_business_group_id            in number,
639   p_pbb_attribute_category       in varchar2         default null,
640   p_pbb_attribute1               in varchar2         default null,
641   p_pbb_attribute2               in varchar2         default null,
642   p_pbb_attribute3               in varchar2         default null,
643   p_pbb_attribute4               in varchar2         default null,
644   p_pbb_attribute5               in varchar2         default null,
645   p_pbb_attribute6               in varchar2         default null,
646   p_pbb_attribute7               in varchar2         default null,
647   p_pbb_attribute8               in varchar2         default null,
648   p_pbb_attribute9               in varchar2         default null,
649   p_pbb_attribute10              in varchar2         default null,
650   p_pbb_attribute11              in varchar2         default null,
651   p_pbb_attribute12              in varchar2         default null,
652   p_pbb_attribute13              in varchar2         default null,
653   p_pbb_attribute14              in varchar2         default null,
654   p_pbb_attribute15              in varchar2         default null,
655   p_pbb_attribute16              in varchar2         default null,
656   p_pbb_attribute17              in varchar2         default null,
657   p_pbb_attribute18              in varchar2         default null,
658   p_pbb_attribute19              in varchar2         default null,
659   p_pbb_attribute20              in varchar2         default null,
660   p_pbb_attribute21              in varchar2         default null,
661   p_pbb_attribute22              in varchar2         default null,
662   p_pbb_attribute23              in varchar2         default null,
663   p_pbb_attribute24              in varchar2         default null,
664   p_pbb_attribute25              in varchar2         default null,
665   p_pbb_attribute26              in varchar2         default null,
666   p_pbb_attribute27              in varchar2         default null,
667   p_pbb_attribute28              in varchar2         default null,
668   p_pbb_attribute29              in varchar2         default null,
669   p_pbb_attribute30              in varchar2         default null,
670   p_object_version_number        out nocopy number,
671   p_effective_date		 in date
672   ) is
673 --
674   l_rec		ben_pbb_shd.g_rec_type;
675   l_proc	varchar2(72) := g_package||'ins';
676 --
677 Begin
678   hr_utility.set_location('Entering:'||l_proc, 5);
679   --
680   -- Call conversion function to turn arguments into the
681   -- p_rec structure.
682   --
683   l_rec :=
684   ben_pbb_shd.convert_args
685   (
686   null,
687   null,
688   null,
689   p_val,
690   p_bnfts_bal_id,
691   p_person_id,
692   p_business_group_id,
693   p_pbb_attribute_category,
694   p_pbb_attribute1,
695   p_pbb_attribute2,
696   p_pbb_attribute3,
697   p_pbb_attribute4,
698   p_pbb_attribute5,
699   p_pbb_attribute6,
700   p_pbb_attribute7,
701   p_pbb_attribute8,
702   p_pbb_attribute9,
703   p_pbb_attribute10,
704   p_pbb_attribute11,
705   p_pbb_attribute12,
706   p_pbb_attribute13,
707   p_pbb_attribute14,
708   p_pbb_attribute15,
709   p_pbb_attribute16,
710   p_pbb_attribute17,
711   p_pbb_attribute18,
712   p_pbb_attribute19,
713   p_pbb_attribute20,
714   p_pbb_attribute21,
715   p_pbb_attribute22,
716   p_pbb_attribute23,
717   p_pbb_attribute24,
718   p_pbb_attribute25,
719   p_pbb_attribute26,
720   p_pbb_attribute27,
721   p_pbb_attribute28,
722   p_pbb_attribute29,
723   p_pbb_attribute30,
724   null
725   );
726   --
727   -- Having converted the arguments into the ben_pbb_rec
728   -- plsql record structure we call the corresponding record
729   -- business process.
730   --
731   ins(l_rec, p_effective_date);
732   --
733   -- Set the OUT arguments.
734   --
735   p_per_bnfts_bal_id        	:= l_rec.per_bnfts_bal_id;
736   p_effective_start_date  	:= l_rec.effective_start_date;
737   p_effective_end_date    	:= l_rec.effective_end_date;
738   p_object_version_number 	:= l_rec.object_version_number;
739   --
740   --
741   hr_utility.set_location(' Leaving:'||l_proc, 10);
742 End ins;
743 --
744 end ben_pbb_ins;