DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PPR_INS

Source


1 Package Body ben_ppr_ins as
2 /* $Header: bepprrhi.pkb 120.1 2008/02/05 09:49:35 rtagarra noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  ben_ppr_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_ppr_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_prmry_care_prvdr_f t
70     where  t.prmry_care_prvdr_id       = p_rec.prmry_care_prvdr_id
71     and    t.effective_start_date =
72              ben_ppr_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_prmry_care_prvdr_f.created_by%TYPE;
77   l_creation_date       ben_prmry_care_prvdr_f.creation_date%TYPE;
78   l_last_update_date    ben_prmry_care_prvdr_f.last_update_date%TYPE;
79   l_last_updated_by     ben_prmry_care_prvdr_f.last_updated_by%TYPE;
80   l_last_update_login   ben_prmry_care_prvdr_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_prmry_care_prvdr_f',
90    p_base_key_column => 'prmry_care_prvdr_id',
91    p_base_key_value  => p_rec.prmry_care_prvdr_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_ppr_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_prmry_care_prvdr_f
132   --
133   insert into ben_prmry_care_prvdr_f
134   ( prmry_care_prvdr_id,
135   effective_start_date,
136   effective_end_date,
137   name,
138   ext_ident,
139   prmry_care_prvdr_typ_cd,
140   prtt_enrt_rslt_id,
141   elig_cvrd_dpnt_id,
142   business_group_id,
143   ppr_attribute_category,
144   ppr_attribute1,
145   ppr_attribute2,
146   ppr_attribute3,
147   ppr_attribute4,
148   ppr_attribute5,
149   ppr_attribute6,
150   ppr_attribute7,
151   ppr_attribute8,
152   ppr_attribute9,
153   ppr_attribute10,
154   ppr_attribute11,
155   ppr_attribute12,
156   ppr_attribute13,
157   ppr_attribute14,
158   ppr_attribute15,
159   ppr_attribute16,
160   ppr_attribute17,
161   ppr_attribute18,
162   ppr_attribute19,
163   ppr_attribute20,
164   ppr_attribute21,
165   ppr_attribute22,
166   ppr_attribute23,
167   ppr_attribute24,
168   ppr_attribute25,
169   ppr_attribute26,
170   ppr_attribute27,
171   ppr_attribute28,
172   ppr_attribute29,
173   ppr_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.prmry_care_prvdr_id,
187   p_rec.effective_start_date,
188   p_rec.effective_end_date,
189   p_rec.name,
190   p_rec.ext_ident,
191   p_rec.prmry_care_prvdr_typ_cd,
192   p_rec.prtt_enrt_rslt_id,
193   p_rec.elig_cvrd_dpnt_id,
194   p_rec.business_group_id,
195   p_rec.ppr_attribute_category,
196   p_rec.ppr_attribute1,
197   p_rec.ppr_attribute2,
198   p_rec.ppr_attribute3,
199   p_rec.ppr_attribute4,
200   p_rec.ppr_attribute5,
201   p_rec.ppr_attribute6,
202   p_rec.ppr_attribute7,
203   p_rec.ppr_attribute8,
204   p_rec.ppr_attribute9,
205   p_rec.ppr_attribute10,
206   p_rec.ppr_attribute11,
207   p_rec.ppr_attribute12,
208   p_rec.ppr_attribute13,
209   p_rec.ppr_attribute14,
210   p_rec.ppr_attribute15,
211   p_rec.ppr_attribute16,
212   p_rec.ppr_attribute17,
213   p_rec.ppr_attribute18,
214   p_rec.ppr_attribute19,
215   p_rec.ppr_attribute20,
216   p_rec.ppr_attribute21,
217   p_rec.ppr_attribute22,
218   p_rec.ppr_attribute23,
219   p_rec.ppr_attribute24,
220   p_rec.ppr_attribute25,
221   p_rec.ppr_attribute26,
222   p_rec.ppr_attribute27,
223   p_rec.ppr_attribute28,
224   p_rec.ppr_attribute29,
225   p_rec.ppr_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_ppr_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_ppr_shd.g_api_dml := false;   -- Unset the api dml status
245     ben_ppr_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_ppr_shd.g_api_dml := false;   -- Unset the api dml status
250     ben_ppr_shd.constraint_error
251       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
252   When Others Then
253     ben_ppr_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_ppr_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_ppr_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   cursor c1 is
330     select ben_prmry_care_prvdr_f_s.nextval from sys.dual;
331 
332 Begin
333   hr_utility.set_location('Entering:'||l_proc, 5);
334 
335   open c1;
336   fetch c1 into p_rec.prmry_care_prvdr_id;
337   close c1;
338 
339   hr_utility.set_location(' Leaving:'||l_proc, 10);
340 End pre_insert;
341 --
342 -- ----------------------------------------------------------------------------
343 -- |-----------------------------< post_insert >------------------------------|
344 -- ----------------------------------------------------------------------------
345 -- {Start Of Comments}
346 --
347 -- Description:
348 --   This private procedure contains any processing which is required after the
349 --   insert dml.
350 --
351 -- Prerequisites:
352 --   This is an internal procedure which is called from the ins procedure.
353 --
354 -- In Parameters:
355 --   A Pl/Sql record structre.
356 --
357 -- Post Success:
358 --   Processing continues.
359 --
360 -- Post Failure:
361 --   If an error has occurred, an error message and exception will be raised
362 --   but not handled.
363 --
364 -- Developer Implementation Notes:
365 --   Any post-processing required after the insert dml is issued should be
366 --   coded within this procedure. It is important to note that any 3rd party
367 --   maintenance should be reviewed before placing in this procedure.
368 --
369 -- Access Status:
370 --   Internal Row Handler Use Only.
371 --
372 -- {End Of Comments}
373 -- ----------------------------------------------------------------------------
374 Procedure post_insert
375   (p_rec       in ben_ppr_shd.g_rec_type,
376    p_effective_date  in date,
377    p_datetrack_mode  in varchar2,
378    p_validation_start_date in date,
379    p_validation_end_date   in date) is
380 --
381   l_proc  varchar2(72) := g_package||'post_insert';
382 --
383 Begin
384   hr_utility.set_location('Entering:'||l_proc, 5);
385 --
386   --
387   -- Start of API User Hook for post_insert.
388   --
389   begin
390     --
391     ben_ppr_rki.after_insert
392       (
393   p_prmry_care_prvdr_id           =>p_rec.prmry_care_prvdr_id
394  ,p_effective_start_date          =>p_rec.effective_start_date
395  ,p_effective_end_date            =>p_rec.effective_end_date
396  ,p_name                          =>p_rec.name
397  ,p_ext_ident                     =>p_rec.ext_ident
398  ,p_prmry_care_prvdr_typ_cd       =>p_rec.prmry_care_prvdr_typ_cd
399  ,p_prtt_enrt_rslt_id             =>p_rec.prtt_enrt_rslt_id
400  ,p_elig_cvrd_dpnt_id             =>p_rec.elig_cvrd_dpnt_id
401  ,p_business_group_id             =>p_rec.business_group_id
402  ,p_ppr_attribute_category        =>p_rec.ppr_attribute_category
403  ,p_ppr_attribute1                =>p_rec.ppr_attribute1
404  ,p_ppr_attribute2                =>p_rec.ppr_attribute2
405  ,p_ppr_attribute3                =>p_rec.ppr_attribute3
406  ,p_ppr_attribute4                =>p_rec.ppr_attribute4
407  ,p_ppr_attribute5                =>p_rec.ppr_attribute5
408  ,p_ppr_attribute6                =>p_rec.ppr_attribute6
409  ,p_ppr_attribute7                =>p_rec.ppr_attribute7
410  ,p_ppr_attribute8                =>p_rec.ppr_attribute8
411  ,p_ppr_attribute9                =>p_rec.ppr_attribute9
412  ,p_ppr_attribute10               =>p_rec.ppr_attribute10
413  ,p_ppr_attribute11               =>p_rec.ppr_attribute11
414  ,p_ppr_attribute12               =>p_rec.ppr_attribute12
415  ,p_ppr_attribute13               =>p_rec.ppr_attribute13
416  ,p_ppr_attribute14               =>p_rec.ppr_attribute14
417  ,p_ppr_attribute15               =>p_rec.ppr_attribute15
418  ,p_ppr_attribute16               =>p_rec.ppr_attribute16
419  ,p_ppr_attribute17               =>p_rec.ppr_attribute17
420  ,p_ppr_attribute18               =>p_rec.ppr_attribute18
421  ,p_ppr_attribute19               =>p_rec.ppr_attribute19
422  ,p_ppr_attribute20               =>p_rec.ppr_attribute20
423  ,p_ppr_attribute21               =>p_rec.ppr_attribute21
424  ,p_ppr_attribute22               =>p_rec.ppr_attribute22
425  ,p_ppr_attribute23               =>p_rec.ppr_attribute23
426  ,p_ppr_attribute24               =>p_rec.ppr_attribute24
427  ,p_ppr_attribute25               =>p_rec.ppr_attribute25
428  ,p_ppr_attribute26               =>p_rec.ppr_attribute26
429  ,p_ppr_attribute27               =>p_rec.ppr_attribute27
430  ,p_ppr_attribute28               =>p_rec.ppr_attribute28
431  ,p_ppr_attribute29               =>p_rec.ppr_attribute29
432  ,p_ppr_attribute30               =>p_rec.ppr_attribute30
433  ,p_request_id                    =>p_rec.request_id
434  ,p_program_application_id        =>p_rec.program_application_id
435  ,p_program_id                    =>p_rec.program_id
436  ,p_program_update_date           =>p_rec.program_update_date
437  ,p_object_version_number         =>p_rec.object_version_number
438  ,p_effective_date                =>p_effective_date
439  ,p_validation_start_date         =>p_validation_start_date
440  ,p_validation_end_date           =>p_validation_end_date
441       );
442     --
443   exception
444     --
445     when hr_api.cannot_find_prog_unit then
446       --
447       hr_api.cannot_find_prog_unit_error
448         (p_module_name => 'ben_prmry_care_prvdr_f'
449         ,p_hook_type   => 'AI');
450       --
451   end;
452   --
453   -- End of API User Hook for post_insert.
454   --
455   --
456   hr_utility.set_location(' Leaving:'||l_proc, 10);
457 End post_insert;
458 --
459 -- ----------------------------------------------------------------------------
460 -- |-------------------------------< ins_lck >--------------------------------|
461 -- ----------------------------------------------------------------------------
462 -- {Start Of Comments}
463 --
464 -- Description:
465 --   The ins_lck process has one main function to perform. When inserting
466 --   a datetracked row, we must validate the DT mode.
467 --   be manipulated.
468 --
469 -- Prerequisites:
470 --   This procedure can only be called for the datetrack mode of INSERT.
471 --
472 -- In Parameters:
473 --
474 -- Post Success:
475 --   On successful completion of the ins_lck process the parental
476 --   datetracked rows will be locked providing the p_enforce_foreign_locking
477 --   argument value is TRUE.
478 --   If the p_enforce_foreign_locking argument value is FALSE then the
479 --   parential rows are not locked.
480 --
481 -- Post Failure:
482 --   The Lck process can fail for:
483 --   1) When attempting to lock the row the row could already be locked by
484 --      another user. This will raise the HR_Api.Object_Locked exception.
485 --   2) When attempting to the lock the parent which doesn't exist.
486 --      For the entity to be locked the parent must exist!
487 --
488 -- Developer Implementation Notes:
489 --   None.
490 --
491 -- Access Status:
492 --   Internal Row Handler Use Only.
493 --
494 -- {End Of Comments}
495 -- ----------------------------------------------------------------------------
496 Procedure ins_lck
497   (p_effective_date  in  date,
498    p_datetrack_mode  in  varchar2,
499    p_rec       in  ben_ppr_shd.g_rec_type,
500    p_validation_start_date out nocopy date,
501    p_validation_end_date   out nocopy date) is
502 --
503   l_proc      varchar2(72) := g_package||'ins_lck';
504   l_validation_start_date date;
505   l_validation_end_date   date;
506 --
507 Begin
508   hr_utility.set_location('Entering:'||l_proc, 5);
509   --
510   -- Validate the datetrack mode mode getting the validation start
511   -- and end dates for the specified datetrack operation.
512   --
513   dt_api.validate_dt_mode
514   (p_effective_date    => p_effective_date,
515    p_datetrack_mode    => p_datetrack_mode,
516    p_base_table_name     => 'ben_prmry_care_prvdr_f',
517    p_base_key_column     => 'prmry_care_prvdr_id',
518    p_base_key_value      => p_rec.prmry_care_prvdr_id,
519    p_parent_table_name1      => 'ben_elig_cvrd_dpnt_f',
520    p_parent_key_column1      => 'elig_cvrd_dpnt_id',
521    p_parent_key_value1       => p_rec.elig_cvrd_dpnt_id,
522    p_parent_table_name2      => 'ben_prtt_enrt_rslt_f',
523    p_parent_key_column2      => 'prtt_enrt_rslt_id',
524    p_parent_key_value2       => p_rec.prtt_enrt_rslt_id,
525          p_enforce_foreign_locking => true,
526    p_validation_start_date   => l_validation_start_date,
527    p_validation_end_date     => l_validation_end_date);
528   --
529   -- Set the validation start and end date OUT arguments
530   --
531   p_validation_start_date := l_validation_start_date;
532   p_validation_end_date   := l_validation_end_date;
533   --
534   hr_utility.set_location(' Leaving:'||l_proc, 10);
535 --
536 End ins_lck;
537 --
538 -- ----------------------------------------------------------------------------
539 -- |---------------------------------< ins >----------------------------------|
540 -- ----------------------------------------------------------------------------
541 Procedure ins
542   (
543   p_rec      in out nocopy ben_ppr_shd.g_rec_type,
544   p_effective_date in     date
545   ) is
546 --
547   l_proc      varchar2(72) := g_package||'ins';
548   l_datetrack_mode    varchar2(30) := 'INSERT';
549   l_validation_start_date date;
550   l_validation_end_date   date;
551 --
552 Begin
553   hr_utility.set_location('Entering:'||l_proc, 5);
554   --
555   -- Call the lock operation
556   --
557   ins_lck
558   (p_effective_date  => p_effective_date,
559    p_datetrack_mode  => l_datetrack_mode,
560    p_rec       => p_rec,
561    p_validation_start_date => l_validation_start_date,
562    p_validation_end_date   => l_validation_end_date);
563   --
564   -- Call the supporting insert validate operations
565   --
566   ben_ppr_bus.insert_validate
567   (p_rec       => p_rec,
568    p_effective_date  => p_effective_date,
569    p_datetrack_mode  => l_datetrack_mode,
570    p_validation_start_date => l_validation_start_date,
571    p_validation_end_date   => l_validation_end_date);
572   --
573   -- Call the supporting pre-insert operation
574   --
575   pre_insert
576   (p_rec       => p_rec,
577    p_effective_date  => p_effective_date,
578    p_datetrack_mode  => l_datetrack_mode,
579    p_validation_start_date => l_validation_start_date,
580    p_validation_end_date   => l_validation_end_date);
581   --
582   -- Insert the row
583   --
584   insert_dml
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 post-insert operation
592   --
593   post_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 end ins;
600 --
601 -- ----------------------------------------------------------------------------
602 -- |---------------------------------< ins >----------------------------------|
603 -- ----------------------------------------------------------------------------
604 Procedure ins
605   (
606   p_prmry_care_prvdr_id          out nocopy number,
607   p_effective_start_date         out nocopy date,
608   p_effective_end_date           out nocopy date,
609   p_prmry_care_prvdr_typ_cd      in varchar2,
610   p_name                         in varchar2,
611   p_ext_ident                    in varchar2         default null,
612   p_prtt_enrt_rslt_id            in number           default null,
613   p_elig_cvrd_dpnt_id            in number           default null,
614   p_business_group_id            in number,
615   p_ppr_attribute_category       in varchar2         default null,
616   p_ppr_attribute1               in varchar2         default null,
617   p_ppr_attribute2               in varchar2         default null,
618   p_ppr_attribute3               in varchar2         default null,
619   p_ppr_attribute4               in varchar2         default null,
620   p_ppr_attribute5               in varchar2         default null,
621   p_ppr_attribute6               in varchar2         default null,
622   p_ppr_attribute7               in varchar2         default null,
623   p_ppr_attribute8               in varchar2         default null,
624   p_ppr_attribute9               in varchar2         default null,
625   p_ppr_attribute10              in varchar2         default null,
626   p_ppr_attribute11              in varchar2         default null,
627   p_ppr_attribute12              in varchar2         default null,
628   p_ppr_attribute13              in varchar2         default null,
629   p_ppr_attribute14              in varchar2         default null,
630   p_ppr_attribute15              in varchar2         default null,
631   p_ppr_attribute16              in varchar2         default null,
632   p_ppr_attribute17              in varchar2         default null,
633   p_ppr_attribute18              in varchar2         default null,
634   p_ppr_attribute19              in varchar2         default null,
635   p_ppr_attribute20              in varchar2         default null,
636   p_ppr_attribute21              in varchar2         default null,
637   p_ppr_attribute22              in varchar2         default null,
638   p_ppr_attribute23              in varchar2         default null,
639   p_ppr_attribute24              in varchar2         default null,
640   p_ppr_attribute25              in varchar2         default null,
641   p_ppr_attribute26              in varchar2         default null,
642   p_ppr_attribute27              in varchar2         default null,
643   p_ppr_attribute28              in varchar2         default null,
644   p_ppr_attribute29              in varchar2         default null,
645   p_ppr_attribute30              in varchar2         default null,
646   p_request_id                   in number           default null,
647   p_program_application_id       in number           default null,
648   p_program_id                   in number           default null,
649   p_program_update_date          in date             default null,
650   p_object_version_number        out nocopy number,
651   p_effective_date     in date
652   ) is
653 --
654   l_rec   ben_ppr_shd.g_rec_type;
655   l_proc  varchar2(72) := g_package||'ins';
656 --
657 Begin
658   hr_utility.set_location('Entering:'||l_proc, 5);
659   --
660   -- Call conversion function to turn arguments into the
661   -- p_rec structure.
662   --
663   l_rec :=
664   ben_ppr_shd.convert_args
665   (
666   null,
667   null,
668   null,
669   p_prmry_care_prvdr_typ_cd,
670   p_name,
671   p_ext_ident,
672   p_prtt_enrt_rslt_id,
673   p_elig_cvrd_dpnt_id,
674   p_business_group_id,
675   p_ppr_attribute_category,
676   p_ppr_attribute1,
677   p_ppr_attribute2,
678   p_ppr_attribute3,
679   p_ppr_attribute4,
680   p_ppr_attribute5,
681   p_ppr_attribute6,
682   p_ppr_attribute7,
683   p_ppr_attribute8,
684   p_ppr_attribute9,
685   p_ppr_attribute10,
686   p_ppr_attribute11,
687   p_ppr_attribute12,
688   p_ppr_attribute13,
689   p_ppr_attribute14,
690   p_ppr_attribute15,
691   p_ppr_attribute16,
692   p_ppr_attribute17,
693   p_ppr_attribute18,
694   p_ppr_attribute19,
695   p_ppr_attribute20,
696   p_ppr_attribute21,
697   p_ppr_attribute22,
698   p_ppr_attribute23,
699   p_ppr_attribute24,
700   p_ppr_attribute25,
701   p_ppr_attribute26,
702   p_ppr_attribute27,
703   p_ppr_attribute28,
704   p_ppr_attribute29,
705   p_ppr_attribute30,
706   p_request_id,
707   p_program_application_id,
708   p_program_id,
709   p_program_update_date,
710   null
711   );
712   --
713   -- Having converted the arguments into the ben_ppr_rec
714   -- plsql record structure we call the corresponding record
715   -- business process.
716   --
717   ins(l_rec, p_effective_date);
718   --
719   -- Set the OUT arguments.
720   --
721   p_prmry_care_prvdr_id         := l_rec.prmry_care_prvdr_id;
722   p_effective_start_date    := l_rec.effective_start_date;
723   p_effective_end_date      := l_rec.effective_end_date;
724   p_object_version_number   := l_rec.object_version_number;
725   --
726   --
727   hr_utility.set_location(' Leaving:'||l_proc, 10);
728 End ins;
729 --
730 end ben_ppr_ins;