DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PBC_INS

Source


1 Package Body ben_pbc_ins as
2 /* $Header: bepbcrhi.pkb 115.6 2002/12/11 11:17:04 hnarayan ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_pbc_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_pbc_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_pl_bnf_ctfn_prvdd_f t
70     where  t.pl_bnf_ctfn_prvdd_id       = p_rec.pl_bnf_ctfn_prvdd_id
71     and    t.effective_start_date =
72              ben_pbc_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_pl_bnf_ctfn_prvdd_f.created_by%TYPE;
77   l_creation_date       ben_pl_bnf_ctfn_prvdd_f.creation_date%TYPE;
78   l_last_update_date   	ben_pl_bnf_ctfn_prvdd_f.last_update_date%TYPE;
79   l_last_updated_by     ben_pl_bnf_ctfn_prvdd_f.last_updated_by%TYPE;
80   l_last_update_login   ben_pl_bnf_ctfn_prvdd_f.last_update_login%TYPE;
81 --
82 Begin
83   hr_utility.set_location('Entering:'||l_proc, 5);
84   --
85   -- Get the object version number for the insert
86   --
87   p_rec.object_version_number :=
88     dt_api.get_object_version_number
89 	(p_base_table_name => 'ben_pl_bnf_ctfn_prvdd_f',
90 	 p_base_key_column => 'pl_bnf_ctfn_prvdd_id',
91 	 p_base_key_value  => p_rec.pl_bnf_ctfn_prvdd_id);
92   --
93   -- Set the effective start and end dates to the corresponding
94   -- validation start and end dates
95   --
96   p_rec.effective_start_date := p_validation_start_date;
97   p_rec.effective_end_date   := p_validation_end_date;
98   --
99   -- If the datetrack_mode is not INSERT then we must populate the WHO
100   -- columns with the 'old' creation values and 'new' updated values.
101   --
102   If (p_datetrack_mode <> 'INSERT') then
103     hr_utility.set_location(l_proc, 10);
104     --
105     -- Select the 'old' created values
106     --
107     Open C_Sel1;
108     Fetch C_Sel1 Into l_created_by, l_creation_date;
109     If C_Sel1%notfound Then
110       --
111       -- The previous 'old' created row has not been found. We need
112       -- to error as an internal datetrack problem exists.
113       --
114       Close C_Sel1;
115       fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
116       fnd_message.set_token('PROCEDURE', l_proc);
117       fnd_message.set_token('STEP','10');
118       fnd_message.raise_error;
119     End If;
120     Close C_Sel1;
121     --
122     -- Set the AOL updated WHO values
123     --
124     l_last_update_date   := sysdate;
125     l_last_updated_by    := fnd_global.user_id;
126     l_last_update_login  := fnd_global.login_id;
127   End If;
128   --
129   ben_pbc_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_pl_bnf_ctfn_prvdd_f
132   --
133   insert into ben_pl_bnf_ctfn_prvdd_f
134   (	pl_bnf_ctfn_prvdd_id,
135 	effective_start_date,
136 	effective_end_date,
137 	bnf_ctfn_typ_cd,
138 	bnf_ctfn_recd_dt,
139 	bnf_ctfn_rqd_flag,
140 	pl_bnf_id,
141 	prtt_enrt_actn_id,
142 	business_group_id,
143 	pbc_attribute_category,
144 	pbc_attribute1,
145 	pbc_attribute2,
146 	pbc_attribute3,
147 	pbc_attribute4,
148 	pbc_attribute5,
149 	pbc_attribute6,
150 	pbc_attribute7,
151 	pbc_attribute8,
152 	pbc_attribute9,
153 	pbc_attribute10,
154 	pbc_attribute11,
155 	pbc_attribute12,
156 	pbc_attribute13,
157 	pbc_attribute14,
158 	pbc_attribute15,
159 	pbc_attribute16,
160 	pbc_attribute17,
161 	pbc_attribute18,
162 	pbc_attribute19,
163 	pbc_attribute20,
164 	pbc_attribute21,
165 	pbc_attribute22,
166 	pbc_attribute23,
167 	pbc_attribute24,
168 	pbc_attribute25,
169 	pbc_attribute26,
170 	pbc_attribute27,
171 	pbc_attribute28,
172 	pbc_attribute29,
173 	pbc_attribute30,
174 	request_id,
175 	program_application_id,
176 	program_id,
177 	program_update_date,
178 	object_version_number
179    	, created_by,
180    	creation_date,
181    	last_update_date,
182    	last_updated_by,
183    	last_update_login
184   )
185   Values
186   (	p_rec.pl_bnf_ctfn_prvdd_id,
187 	p_rec.effective_start_date,
188 	p_rec.effective_end_date,
189 	p_rec.bnf_ctfn_typ_cd,
190 	p_rec.bnf_ctfn_recd_dt,
191 	p_rec.bnf_ctfn_rqd_flag,
192 	p_rec.pl_bnf_id,
193 	p_rec.prtt_enrt_actn_id,
194 	p_rec.business_group_id,
195 	p_rec.pbc_attribute_category,
196 	p_rec.pbc_attribute1,
197 	p_rec.pbc_attribute2,
198 	p_rec.pbc_attribute3,
199 	p_rec.pbc_attribute4,
200 	p_rec.pbc_attribute5,
201 	p_rec.pbc_attribute6,
202 	p_rec.pbc_attribute7,
203 	p_rec.pbc_attribute8,
204 	p_rec.pbc_attribute9,
205 	p_rec.pbc_attribute10,
206 	p_rec.pbc_attribute11,
207 	p_rec.pbc_attribute12,
208 	p_rec.pbc_attribute13,
209 	p_rec.pbc_attribute14,
210 	p_rec.pbc_attribute15,
211 	p_rec.pbc_attribute16,
212 	p_rec.pbc_attribute17,
213 	p_rec.pbc_attribute18,
214 	p_rec.pbc_attribute19,
215 	p_rec.pbc_attribute20,
216 	p_rec.pbc_attribute21,
217 	p_rec.pbc_attribute22,
218 	p_rec.pbc_attribute23,
219 	p_rec.pbc_attribute24,
220 	p_rec.pbc_attribute25,
221 	p_rec.pbc_attribute26,
222 	p_rec.pbc_attribute27,
223 	p_rec.pbc_attribute28,
224 	p_rec.pbc_attribute29,
225 	p_rec.pbc_attribute30,
226 	p_rec.request_id,
227 	p_rec.program_application_id,
228 	p_rec.program_id,
229 	p_rec.program_update_date,
230 	p_rec.object_version_number
231 	, l_created_by,
232    	l_creation_date,
233    	l_last_update_date,
234    	l_last_updated_by,
235    	l_last_update_login
236   );
237   --
238   ben_pbc_shd.g_api_dml := false;   -- Unset the api dml status
239   hr_utility.set_location(' Leaving:'||l_proc, 15);
240 --
241 Exception
242   When hr_api.check_integrity_violated Then
243     -- A check constraint has been violated
244     ben_pbc_shd.g_api_dml := false;   -- Unset the api dml status
245     ben_pbc_shd.constraint_error
246       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
247   When hr_api.unique_integrity_violated Then
248     -- Unique integrity has been violated
249     ben_pbc_shd.g_api_dml := false;   -- Unset the api dml status
250     ben_pbc_shd.constraint_error
251       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
252   When Others Then
253     ben_pbc_shd.g_api_dml := false;   -- Unset the api dml status
254     Raise;
255 End dt_insert_dml;
256 --
257 -- ----------------------------------------------------------------------------
258 -- |------------------------------< insert_dml >------------------------------|
259 -- ----------------------------------------------------------------------------
260 Procedure insert_dml
261 	(p_rec 			 in out nocopy ben_pbc_shd.g_rec_type,
262 	 p_effective_date	 in	date,
263 	 p_datetrack_mode	 in	varchar2,
264 	 p_validation_start_date in	date,
265 	 p_validation_end_date	 in	date) is
266 --
267   l_proc	varchar2(72) := g_package||'insert_dml';
268 --
269 Begin
270   hr_utility.set_location('Entering:'||l_proc, 5);
271   --
272   dt_insert_dml(p_rec			=> p_rec,
273 		p_effective_date	=> p_effective_date,
274 		p_datetrack_mode	=> p_datetrack_mode,
275        		p_validation_start_date	=> p_validation_start_date,
276 		p_validation_end_date	=> p_validation_end_date);
277   --
278   hr_utility.set_location(' Leaving:'||l_proc, 10);
279 End insert_dml;
280 --
281 -- ----------------------------------------------------------------------------
282 -- |------------------------------< pre_insert >------------------------------|
283 -- ----------------------------------------------------------------------------
284 -- {Start Of Comments}
285 --
286 -- Description:
287 --   This private procedure contains any processing which is required before
288 --   the insert dml. Presently, if the entity has a corresponding primary
289 --   key which is maintained by an associating sequence, the primary key for
290 --   the entity will be populated with the next sequence value in
291 --   preparation for the insert dml.
292 --   Also, if comments are defined for this entity, the comments insert
293 --   logic will also be called, generating a comment_id if required.
294 --
295 -- Prerequisites:
296 --   This is an internal procedure which is called from the ins procedure.
297 --
298 -- In Parameters:
299 --   A Pl/Sql record structre.
300 --
301 -- Post Success:
302 --   Processing continues.
303 --
304 -- Post Failure:
305 --   If an error has occurred, an error message and exception will be raised
306 --   but not handled.
307 --
308 -- Developer Implementation Notes:
309 --   Any pre-processing required before the insert dml is issued should be
310 --   coded within this procedure. As stated above, a good example is the
311 --   generation of a primary key number via a corresponding sequence.
312 --   It is important to note that any 3rd party maintenance should be reviewed
313 --   before placing in this procedure.
314 --
315 -- Access Status:
316 --   Internal Row Handler Use Only.
317 --
318 -- {End Of Comments}
319 -- ----------------------------------------------------------------------------
320 Procedure pre_insert
321 	(p_rec  			in out nocopy ben_pbc_shd.g_rec_type,
322 	 p_effective_date		in date,
323 	 p_datetrack_mode		in varchar2,
324 	 p_validation_start_date	in date,
325 	 p_validation_end_date		in date) is
326 --
327   l_proc	varchar2(72) := g_package||'pre_insert';
328 --
329 --
330   cursor c1 is
331     select ben_pl_bnf_ctfn_prvdd_f_s.nextval
332     from sys.dual;
333 --
334 --
335 Begin
336   hr_utility.set_location('Entering:'||l_proc, 5);
337   --
338   --
339   open c1;
340   fetch c1 into p_rec.pl_bnf_ctfn_prvdd_id;
341   close c1;
342   --
343   --
344   --
345   hr_utility.set_location(' Leaving:'||l_proc, 10);
346 End pre_insert;
347 --
348 -- ----------------------------------------------------------------------------
349 -- |-----------------------------< post_insert >------------------------------|
350 -- ----------------------------------------------------------------------------
351 -- {Start Of Comments}
352 --
353 -- Description:
354 --   This private procedure contains any processing which is required after the
355 --   insert dml.
356 --
357 -- Prerequisites:
358 --   This is an internal procedure which is called from the ins procedure.
359 --
360 -- In Parameters:
361 --   A Pl/Sql record structre.
362 --
363 -- Post Success:
364 --   Processing continues.
365 --
366 -- Post Failure:
367 --   If an error has occurred, an error message and exception will be raised
368 --   but not handled.
369 --
370 -- Developer Implementation Notes:
371 --   Any post-processing required after the insert dml is issued should be
372 --   coded within this procedure. It is important to note that any 3rd party
373 --   maintenance should be reviewed before placing in this procedure.
374 --
375 -- Access Status:
376 --   Internal Row Handler Use Only.
377 --
378 -- {End Of Comments}
379 -- ----------------------------------------------------------------------------
380 Procedure post_insert
381 	(p_rec 			 in ben_pbc_shd.g_rec_type,
382 	 p_effective_date	 in date,
383 	 p_datetrack_mode	 in varchar2,
384 	 p_validation_start_date in date,
385 	 p_validation_end_date	 in date) is
386 --
387   l_proc	varchar2(72) := g_package||'post_insert';
388 --
389 Begin
390   hr_utility.set_location('Entering:'||l_proc, 5);
391 --
392   --
393   -- Start of API User Hook for post_insert.
394   --
395   begin
396     --
397     ben_pbc_rki.after_insert
398       (
399   p_pl_bnf_ctfn_prvdd_id          =>p_rec.pl_bnf_ctfn_prvdd_id
400  ,p_effective_start_date          =>p_rec.effective_start_date
401  ,p_effective_end_date            =>p_rec.effective_end_date
402  ,p_bnf_ctfn_typ_cd               =>p_rec.bnf_ctfn_typ_cd
403  ,p_bnf_ctfn_recd_dt              =>p_rec.bnf_ctfn_recd_dt
404  ,p_bnf_ctfn_rqd_flag             =>p_rec.bnf_ctfn_rqd_flag
405  ,p_pl_bnf_id                     =>p_rec.pl_bnf_id
406  ,p_prtt_enrt_actn_id             =>p_rec.prtt_enrt_actn_id
407  ,p_business_group_id             =>p_rec.business_group_id
408  ,p_pbc_attribute_category        =>p_rec.pbc_attribute_category
409  ,p_pbc_attribute1                =>p_rec.pbc_attribute1
410  ,p_pbc_attribute2                =>p_rec.pbc_attribute2
411  ,p_pbc_attribute3                =>p_rec.pbc_attribute3
412  ,p_pbc_attribute4                =>p_rec.pbc_attribute4
413  ,p_pbc_attribute5                =>p_rec.pbc_attribute5
414  ,p_pbc_attribute6                =>p_rec.pbc_attribute6
415  ,p_pbc_attribute7                =>p_rec.pbc_attribute7
416  ,p_pbc_attribute8                =>p_rec.pbc_attribute8
417  ,p_pbc_attribute9                =>p_rec.pbc_attribute9
418  ,p_pbc_attribute10               =>p_rec.pbc_attribute10
419  ,p_pbc_attribute11               =>p_rec.pbc_attribute11
420  ,p_pbc_attribute12               =>p_rec.pbc_attribute12
421  ,p_pbc_attribute13               =>p_rec.pbc_attribute13
422  ,p_pbc_attribute14               =>p_rec.pbc_attribute14
423  ,p_pbc_attribute15               =>p_rec.pbc_attribute15
424  ,p_pbc_attribute16               =>p_rec.pbc_attribute16
425  ,p_pbc_attribute17               =>p_rec.pbc_attribute17
426  ,p_pbc_attribute18               =>p_rec.pbc_attribute18
427  ,p_pbc_attribute19               =>p_rec.pbc_attribute19
428  ,p_pbc_attribute20               =>p_rec.pbc_attribute20
429  ,p_pbc_attribute21               =>p_rec.pbc_attribute21
430  ,p_pbc_attribute22               =>p_rec.pbc_attribute22
431  ,p_pbc_attribute23               =>p_rec.pbc_attribute23
432  ,p_pbc_attribute24               =>p_rec.pbc_attribute24
433  ,p_pbc_attribute25               =>p_rec.pbc_attribute25
434  ,p_pbc_attribute26               =>p_rec.pbc_attribute26
435  ,p_pbc_attribute27               =>p_rec.pbc_attribute27
436  ,p_pbc_attribute28               =>p_rec.pbc_attribute28
437  ,p_pbc_attribute29               =>p_rec.pbc_attribute29
438  ,p_pbc_attribute30               =>p_rec.pbc_attribute30
439  ,p_request_id                    =>p_rec.request_id
440  ,p_program_application_id        =>p_rec.program_application_id
441  ,p_program_id                    =>p_rec.program_id
442  ,p_program_update_date           =>p_rec.program_update_date
443  ,p_object_version_number         =>p_rec.object_version_number
444  ,p_effective_date                =>p_effective_date
445  ,p_validation_start_date         =>p_validation_start_date
446  ,p_validation_end_date           =>p_validation_end_date
447       );
448     --
449   exception
450     --
451     when hr_api.cannot_find_prog_unit then
452       --
453       hr_api.cannot_find_prog_unit_error
454         (p_module_name => 'ben_pl_bnf_ctfn_prvdd_f'
455         ,p_hook_type   => 'AI');
456       --
457   end;
458   --
459   -- End of API User Hook for post_insert.
460   --
461   --
462   hr_utility.set_location(' Leaving:'||l_proc, 10);
463 End post_insert;
464 --
465 -- ----------------------------------------------------------------------------
466 -- |-------------------------------< ins_lck >--------------------------------|
467 -- ----------------------------------------------------------------------------
468 -- {Start Of Comments}
469 --
470 -- Description:
471 --   The ins_lck process has one main function to perform. When inserting
472 --   a datetracked row, we must validate the DT mode.
473 --   be manipulated.
474 --
475 -- Prerequisites:
476 --   This procedure can only be called for the datetrack mode of INSERT.
477 --
478 -- In Parameters:
479 --
480 -- Post Success:
481 --   On successful completion of the ins_lck process the parental
482 --   datetracked rows will be locked providing the p_enforce_foreign_locking
483 --   argument value is TRUE.
484 --   If the p_enforce_foreign_locking argument value is FALSE then the
485 --   parential rows are not locked.
486 --
487 -- Post Failure:
488 --   The Lck process can fail for:
489 --   1) When attempting to lock the row the row could already be locked by
490 --      another user. This will raise the HR_Api.Object_Locked exception.
491 --   2) When attempting to the lock the parent which doesn't exist.
492 --      For the entity to be locked the parent must exist!
493 --
494 -- Developer Implementation Notes:
495 --   None.
496 --
497 -- Access Status:
498 --   Internal Row Handler Use Only.
499 --
500 -- {End Of Comments}
501 -- ----------------------------------------------------------------------------
502 Procedure ins_lck
503 	(p_effective_date	 in  date,
504 	 p_datetrack_mode	 in  varchar2,
505 	 p_rec	 		 in  ben_pbc_shd.g_rec_type,
506 	 p_validation_start_date out nocopy date,
507 	 p_validation_end_date	 out nocopy date) is
508 --
509   l_proc		  varchar2(72) := g_package||'ins_lck';
510   l_validation_start_date date;
511   l_validation_end_date	  date;
512 --
513 Begin
514   hr_utility.set_location('Entering:'||l_proc, 5);
515   --
516   -- Validate the datetrack mode mode getting the validation start
517   -- and end dates for the specified datetrack operation.
518   --
519   dt_api.validate_dt_mode
520 	(p_effective_date	   => p_effective_date,
521 	 p_datetrack_mode	   => p_datetrack_mode,
522 	 p_base_table_name	   => 'ben_pl_bnf_ctfn_prvdd_f',
523 	 p_base_key_column	   => 'pl_bnf_ctfn_prvdd_id',
524 	 p_base_key_value 	   => p_rec.pl_bnf_ctfn_prvdd_id,
525 	 p_parent_table_name1      => 'ben_pl_bnf_f',
526 	 p_parent_key_column1      => 'pl_bnf_id',
527 	 p_parent_key_value1       => p_rec.pl_bnf_id,
528 	 p_parent_table_name2      => 'ben_prtt_enrt_actn_f',
529 	 p_parent_key_column2      => 'prtt_enrt_actn_id',
530 	 p_parent_key_value2       => p_rec.prtt_enrt_actn_id,
531          p_enforce_foreign_locking => false,
532 	 p_validation_start_date   => l_validation_start_date,
533  	 p_validation_end_date	   => l_validation_end_date);
534   --
535   -- Set the validation start and end date OUT arguments
536   --
537   p_validation_start_date := l_validation_start_date;
538   p_validation_end_date   := l_validation_end_date;
539   --
540   hr_utility.set_location(' Leaving:'||l_proc, 10);
541 --
542 End ins_lck;
543 --
544 -- ----------------------------------------------------------------------------
545 -- |---------------------------------< ins >----------------------------------|
546 -- ----------------------------------------------------------------------------
547 Procedure ins
548   (
549   p_rec		   in out nocopy ben_pbc_shd.g_rec_type,
550   p_effective_date in     date
551   ) is
552 --
553   l_proc			varchar2(72) := g_package||'ins';
554   l_datetrack_mode		varchar2(30) := 'INSERT';
555   l_validation_start_date	date;
556   l_validation_end_date		date;
557 --
558 Begin
559   hr_utility.set_location('Entering:'||l_proc, 5);
560   --
561   -- Call the lock operation
562   --
563   ins_lck
564 	(p_effective_date	 => p_effective_date,
565 	 p_datetrack_mode	 => l_datetrack_mode,
566 	 p_rec	 		 => p_rec,
567 	 p_validation_start_date => l_validation_start_date,
568 	 p_validation_end_date	 => l_validation_end_date);
569   --
570   -- Call the supporting insert validate operations
571   --
572   ben_pbc_bus.insert_validate
573 	(p_rec			 => p_rec,
574 	 p_effective_date	 => p_effective_date,
575 	 p_datetrack_mode	 => l_datetrack_mode,
576 	 p_validation_start_date => l_validation_start_date,
577 	 p_validation_end_date	 => l_validation_end_date);
578   --
579   -- Call the supporting pre-insert operation
580   --
581   pre_insert
582  	(p_rec			 => p_rec,
583 	 p_effective_date	 => p_effective_date,
584 	 p_datetrack_mode	 => l_datetrack_mode,
585 	 p_validation_start_date => l_validation_start_date,
586 	 p_validation_end_date	 => l_validation_end_date);
587   --
588   -- Insert the row
589   --
590   insert_dml
591  	(p_rec			 => p_rec,
592 	 p_effective_date	 => p_effective_date,
593 	 p_datetrack_mode	 => l_datetrack_mode,
594 	 p_validation_start_date => l_validation_start_date,
595 	 p_validation_end_date	 => l_validation_end_date);
596   --
597   -- Call the supporting post-insert operation
598   --
599   post_insert
600  	(p_rec			 => p_rec,
601 	 p_effective_date	 => p_effective_date,
602 	 p_datetrack_mode	 => l_datetrack_mode,
603 	 p_validation_start_date => l_validation_start_date,
604 	 p_validation_end_date	 => l_validation_end_date);
605 end ins;
606 --
607 -- ----------------------------------------------------------------------------
608 -- |---------------------------------< ins >----------------------------------|
609 -- ----------------------------------------------------------------------------
610 Procedure ins
611   (
612   p_pl_bnf_ctfn_prvdd_id         out nocopy number,
613   p_effective_start_date         out nocopy date,
614   p_effective_end_date           out nocopy date,
615   p_bnf_ctfn_typ_cd              in varchar2,
616   p_bnf_ctfn_recd_dt             in date             default null,
617   p_bnf_ctfn_rqd_flag            in varchar2,
618   p_pl_bnf_id                    in number,
619   p_prtt_enrt_actn_id            in number,
620   p_business_group_id            in number,
621   p_pbc_attribute_category       in varchar2         default null,
622   p_pbc_attribute1               in varchar2         default null,
623   p_pbc_attribute2               in varchar2         default null,
624   p_pbc_attribute3               in varchar2         default null,
625   p_pbc_attribute4               in varchar2         default null,
626   p_pbc_attribute5               in varchar2         default null,
627   p_pbc_attribute6               in varchar2         default null,
628   p_pbc_attribute7               in varchar2         default null,
629   p_pbc_attribute8               in varchar2         default null,
630   p_pbc_attribute9               in varchar2         default null,
631   p_pbc_attribute10              in varchar2         default null,
632   p_pbc_attribute11              in varchar2         default null,
633   p_pbc_attribute12              in varchar2         default null,
634   p_pbc_attribute13              in varchar2         default null,
635   p_pbc_attribute14              in varchar2         default null,
636   p_pbc_attribute15              in varchar2         default null,
637   p_pbc_attribute16              in varchar2         default null,
638   p_pbc_attribute17              in varchar2         default null,
639   p_pbc_attribute18              in varchar2         default null,
640   p_pbc_attribute19              in varchar2         default null,
641   p_pbc_attribute20              in varchar2         default null,
642   p_pbc_attribute21              in varchar2         default null,
643   p_pbc_attribute22              in varchar2         default null,
644   p_pbc_attribute23              in varchar2         default null,
645   p_pbc_attribute24              in varchar2         default null,
646   p_pbc_attribute25              in varchar2         default null,
647   p_pbc_attribute26              in varchar2         default null,
648   p_pbc_attribute27              in varchar2         default null,
649   p_pbc_attribute28              in varchar2         default null,
650   p_pbc_attribute29              in varchar2         default null,
651   p_pbc_attribute30              in varchar2         default null,
652   p_request_id                   in number           default null,
653   p_program_application_id       in number           default null,
654   p_program_id                   in number           default null,
655   p_program_update_date          in date             default null,
656   p_object_version_number        out nocopy number,
657   p_effective_date		 in date
658   ) is
659 --
660   l_rec		ben_pbc_shd.g_rec_type;
661   l_proc	varchar2(72) := g_package||'ins';
662 --
663 Begin
664   hr_utility.set_location('Entering:'||l_proc, 5);
665   --
666   -- Call conversion function to turn arguments into the
667   -- p_rec structure.
668   --
669   l_rec :=
670   ben_pbc_shd.convert_args
671   (
672   null,
673   null,
674   null,
675   p_bnf_ctfn_typ_cd,
676   p_bnf_ctfn_recd_dt,
677   p_bnf_ctfn_rqd_flag,
678   p_pl_bnf_id,
679   p_prtt_enrt_actn_id,
680   p_business_group_id,
681   p_pbc_attribute_category,
682   p_pbc_attribute1,
683   p_pbc_attribute2,
684   p_pbc_attribute3,
685   p_pbc_attribute4,
686   p_pbc_attribute5,
687   p_pbc_attribute6,
688   p_pbc_attribute7,
689   p_pbc_attribute8,
690   p_pbc_attribute9,
691   p_pbc_attribute10,
692   p_pbc_attribute11,
693   p_pbc_attribute12,
694   p_pbc_attribute13,
695   p_pbc_attribute14,
696   p_pbc_attribute15,
697   p_pbc_attribute16,
698   p_pbc_attribute17,
699   p_pbc_attribute18,
700   p_pbc_attribute19,
701   p_pbc_attribute20,
702   p_pbc_attribute21,
703   p_pbc_attribute22,
704   p_pbc_attribute23,
705   p_pbc_attribute24,
706   p_pbc_attribute25,
707   p_pbc_attribute26,
708   p_pbc_attribute27,
709   p_pbc_attribute28,
710   p_pbc_attribute29,
711   p_pbc_attribute30,
712   p_request_id,
713   p_program_application_id,
714   p_program_id,
715   p_program_update_date,
716   null
717   );
718   --
719   -- Having converted the arguments into the ben_pbc_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_pl_bnf_ctfn_prvdd_id        	:= l_rec.pl_bnf_ctfn_prvdd_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_pbc_ins;