DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_PPD_UPD

Source


1 Package Body pay_ppd_upd as
2 /* $Header: pyppdrhi.pkb 120.2 2005/12/29 01:38 nprasath noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pay_ppd_upd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |----------------------------< dt_update_dml >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the execution of dml from the datetrack mode
17 --   of CORRECTION only. It is important to note that the object version
18 --   number is only increment by 1 because the datetrack correction is
19 --   soley for one datetracked row.
20 --   This procedure controls the actual dml update logic. The functions of
21 --   this procedure are as follows:
22 --   1) Get the next object_version_number.
23 --   2) To set and unset the g_api_dml status as required (as we are about to
24 --      perform dml).
25 --   3) To update the specified row in the schema using the primary key in
26 --      the predicates.
27 --   4) To trap any constraint violations that may have occurred.
28 --   5) To raise any other errors.
29 --
30 -- Prerequisites:
31 --   This is an internal private procedure which must be called from the
32 --   update_dml procedure.
33 --
34 -- In Parameters:
35 --   A Pl/Sql record structure.
36 --
37 -- Post Success:
38 --   The specified row will be updated in the schema.
39 --
40 -- Post Failure:
41 --   On the update 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 --   The update 'set' arguments list should be modified if any of your
50 --   attributes are not updateable.
51 --
52 -- Access Status:
53 --   Internal Row Handler Use Only.
54 --
55 -- {End Of Comments}
56 -- ----------------------------------------------------------------------------
57 Procedure dt_update_dml
58   (p_rec                   in out nocopy pay_ppd_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
63   ) is
64 --
65   l_proc        varchar2(72) := g_package||'dt_update_dml';
66 --
67 Begin
68   hr_utility.set_location('Entering:'||l_proc, 5);
69   --
70   If (p_datetrack_mode = hr_api.g_correction) then
71     hr_utility.set_location(l_proc, 10);
72     --
73     -- Because we are updating a row we must get the next object
74     -- version number.
75     --
76     p_rec.object_version_number :=
77       dt_api.get_object_version_number
78         (p_base_table_name => 'pay_pl_paye_details_f'
79         ,p_base_key_column => 'paye_details_id'
80         ,p_base_key_value  => p_rec.paye_details_id
81         );
82     --
83     --
84     --
85     -- Update the pay_pl_paye_details_f Row
86     --
87     update  pay_pl_paye_details_f
88     set
89      paye_details_id                      = p_rec.paye_details_id
90     ,per_or_asg_id                        = p_rec.per_or_asg_id
91     ,business_group_id                    = p_rec.business_group_id
92     ,contract_category                    = p_rec.contract_category
93     ,object_version_number                = p_rec.object_version_number
94     ,tax_reduction                        = p_rec.tax_reduction
95     ,tax_calc_with_spouse_child           = p_rec.tax_calc_with_spouse_child
96     ,income_reduction                     = p_rec.income_reduction
97     ,income_reduction_amount              = p_rec.income_reduction_amount
98     ,rate_of_tax                          = p_rec.rate_of_tax
99     ,program_id                           = p_rec.program_id
100     ,program_login_id                     = p_rec.program_login_id
101     ,program_application_id               = p_rec.program_application_id
102     ,request_id                           = p_rec.request_id
103     where   paye_details_id = p_rec.paye_details_id
104     and     effective_start_date = p_validation_start_date
105     and     effective_end_date   = p_validation_end_date;
106     --
107     --
108     --
109     -- Set the effective start and end dates
110     --
111     p_rec.effective_start_date := p_validation_start_date;
112     p_rec.effective_end_date   := p_validation_end_date;
113   End If;
114 --
115 hr_utility.set_location(' Leaving:'||l_proc, 15);
116 Exception
117   When hr_api.check_integrity_violated Then
118     -- A check constraint has been violated
119     --
120     pay_ppd_shd.constraint_error
121       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
122   When hr_api.unique_integrity_violated Then
123     -- Unique integrity has been violated
124     --
125     pay_ppd_shd.constraint_error
126       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
127   When Others Then
128     --
129     Raise;
130 End dt_update_dml;
131 --
132 -- ----------------------------------------------------------------------------
133 -- |------------------------------< update_dml >------------------------------|
134 -- ----------------------------------------------------------------------------
135 -- {Start Of Comments}
136 --
137 -- Description:
138 --   This procedure calls the dt_update_dml control logic which handles
139 --   the actual datetrack dml.
140 --
141 -- Prerequisites:
142 --   This is an internal private procedure which must be called from the upd
143 --   procedure.
144 --
145 -- In Parameters:
146 --   A Pl/Sql record structre.
147 --
148 -- Post Success:
149 --   Processing contines.
150 --
151 -- Post Failure:
152 --   No specific error handling is required within this procedure.
153 --
154 -- Developer Implementation Notes:
155 --   The update 'set' arguments list should be modified if any of your
156 --   attributes are not updateable.
157 --
158 -- Access Status:
159 --   Internal Row Handler Use Only.
160 --
161 -- {End Of Comments}
162 -- ----------------------------------------------------------------------------
163 Procedure update_dml
164   (p_rec                      in out nocopy pay_ppd_shd.g_rec_type
165   ,p_effective_date           in date
166   ,p_datetrack_mode           in varchar2
167   ,p_validation_start_date    in date
168   ,p_validation_end_date      in date
169   ) is
170 --
171   l_proc        varchar2(72) := g_package||'update_dml';
172 --
173 Begin
174   hr_utility.set_location('Entering:'||l_proc, 5);
175   --
176   pay_ppd_upd.dt_update_dml
177     (p_rec                   => p_rec
178     ,p_effective_date        => p_effective_date
179     ,p_datetrack_mode        => p_datetrack_mode
180     ,p_validation_start_date => p_validation_start_date
181     ,p_validation_end_date   => p_validation_end_date
182     );
183   --
184   hr_utility.set_location(' Leaving:'||l_proc, 10);
185 End update_dml;
186 --
187 -- ----------------------------------------------------------------------------
188 -- |----------------------------< dt_pre_update >-----------------------------|
189 -- ----------------------------------------------------------------------------
190 -- {Start Of Comments}
191 --
192 -- Description:
193 --   The dt_pre_update procedure controls the execution
194 --   of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
195 --   and UPDATE_CHANGE_INSERT only. The execution required is as
196 --   follows:
197 --
198 --   1) Providing the datetrack update mode is not 'CORRECTION'
199 --      then set the effective end date of the current row (this
200 --      will be the validation_start_date - 1).
201 --   2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
202 --      corresponding delete_dml process to delete any future rows
203 --      where the effective_start_date is greater than or equal to
204 --      the validation_start_date.
205 --   3) Call the insert_dml process to insert the new updated row
206 --      details.
207 --
208 -- Prerequisites:
209 --   This is an internal procedure which is called from the
210 --   pre_update procedure.
211 --
212 -- In Parameters:
213 --
214 -- Post Success:
215 --   Processing continues.
216 --
217 -- Post Failure:
218 --   If an error has occurred, an error message and exception will be raised
219 --   but not handled.
220 --
221 -- Developer Implementation Notes:
222 --   This is an internal procedure which is required by Datetrack. Don't
223 --   remove or modify.
224 --
225 -- Access Status:
226 --   Internal Row Handler Use Only.
227 --
228 -- {End Of Comments}
229 -- ----------------------------------------------------------------------------
230 Procedure dt_pre_update
231   (p_rec                     in out  nocopy   pay_ppd_shd.g_rec_type
232   ,p_effective_date          in date
233   ,p_datetrack_mode          in varchar2
234   ,p_validation_start_date   in date
235   ,p_validation_end_date     in date
236   ) is
237 --
238   l_proc                 varchar2(72) := g_package||'dt_pre_update';
239   l_dummy_version_number number;
240 --
241 Begin
242   hr_utility.set_location('Entering:'||l_proc, 5);
243   If (p_datetrack_mode <> hr_api.g_correction) then
244     --
245     -- Update the current effective end date
246     --
247     pay_ppd_shd.upd_effective_end_date
248       (p_effective_date         => p_effective_date
249       ,p_base_key_value         => p_rec.paye_details_id
250       ,p_new_effective_end_date => (p_validation_start_date - 1)
251       ,p_validation_start_date  => p_validation_start_date
252       ,p_validation_end_date    => p_validation_end_date
253       ,p_object_version_number  => l_dummy_version_number
254       );
255     --
256     If (p_datetrack_mode = hr_api.g_update_override) then
257       --
258       -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
259       -- delete any future rows
260       --
261       pay_ppd_del.delete_dml
262         (p_rec                   => p_rec
263         ,p_effective_date        => p_effective_date
264         ,p_datetrack_mode        => p_datetrack_mode
265         ,p_validation_start_date => p_validation_start_date
266         ,p_validation_end_date   => p_validation_end_date
267         );
268     End If;
269     --
270     -- We must now insert the updated row
271     --
272     pay_ppd_ins.insert_dml
273       (p_rec                    => p_rec
274       ,p_effective_date         => p_effective_date
275       ,p_datetrack_mode         => p_datetrack_mode
276       ,p_validation_start_date  => p_validation_start_date
277       ,p_validation_end_date    => p_validation_end_date
278       );
279   End If;
280   hr_utility.set_location(' Leaving:'||l_proc, 20);
281 End dt_pre_update;
282 --
283 -- ----------------------------------------------------------------------------
284 -- |------------------------------< pre_update >------------------------------|
285 -- ----------------------------------------------------------------------------
286 -- {Start Of Comments}
287 --
288 -- Description:
289 --   This private procedure contains any processing which is required before
290 --   the update dml.
291 --
292 -- Prerequisites:
293 --   This is an internal procedure which is called from the upd procedure.
294 --
295 -- In Parameters:
296 --   A Pl/Sql record structure.
297 --
298 -- Post Success:
299 --   Processing continues.
300 --
301 -- Post Failure:
302 --   If an error has occurred, an error message and exception will be raised
303 --   but not handled.
304 -- Developer Implementation Notes:
305 --   Any pre-processing required before the update dml is issued should be
306 --   coded within this procedure. It is important to note that any 3rd party
307 --   maintenance should be reviewed before placing in this procedure. The call
308 --   to the dt_update_dml procedure should NOT be removed.
309 --
310 -- Access Status:
311 --   Internal Row Handler Use Only.
312 --
313 -- {End Of Comments}
314 -- ----------------------------------------------------------------------------
315 Procedure pre_update
316   (p_rec                   in out nocopy pay_ppd_shd.g_rec_type
317   ,p_effective_date        in date
318   ,p_datetrack_mode        in varchar2
319   ,p_validation_start_date in date
320   ,p_validation_end_date   in date
321   ) is
322 --
323   l_proc        varchar2(72) := g_package||'pre_update';
324 --
325 Begin
326   hr_utility.set_location('Entering:'||l_proc, 5);
327   --
328   --
329   --
330   dt_pre_update
331     (p_rec                   => p_rec
332     ,p_effective_date        => p_effective_date
333     ,p_datetrack_mode        => p_datetrack_mode
334     ,p_validation_start_date => p_validation_start_date
335     ,p_validation_end_date   => p_validation_end_date
336     );
337   --
338   hr_utility.set_location(' Leaving:'||l_proc, 10);
339 End pre_update;
340 --
341 -- ----------------------------------------------------------------------------
342 -- |----------------------------< post_update >-------------------------------|
343 -- ----------------------------------------------------------------------------
344 -- {Start Of Comments}
345 --
346 -- Description:
347 --   This private procedure contains any processing which is required after
348 --   the update dml.
349 --
350 -- Prerequisites:
351 --   This is an internal procedure which is called from the upd procedure.
352 --
353 -- In Parameters:
354 --   A Pl/Sql record structure.
355 --
356 -- Post Success:
357 --   Processing continues.
358 --
359 -- Post Failure:
360 --   If an error has occurred, an error message and exception will be raised
361 --   but not handled.
362 --
363 -- Developer Implementation Notes:
364 --   Any post-processing required after the update dml is issued should be
365 --   coded within this procedure. It is important to note that any 3rd party
366 --   maintenance should be reviewed before placing in this procedure.
367 --
368 -- Access Status:
369 --   Internal Row Handler Use Only.
370 --
371 -- {End Of Comments}
372 -- ----------------------------------------------------------------------------
373 Procedure post_update
374   (p_rec                   in pay_ppd_shd.g_rec_type
375   ,p_effective_date        in date
376   ,p_datetrack_mode        in varchar2
377   ,p_validation_start_date in date
378   ,p_validation_end_date   in date
379   ) is
380 --
381   l_proc        varchar2(72) := g_package||'post_update';
382 --
383 Begin
384   hr_utility.set_location('Entering:'||l_proc, 5);
385   begin
386     --
387     pay_ppd_rku.after_update
388       (p_effective_date
389       => p_effective_date
390       ,p_datetrack_mode
391       => p_datetrack_mode
392       ,p_validation_start_date
393       => p_validation_start_date
394       ,p_validation_end_date
395       => p_validation_end_date
396       ,p_paye_details_id
397       => p_rec.paye_details_id
398       ,p_effective_start_date
399       => p_rec.effective_start_date
400       ,p_effective_end_date
401       => p_rec.effective_end_date
402      -- ,p_per_or_asg_id
403     --  => p_rec.per_or_asg_id
404      -- ,p_business_group_id
405   --    => p_rec.business_group_id
406    --   ,p_contract_category
407 --      => p_rec.contract_category
408       ,p_object_version_number
409       => p_rec.object_version_number
410       ,p_tax_reduction
411       => p_rec.tax_reduction
412       ,p_tax_calc_with_spouse_child
413       => p_rec.tax_calc_with_spouse_child
414       ,p_income_reduction
415       => p_rec.income_reduction
416       ,p_income_reduction_amount
417       => p_rec.income_reduction_amount
418       ,p_rate_of_tax
419       => p_rec.rate_of_tax
420       ,p_program_id
421       => p_rec.program_id
422       ,p_program_login_id
423       => p_rec.program_login_id
424       ,p_program_application_id
425       => p_rec.program_application_id
426       ,p_request_id
427       => p_rec.request_id
428       ,p_effective_start_date_o
429       => pay_ppd_shd.g_old_rec.effective_start_date
430       ,p_effective_end_date_o
431       => pay_ppd_shd.g_old_rec.effective_end_date
432       ,p_per_or_asg_id_o
433       => pay_ppd_shd.g_old_rec.per_or_asg_id
434       ,p_business_group_id_o
435       => pay_ppd_shd.g_old_rec.business_group_id
436       ,p_contract_category_o
437       => pay_ppd_shd.g_old_rec.contract_category
438       ,p_object_version_number_o
439       => pay_ppd_shd.g_old_rec.object_version_number
440       ,p_tax_reduction_o
441       => pay_ppd_shd.g_old_rec.tax_reduction
442       ,p_tax_calc_with_spouse_child_o
443       => pay_ppd_shd.g_old_rec.tax_calc_with_spouse_child
444       ,p_income_reduction_o
445       => pay_ppd_shd.g_old_rec.income_reduction
446       ,p_income_reduction_amount_o
447       => pay_ppd_shd.g_old_rec.income_reduction_amount
448       ,p_rate_of_tax_o
449       => pay_ppd_shd.g_old_rec.rate_of_tax
450       ,p_program_id_o
451       => pay_ppd_shd.g_old_rec.program_id
452       ,p_program_login_id_o
453       => pay_ppd_shd.g_old_rec.program_login_id
454       ,p_program_application_id_o
455       => pay_ppd_shd.g_old_rec.program_application_id
456       ,p_request_id_o
457       => pay_ppd_shd.g_old_rec.request_id
458       );
459     --
460   exception
461     --
462     when hr_api.cannot_find_prog_unit then
463       --
464       hr_api.cannot_find_prog_unit_error
465         (p_module_name => 'PAY_PL_PAYE_DETAILS_F'
466         ,p_hook_type   => 'AU');
467       --
468   end;
469   --
470   hr_utility.set_location(' Leaving:'||l_proc, 10);
471 End post_update;
472 --
473 -- ----------------------------------------------------------------------------
474 -- |-----------------------------< convert_defs >-----------------------------|
475 -- ----------------------------------------------------------------------------
476 -- {Start Of Comments}
477 --
478 -- Description:
479 --   The Convert_Defs procedure has one very important function:
480 --   It must return the record structure for the row with all system defaulted
481 --   values converted into its corresponding parameter value for update. When
482 --   we attempt to update a row through the Upd process , certain
483 --   parameters can be defaulted which enables flexibility in the calling of
484 --   the upd process (e.g. only attributes which need to be updated need to be
485 --   specified). For the upd process to determine which attributes
486 --   have NOT been specified we need to check if the parameter has a reserved
487 --   system default value. Therefore, for all parameters which have a
488 --   corresponding reserved system default mechanism specified we need to
489 --   check if a system default is being used. If a system default is being
490 --   used then we convert the defaulted value into its corresponding attribute
491 --   value held in the g_old_rec data structure.
492 --
493 -- Prerequisites:
494 --   This private function can only be called from the upd process.
495 --
496 -- In Parameters:
497 --   A Pl/Sql record structure.
498 --
499 -- Post Success:
500 --   The record structure will be returned with all system defaulted parameter
501 --   values converted into its current row attribute value.
502 --
503 -- Post Failure:
504 --   No direct error handling is required within this function. Any possible
505 --   errors within this procedure will be a PL/SQL value error due to
506 --   conversion of datatypes or data lengths.
507 --
508 -- Developer Implementation Notes:
509 --   None.
510 --
511 -- Access Status:
512 --   Internal Row Handler Use Only.
513 --
514 -- {End Of Comments}
515 -- ----------------------------------------------------------------------------
516 Procedure convert_defs
517   (p_rec in out nocopy pay_ppd_shd.g_rec_type
518   ) is
519 --
520 Begin
521   --
522   -- We must now examine each argument value in the
523   -- p_rec plsql record structure
524   -- to see if a system default is being used. If a system default
525   -- is being used then we must set to the 'current' argument value.
526   --
527   If (p_rec.per_or_asg_id = hr_api.g_number) then
528     p_rec.per_or_asg_id :=
529     pay_ppd_shd.g_old_rec.per_or_asg_id;
530   End If;
531   If (p_rec.business_group_id = hr_api.g_number) then
532     p_rec.business_group_id :=
533     pay_ppd_shd.g_old_rec.business_group_id;
534   End If;
535   If (p_rec.contract_category = hr_api.g_varchar2) then
536     p_rec.contract_category :=
537     pay_ppd_shd.g_old_rec.contract_category;
538   End If;
539   If (p_rec.tax_reduction = hr_api.g_varchar2) then
540     p_rec.tax_reduction :=
541     pay_ppd_shd.g_old_rec.tax_reduction;
542   End If;
543   If (p_rec.tax_calc_with_spouse_child = hr_api.g_varchar2) then
544     p_rec.tax_calc_with_spouse_child :=
545     pay_ppd_shd.g_old_rec.tax_calc_with_spouse_child;
546   End If;
547   If (p_rec.income_reduction = hr_api.g_varchar2) then
548     p_rec.income_reduction :=
549     pay_ppd_shd.g_old_rec.income_reduction;
550   End If;
551   If (p_rec.income_reduction_amount = hr_api.g_number) then
552     p_rec.income_reduction_amount :=
553     pay_ppd_shd.g_old_rec.income_reduction_amount;
554   End If;
555   If (p_rec.rate_of_tax = hr_api.g_varchar2) then
556     p_rec.rate_of_tax :=
557     pay_ppd_shd.g_old_rec.rate_of_tax;
558   End If;
559   If (p_rec.program_id = hr_api.g_number) then
560     p_rec.program_id :=
561     pay_ppd_shd.g_old_rec.program_id;
562   End If;
563   If (p_rec.program_login_id = hr_api.g_number) then
564     p_rec.program_login_id :=
565     pay_ppd_shd.g_old_rec.program_login_id;
566   End If;
567   If (p_rec.program_application_id = hr_api.g_number) then
568     p_rec.program_application_id :=
569     pay_ppd_shd.g_old_rec.program_application_id;
570   End If;
571   If (p_rec.request_id = hr_api.g_number) then
572     p_rec.request_id :=
573     pay_ppd_shd.g_old_rec.request_id;
574   End If;
575   --
576 End convert_defs;
577 --
578 -- ----------------------------------------------------------------------------
579 -- |---------------------------------< upd >----------------------------------|
580 -- ----------------------------------------------------------------------------
581 Procedure upd
582   (p_effective_date in     date
583   ,p_datetrack_mode in     varchar2
584   ,p_rec            in out nocopy pay_ppd_shd.g_rec_type
585   ) is
586 --
587   l_proc                        varchar2(72) := g_package||'upd';
588   l_validation_start_date       date;
589   l_validation_end_date         date;
590 --
591 Begin
592   hr_utility.set_location('Entering:'||l_proc, 5);
593   --
594   -- Ensure that the DateTrack update mode is valid
595   --
596   dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
597   --
598   -- We must lock the row which we need to update.
599   --
600   pay_ppd_shd.lck
601     (p_effective_date                   => p_effective_date
602     ,p_datetrack_mode                   => p_datetrack_mode
603     ,p_paye_details_id                  => p_rec.paye_details_id
604     ,p_object_version_number            => p_rec.object_version_number
605     ,p_validation_start_date            => l_validation_start_date
606     ,p_validation_end_date              => l_validation_end_date
607     );
608   --
609   -- 1. During an update system defaults are used to determine if
610   --    arguments have been defaulted or not. We must therefore
611   --    derive the full record structure values to be updated.
612   --
613   -- 2. Call the supporting update validate operations.
614   --
615   pay_ppd_upd.convert_defs(p_rec);
616   --
617   pay_ppd_bus.update_validate
618     (p_rec                              => p_rec
619     ,p_effective_date                   => p_effective_date
620     ,p_datetrack_mode                   => p_datetrack_mode
621     ,p_validation_start_date            => l_validation_start_date
622     ,p_validation_end_date              => l_validation_end_date
623     );
624   --
625   -- Call to raise any errors on multi-message list
626   hr_multi_message.end_validation_set;
627   --
628   -- Call the supporting pre-update operation
629   --
630   pre_update
631     (p_rec                              => p_rec
632     ,p_effective_date                   => p_effective_date
633     ,p_datetrack_mode                   => p_datetrack_mode
634     ,p_validation_start_date            => l_validation_start_date
635     ,p_validation_end_date              => l_validation_end_date
636     );
637   --
638   -- Update the row.
639   --
640   update_dml
641     (p_rec                              => p_rec
642     ,p_effective_date                   => p_effective_date
643     ,p_datetrack_mode                   => p_datetrack_mode
644     ,p_validation_start_date            => l_validation_start_date
645     ,p_validation_end_date                  => l_validation_end_date
646     );
647   --
648   -- Call the supporting post-update operation
649   --
650   post_update
651     (p_rec                              => p_rec
652     ,p_effective_date                   => p_effective_date
653     ,p_datetrack_mode                   => p_datetrack_mode
654     ,p_validation_start_date            => l_validation_start_date
655     ,p_validation_end_date              => l_validation_end_date
656     );
657   --
658   -- Call to raise any errors on multi-message list
659   hr_multi_message.end_validation_set;
660 End upd;
661 --
662 -- ----------------------------------------------------------------------------
663 -- |------------------------------< upd >-------------------------------------|
664 -- ----------------------------------------------------------------------------
665 Procedure upd
666   (p_effective_date               in     date
667   ,p_datetrack_mode               in     varchar2
668   ,p_paye_details_id              in     number
669   ,p_object_version_number        in out nocopy number
670   ,p_tax_reduction                in     varchar2  default hr_api.g_varchar2
671   ,p_tax_calc_with_spouse_child   in     varchar2  default hr_api.g_varchar2
672   ,p_income_reduction             in     varchar2  default hr_api.g_varchar2
673   ,p_income_reduction_amount      in     number    default hr_api.g_number
674   ,p_rate_of_tax                  in     varchar2  default hr_api.g_varchar2
675   ,p_program_id                   in     number    default hr_api.g_number
676   ,p_program_login_id             in     number    default hr_api.g_number
677   ,p_program_application_id       in     number    default hr_api.g_number
678   ,p_request_id                   in     number    default hr_api.g_number
679   ,p_effective_start_date            out nocopy date
680   ,p_effective_end_date              out nocopy date
681   ) is
682 --
683   l_rec         pay_ppd_shd.g_rec_type;
684   l_proc        varchar2(72) := g_package||'upd';
685 --
686 Begin
687   hr_utility.set_location('Entering:'||l_proc, 5);
688   --
689   -- Call conversion function to turn arguments into the
690   -- l_rec structure.
691   --
692   l_rec :=
693   pay_ppd_shd.convert_args
694     (p_paye_details_id
695     ,null
696     ,null
697     ,hr_api.g_number
698     ,hr_api.g_number
699     ,hr_api.g_varchar2
700     ,p_object_version_number
701     ,p_tax_reduction
702     ,p_tax_calc_with_spouse_child
703     ,p_income_reduction
704     ,p_income_reduction_amount
705     ,p_rate_of_tax
706     ,p_program_id
707     ,p_program_login_id
708     ,p_program_application_id
709     ,p_request_id
710     );
711   --
712   -- Having converted the arguments into the
713   -- plsql record structure we call the corresponding record
714   -- business process.
715   --
716   pay_ppd_upd.upd
717     (p_effective_date
718     ,p_datetrack_mode
719     ,l_rec
720     );
721   --
722   -- Set the out parameters
723   --
724   p_object_version_number            := l_rec.object_version_number;
725   p_effective_start_date             := l_rec.effective_start_date;
726   p_effective_end_date               := l_rec.effective_end_date;
727   --
728   --
729   hr_utility.set_location(' Leaving:'||l_proc, 10);
730 End upd;
731 --
732 end pay_ppd_upd;