DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_PPR_INS

Source


1 Package Body pay_ppr_ins as
2 /* $Header: pypprrhi.pkb 115.3 2004/02/25 21:33 adkumar noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pay_ppr_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_status_processing_rule_id_i  number   default null;
14 --
15 -- ----------------------------------------------------------------------------
16 -- |------------------------< set_base_key_value >----------------------------|
17 -- ----------------------------------------------------------------------------
18 procedure set_base_key_value
19   (p_status_processing_rule_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_ppr_ins.g_status_processing_rule_id_i := p_status_processing_rule_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_ppr_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_status_processing_rules_f t
92     where  t.status_processing_rule_id       = p_rec.status_processing_rule_id
93     and    t.effective_start_date =
94              pay_ppr_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_status_processing_rules_f.created_by%TYPE;
99   l_creation_date       pay_status_processing_rules_f.creation_date%TYPE;
100   l_last_update_date    pay_status_processing_rules_f.last_update_date%TYPE;
101   l_last_updated_by     pay_status_processing_rules_f.last_updated_by%TYPE;
102   l_last_update_login   pay_status_processing_rules_f.last_update_login%TYPE;
103 --
104 Begin
105   hr_utility.set_location('Entering:'||l_proc, 5);
106   --
107   -- Set the effective start and end dates to the corresponding
108   -- validation start and end dates
109   --
110   p_rec.effective_start_date := p_validation_start_date;
111   p_rec.effective_end_date   := p_validation_end_date;
112   --
113   -- If the datetrack_mode is not INSERT then we must populate the WHO
114   -- columns with the 'old' creation values and 'new' updated values.
115   --
116   If (p_datetrack_mode <> hr_api.g_insert) then
117     hr_utility.set_location(l_proc, 10);
118     --
119       -- Get the object version number for the insert
120   --
121   p_rec.object_version_number :=
122     dt_api.get_object_version_number
123       (p_base_table_name => 'pay_status_processing_rules_f'
124       ,p_base_key_column => 'status_processing_rule_id'
125       ,p_base_key_value  => p_rec.status_processing_rule_id
126       );
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   Else
151     p_rec.object_version_number := 1;  -- Initialise the object version
152   End If;
153   --
154   pay_ppr_shd.g_api_dml := true;  -- Set the api dml status
155   --
156   -- Insert the row into: pay_status_processing_rules_f
157   --
158   insert into pay_status_processing_rules_f
159       (status_processing_rule_id
160       ,effective_start_date
161       ,effective_end_date
162       ,business_group_id
163       ,legislation_code
164       ,element_type_id
165       ,assignment_status_type_id
166       ,formula_id
167       ,processing_rule
168       ,comment_id
169       ,legislation_subgroup
170       ,object_version_number
171       ,created_by
172       ,creation_date
173       ,last_update_date
174       ,last_updated_by
175       ,last_update_login
176       )
177   Values
178     (p_rec.status_processing_rule_id
179     ,p_rec.effective_start_date
180     ,p_rec.effective_end_date
181     ,p_rec.business_group_id
182     ,p_rec.legislation_code
183     ,p_rec.element_type_id
184     ,p_rec.assignment_status_type_id
185     ,p_rec.formula_id
186     ,p_rec.processing_rule
187     ,p_rec.comment_id
188     ,p_rec.legislation_subgroup
189     ,p_rec.object_version_number
190     ,l_created_by
191     ,l_creation_date
192     ,l_last_update_date
193     ,l_last_updated_by
194     ,l_last_update_login
195     );
196   --
197   pay_ppr_shd.g_api_dml := false;   -- Unset the api dml status
198   hr_utility.set_location(' Leaving:'||l_proc, 15);
199 --
200 Exception
201   When hr_api.check_integrity_violated Then
202     -- A check constraint has been violated
203     pay_ppr_shd.g_api_dml := false;   -- Unset the api dml status
204     pay_ppr_shd.constraint_error
205       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
206   When hr_api.unique_integrity_violated Then
207     -- Unique integrity has been violated
208     pay_ppr_shd.g_api_dml := false;   -- Unset the api dml status
209     pay_ppr_shd.constraint_error
210       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
211   When Others Then
212     pay_ppr_shd.g_api_dml := false;   -- Unset the api dml status
213     Raise;
214 End dt_insert_dml;
215 --
216 -- ----------------------------------------------------------------------------
217 -- |-----------------------< create_app_ownerships >--------------------------|
218 -- ----------------------------------------------------------------------------
219 --
220 -- Description:
221 --   This procedure inserts a row into the HR_APPLICATION_OWNERSHIPS table
222 --   when the row handler is called in the appropriate mode.
223 --
224 -- ----------------------------------------------------------------------------
225 PROCEDURE create_app_ownerships(p_pk_column  IN varchar2
226                                ,p_pk_value   IN varchar2) IS
227 --
228 CURSOR csr_definition IS
229   SELECT product_short_name
230     FROM hr_owner_definitions
231    WHERE session_id = hr_startup_data_api_support.g_session_id;
232 --
233 BEGIN
234   --
235   IF (hr_startup_data_api_support.return_startup_mode IN
236                                ('STARTUP','GENERIC')) THEN
237      --
238      FOR c1 IN csr_definition LOOP
239        --
240        INSERT INTO hr_application_ownerships
241          (key_name
242          ,key_value
243          ,product_name
244          )
245        VALUES
246          (p_pk_column
247          ,fnd_number.number_to_canonical(p_pk_value)
248          ,c1.product_short_name
249          );
250      END LOOP;
251   END IF;
252 END create_app_ownerships;
253 --
254 -- ----------------------------------------------------------------------------
255 -- |-----------------------< create_app_ownerships >--------------------------|
256 -- ----------------------------------------------------------------------------
257 PROCEDURE create_app_ownerships(p_pk_column IN varchar2
258                                ,p_pk_value  IN number) IS
259 --
260 BEGIN
261   create_app_ownerships(p_pk_column, to_char(p_pk_value));
262 END create_app_ownerships;
263 --
264 -- ----------------------------------------------------------------------------
265 -- |------------------------------< insert_dml >------------------------------|
266 -- ----------------------------------------------------------------------------
267 Procedure insert_dml
268   (p_rec                   in out nocopy pay_ppr_shd.g_rec_type
269   ,p_effective_date        in date
270   ,p_datetrack_mode        in varchar2
271   ,p_validation_start_date in date
272   ,p_validation_end_date   in date
273   ) is
274 --
275   l_proc        varchar2(72) := g_package||'insert_dml';
276 --
277 Begin
278   hr_utility.set_location('Entering:'||l_proc, 5);
279   --
280   pay_ppr_ins.dt_insert_dml
281     (p_rec                   => p_rec
282     ,p_effective_date        => p_effective_date
283     ,p_datetrack_mode        => p_datetrack_mode
284     ,p_validation_start_date => p_validation_start_date
285     ,p_validation_end_date   => p_validation_end_date
286     );
287   --
288   hr_utility.set_location(' Leaving:'||l_proc, 10);
289 End insert_dml;
290 --
291 -- ----------------------------------------------------------------------------
292 -- |------------------------------< pre_insert >------------------------------|
293 -- ----------------------------------------------------------------------------
294 -- {Start Of Comments}
295 --
296 -- Description:
297 --   This private procedure contains any processing which is required before
298 --   the insert dml. Presently, if the entity has a corresponding primary
299 --   key which is maintained by an associating sequence, the primary key for
300 --   the entity will be populated with the next sequence value in
301 --   preparation for the insert dml.
302 --   Also, if comments are defined for this entity, the comments insert
303 --   logic will also be called, generating a comment_id if required.
304 --
305 -- Prerequisites:
306 --   This is an internal procedure which is called from the ins procedure.
307 --
308 -- In Parameters:
309 --   A Pl/Sql record structure.
310 --
311 -- Post Success:
312 --   Processing continues.
313 --
314 -- Post Failure:
315 --   If an error has occurred, an error message and exception will be raised
316 --   but not handled.
317 --
318 -- Developer Implementation Notes:
319 --   Any pre-processing required before the insert dml is issued should be
320 --   coded within this procedure. As stated above, a good example is the
321 --   generation of a primary key number via a corresponding sequence.
322 --   It is important to note that any 3rd party maintenance should be reviewed
323 --   before placing in this procedure.
324 --
325 -- Access Status:
326 --   Internal Row Handler Use Only.
327 --
328 -- {End Of Comments}
329 -- ----------------------------------------------------------------------------
330 Procedure pre_insert
331   (p_rec                   in out nocopy pay_ppr_shd.g_rec_type
332   ,p_effective_date        in date
333   ,p_datetrack_mode        in varchar2
334   ,p_validation_start_date in date
335   ,p_validation_end_date   in date
336   ) is
337 --
338   Cursor C_Sel1 is select pay_status_processing_rules_s.nextval from sys.dual;
339 --
340  Cursor C_Sel2 is
341     Select null
342       from pay_status_processing_rules_f
343      where status_processing_rule_id =
344              pay_ppr_ins.g_status_processing_rule_id_i;
345 --
346   l_proc        varchar2(72) := g_package||'pre_insert';
347   l_exists      varchar2(1);
348 
349 --
350 Begin
351   hr_utility.set_location('Entering:'||l_proc, 5);
352   --
353     If (pay_ppr_ins.g_status_processing_rule_id_i is not null) Then
354     --
355     -- Verify registered primary key values not already in use
356     --
357     Open C_Sel2;
358     Fetch C_Sel2 into l_exists;
359     If C_Sel2%found Then
360        Close C_Sel2;
361        --
362        -- The primary key values are already in use.
363        --
364        fnd_message.set_name('PER','PER_289391_KEY_ALREADY_USED');
365        fnd_message.set_token('TABLE_NAME','pay_status_processing_rules_f');
366        fnd_message.raise_error;
367     End If;
368     Close C_Sel2;
369     --
370     -- Use registered key values and clear globals
371     --
372     p_rec.status_processing_rule_id :=
373       pay_ppr_ins.g_status_processing_rule_id_i;
374     pay_ppr_ins.g_status_processing_rule_id_i := null;
375   Else
376     --
377     -- No registerd key values, so select the next sequence number
378     --
379     --
380     -- Select the next sequence number
381     --
382     Open C_Sel1;
383     Fetch C_Sel1 Into p_rec.status_processing_rule_id;
384     Close C_Sel1;
385   End If;
386   --
387   --
388   -- Insert the comment text if comments exist
389   --
390   If (p_rec.comments is not null) then
391     hr_comm_api.ins
392       (p_comment_id        => p_rec.comment_id
393       ,p_source_table_name => 'PAY_STATUS_PROCESSING_RULES_F'
394       ,p_comment_text      => p_rec.comments
395       );
396   End If;
397 
398 --
399   hr_utility.set_location(' Leaving:'||l_proc, 10);
400 End pre_insert;
401 --
402 -- ----------------------------------------------------------------------------
403 -- |----------------------------< post_insert >-------------------------------|
404 -- ----------------------------------------------------------------------------
405 -- {Start Of Comments}
406 --
407 -- Description:
408 --   This private procedure contains any processing which is required after
409 --   the insert dml.
410 --
411 -- Prerequisites:
412 --   This is an internal procedure which is called from the ins procedure.
413 --
414 -- In Parameters:
415 --   A Pl/Sql record structure.
416 --
417 -- Post Success:
418 --   Processing continues.
419 --
420 -- Post Failure:
421 --   If an error has occurred, an error message and exception will be raised
422 --   but not handled.
423 --
424 -- Developer Implementation Notes:
425 --   Any post-processing required after the insert dml is issued should be
426 --   coded within this procedure. It is important to note that any 3rd party
427 --   maintenance should be reviewed before placing in this procedure.
428 --
429 -- Access Status:
430 --   Internal Row Handler Use Only.
431 --
432 -- {End Of Comments}
433 -- ----------------------------------------------------------------------------
434 Procedure post_insert
435   (p_rec                   in pay_ppr_shd.g_rec_type
436   ,p_effective_date        in date
437   ,p_datetrack_mode        in varchar2
438   ,p_validation_start_date in date
439   ,p_validation_end_date   in date
440   ,p_formula_mismatch_warning in boolean
441   ) is
442 --
443   l_proc        varchar2(72) := g_package||'post_insert';
444 --
445 Begin
446   hr_utility.set_location('Entering:'||l_proc, 5);
447   begin
448       --
449     -- insert ownerships if applicable
450     create_app_ownerships
451       ('STATUS_PROCESSING_RULE_ID', p_rec.status_processing_rule_id
452       );
453     --
454     --
455     pay_ppr_rki.after_insert
456       (p_effective_date             => p_effective_date
457       ,p_validation_start_date      => p_validation_start_date
458       ,p_validation_end_date        => p_validation_end_date
459       ,p_status_processing_rule_id  => p_rec.status_processing_rule_id
460       ,p_effective_start_date       => p_rec.effective_start_date
461       ,p_effective_end_date         => p_rec.effective_end_date
462       ,p_business_group_id          => p_rec.business_group_id
463       ,p_legislation_code           => p_rec.legislation_code
464       ,p_element_type_id            => p_rec.element_type_id
465       ,p_assignment_status_type_id  => p_rec.assignment_status_type_id
466       ,p_formula_id                 => p_rec.formula_id
467       ,p_comment_id                 => p_rec.comment_id
468       ,p_comments                   => p_rec.comments
469       ,p_legislation_subgroup       => p_rec.legislation_subgroup
470       ,p_object_version_number      => p_rec.object_version_number
471       ,p_formula_mismatch_warning   => p_formula_mismatch_warning
472       );
473     --
474   exception
475     --
476     when hr_api.cannot_find_prog_unit then
477       --
478       hr_api.cannot_find_prog_unit_error
479         (p_module_name => 'PAY_STATUS_PROCESSING_RULES_F'
480         ,p_hook_type   => 'AI');
481       --
482   end;
483   --
484   hr_utility.set_location(' Leaving:'||l_proc, 10);
485 End post_insert;
486 --
487 -- ----------------------------------------------------------------------------
488 -- |-------------------------------< ins_lck >--------------------------------|
489 -- ----------------------------------------------------------------------------
490 -- {Start Of Comments}
491 --
492 -- Description:
493 --   The ins_lck process has one main function to perform. When inserting
494 --   a datetracked row, we must validate the DT mode.
495 --
496 -- Prerequisites:
497 --   This procedure can only be called for the datetrack mode of INSERT.
498 --
499 -- In Parameters:
500 --
501 -- Post Success:
502 --   On successful completion of the ins_lck process the parental
503 --   datetracked rows will be locked providing the p_enforce_foreign_locking
504 --   argument value is TRUE.
505 --   If the p_enforce_foreign_locking argument value is FALSE then the
506 --   parential rows are not locked.
507 --
508 -- Post Failure:
509 --   The Lck process can fail for:
510 --   1) When attempting to lock the row the row could already be locked by
511 --      another user. This will raise the HR_Api.Object_Locked exception.
512 --   2) When attempting to the lock the parent which doesn't exist.
513 --      For the entity to be locked the parent must exist!
514 --
515 -- Developer Implementation Notes:
516 --   None.
517 --
518 -- Access Status:
519 --   Internal Row Handler Use Only.
520 --
521 -- {End Of Comments}
522 -- ----------------------------------------------------------------------------
523 Procedure ins_lck
524   (p_effective_date        in date
525   ,p_datetrack_mode        in varchar2
526   ,p_rec                   in pay_ppr_shd.g_rec_type
527   ,p_validation_start_date out nocopy date
528   ,p_validation_end_date   out nocopy date
529   ) is
530 --
531   l_proc                  varchar2(72) := g_package||'ins_lck';
532   l_validation_start_date date;
533   l_validation_end_date   date;
534 --
535 Begin
536   hr_utility.set_location('Entering:'||l_proc, 5);
537   --
538   -- Validate the datetrack mode mode getting the validation start
539   -- and end dates for the specified datetrack operation.
540   --
541   dt_api.validate_dt_mode
542     (p_effective_date          => p_effective_date
543     ,p_datetrack_mode          => p_datetrack_mode
544     ,p_base_table_name         => 'pay_status_processing_rules_f'
545     ,p_base_key_column         => 'status_processing_rule_id'
546     ,p_base_key_value          => p_rec.status_processing_rule_id
547     ,p_enforce_foreign_locking => true
548     ,p_validation_start_date   => l_validation_start_date
549     ,p_validation_end_date     => l_validation_end_date
550     );
551   --
552   -- Set the validation start and end date OUT arguments
553   --
554   p_validation_start_date := l_validation_start_date;
555   p_validation_end_date   := l_validation_end_date;
556   --
557   hr_utility.set_location(' Leaving:'||l_proc, 10);
558   --
559 End ins_lck;
560 --
561 -- ----------------------------------------------------------------------------
562 -- |---------------------------------< ins >----------------------------------|
563 -- ----------------------------------------------------------------------------
564 Procedure ins
565   (p_effective_date in     date
566   ,p_rec            in out nocopy pay_ppr_shd.g_rec_type
567   ,p_formula_mismatch_warning out nocopy boolean
568   ) is
569 --
570   l_proc                        varchar2(72) := g_package||'ins';
571   l_datetrack_mode              varchar2(30) := hr_api.g_insert;
572   l_validation_start_date       date;
573   l_validation_end_date         date;
574   l_processing_rule             varchar2(1);
575   l_formula_mismatch_warning    boolean;
576 --
577 Begin
578   hr_utility.set_location('Entering:'||l_proc, 5);
579   --
580   -- Call the lock operation
581   --
582   pay_ppr_ins.ins_lck
583     (p_effective_date        => p_effective_date
584     ,p_datetrack_mode        => l_datetrack_mode
585     ,p_rec                   => p_rec
586     ,p_validation_start_date => l_validation_start_date
587     ,p_validation_end_date   => l_validation_end_date
588     );
589 
590   --
591   -- Call the supporting insert validate operations
592   --
593   pay_ppr_bus.insert_validate
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     ,p_processing_rule       => l_processing_rule
600     ,p_formula_mismatch_warning => l_formula_mismatch_warning
601     );
602   --
603 
604       p_rec.processing_rule          := l_processing_rule;
605       p_formula_mismatch_warning := l_formula_mismatch_warning;
606   --
607   pay_ppr_bus.set_effective_end_date
608 	  (p_effective_date             => p_effective_date
609  	  ,p_status_processing_rule_id  => null
610 	  ,p_element_type_id		=> p_rec.element_type_id
611 	  ,p_formula_id			=> p_rec.formula_id
612 	  ,p_assignment_status_type_id  => p_rec.assignment_status_type_id
613 	  ,p_processing_rule            => p_rec.processing_rule
614 	  ,p_business_group_id          => p_rec.business_group_id
615 	  ,p_legislation_code           => p_rec.legislation_code
616 	  ,p_datetrack_mode             => null
617 	  ,p_validation_start_date      => l_validation_start_date
618           ,p_validation_end_date        => l_validation_end_date
619   );
620 
621   --
622   -- Call to raise any errors on multi-message list
623   hr_multi_message.end_validation_set;
624   --
625   -- Call the supporting pre-insert operation
626   --
627   pay_ppr_ins.pre_insert
628     (p_rec                   => p_rec
629     ,p_effective_date        => p_effective_date
630     ,p_datetrack_mode        => l_datetrack_mode
631     ,p_validation_start_date => l_validation_start_date
632     ,p_validation_end_date   => l_validation_end_date
633     );
634   --
635   -- Insert the row
636   --
637   pay_ppr_ins.insert_dml
638     (p_rec                   => p_rec
639     ,p_effective_date        => p_effective_date
640     ,p_datetrack_mode        => l_datetrack_mode
641     ,p_validation_start_date => l_validation_start_date
642     ,p_validation_end_date   => l_validation_end_date
643     );
644   --
645   -- Call the supporting post-insert operation
646   --
647   pay_ppr_ins.post_insert
648     (p_rec                   => p_rec
649     ,p_effective_date        => p_effective_date
650     ,p_datetrack_mode        => l_datetrack_mode
651     ,p_validation_start_date => l_validation_start_date
652     ,p_validation_end_date   => l_validation_end_date
653     ,p_formula_mismatch_warning =>l_formula_mismatch_warning
654     );
655   --
656   -- Call to raise any errors on multi-message list
657   hr_multi_message.end_validation_set;
658   --
659   hr_utility.set_location('Leaving:'||l_proc,10);
660 end ins;
661 --
662 -- ----------------------------------------------------------------------------
663 -- |---------------------------------< ins >----------------------------------|
664 -- ----------------------------------------------------------------------------
665 Procedure ins
666   (p_effective_date                 in     date
667   ,p_element_type_id                in     number
668   ,p_business_group_id              in     number   default null
669   ,p_legislation_code               in     varchar2 default null
670   ,p_assignment_status_type_id      in     number   default null
671   ,p_formula_id                     in     number   default null
672   ,p_comments                       in     varchar2 default null
673   ,p_legislation_subgroup           in     varchar2 default null
674   ,p_status_processing_rule_id         out nocopy number
675   ,p_object_version_number             out nocopy number
676   ,p_effective_start_date              out nocopy date
677   ,p_effective_end_date                out nocopy date
678   ,p_comment_id                        out nocopy number
679   ,p_formula_mismatch_warning	       out nocopy boolean
680   ) is
681 --
682   l_rec         pay_ppr_shd.g_rec_type;
683   l_proc        varchar2(72) := g_package||'ins';
684   l_formula_mismatch_warning    boolean;
685 --
686 Begin
687   hr_utility.set_location('Entering:'||l_proc, 5);
688   --
689   -- Call conversion function to turn arguments into the
690   -- p_rec structure.
691   --
692   l_rec :=
693   pay_ppr_shd.convert_args
694     (null
695     ,null
696     ,null
697     ,p_business_group_id
698     ,p_legislation_code
699     ,p_element_type_id
700     ,p_assignment_status_type_id
701     ,p_formula_id
702     ,null
703     ,null
704     ,p_comments
705     ,p_legislation_subgroup
706     ,null
707     );
708   --
709   -- Having converted the arguments into the pay_ppr_rec
710   -- plsql record structure we call the corresponding record
711   -- business process.
712   --
713   pay_ppr_ins.ins
714     (p_effective_date
715     ,l_rec
716     ,l_formula_mismatch_warning
717     );
718   --
719   -- Set the OUT arguments.
720   --
721   p_status_processing_rule_id        := l_rec.status_processing_rule_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   p_comment_id                       := l_rec.comment_id;
726   p_formula_mismatch_warning         := l_formula_mismatch_warning;
727   --
728   hr_utility.set_location(' Leaving:'||l_proc, 10);
729 End ins;
730 --
731 end pay_ppr_ins;