DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_PBC_INS

Source


1 Package Body pay_pbc_ins as
2 /* $Header: pypbcrhi.pkb 120.0 2005/05/29 07:19:45 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pay_pbc_ins.';  -- Global package name
9 --
10 -- The following global variables are only to be used by
11 -- the set_base_key_value and pre_insert procedures.
12 --
13 g_balance_category_id_i  number   default null;
14 --
15 -- ----------------------------------------------------------------------------
16 -- |------------------------< set_base_key_value >----------------------------|
17 -- ----------------------------------------------------------------------------
18 procedure set_base_key_value
19   (p_balance_category_id  in  number) is
20 --
21   l_proc       varchar2(72) := g_package||'set_base_key_value';
22 --
23 Begin
24   hr_utility.set_location('Entering:'||l_proc, 10);
25   --
26   pay_pbc_ins.g_balance_category_id_i := p_balance_category_id;
27   --
28   hr_utility.set_location(' Leaving:'||l_proc, 20);
29 End set_base_key_value;
30 --
31 --
32 -- ----------------------------------------------------------------------------
33 -- |----------------------------< dt_insert_dml >-----------------------------|
34 -- ----------------------------------------------------------------------------
35 -- {Start Of Comments}
36 --
37 -- Description:
38 --   This procedure controls the actual dml insert logic for datetrack. The
39 --   functions of this procedure are as follows:
40 --   1) Get the object_version_number.
41 --   2) To set the effective start and end dates to the corresponding
42 --      validation start and end dates. Also, the object version number
43 --      record attribute is set.
44 --   3) To set and unset the g_api_dml status as required (as we are about to
45 --      perform dml).
46 --   4) To insert the row into the schema with the derived effective start
47 --      and end dates and the object version number.
48 --   5) To trap any constraint violations that may have occurred.
49 --   6) To raise any other errors.
50 --
51 -- Prerequisites:
52 --   This is an internal private procedure which must be called from the
53 --   insert_dml and pre_update (logic permitting) procedure and must have
54 --   all mandatory arguments set.
55 --
56 -- In Parameters:
57 --   A Pl/Sql record structure.
58 --
59 -- Post Success:
60 --   The specified row will be inserted into the schema.
61 --
62 -- Post Failure:
63 --   On the insert dml failure it is important to note that we always reset the
64 --   g_api_dml status to false.
65 --   If a check or unique integrity constraint violation is raised the
66 --   constraint_error procedure will be called.
67 --   If any other error is reported, the error will be raised after the
68 --   g_api_dml status is reset.
69 --
70 -- Developer Implementation Notes:
71 --   This is an internal datetrack maintenance procedure which should
72 --   not be modified in anyway.
73 --
74 -- Access Status:
75 --   Internal Row Handler Use Only.
76 --
77 -- {End Of Comments}
78 -- ----------------------------------------------------------------------------
79 Procedure dt_insert_dml
80   (p_rec                     in out nocopy pay_pbc_shd.g_rec_type
81   ,p_effective_date          in date
82   ,p_datetrack_mode          in varchar2
83   ,p_validation_start_date   in date
84   ,p_validation_end_date     in date
85   ) is
86 -- Cursor to select 'old' created AOL who column values
87 --
88   Cursor C_Sel1 Is
89     select t.created_by,
90            t.creation_date
91     from   pay_balance_categories_f t
92     where  t.balance_category_id       = p_rec.balance_category_id
93     and    t.effective_start_date =
94              pay_pbc_shd.g_old_rec.effective_start_date
95     and    t.effective_end_date   = (p_validation_start_date - 1);
96 --
97   l_proc                varchar2(72) := g_package||'dt_insert_dml';
98   l_created_by          pay_balance_categories_f.created_by%TYPE;
99   l_creation_date       pay_balance_categories_f.creation_date%TYPE;
100   l_last_update_date    pay_balance_categories_f.last_update_date%TYPE;
101   l_last_updated_by     pay_balance_categories_f.last_updated_by%TYPE;
102   l_last_update_login   pay_balance_categories_f.last_update_login%TYPE;
103 --
104 Begin
105   hr_utility.set_location('Entering:'||l_proc, 5);
106   --
107   -- Get the object version number for the insert
108   --
109   p_rec.object_version_number :=
110     dt_api.get_object_version_number
111       (p_base_table_name => 'pay_balance_categories_f'
112       ,p_base_key_column => 'balance_category_id'
113       ,p_base_key_value  => p_rec.balance_category_id
114       );
115   --
116   -- Set the effective start and end dates to the corresponding
117   -- validation start and end dates
118   --
119   p_rec.effective_start_date := p_validation_start_date;
120   p_rec.effective_end_date   := p_validation_end_date;
121   --
122   -- If the datetrack_mode is not INSERT then we must populate the WHO
123   -- columns with the 'old' creation values and 'new' updated values.
124   --
125   If (p_datetrack_mode <> hr_api.g_insert) then
126     hr_utility.set_location(l_proc, 10);
127     --
128     -- Select the 'old' created values
129     --
130     Open C_Sel1;
131     Fetch C_Sel1 Into l_created_by, l_creation_date;
132     If C_Sel1%notfound Then
133       --
134       -- The previous 'old' created row has not been found. We need
135       -- to error as an internal datetrack problem exists.
136       --
137       Close C_Sel1;
138       fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
139       fnd_message.set_token('PROCEDURE', l_proc);
140       fnd_message.set_token('STEP','10');
141       fnd_message.raise_error;
142     End If;
143     Close C_Sel1;
144     --
145     -- Set the AOL updated WHO values
146     --
147     l_last_update_date   := sysdate;
148     l_last_updated_by    := fnd_global.user_id;
149     l_last_update_login  := fnd_global.login_id;
150   End If;
151   --
152   --
153   --
154   -- Insert the row into: pay_balance_categories_f
155   --
156   insert into pay_balance_categories_f
157       (balance_category_id
158       ,category_name
159       ,effective_start_date
160       ,effective_end_date
161       ,legislation_code
162       ,business_group_id
163       ,save_run_balance_enabled
164       ,user_category_name
165       ,pbc_information_category
166       ,pbc_information1
167       ,pbc_information2
168       ,pbc_information3
169       ,pbc_information4
170       ,pbc_information5
171       ,pbc_information6
172       ,pbc_information7
173       ,pbc_information8
174       ,pbc_information9
175       ,pbc_information10
176       ,pbc_information11
177       ,pbc_information12
178       ,pbc_information13
179       ,pbc_information14
180       ,pbc_information15
181       ,pbc_information16
182       ,pbc_information17
183       ,pbc_information18
184       ,pbc_information19
185       ,pbc_information20
186       ,pbc_information21
187       ,pbc_information22
188       ,pbc_information23
189       ,pbc_information24
190       ,pbc_information25
191       ,pbc_information26
192       ,pbc_information27
193       ,pbc_information28
194       ,pbc_information29
195       ,pbc_information30
196       ,object_version_number
197       ,created_by
198       ,creation_date
199       ,last_update_date
200       ,last_updated_by
201       ,last_update_login
202       )
203   Values
204     (p_rec.balance_category_id
205     ,p_rec.category_name
206     ,p_rec.effective_start_date
207     ,p_rec.effective_end_date
208     ,p_rec.legislation_code
209     ,p_rec.business_group_id
210     ,p_rec.save_run_balance_enabled
211     ,p_rec.user_category_name
212     ,p_rec.pbc_information_category
213     ,p_rec.pbc_information1
214     ,p_rec.pbc_information2
215     ,p_rec.pbc_information3
216     ,p_rec.pbc_information4
217     ,p_rec.pbc_information5
218     ,p_rec.pbc_information6
219     ,p_rec.pbc_information7
220     ,p_rec.pbc_information8
221     ,p_rec.pbc_information9
222     ,p_rec.pbc_information10
223     ,p_rec.pbc_information11
224     ,p_rec.pbc_information12
225     ,p_rec.pbc_information13
226     ,p_rec.pbc_information14
227     ,p_rec.pbc_information15
228     ,p_rec.pbc_information16
229     ,p_rec.pbc_information17
230     ,p_rec.pbc_information18
231     ,p_rec.pbc_information19
232     ,p_rec.pbc_information20
233     ,p_rec.pbc_information21
234     ,p_rec.pbc_information22
235     ,p_rec.pbc_information23
236     ,p_rec.pbc_information24
237     ,p_rec.pbc_information25
238     ,p_rec.pbc_information26
239     ,p_rec.pbc_information27
240     ,p_rec.pbc_information28
241     ,p_rec.pbc_information29
242     ,p_rec.pbc_information30
243     ,p_rec.object_version_number
244     ,l_created_by
245     ,l_creation_date
246     ,l_last_update_date
247     ,l_last_updated_by
248     ,l_last_update_login
249     );
250   --
251   --
252   hr_utility.set_location(' Leaving:'||l_proc, 15);
253 --
254 Exception
255   When hr_api.check_integrity_violated Then
256     -- A check constraint has been violated
257     --
258     pay_pbc_shd.constraint_error
259       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
260   When hr_api.unique_integrity_violated Then
261     -- Unique integrity has been violated
262     --
263     pay_pbc_shd.constraint_error
264       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
265   When Others Then
266     --
267     Raise;
268 End dt_insert_dml;
269 --
270 -- ----------------------------------------------------------------------------
271 -- |-----------------------< create_app_ownerships >--------------------------|
272 -- ----------------------------------------------------------------------------
273 --
274 -- Description:
275 --   This procedure inserts a row into the HR_APPLICATION_OWNERSHIPS table
276 --   when the row handler is called in the appropriate mode.
277 --
278 -- ----------------------------------------------------------------------------
279 PROCEDURE create_app_ownerships(p_pk_column  IN varchar2
280                                ,p_pk_value   IN varchar2) IS
281 --
282 CURSOR csr_definition IS
283   SELECT product_short_name
284     FROM hr_owner_definitions
285    WHERE session_id = hr_startup_data_api_support.g_session_id;
286 --
287 BEGIN
288   --
289   IF (hr_startup_data_api_support.return_startup_mode IN
290                                ('STARTUP','GENERIC')) THEN
291      --
292      FOR c1 IN csr_definition LOOP
293        --
294        INSERT INTO hr_application_ownerships
295          (key_name
296          ,key_value
297          ,product_name
298          )
299        VALUES
300          (p_pk_column
301          ,fnd_number.number_to_canonical(p_pk_value)
302          ,c1.product_short_name
303          );
304      END LOOP;
305   END IF;
306 END create_app_ownerships;
307 --
308 -- ----------------------------------------------------------------------------
309 -- |-----------------------< create_app_ownerships >--------------------------|
310 -- ----------------------------------------------------------------------------
311 PROCEDURE create_app_ownerships(p_pk_column IN varchar2
312                                ,p_pk_value  IN number) IS
313 --
314 BEGIN
315   create_app_ownerships(p_pk_column, to_char(p_pk_value));
316 END create_app_ownerships;
317 --
318 -- ----------------------------------------------------------------------------
319 -- |------------------------------< insert_dml >------------------------------|
320 -- ----------------------------------------------------------------------------
321 Procedure insert_dml
322   (p_rec                   in out nocopy pay_pbc_shd.g_rec_type
323   ,p_effective_date        in date
324   ,p_datetrack_mode        in varchar2
325   ,p_validation_start_date in date
326   ,p_validation_end_date   in date
327   ) is
328 --
329   l_proc        varchar2(72) := g_package||'insert_dml';
330 --
331 Begin
332   hr_utility.set_location('Entering:'||l_proc, 5);
333   --
334   pay_pbc_ins.dt_insert_dml
335     (p_rec                   => p_rec
336     ,p_effective_date        => p_effective_date
337     ,p_datetrack_mode        => p_datetrack_mode
338     ,p_validation_start_date => p_validation_start_date
339     ,p_validation_end_date   => p_validation_end_date
340     );
341   --
342   hr_utility.set_location(' Leaving:'||l_proc, 10);
343 End insert_dml;
344 --
345 -- ----------------------------------------------------------------------------
346 -- |------------------------------< pre_insert >------------------------------|
347 -- ----------------------------------------------------------------------------
348 -- {Start Of Comments}
349 --
350 -- Description:
351 --   This private procedure contains any processing which is required before
352 --   the insert dml. Presently, if the entity has a corresponding primary
353 --   key which is maintained by an associating sequence, the primary key for
354 --   the entity will be populated with the next sequence value in
355 --   preparation for the insert dml.
356 --   Also, if comments are defined for this entity, the comments insert
357 --   logic will also be called, generating a comment_id if required.
358 --
359 -- Prerequisites:
360 --   This is an internal procedure which is called from the ins procedure.
361 --
362 -- In Parameters:
363 --   A Pl/Sql record structure.
364 --
365 -- Post Success:
366 --   Processing continues.
367 --
368 -- Post Failure:
369 --   If an error has occurred, an error message and exception will be raised
370 --   but not handled.
371 --
372 -- Developer Implementation Notes:
373 --   Any pre-processing required before the insert dml is issued should be
374 --   coded within this procedure. As stated above, a good example is the
375 --   generation of a primary key number via a corresponding sequence.
376 --   It is important to note that any 3rd party maintenance should be reviewed
377 --   before placing in this procedure.
378 --
379 -- Access Status:
380 --   Internal Row Handler Use Only.
381 --
382 -- {End Of Comments}
383 -- ----------------------------------------------------------------------------
384 Procedure pre_insert
385   (p_rec                   in out nocopy pay_pbc_shd.g_rec_type
386   ,p_effective_date        in date
387   ,p_datetrack_mode        in varchar2
388   ,p_validation_start_date in date
389   ,p_validation_end_date   in date
390   ) is
391 --
392   Cursor C_Sel1 is select pay_balance_categories_s.nextval from sys.dual;
393 --
394  Cursor C_Sel2 is
395     Select null
396       from pay_balance_categories_f
397      where balance_category_id =
398              pay_pbc_ins.g_balance_category_id_i;
399 --
400   l_proc        varchar2(72) := g_package||'pre_insert';
401   l_exists      varchar2(1);
402 --
403 Begin
404   hr_utility.set_location('Entering:'||l_proc, 5);
405   --
406     If (pay_pbc_ins.g_balance_category_id_i is not null) Then
407     --
408     -- Verify registered primary key values not already in use
409     --
410     Open C_Sel2;
411     Fetch C_Sel2 into l_exists;
412     If C_Sel2%found Then
413        Close C_Sel2;
414        --
415        -- The primary key values are already in use.
416        --
417        fnd_message.set_name('PER','PER_289391_KEY_ALREADY_USED');
418        fnd_message.set_token('TABLE_NAME','pay_balance_categories_f');
419        fnd_message.raise_error;
420     End If;
421     Close C_Sel2;
422     --
423     -- Use registered key values and clear globals
424     --
425     p_rec.balance_category_id :=
426       pay_pbc_ins.g_balance_category_id_i;
427     pay_pbc_ins.g_balance_category_id_i := null;
428   Else
429     --
430     -- No registerd key values, so select the next sequence number
431     --
432     --
433     -- Select the next sequence number
434     --
435     Open C_Sel1;
436     Fetch C_Sel1 Into p_rec.balance_category_id;
437     Close C_Sel1;
438   End If;
439   --
440   --
441   hr_utility.set_location(' Leaving:'||l_proc, 10);
442 End pre_insert;
443 --
444 -- ----------------------------------------------------------------------------
445 -- |----------------------------< post_insert >-------------------------------|
446 -- ----------------------------------------------------------------------------
447 -- {Start Of Comments}
448 --
449 -- Description:
450 --   This private procedure contains any processing which is required after
451 --   the insert dml.
452 --
453 -- Prerequisites:
454 --   This is an internal procedure which is called from the ins procedure.
455 --
456 -- In Parameters:
457 --   A Pl/Sql record structure.
458 --
459 -- Post Success:
460 --   Processing continues.
461 --
462 -- Post Failure:
463 --   If an error has occurred, an error message and exception will be raised
464 --   but not handled.
465 --
466 -- Developer Implementation Notes:
467 --   Any post-processing required after the insert dml is issued should be
468 --   coded within this procedure. It is important to note that any 3rd party
469 --   maintenance should be reviewed before placing in this procedure.
470 --
471 -- Access Status:
472 --   Internal Row Handler Use Only.
473 --
474 -- {End Of Comments}
475 -- ----------------------------------------------------------------------------
476 Procedure post_insert
477   (p_rec                   in pay_pbc_shd.g_rec_type
478   ,p_effective_date        in date
479   ,p_datetrack_mode        in varchar2
480   ,p_validation_start_date in date
481   ,p_validation_end_date   in date
482   ) is
483 --
484   l_proc        varchar2(72) := g_package||'post_insert';
485 --
486 Begin
487   hr_utility.set_location('Entering:'||l_proc, 5);
488   begin
489       --
490     -- insert ownerships if applicable
491     create_app_ownerships
492       ('BALANCE_CATEGORY_ID', p_rec.balance_category_id
493       );
494     --
495     --
496     pay_pbc_rki.after_insert
497       (p_effective_date
498       => p_effective_date
499       ,p_validation_start_date
500       => p_validation_start_date
501       ,p_validation_end_date
502       => p_validation_end_date
503       ,p_balance_category_id
504       => p_rec.balance_category_id
505       ,p_category_name
506       => p_rec.category_name
507       ,p_effective_start_date
508       => p_rec.effective_start_date
509       ,p_effective_end_date
510       => p_rec.effective_end_date
511       ,p_legislation_code
512       => p_rec.legislation_code
513       ,p_business_group_id
514       => p_rec.business_group_id
515       ,p_save_run_balance_enabled
516       => p_rec.save_run_balance_enabled
517       ,p_user_category_name
518       => p_rec.user_category_name
519       ,p_pbc_information_category
520       => p_rec.pbc_information_category
521       ,p_pbc_information1
522       => p_rec.pbc_information1
523       ,p_pbc_information2
524       => p_rec.pbc_information2
525       ,p_pbc_information3
526       => p_rec.pbc_information3
527       ,p_pbc_information4
528       => p_rec.pbc_information4
529       ,p_pbc_information5
530       => p_rec.pbc_information5
531       ,p_pbc_information6
532       => p_rec.pbc_information6
533       ,p_pbc_information7
534       => p_rec.pbc_information7
535       ,p_pbc_information8
536       => p_rec.pbc_information8
537       ,p_pbc_information9
538       => p_rec.pbc_information9
539       ,p_pbc_information10
540       => p_rec.pbc_information10
541       ,p_pbc_information11
542       => p_rec.pbc_information11
543       ,p_pbc_information12
544       => p_rec.pbc_information12
545       ,p_pbc_information13
546       => p_rec.pbc_information13
547       ,p_pbc_information14
548       => p_rec.pbc_information14
549       ,p_pbc_information15
550       => p_rec.pbc_information15
551       ,p_pbc_information16
552       => p_rec.pbc_information16
553       ,p_pbc_information17
554       => p_rec.pbc_information17
555       ,p_pbc_information18
556       => p_rec.pbc_information18
557       ,p_pbc_information19
558       => p_rec.pbc_information19
559       ,p_pbc_information20
560       => p_rec.pbc_information20
561       ,p_pbc_information21
562       => p_rec.pbc_information21
563       ,p_pbc_information22
564       => p_rec.pbc_information22
565       ,p_pbc_information23
566       => p_rec.pbc_information23
567       ,p_pbc_information24
568       => p_rec.pbc_information24
569       ,p_pbc_information25
570       => p_rec.pbc_information25
571       ,p_pbc_information26
572       => p_rec.pbc_information26
573       ,p_pbc_information27
574       => p_rec.pbc_information27
575       ,p_pbc_information28
576       => p_rec.pbc_information28
577       ,p_pbc_information29
578       => p_rec.pbc_information29
579       ,p_pbc_information30
580       => p_rec.pbc_information30
581       ,p_object_version_number
582       => p_rec.object_version_number
583       );
584     --
585   exception
586     --
587     when hr_api.cannot_find_prog_unit then
588       --
589       hr_api.cannot_find_prog_unit_error
590         (p_module_name => 'PAY_BALANCE_CATEGORIES_F'
591         ,p_hook_type   => 'AI');
592       --
593   end;
594   --
595   hr_utility.set_location(' Leaving:'||l_proc, 10);
596 End post_insert;
597 --
598 -- ----------------------------------------------------------------------------
599 -- |-------------------------------< ins_lck >--------------------------------|
600 -- ----------------------------------------------------------------------------
601 -- {Start Of Comments}
602 --
603 -- Description:
604 --   The ins_lck process has one main function to perform. When inserting
605 --   a datetracked row, we must validate the DT mode.
606 --
607 -- Prerequisites:
608 --   This procedure can only be called for the datetrack mode of INSERT.
609 --
610 -- In Parameters:
611 --
612 -- Post Success:
613 --   On successful completion of the ins_lck process the parental
614 --   datetracked rows will be locked providing the p_enforce_foreign_locking
615 --   argument value is TRUE.
616 --   If the p_enforce_foreign_locking argument value is FALSE then the
617 --   parential rows are not locked.
618 --
619 -- Post Failure:
620 --   The Lck process can fail for:
621 --   1) When attempting to lock the row the row could already be locked by
622 --      another user. This will raise the HR_Api.Object_Locked exception.
623 --   2) When attempting to the lock the parent which doesn't exist.
624 --      For the entity to be locked the parent must exist!
625 --
626 -- Developer Implementation Notes:
627 --   None.
628 --
629 -- Access Status:
630 --   Internal Row Handler Use Only.
631 --
632 -- {End Of Comments}
633 -- ----------------------------------------------------------------------------
634 Procedure ins_lck
635   (p_effective_date        in date
636   ,p_datetrack_mode        in varchar2
637   ,p_rec                   in pay_pbc_shd.g_rec_type
638   ,p_validation_start_date out nocopy date
639   ,p_validation_end_date   out nocopy date
640   ) is
641 --
642   l_proc                  varchar2(72) := g_package||'ins_lck';
643   l_validation_start_date date;
644   l_validation_end_date   date;
645 --
646 Begin
647   hr_utility.set_location('Entering:'||l_proc, 5);
648   --
649   -- Validate the datetrack mode mode getting the validation start
650   -- and end dates for the specified datetrack operation.
651   --
652   dt_api.validate_dt_mode
653     (p_effective_date          => p_effective_date
654     ,p_datetrack_mode          => p_datetrack_mode
655     ,p_base_table_name         => 'pay_balance_categories_f'
656     ,p_base_key_column         => 'balance_category_id'
657     ,p_base_key_value          => p_rec.balance_category_id
658     ,p_enforce_foreign_locking => true
659     ,p_validation_start_date   => l_validation_start_date
660     ,p_validation_end_date     => l_validation_end_date
661     );
662   --
663   -- Set the validation start and end date OUT arguments
664   --
665   p_validation_start_date := l_validation_start_date;
666   p_validation_end_date   := l_validation_end_date;
667   --
668   hr_utility.set_location(' Leaving:'||l_proc, 10);
669   --
670 End ins_lck;
671 --
672 -- ----------------------------------------------------------------------------
673 -- |---------------------------------< ins >----------------------------------|
674 -- ----------------------------------------------------------------------------
675 Procedure ins
676   (p_effective_date in     date
677   ,p_rec            in out nocopy pay_pbc_shd.g_rec_type
678   ) is
679 --
680   l_proc                        varchar2(72) := g_package||'ins';
681   l_datetrack_mode              varchar2(30) := hr_api.g_insert;
682   l_validation_start_date       date;
683   l_validation_end_date         date;
684 --
685 Begin
686   hr_utility.set_location('Entering:'||l_proc, 5);
687   --
688   -- Call the lock operation
689   --
690   pay_pbc_ins.ins_lck
691     (p_effective_date        => p_effective_date
692     ,p_datetrack_mode        => l_datetrack_mode
693     ,p_rec                   => p_rec
694     ,p_validation_start_date => l_validation_start_date
695     ,p_validation_end_date   => l_validation_end_date
696     );
697   --
698   -- Call the supporting insert validate operations
699   --
700   pay_pbc_bus.insert_validate
701     (p_rec                   => p_rec
702     ,p_effective_date        => p_effective_date
703     ,p_datetrack_mode        => l_datetrack_mode
704     ,p_validation_start_date => l_validation_start_date
705     ,p_validation_end_date   => l_validation_end_date
706     );
707   --
708   -- Call to raise any errors on multi-message list
709   hr_multi_message.end_validation_set;
710   --
711   -- Call the supporting pre-insert operation
712   --
713   pay_pbc_ins.pre_insert
714     (p_rec                   => p_rec
715     ,p_effective_date        => p_effective_date
716     ,p_datetrack_mode        => l_datetrack_mode
717     ,p_validation_start_date => l_validation_start_date
718     ,p_validation_end_date   => l_validation_end_date
719     );
720   --
721   -- Insert the row
722   --
723   pay_pbc_ins.insert_dml
724     (p_rec                   => p_rec
725     ,p_effective_date        => p_effective_date
726     ,p_datetrack_mode        => l_datetrack_mode
727     ,p_validation_start_date => l_validation_start_date
728     ,p_validation_end_date   => l_validation_end_date
729     );
730   --
731   -- Call the supporting post-insert operation
732   --
733   pay_pbc_ins.post_insert
734     (p_rec                   => p_rec
735     ,p_effective_date        => p_effective_date
736     ,p_datetrack_mode        => l_datetrack_mode
737     ,p_validation_start_date => l_validation_start_date
738     ,p_validation_end_date   => l_validation_end_date
739     );
740   --
741   -- Call to raise any errors on multi-message list
742   hr_multi_message.end_validation_set;
743   --
744   hr_utility.set_location('Leaving:'||l_proc,10);
745 end ins;
746 --
747 -- ----------------------------------------------------------------------------
748 -- |---------------------------------< ins >----------------------------------|
749 -- ----------------------------------------------------------------------------
750 Procedure ins
751   (p_effective_date                 in     date
752   ,p_category_name                  in     varchar2
753   ,p_legislation_code               in     varchar2 default null
754   ,p_business_group_id              in     number   default null
755   ,p_save_run_balance_enabled       in     varchar2 default null
756   ,p_user_category_name             in     varchar2 default null
757   ,p_pbc_information_category       in     varchar2 default null
758   ,p_pbc_information1               in     varchar2 default null
759   ,p_pbc_information2               in     varchar2 default null
760   ,p_pbc_information3               in     varchar2 default null
761   ,p_pbc_information4               in     varchar2 default null
762   ,p_pbc_information5               in     varchar2 default null
763   ,p_pbc_information6               in     varchar2 default null
764   ,p_pbc_information7               in     varchar2 default null
765   ,p_pbc_information8               in     varchar2 default null
766   ,p_pbc_information9               in     varchar2 default null
767   ,p_pbc_information10              in     varchar2 default null
768   ,p_pbc_information11              in     varchar2 default null
769   ,p_pbc_information12              in     varchar2 default null
770   ,p_pbc_information13              in     varchar2 default null
771   ,p_pbc_information14              in     varchar2 default null
772   ,p_pbc_information15              in     varchar2 default null
773   ,p_pbc_information16              in     varchar2 default null
774   ,p_pbc_information17              in     varchar2 default null
775   ,p_pbc_information18              in     varchar2 default null
776   ,p_pbc_information19              in     varchar2 default null
777   ,p_pbc_information20              in     varchar2 default null
778   ,p_pbc_information21              in     varchar2 default null
779   ,p_pbc_information22              in     varchar2 default null
780   ,p_pbc_information23              in     varchar2 default null
781   ,p_pbc_information24              in     varchar2 default null
782   ,p_pbc_information25              in     varchar2 default null
783   ,p_pbc_information26              in     varchar2 default null
784   ,p_pbc_information27              in     varchar2 default null
785   ,p_pbc_information28              in     varchar2 default null
786   ,p_pbc_information29              in     varchar2 default null
787   ,p_pbc_information30              in     varchar2 default null
788   ,p_balance_category_id               out nocopy number
789   ,p_object_version_number             out nocopy number
790   ,p_effective_start_date              out nocopy date
791   ,p_effective_end_date                out nocopy date
792   ) is
793 --
794   l_rec         pay_pbc_shd.g_rec_type;
795   l_proc        varchar2(72) := g_package||'ins';
796 --
797 Begin
798   hr_utility.set_location('Entering:'||l_proc, 5);
799   --
800   -- Call conversion function to turn arguments into the
801   -- p_rec structure.
802   --
803   l_rec :=
804   pay_pbc_shd.convert_args
805     (null
806     ,p_category_name
807     ,null
808     ,null
809     ,p_legislation_code
810     ,p_business_group_id
811     ,p_save_run_balance_enabled
812     ,p_user_category_name
813     ,p_pbc_information_category
814     ,p_pbc_information1
815     ,p_pbc_information2
816     ,p_pbc_information3
817     ,p_pbc_information4
818     ,p_pbc_information5
819     ,p_pbc_information6
820     ,p_pbc_information7
821     ,p_pbc_information8
822     ,p_pbc_information9
823     ,p_pbc_information10
824     ,p_pbc_information11
825     ,p_pbc_information12
826     ,p_pbc_information13
827     ,p_pbc_information14
828     ,p_pbc_information15
829     ,p_pbc_information16
830     ,p_pbc_information17
831     ,p_pbc_information18
832     ,p_pbc_information19
833     ,p_pbc_information20
834     ,p_pbc_information21
835     ,p_pbc_information22
836     ,p_pbc_information23
837     ,p_pbc_information24
838     ,p_pbc_information25
839     ,p_pbc_information26
840     ,p_pbc_information27
841     ,p_pbc_information28
842     ,p_pbc_information29
843     ,p_pbc_information30
844     ,null
845     );
846   --
847   -- Having converted the arguments into the pay_pbc_rec
848   -- plsql record structure we call the corresponding record
849   -- business process.
850   --
851   pay_pbc_ins.ins
852     (p_effective_date
853     ,l_rec
854     );
855   --
856   -- Set the OUT arguments.
857   --
858   p_balance_category_id              := l_rec.balance_category_id;
859   p_effective_start_date             := l_rec.effective_start_date;
860   p_effective_end_date               := l_rec.effective_end_date;
861   p_object_version_number            := l_rec.object_version_number;
862   --
863   --
864   hr_utility.set_location(' Leaving:'||l_proc, 10);
865 End ins;
866 --
867 end pay_pbc_ins;