DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_ETP_UPD

Source


1 Package Body pay_etp_upd as
2 /* $Header: pyetprhi.pkb 120.6.12010000.6 2009/07/30 11:56:55 npannamp ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pay_etp_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_etp_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_element_types_f'
79         ,p_base_key_column => 'element_type_id'
80         ,p_base_key_value  => p_rec.element_type_id
81         );
82     --
83     pay_etp_shd.g_api_dml := true;  -- Set the api dml status
84     --
85     -- Update the pay_element_types_f Row
86     --
87     update  pay_element_types_f
88     set
89      element_type_id                      = p_rec.element_type_id
90     ,business_group_id                    = p_rec.business_group_id
91     ,legislation_code                     = p_rec.legislation_code
92     ,formula_id                           = p_rec.formula_id
93     ,input_currency_code                  = p_rec.input_currency_code
94     ,output_currency_code                 = p_rec.output_currency_code
95     ,classification_id                    = p_rec.classification_id
96     ,benefit_classification_id            = p_rec.benefit_classification_id
97     ,additional_entry_allowed_flag        = p_rec.additional_entry_allowed_flag
98     ,adjustment_only_flag                 = p_rec.adjustment_only_flag
99     ,closed_for_entry_flag                = p_rec.closed_for_entry_flag
100     ,element_name                         = p_rec.element_name
101     ,indirect_only_flag                   = p_rec.indirect_only_flag
102     ,multiple_entries_allowed_flag        = p_rec.multiple_entries_allowed_flag
103     ,multiply_value_flag                  = p_rec.multiply_value_flag
104     ,post_termination_rule                = p_rec.post_termination_rule
105     ,process_in_run_flag                  = p_rec.process_in_run_flag
106     ,processing_priority                  = p_rec.processing_priority
107     ,processing_type                      = p_rec.processing_type
108     ,standard_link_flag                   = p_rec.standard_link_flag
109     ,comment_id                           = p_rec.comment_id
110     ,description                          = p_rec.description
111     ,legislation_subgroup                 = p_rec.legislation_subgroup
112     ,qualifying_age                       = p_rec.qualifying_age
113     ,qualifying_length_of_service         = p_rec.qualifying_length_of_service
114     ,qualifying_units                     = p_rec.qualifying_units
115     ,reporting_name                       = p_rec.reporting_name
116     ,attribute_category                   = p_rec.attribute_category
117     ,attribute1                           = p_rec.attribute1
118     ,attribute2                           = p_rec.attribute2
119     ,attribute3                           = p_rec.attribute3
120     ,attribute4                           = p_rec.attribute4
121     ,attribute5                           = p_rec.attribute5
122     ,attribute6                           = p_rec.attribute6
123     ,attribute7                           = p_rec.attribute7
124     ,attribute8                           = p_rec.attribute8
125     ,attribute9                           = p_rec.attribute9
126     ,attribute10                          = p_rec.attribute10
127     ,attribute11                          = p_rec.attribute11
128     ,attribute12                          = p_rec.attribute12
129     ,attribute13                          = p_rec.attribute13
130     ,attribute14                          = p_rec.attribute14
131     ,attribute15                          = p_rec.attribute15
132     ,attribute16                          = p_rec.attribute16
133     ,attribute17                          = p_rec.attribute17
134     ,attribute18                          = p_rec.attribute18
135     ,attribute19                          = p_rec.attribute19
136     ,attribute20                          = p_rec.attribute20
137     ,element_information_category         = p_rec.element_information_category
138     ,element_information1                 = p_rec.element_information1
139     ,element_information2                 = p_rec.element_information2
140     ,element_information3                 = p_rec.element_information3
141     ,element_information4                 = p_rec.element_information4
142     ,element_information5                 = p_rec.element_information5
143     ,element_information6                 = p_rec.element_information6
144     ,element_information7                 = p_rec.element_information7
145     ,element_information8                 = p_rec.element_information8
146     ,element_information9                 = p_rec.element_information9
147     ,element_information10                = p_rec.element_information10
148     ,element_information11                = p_rec.element_information11
149     ,element_information12                = p_rec.element_information12
150     ,element_information13                = p_rec.element_information13
151     ,element_information14                = p_rec.element_information14
152     ,element_information15                = p_rec.element_information15
153     ,element_information16                = p_rec.element_information16
154     ,element_information17                = p_rec.element_information17
155     ,element_information18                = p_rec.element_information18
156     ,element_information19                = p_rec.element_information19
157     ,element_information20                = p_rec.element_information20
158     ,third_party_pay_only_flag            = p_rec.third_party_pay_only_flag
159     ,object_version_number                = p_rec.object_version_number
160     ,iterative_flag                       = p_rec.iterative_flag
161     ,iterative_formula_id                 = p_rec.iterative_formula_id
162     ,iterative_priority                   = p_rec.iterative_priority
163     ,creator_type                         = p_rec.creator_type
164     ,retro_summ_ele_id                    = p_rec.retro_summ_ele_id
165     ,grossup_flag                         = p_rec.grossup_flag
166     ,process_mode                         = p_rec.process_mode
167     ,advance_indicator                    = p_rec.advance_indicator
168     ,advance_payable                      = p_rec.advance_payable
169     ,advance_deduction                    = p_rec.advance_deduction
170     ,process_advance_entry                = p_rec.process_advance_entry
171     ,proration_group_id                   = p_rec.proration_group_id
172     ,proration_formula_id                 = p_rec.proration_formula_id
173     ,recalc_event_group_id                = p_rec.recalc_event_group_id
174     ,once_each_period_flag                = p_rec.once_each_period_flag
175     ,time_definition_type		  = p_rec.time_definition_type
176     ,time_definition_id			  = p_rec.time_definition_id
177     ,advance_element_type_id		  = p_rec.advance_element_type_id
178     ,deduction_element_type_id		  = p_rec.deduction_element_type_id
179     where   element_type_id = p_rec.element_type_id
180     and     effective_start_date = p_validation_start_date
181     and     effective_end_date   = p_validation_end_date;
182     --
183     pay_etp_shd.g_api_dml := false;   -- Unset the api dml status
184     --
185     -- Set the effective start and end dates
186     --
187     p_rec.effective_start_date := p_validation_start_date;
188     p_rec.effective_end_date   := p_validation_end_date;
189   End If;
190 --
191 hr_utility.set_location(' Leaving:'||l_proc, 15);
192 Exception
193   When hr_api.check_integrity_violated Then
194     -- A check constraint has been violated
195     pay_etp_shd.g_api_dml := false;   -- Unset the api dml status
196     pay_etp_shd.constraint_error
197       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
198   When hr_api.unique_integrity_violated Then
199     -- Unique integrity has been violated
200     pay_etp_shd.g_api_dml := false;   -- Unset the api dml status
201     pay_etp_shd.constraint_error
202       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
203   When Others Then
204     pay_etp_shd.g_api_dml := false;   -- Unset the api dml status
205     Raise;
206 End dt_update_dml;
207 --
208 -- ----------------------------------------------------------------------------
209 -- |------------------------------< update_dml >------------------------------|
210 -- ----------------------------------------------------------------------------
211 -- {Start Of Comments}
212 --
213 -- Description:
214 --   This procedure calls the dt_update_dml control logic which handles
215 --   the actual datetrack dml.
216 --
217 -- Prerequisites:
218 --   This is an internal private procedure which must be called from the upd
219 --   procedure.
220 --
221 -- In Parameters:
222 --   A Pl/Sql record structre.
223 --
224 -- Post Success:
225 --   Processing contines.
226 --
227 -- Post Failure:
228 --   No specific error handling is required within this procedure.
229 --
230 -- Developer Implementation Notes:
231 --   The update 'set' arguments list should be modified if any of your
232 --   attributes are not updateable.
233 --
234 -- Access Status:
235 --   Internal Row Handler Use Only.
236 --
237 -- {End Of Comments}
238 -- ----------------------------------------------------------------------------
239 Procedure update_dml
240   (p_rec                      in out nocopy pay_etp_shd.g_rec_type
241   ,p_effective_date           in date
242   ,p_datetrack_mode           in varchar2
243   ,p_validation_start_date    in date
244   ,p_validation_end_date      in date
245   ) is
246 --
247   l_proc        varchar2(72) := g_package||'update_dml';
248 --
249 Begin
250   hr_utility.set_location('Entering:'||l_proc, 5);
251   --
252   pay_etp_upd.dt_update_dml
253     (p_rec                   => p_rec
254     ,p_effective_date        => p_effective_date
255     ,p_datetrack_mode        => p_datetrack_mode
256     ,p_validation_start_date => p_validation_start_date
257     ,p_validation_end_date   => p_validation_end_date
258     );
259   --
260   hr_utility.set_location(' Leaving:'||l_proc, 10);
261 End update_dml;
262 --
263 -- ----------------------------------------------------------------------------
264 -- |----------------------------< dt_pre_update >-----------------------------|
265 -- ----------------------------------------------------------------------------
266 -- {Start Of Comments}
267 --
268 -- Description:
269 --   The dt_pre_update procedure controls the execution
270 --   of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
271 --   and UPDATE_CHANGE_INSERT only. The execution required is as
272 --   follows:
273 --
274 --   1) Providing the datetrack update mode is not 'CORRECTION'
275 --      then set the effective end date of the current row (this
276 --      will be the validation_start_date - 1).
277 --   2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
278 --      corresponding delete_dml process to delete any future rows
279 --      where the effective_start_date is greater than or equal to
280 --      the validation_start_date.
281 --   3) Call the insert_dml process to insert the new updated row
282 --      details.
283 --
284 -- Prerequisites:
285 --   This is an internal procedure which is called from the
286 --   pre_update procedure.
287 --
288 -- In Parameters:
289 --
290 -- Post Success:
291 --   Processing continues.
292 --
293 -- Post Failure:
294 --   If an error has occurred, an error message and exception will be raised
295 --   but not handled.
296 --
297 -- Developer Implementation Notes:
298 --   This is an internal procedure which is required by Datetrack. Don't
299 --   remove or modify.
300 --
301 -- Access Status:
302 --   Internal Row Handler Use Only.
303 --
304 -- {End Of Comments}
305 -- ----------------------------------------------------------------------------
306 Procedure dt_pre_update
307   (p_rec                     in out nocopy     pay_etp_shd.g_rec_type
308   ,p_effective_date          in date
309   ,p_datetrack_mode          in varchar2
310   ,p_validation_start_date   in date
311   ,p_validation_end_date     in date
312   ) is
313 --
314   l_proc                 varchar2(72) := g_package||'dt_pre_update';
315   l_dummy_version_number number;
316 --
317 Begin
318   hr_utility.set_location('Entering:'||l_proc, 5);
319   If (p_datetrack_mode <> hr_api.g_correction) then
320     --
321     -- Update the current effective end date
322     --
323     pay_etp_shd.upd_effective_end_date
324       (p_effective_date         => p_effective_date
325       ,p_base_key_value         => p_rec.element_type_id
326       ,p_new_effective_end_date => (p_validation_start_date - 1)
327       ,p_validation_start_date  => p_validation_start_date
328       ,p_validation_end_date    => p_validation_end_date
329       ,p_object_version_number  => l_dummy_version_number
330       );
331     --
332     If (p_datetrack_mode = hr_api.g_update_override) then
333       --
334       -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
335       -- delete any future rows
336       --
337       pay_etp_del.delete_dml
338         (p_rec                   => p_rec
339         ,p_effective_date        => p_effective_date
340         ,p_datetrack_mode        => p_datetrack_mode
341         ,p_validation_start_date => p_validation_start_date
342         ,p_validation_end_date   => p_validation_end_date
343         );
344     End If;
345     --
346     -- We must now insert the updated row
347     --
348     pay_etp_ins.insert_dml
349       (p_rec                    => p_rec
350       ,p_effective_date         => p_effective_date
351       ,p_datetrack_mode         => p_datetrack_mode
352       ,p_validation_start_date  => p_validation_start_date
353       ,p_validation_end_date    => p_validation_end_date
354       );
355   End If;
356   hr_utility.set_location(' Leaving:'||l_proc, 20);
357 End dt_pre_update;
358 --
359 -- ----------------------------------------------------------------------------
360 -- |------------------------------< pre_update >------------------------------|
361 -- ----------------------------------------------------------------------------
362 -- {Start Of Comments}
363 --
364 -- Description:
365 --   This private procedure contains any processing which is required before
366 --   the update dml.
367 --
368 -- Prerequisites:
369 --   This is an internal procedure which is called from the upd procedure.
370 --
371 -- In Parameters:
372 --   A Pl/Sql record structure.
373 --
374 -- Post Success:
375 --   Processing continues.
376 --
377 -- Post Failure:
378 --   If an error has occurred, an error message and exception will be raised
379 --   but not handled.
380 -- Developer Implementation Notes:
381 --   Any pre-processing required before the update dml is issued should be
382 --   coded within this procedure. It is important to note that any 3rd party
383 --   maintenance should be reviewed before placing in this procedure. The call
384 --   to the dt_update_dml procedure should NOT be removed.
385 --
386 -- Access Status:
387 --   Internal Row Handler Use Only.
388 --
389 -- {End Of Comments}
390 -- ----------------------------------------------------------------------------
391 Procedure pre_update
392   (p_rec                   in out nocopy pay_etp_shd.g_rec_type
393   ,p_effective_date        in date
394   ,p_datetrack_mode        in varchar2
395   ,p_validation_start_date in date
396   ,p_validation_end_date   in date
397   ) is
398 --
399   l_proc        varchar2(72) := g_package||'pre_update';
400 --
401 Begin
402   hr_utility.set_location('Entering:'||l_proc, 5);
403   --
404   --
405   -- Insert the comment text if comments exist
406   --
407   If (p_rec.comments is not null and p_rec.comment_id is null) then
408      hr_comm_api.ins(p_comment_id        => p_rec.comment_id
409                     ,p_source_table_name => 'PAY_ELEMENT_TYPES_F'
410                     ,p_comment_text      => p_rec.comments
411                     );
412   -- Update the comments if they have changed
413   ElsIf (p_rec.comment_id is not null and p_rec.comments <>
414         pay_etp_shd.g_old_rec.comments) then
415      hr_comm_api.upd(p_comment_id        => p_rec.comment_id
416                     ,p_source_table_name => 'PAY_ELEMENT_TYPES_F'
417                     ,p_comment_text      => p_rec.comments
418                     );
419   End If;
420   --
421   dt_pre_update
422     (p_rec                   => p_rec
423     ,p_effective_date        => p_effective_date
424     ,p_datetrack_mode        => p_datetrack_mode
425     ,p_validation_start_date => p_validation_start_date
426     ,p_validation_end_date   => p_validation_end_date
427     );
428   --
429   hr_utility.set_location(' Leaving:'||l_proc, 10);
430 End pre_update;
431 --
432 -- ----------------------------------------------------------------------------
433 -- |----------------------------< post_update >-------------------------------|
434 -- ----------------------------------------------------------------------------
435 -- {Start Of Comments}
436 --
437 -- Description:
438 --   This private procedure contains any processing which is required after
439 --   the update dml.
440 --
441 -- Prerequisites:
442 --   This is an internal procedure which is called from the upd procedure.
443 --
444 -- In Parameters:
445 --   A Pl/Sql record structure.
446 --
447 -- Post Success:
448 --   Processing continues.
449 --
450 -- Post Failure:
451 --   If an error has occurred, an error message and exception will be raised
452 --   but not handled.
453 --
454 -- Developer Implementation Notes:
455 --   Any post-processing required after the update dml is issued should be
456 --   coded within this procedure. It is important to note that any 3rd party
457 --   maintenance should be reviewed before placing in this procedure.
458 --
459 -- Access Status:
460 --   Internal Row Handler Use Only.
461 --
462 -- {End Of Comments}
463 -- ----------------------------------------------------------------------------
464 Procedure post_update
465   (p_rec                   in pay_etp_shd.g_rec_type
466   ,p_effective_date        in date
467   ,p_datetrack_mode        in varchar2
468   ,p_validation_start_date in date
469   ,p_validation_end_date   in date
470   ) is
471 --
472   l_proc        varchar2(72) := g_package||'post_update';
473 --
474 Begin
475   hr_utility.set_location('Entering:'||l_proc, 5);
476   begin
477     --
478     pay_etp_rku.after_update
479       (p_effective_date
480       => p_effective_date
481       ,p_datetrack_mode
482       => p_datetrack_mode
483       ,p_validation_start_date
484       => p_validation_start_date
485       ,p_validation_end_date
486       => p_validation_end_date
487       ,p_element_type_id
488       => p_rec.element_type_id
489       ,p_effective_start_date
490       => p_rec.effective_start_date
491       ,p_effective_end_date
492       => p_rec.effective_end_date
493       ,p_business_group_id
494       => p_rec.business_group_id
495       ,p_legislation_code
496       => p_rec.legislation_code
497       ,p_formula_id
498       => p_rec.formula_id
499       ,p_input_currency_code
500       => p_rec.input_currency_code
501       ,p_output_currency_code
502       => p_rec.output_currency_code
503       ,p_classification_id
504       => p_rec.classification_id
505       ,p_benefit_classification_id
506       => p_rec.benefit_classification_id
507       ,p_additional_entry_allowed_fla
508       => p_rec.additional_entry_allowed_flag
509       ,p_adjustment_only_flag
510       => p_rec.adjustment_only_flag
511       ,p_closed_for_entry_flag
512       => p_rec.closed_for_entry_flag
513       ,p_element_name
514       => p_rec.element_name
515       ,p_indirect_only_flag
516       => p_rec.indirect_only_flag
517       ,p_multiple_entries_allowed_fla
518       => p_rec.multiple_entries_allowed_flag
519       ,p_multiply_value_flag
520       => p_rec.multiply_value_flag
521       ,p_post_termination_rule
522       => p_rec.post_termination_rule
523       ,p_process_in_run_flag
524       => p_rec.process_in_run_flag
525       ,p_processing_priority
526       => p_rec.processing_priority
527       ,p_processing_type
528       => p_rec.processing_type
529       ,p_standard_link_flag
530       => p_rec.standard_link_flag
531       ,p_comment_id
532       => p_rec.comment_id
533       ,p_comments
534       => p_rec.comments
535       ,p_description
536       => p_rec.description
537       ,p_legislation_subgroup
538       => p_rec.legislation_subgroup
539       ,p_qualifying_age
540       => p_rec.qualifying_age
541       ,p_qualifying_length_of_service
542       => p_rec.qualifying_length_of_service
543       ,p_qualifying_units
544       => p_rec.qualifying_units
545       ,p_reporting_name
546       => p_rec.reporting_name
547       ,p_attribute_category
548       => p_rec.attribute_category
549       ,p_attribute1
550       => p_rec.attribute1
551       ,p_attribute2
552       => p_rec.attribute2
553       ,p_attribute3
554       => p_rec.attribute3
555       ,p_attribute4
556       => p_rec.attribute4
557       ,p_attribute5
558       => p_rec.attribute5
559       ,p_attribute6
560       => p_rec.attribute6
561       ,p_attribute7
562       => p_rec.attribute7
563       ,p_attribute8
564       => p_rec.attribute8
565       ,p_attribute9
566       => p_rec.attribute9
567       ,p_attribute10
568       => p_rec.attribute10
569       ,p_attribute11
570       => p_rec.attribute11
571       ,p_attribute12
572       => p_rec.attribute12
573       ,p_attribute13
574       => p_rec.attribute13
575       ,p_attribute14
576       => p_rec.attribute14
577       ,p_attribute15
578       => p_rec.attribute15
579       ,p_attribute16
580       => p_rec.attribute16
581       ,p_attribute17
582       => p_rec.attribute17
583       ,p_attribute18
584       => p_rec.attribute18
585       ,p_attribute19
586       => p_rec.attribute19
587       ,p_attribute20
588       => p_rec.attribute20
589       ,p_element_information_category
590       => p_rec.element_information_category
591       ,p_element_information1
592       => p_rec.element_information1
593       ,p_element_information2
594       => p_rec.element_information2
595       ,p_element_information3
596       => p_rec.element_information3
597       ,p_element_information4
598       => p_rec.element_information4
599       ,p_element_information5
600       => p_rec.element_information5
601       ,p_element_information6
602       => p_rec.element_information6
603       ,p_element_information7
604       => p_rec.element_information7
605       ,p_element_information8
606       => p_rec.element_information8
607       ,p_element_information9
608       => p_rec.element_information9
609       ,p_element_information10
610       => p_rec.element_information10
611       ,p_element_information11
612       => p_rec.element_information11
613       ,p_element_information12
614       => p_rec.element_information12
615       ,p_element_information13
616       => p_rec.element_information13
617       ,p_element_information14
618       => p_rec.element_information14
619       ,p_element_information15
620       => p_rec.element_information15
621       ,p_element_information16
622       => p_rec.element_information16
623       ,p_element_information17
624       => p_rec.element_information17
625       ,p_element_information18
626       => p_rec.element_information18
627       ,p_element_information19
628       => p_rec.element_information19
629       ,p_element_information20
630       => p_rec.element_information20
631       ,p_third_party_pay_only_flag
632       => p_rec.third_party_pay_only_flag
633       ,p_object_version_number
634       => p_rec.object_version_number
635       ,p_iterative_flag
636       => p_rec.iterative_flag
637       ,p_iterative_formula_id
638       => p_rec.iterative_formula_id
639       ,p_iterative_priority
640       => p_rec.iterative_priority
641       ,p_creator_type
642       => p_rec.creator_type
643       ,p_retro_summ_ele_id
644       => p_rec.retro_summ_ele_id
645       ,p_grossup_flag
646       => p_rec.grossup_flag
647       ,p_process_mode
648       => p_rec.process_mode
649       ,p_advance_indicator
650       => p_rec.advance_indicator
651       ,p_advance_payable
652       => p_rec.advance_payable
653       ,p_advance_deduction
654       => p_rec.advance_deduction
655       ,p_process_advance_entry
656       => p_rec.process_advance_entry
657       ,p_proration_group_id
658       => p_rec.proration_group_id
659       ,p_proration_formula_id
660       => p_rec.proration_formula_id
661       ,p_recalc_event_group_id
662       => p_rec.recalc_event_group_id
663       ,p_once_each_period_flag
664       => p_rec.once_each_period_flag
665       ,p_time_definition_type
666       => p_rec.time_definition_type
667       ,p_time_definition_id
668       => p_rec.time_definition_id
669       ,p_advance_element_type_id
670       => p_rec.advance_element_type_id
671       ,p_deduction_element_type_id
672       => p_rec.deduction_element_type_id
673       ,p_effective_start_date_o
674       => pay_etp_shd.g_old_rec.effective_start_date
675       ,p_effective_end_date_o
676       => pay_etp_shd.g_old_rec.effective_end_date
677       ,p_business_group_id_o
678       => pay_etp_shd.g_old_rec.business_group_id
679       ,p_legislation_code_o
680       => pay_etp_shd.g_old_rec.legislation_code
681       ,p_formula_id_o
682       => pay_etp_shd.g_old_rec.formula_id
683       ,p_input_currency_code_o
684       => pay_etp_shd.g_old_rec.input_currency_code
685       ,p_output_currency_code_o
686       => pay_etp_shd.g_old_rec.output_currency_code
687       ,p_classification_id_o
688       => pay_etp_shd.g_old_rec.classification_id
689       ,p_benefit_classification_id_o
690       => pay_etp_shd.g_old_rec.benefit_classification_id
691       ,p_additional_entry_allowed_f_o
692       => pay_etp_shd.g_old_rec.additional_entry_allowed_flag
693       ,p_adjustment_only_flag_o
694       => pay_etp_shd.g_old_rec.adjustment_only_flag
695       ,p_closed_for_entry_flag_o
696       => pay_etp_shd.g_old_rec.closed_for_entry_flag
697       ,p_element_name_o
698       => pay_etp_shd.g_old_rec.element_name
699       ,p_indirect_only_flag_o
700       => pay_etp_shd.g_old_rec.indirect_only_flag
701       ,p_multiple_entries_allowed_f_o
702       => pay_etp_shd.g_old_rec.multiple_entries_allowed_flag
703       ,p_multiply_value_flag_o
704       => pay_etp_shd.g_old_rec.multiply_value_flag
705       ,p_post_termination_rule_o
706       => pay_etp_shd.g_old_rec.post_termination_rule
707       ,p_process_in_run_flag_o
708       => pay_etp_shd.g_old_rec.process_in_run_flag
709       ,p_processing_priority_o
710       => pay_etp_shd.g_old_rec.processing_priority
711       ,p_processing_type_o
712       => pay_etp_shd.g_old_rec.processing_type
713       ,p_standard_link_flag_o
714       => pay_etp_shd.g_old_rec.standard_link_flag
715       ,p_comment_id_o
716       => pay_etp_shd.g_old_rec.comment_id
717       ,p_comments_o
718       => pay_etp_shd.g_old_rec.comments
719       ,p_description_o
720       => pay_etp_shd.g_old_rec.description
721       ,p_legislation_subgroup_o
722       => pay_etp_shd.g_old_rec.legislation_subgroup
723       ,p_qualifying_age_o
724       => pay_etp_shd.g_old_rec.qualifying_age
725       ,p_qualifying_length_of_servi_o
726       => pay_etp_shd.g_old_rec.qualifying_length_of_service
727       ,p_qualifying_units_o
728       => pay_etp_shd.g_old_rec.qualifying_units
729       ,p_reporting_name_o
730       => pay_etp_shd.g_old_rec.reporting_name
731       ,p_attribute_category_o
732       => pay_etp_shd.g_old_rec.attribute_category
733       ,p_attribute1_o
734       => pay_etp_shd.g_old_rec.attribute1
735       ,p_attribute2_o
736       => pay_etp_shd.g_old_rec.attribute2
737       ,p_attribute3_o
738       => pay_etp_shd.g_old_rec.attribute3
739       ,p_attribute4_o
740       => pay_etp_shd.g_old_rec.attribute4
741       ,p_attribute5_o
742       => pay_etp_shd.g_old_rec.attribute5
743       ,p_attribute6_o
744       => pay_etp_shd.g_old_rec.attribute6
745       ,p_attribute7_o
746       => pay_etp_shd.g_old_rec.attribute7
747       ,p_attribute8_o
748       => pay_etp_shd.g_old_rec.attribute8
749       ,p_attribute9_o
750       => pay_etp_shd.g_old_rec.attribute9
751       ,p_attribute10_o
752       => pay_etp_shd.g_old_rec.attribute10
753       ,p_attribute11_o
754       => pay_etp_shd.g_old_rec.attribute11
755       ,p_attribute12_o
756       => pay_etp_shd.g_old_rec.attribute12
757       ,p_attribute13_o
758       => pay_etp_shd.g_old_rec.attribute13
759       ,p_attribute14_o
760       => pay_etp_shd.g_old_rec.attribute14
761       ,p_attribute15_o
762       => pay_etp_shd.g_old_rec.attribute15
763       ,p_attribute16_o
764       => pay_etp_shd.g_old_rec.attribute16
765       ,p_attribute17_o
766       => pay_etp_shd.g_old_rec.attribute17
767       ,p_attribute18_o
768       => pay_etp_shd.g_old_rec.attribute18
769       ,p_attribute19_o
770       => pay_etp_shd.g_old_rec.attribute19
771       ,p_attribute20_o
772       => pay_etp_shd.g_old_rec.attribute20
773       ,p_element_information_catego_o
774       => pay_etp_shd.g_old_rec.element_information_category
775       ,p_element_information1_o
776       => pay_etp_shd.g_old_rec.element_information1
777       ,p_element_information2_o
778       => pay_etp_shd.g_old_rec.element_information2
779       ,p_element_information3_o
780       => pay_etp_shd.g_old_rec.element_information3
781       ,p_element_information4_o
782       => pay_etp_shd.g_old_rec.element_information4
783       ,p_element_information5_o
784       => pay_etp_shd.g_old_rec.element_information5
785       ,p_element_information6_o
786       => pay_etp_shd.g_old_rec.element_information6
787       ,p_element_information7_o
788       => pay_etp_shd.g_old_rec.element_information7
789       ,p_element_information8_o
790       => pay_etp_shd.g_old_rec.element_information8
791       ,p_element_information9_o
792       => pay_etp_shd.g_old_rec.element_information9
793       ,p_element_information10_o
794       => pay_etp_shd.g_old_rec.element_information10
795       ,p_element_information11_o
796       => pay_etp_shd.g_old_rec.element_information11
797       ,p_element_information12_o
798       => pay_etp_shd.g_old_rec.element_information12
799       ,p_element_information13_o
800       => pay_etp_shd.g_old_rec.element_information13
801       ,p_element_information14_o
802       => pay_etp_shd.g_old_rec.element_information14
803       ,p_element_information15_o
804       => pay_etp_shd.g_old_rec.element_information15
805       ,p_element_information16_o
806       => pay_etp_shd.g_old_rec.element_information16
807       ,p_element_information17_o
808       => pay_etp_shd.g_old_rec.element_information17
809       ,p_element_information18_o
810       => pay_etp_shd.g_old_rec.element_information18
811       ,p_element_information19_o
812       => pay_etp_shd.g_old_rec.element_information19
813       ,p_element_information20_o
814       => pay_etp_shd.g_old_rec.element_information20
815       ,p_third_party_pay_only_flag_o
816       => pay_etp_shd.g_old_rec.third_party_pay_only_flag
817       ,p_object_version_number_o
818       => pay_etp_shd.g_old_rec.object_version_number
819       ,p_iterative_flag_o
820       => pay_etp_shd.g_old_rec.iterative_flag
821       ,p_iterative_formula_id_o
822       => pay_etp_shd.g_old_rec.iterative_formula_id
823       ,p_iterative_priority_o
824       => pay_etp_shd.g_old_rec.iterative_priority
825       ,p_creator_type_o
826       => pay_etp_shd.g_old_rec.creator_type
827       ,p_retro_summ_ele_id_o
828       => pay_etp_shd.g_old_rec.retro_summ_ele_id
829       ,p_grossup_flag_o
830       => pay_etp_shd.g_old_rec.grossup_flag
831       ,p_process_mode_o
832       => pay_etp_shd.g_old_rec.process_mode
833       ,p_advance_indicator_o
834       => pay_etp_shd.g_old_rec.advance_indicator
835       ,p_advance_payable_o
836       => pay_etp_shd.g_old_rec.advance_payable
837       ,p_advance_deduction_o
838       => pay_etp_shd.g_old_rec.advance_deduction
839       ,p_process_advance_entry_o
840       => pay_etp_shd.g_old_rec.process_advance_entry
841       ,p_proration_group_id_o
842       => pay_etp_shd.g_old_rec.proration_group_id
843       ,p_proration_formula_id_o
844       => pay_etp_shd.g_old_rec.proration_formula_id
845       ,p_recalc_event_group_id_o
846       => pay_etp_shd.g_old_rec.recalc_event_group_id
847       ,p_once_each_period_flag_o
848       => pay_etp_shd.g_old_rec.once_each_period_flag
849       ,p_time_definition_type_o
850       => pay_etp_shd.g_old_rec.time_definition_type
851       ,p_time_definition_id_o
852       => pay_etp_shd.g_old_rec.time_definition_id
853       ,p_advance_element_type_id_o
854       => pay_etp_shd.g_old_rec.advance_element_type_id
855       ,p_deduction_element_type_id_o
856       => pay_etp_shd.g_old_rec.deduction_element_type_id
857       );
858     --
859   exception
860     --
861     when hr_api.cannot_find_prog_unit then
862       --
863       hr_api.cannot_find_prog_unit_error
864         (p_module_name => 'PAY_ELEMENT_TYPES_F'
865         ,p_hook_type   => 'AU');
866       --
867   end;
868   --
869   hr_utility.set_location(' Leaving:'||l_proc, 10);
870 End post_update;
871 --
872 -- ----------------------------------------------------------------------------
873 -- |-----------------------------< convert_defs >-----------------------------|
874 -- ----------------------------------------------------------------------------
875 -- {Start Of Comments}
876 --
877 -- Description:
878 --   The Convert_Defs procedure has one very important function:
879 --   It must return the record structure for the row with all system defaulted
880 --   values converted into its corresponding parameter value for update. When
881 --   we attempt to update a row through the Upd process , certain
882 --   parameters can be defaulted which enables flexibility in the calling of
883 --   the upd process (e.g. only attributes which need to be updated need to be
884 --   specified). For the upd process to determine which attributes
885 --   have NOT been specified we need to check if the parameter has a reserved
886 --   system default value. Therefore, for all parameters which have a
887 --   corresponding reserved system default mechanism specified we need to
888 --   check if a system default is being used. If a system default is being
889 --   used then we convert the defaulted value into its corresponding attribute
890 --   value held in the g_old_rec data structure.
891 --
892 -- Prerequisites:
893 --   This private function can only be called from the upd process.
894 --
895 -- In Parameters:
896 --   A Pl/Sql record structure.
897 --
898 -- Post Success:
899 --   The record structure will be returned with all system defaulted parameter
900 --   values converted into its current row attribute value.
901 --
902 -- Post Failure:
903 --   No direct error handling is required within this function. Any possible
904 --   errors within this procedure will be a PL/SQL value error due to
905 --   conversion of datatypes or data lengths.
906 --
907 -- Developer Implementation Notes:
908 --   None.
909 --
910 -- Access Status:
911 --   Internal Row Handler Use Only.
912 --
913 -- {End Of Comments}
914 -- ----------------------------------------------------------------------------
915 Procedure convert_defs
916   (p_rec in out nocopy pay_etp_shd.g_rec_type
917   ) is
918 --
919 Begin
920   --
921   -- We must now examine each argument value in the
922   -- p_rec plsql record structure
923   -- to see if a system default is being used. If a system default
924   -- is being used then we must set to the 'current' argument value.
925   --
926   If (p_rec.business_group_id = hr_api.g_number) then
927     p_rec.business_group_id :=
928     pay_etp_shd.g_old_rec.business_group_id;
929   End If;
930   If (p_rec.legislation_code = hr_api.g_varchar2) then
931     p_rec.legislation_code :=
932     pay_etp_shd.g_old_rec.legislation_code;
933   End If;
934   If (p_rec.formula_id = hr_api.g_number) then
935     p_rec.formula_id :=
936     pay_etp_shd.g_old_rec.formula_id;
937   End If;
938   If (p_rec.input_currency_code = hr_api.g_varchar2) then
939     p_rec.input_currency_code :=
940     pay_etp_shd.g_old_rec.input_currency_code;
941   End If;
942   If (p_rec.output_currency_code = hr_api.g_varchar2) then
943     p_rec.output_currency_code :=
944     pay_etp_shd.g_old_rec.output_currency_code;
945   End If;
946   If (p_rec.classification_id = hr_api.g_number) then
947     p_rec.classification_id :=
948     pay_etp_shd.g_old_rec.classification_id;
949   End If;
950   If (p_rec.benefit_classification_id = hr_api.g_number) then
951     p_rec.benefit_classification_id :=
952     pay_etp_shd.g_old_rec.benefit_classification_id;
953   End If;
954   If (p_rec.additional_entry_allowed_flag = hr_api.g_varchar2) then
955     p_rec.additional_entry_allowed_flag :=
956     pay_etp_shd.g_old_rec.additional_entry_allowed_flag;
957   End If;
958   If (p_rec.adjustment_only_flag = hr_api.g_varchar2) then
959     p_rec.adjustment_only_flag :=
960     pay_etp_shd.g_old_rec.adjustment_only_flag;
961   End If;
962   If (p_rec.closed_for_entry_flag = hr_api.g_varchar2) then
963     p_rec.closed_for_entry_flag :=
964     pay_etp_shd.g_old_rec.closed_for_entry_flag;
965   End If;
966   If (p_rec.element_name = hr_api.g_varchar2) then
967     p_rec.element_name :=
968     pay_etp_shd.g_old_rec.element_name;
969   End If;
970   If (p_rec.indirect_only_flag = hr_api.g_varchar2) then
971     p_rec.indirect_only_flag :=
972     pay_etp_shd.g_old_rec.indirect_only_flag;
973   End If;
974   If (p_rec.multiple_entries_allowed_flag = hr_api.g_varchar2) then
975     p_rec.multiple_entries_allowed_flag :=
976     pay_etp_shd.g_old_rec.multiple_entries_allowed_flag;
977   End If;
978   If (p_rec.multiply_value_flag = hr_api.g_varchar2) then
979     p_rec.multiply_value_flag :=
980     pay_etp_shd.g_old_rec.multiply_value_flag;
981   End If;
982   If (p_rec.post_termination_rule = hr_api.g_varchar2) then
983     p_rec.post_termination_rule :=
984     pay_etp_shd.g_old_rec.post_termination_rule;
985   End If;
986   If (p_rec.process_in_run_flag = hr_api.g_varchar2) then
987     p_rec.process_in_run_flag :=
988     pay_etp_shd.g_old_rec.process_in_run_flag;
989   End If;
990   If (p_rec.processing_priority = hr_api.g_number) then
991     p_rec.processing_priority :=
992     pay_etp_shd.g_old_rec.processing_priority;
993   End If;
994   If (p_rec.processing_type = hr_api.g_varchar2) then
995     p_rec.processing_type :=
996     pay_etp_shd.g_old_rec.processing_type;
997   End If;
998   If (p_rec.standard_link_flag = hr_api.g_varchar2) then
999     p_rec.standard_link_flag :=
1000     pay_etp_shd.g_old_rec.standard_link_flag;
1001   End If;
1002   If (p_rec.comment_id = hr_api.g_number) then
1003     p_rec.comment_id :=
1004     pay_etp_shd.g_old_rec.comment_id;
1005   End If;
1006   If (p_rec.comments = hr_api.g_varchar2) then
1007     p_rec.comments :=
1008     pay_etp_shd.g_old_rec.comments;
1009   End If;
1010   If (p_rec.description = hr_api.g_varchar2) then
1011     p_rec.description :=
1012     pay_etp_shd.g_old_rec.description;
1013   End If;
1014   If (p_rec.legislation_subgroup = hr_api.g_varchar2) then
1015     p_rec.legislation_subgroup :=
1016     pay_etp_shd.g_old_rec.legislation_subgroup;
1017   End If;
1018   If (p_rec.qualifying_age = hr_api.g_number) then
1019     p_rec.qualifying_age :=
1020     pay_etp_shd.g_old_rec.qualifying_age;
1021   End If;
1022   If (p_rec.qualifying_length_of_service = hr_api.g_number) then
1023     p_rec.qualifying_length_of_service :=
1024     pay_etp_shd.g_old_rec.qualifying_length_of_service;
1025   End If;
1026   If (p_rec.qualifying_units = hr_api.g_varchar2) then
1027     p_rec.qualifying_units :=
1028     pay_etp_shd.g_old_rec.qualifying_units;
1029   End If;
1030   If (p_rec.reporting_name = hr_api.g_varchar2) then
1031     p_rec.reporting_name :=
1032     pay_etp_shd.g_old_rec.reporting_name;
1033   End If;
1034   If (p_rec.attribute_category = hr_api.g_varchar2) then
1035     p_rec.attribute_category :=
1036     pay_etp_shd.g_old_rec.attribute_category;
1037   End If;
1038   If (p_rec.attribute1 = hr_api.g_varchar2) then
1039     p_rec.attribute1 :=
1040     pay_etp_shd.g_old_rec.attribute1;
1041   End If;
1042   If (p_rec.attribute2 = hr_api.g_varchar2) then
1043     p_rec.attribute2 :=
1044     pay_etp_shd.g_old_rec.attribute2;
1045   End If;
1046   If (p_rec.attribute3 = hr_api.g_varchar2) then
1047     p_rec.attribute3 :=
1048     pay_etp_shd.g_old_rec.attribute3;
1049   End If;
1050   If (p_rec.attribute4 = hr_api.g_varchar2) then
1051     p_rec.attribute4 :=
1052     pay_etp_shd.g_old_rec.attribute4;
1053   End If;
1054   If (p_rec.attribute5 = hr_api.g_varchar2) then
1055     p_rec.attribute5 :=
1056     pay_etp_shd.g_old_rec.attribute5;
1057   End If;
1058   If (p_rec.attribute6 = hr_api.g_varchar2) then
1059     p_rec.attribute6 :=
1060     pay_etp_shd.g_old_rec.attribute6;
1061   End If;
1062   If (p_rec.attribute7 = hr_api.g_varchar2) then
1063     p_rec.attribute7 :=
1064     pay_etp_shd.g_old_rec.attribute7;
1065   End If;
1066   If (p_rec.attribute8 = hr_api.g_varchar2) then
1067     p_rec.attribute8 :=
1068     pay_etp_shd.g_old_rec.attribute8;
1069   End If;
1070   If (p_rec.attribute9 = hr_api.g_varchar2) then
1071     p_rec.attribute9 :=
1072     pay_etp_shd.g_old_rec.attribute9;
1073   End If;
1074   If (p_rec.attribute10 = hr_api.g_varchar2) then
1075     p_rec.attribute10 :=
1076     pay_etp_shd.g_old_rec.attribute10;
1077   End If;
1078   If (p_rec.attribute11 = hr_api.g_varchar2) then
1079     p_rec.attribute11 :=
1080     pay_etp_shd.g_old_rec.attribute11;
1081   End If;
1082   If (p_rec.attribute12 = hr_api.g_varchar2) then
1083     p_rec.attribute12 :=
1084     pay_etp_shd.g_old_rec.attribute12;
1085   End If;
1086   If (p_rec.attribute13 = hr_api.g_varchar2) then
1087     p_rec.attribute13 :=
1088     pay_etp_shd.g_old_rec.attribute13;
1089   End If;
1090   If (p_rec.attribute14 = hr_api.g_varchar2) then
1091     p_rec.attribute14 :=
1092     pay_etp_shd.g_old_rec.attribute14;
1093   End If;
1094   If (p_rec.attribute15 = hr_api.g_varchar2) then
1095     p_rec.attribute15 :=
1096     pay_etp_shd.g_old_rec.attribute15;
1097   End If;
1098   If (p_rec.attribute16 = hr_api.g_varchar2) then
1099     p_rec.attribute16 :=
1100     pay_etp_shd.g_old_rec.attribute16;
1101   End If;
1102   If (p_rec.attribute17 = hr_api.g_varchar2) then
1103     p_rec.attribute17 :=
1104     pay_etp_shd.g_old_rec.attribute17;
1105   End If;
1106   If (p_rec.attribute18 = hr_api.g_varchar2) then
1107     p_rec.attribute18 :=
1108     pay_etp_shd.g_old_rec.attribute18;
1109   End If;
1110   If (p_rec.attribute19 = hr_api.g_varchar2) then
1111     p_rec.attribute19 :=
1112     pay_etp_shd.g_old_rec.attribute19;
1113   End If;
1114   If (p_rec.attribute20 = hr_api.g_varchar2) then
1115     p_rec.attribute20 :=
1116     pay_etp_shd.g_old_rec.attribute20;
1117   End If;
1118   If (p_rec.element_information_category = hr_api.g_varchar2) then
1119     p_rec.element_information_category :=
1120     pay_etp_shd.g_old_rec.element_information_category;
1121   End If;
1122   If (p_rec.element_information1 = hr_api.g_varchar2) then
1123     p_rec.element_information1 :=
1124     pay_etp_shd.g_old_rec.element_information1;
1125   End If;
1126   If (p_rec.element_information2 = hr_api.g_varchar2) then
1127     p_rec.element_information2 :=
1128     pay_etp_shd.g_old_rec.element_information2;
1129   End If;
1130   If (p_rec.element_information3 = hr_api.g_varchar2) then
1131     p_rec.element_information3 :=
1132     pay_etp_shd.g_old_rec.element_information3;
1133   End If;
1134   If (p_rec.element_information4 = hr_api.g_varchar2) then
1135     p_rec.element_information4 :=
1136     pay_etp_shd.g_old_rec.element_information4;
1137   End If;
1138   If (p_rec.element_information5 = hr_api.g_varchar2) then
1139     p_rec.element_information5 :=
1140     pay_etp_shd.g_old_rec.element_information5;
1141   End If;
1142   If (p_rec.element_information6 = hr_api.g_varchar2) then
1143     p_rec.element_information6 :=
1144     pay_etp_shd.g_old_rec.element_information6;
1145   End If;
1146   If (p_rec.element_information7 = hr_api.g_varchar2) then
1147     p_rec.element_information7 :=
1148     pay_etp_shd.g_old_rec.element_information7;
1149   End If;
1150   If (p_rec.element_information8 = hr_api.g_varchar2) then
1151     p_rec.element_information8 :=
1152     pay_etp_shd.g_old_rec.element_information8;
1153   End If;
1154   If (p_rec.element_information9 = hr_api.g_varchar2) then
1155     p_rec.element_information9 :=
1156     pay_etp_shd.g_old_rec.element_information9;
1157   End If;
1158   If (p_rec.element_information10 = hr_api.g_varchar2) then
1159     p_rec.element_information10 :=
1160     pay_etp_shd.g_old_rec.element_information10;
1161   End If;
1162   If (p_rec.element_information11 = hr_api.g_varchar2) then
1163     p_rec.element_information11 :=
1164     pay_etp_shd.g_old_rec.element_information11;
1165   End If;
1166   If (p_rec.element_information12 = hr_api.g_varchar2) then
1167     p_rec.element_information12 :=
1168     pay_etp_shd.g_old_rec.element_information12;
1169   End If;
1170   If (p_rec.element_information13 = hr_api.g_varchar2) then
1171     p_rec.element_information13 :=
1172     pay_etp_shd.g_old_rec.element_information13;
1173   End If;
1174   If (p_rec.element_information14 = hr_api.g_varchar2) then
1175     p_rec.element_information14 :=
1176     pay_etp_shd.g_old_rec.element_information14;
1177   End If;
1178   If (p_rec.element_information15 = hr_api.g_varchar2) then
1179     p_rec.element_information15 :=
1180     pay_etp_shd.g_old_rec.element_information15;
1181   End If;
1182   If (p_rec.element_information16 = hr_api.g_varchar2) then
1183     p_rec.element_information16 :=
1184     pay_etp_shd.g_old_rec.element_information16;
1185   End If;
1186   If (p_rec.element_information17 = hr_api.g_varchar2) then
1187     p_rec.element_information17 :=
1188     pay_etp_shd.g_old_rec.element_information17;
1189   End If;
1190   If (p_rec.element_information18 = hr_api.g_varchar2) then
1191     p_rec.element_information18 :=
1192     pay_etp_shd.g_old_rec.element_information18;
1193   End If;
1194   If (p_rec.element_information19 = hr_api.g_varchar2) then
1195     p_rec.element_information19 :=
1196     pay_etp_shd.g_old_rec.element_information19;
1197   End If;
1198   If (p_rec.element_information20 = hr_api.g_varchar2) then
1199     p_rec.element_information20 :=
1200     pay_etp_shd.g_old_rec.element_information20;
1201   End If;
1202   If (p_rec.third_party_pay_only_flag = hr_api.g_varchar2) then
1203     p_rec.third_party_pay_only_flag :=
1204     pay_etp_shd.g_old_rec.third_party_pay_only_flag;
1205   End If;
1206   If (p_rec.iterative_flag = hr_api.g_varchar2) then
1207     p_rec.iterative_flag :=
1208     pay_etp_shd.g_old_rec.iterative_flag;
1209   End If;
1210   If (p_rec.iterative_formula_id = hr_api.g_number) then
1211     p_rec.iterative_formula_id :=
1212     pay_etp_shd.g_old_rec.iterative_formula_id;
1213   End If;
1214   If (p_rec.iterative_priority = hr_api.g_number) then
1215     p_rec.iterative_priority :=
1216     pay_etp_shd.g_old_rec.iterative_priority;
1217   End If;
1218   If (p_rec.creator_type = hr_api.g_varchar2) then
1219     p_rec.creator_type :=
1220     pay_etp_shd.g_old_rec.creator_type;
1221   End If;
1222   If (p_rec.retro_summ_ele_id = hr_api.g_number) then
1223     p_rec.retro_summ_ele_id :=
1224     pay_etp_shd.g_old_rec.retro_summ_ele_id;
1225   End If;
1226   If (p_rec.grossup_flag = hr_api.g_varchar2) then
1227     p_rec.grossup_flag :=
1228     pay_etp_shd.g_old_rec.grossup_flag;
1229   End If;
1230   If (p_rec.process_mode = hr_api.g_varchar2) then
1231     p_rec.process_mode :=
1232     pay_etp_shd.g_old_rec.process_mode;
1233   End If;
1234   If (p_rec.advance_indicator = hr_api.g_varchar2) then
1235     p_rec.advance_indicator :=
1236     pay_etp_shd.g_old_rec.advance_indicator;
1237   End If;
1238   If (p_rec.advance_payable = hr_api.g_varchar2) then
1239     p_rec.advance_payable :=
1240     pay_etp_shd.g_old_rec.advance_payable;
1241   End If;
1242   If (p_rec.advance_deduction = hr_api.g_varchar2) then
1243     p_rec.advance_deduction :=
1244     pay_etp_shd.g_old_rec.advance_deduction;
1245   End If;
1246   If (p_rec.process_advance_entry = hr_api.g_varchar2) then
1247     p_rec.process_advance_entry :=
1248     pay_etp_shd.g_old_rec.process_advance_entry;
1249   End If;
1250   If (p_rec.proration_group_id = hr_api.g_number) then
1251     p_rec.proration_group_id :=
1252     pay_etp_shd.g_old_rec.proration_group_id;
1253   End If;
1254   If (p_rec.proration_formula_id = hr_api.g_number) then
1255     p_rec.proration_formula_id :=
1256     pay_etp_shd.g_old_rec.proration_formula_id;
1257   End If;
1258   If (p_rec.recalc_event_group_id = hr_api.g_number) then
1259     p_rec.recalc_event_group_id :=
1260     pay_etp_shd.g_old_rec.recalc_event_group_id;
1261   End If;
1262   If (p_rec.once_each_period_flag = hr_api.g_varchar2) then
1263     p_rec.once_each_period_flag :=
1264     pay_etp_shd.g_old_rec.once_each_period_flag;
1265   End If;
1266   If (p_rec.time_definition_type = hr_api.g_varchar2) then
1267     p_rec.time_definition_type :=
1268     pay_etp_shd.g_old_rec.time_definition_type;
1269   End If;
1270   If (p_rec.time_definition_id = hr_api.g_number) then
1271     p_rec.time_definition_id :=
1272     pay_etp_shd.g_old_rec.time_definition_id;
1273   End If;
1274   If (p_rec.advance_element_type_id = hr_api.g_number) then
1275      p_rec.advance_element_type_id :=
1276      pay_etp_shd.g_old_rec.advance_element_type_id;
1277   End If;
1278   If (p_rec.deduction_element_type_id = hr_api.g_number) then
1279      p_rec.deduction_element_type_id :=
1280      pay_etp_shd.g_old_rec.deduction_element_type_id;
1281   End If;
1282   --
1283 End convert_defs;
1284 --
1285 -- ----------------------------------------------------------------------------
1286 -- |---------------------------------< upd >----------------------------------|
1287 -- ----------------------------------------------------------------------------
1288 Procedure upd
1289   (p_effective_date 		   in     date
1290   ,p_datetrack_mode 		   in     varchar2
1291   ,p_rec                           in out nocopy pay_etp_shd.g_rec_type
1292   ,p_processing_priority_warning      out nocopy boolean
1293   ) is
1294 --
1295   l_proc                        varchar2(72) := g_package||'upd';
1296   l_validation_start_date       date;
1297   l_validation_end_date         date;
1298   l_processing_priority_warning boolean;
1299 --
1300 Begin
1301   hr_utility.set_location('Entering:'||l_proc, 5);
1302 
1303   --
1304   -- Ensure that the DateTrack update mode is valid
1305   --
1306   dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
1307   --
1308   -- We must lock the row which we need to update.
1309   --
1310   pay_etp_shd.lck
1311     (p_effective_date                   => p_effective_date
1312     ,p_datetrack_mode                   => p_datetrack_mode
1313     ,p_element_type_id                  => p_rec.element_type_id
1314     ,p_object_version_number            => p_rec.object_version_number
1315     ,p_validation_start_date            => l_validation_start_date
1316     ,p_validation_end_date              => l_validation_end_date
1317     );
1318   --
1319   -- 1. During an update system defaults are used to determine if
1320   --    arguments have been defaulted or not. We must therefore
1321   --    derive the full record structure values to be updated.
1322   --
1323   -- 2. Call the supporting update validate operations.
1324   --
1325   pay_etp_upd.convert_defs(p_rec);
1326   --
1327   pay_etp_bus.update_validate
1328     (p_rec                              => p_rec
1329     ,p_effective_date                   => p_effective_date
1330     ,p_datetrack_mode                   => p_datetrack_mode
1331     ,p_validation_start_date            => l_validation_start_date
1332     ,p_validation_end_date              => l_validation_end_date
1333     ,p_processing_priority_warning      => l_processing_priority_warning
1334     );
1335   --
1336   p_processing_priority_warning := l_processing_priority_warning;
1337   --
1338   --
1339   -- Call to raise any errors on multi-message list
1340   hr_multi_message.end_validation_set;
1341   --
1342   -- Call the supporting pre-update operation
1343   --
1344   pre_update
1345     (p_rec                              => p_rec
1346     ,p_effective_date                   => p_effective_date
1347     ,p_datetrack_mode                   => p_datetrack_mode
1348     ,p_validation_start_date            => l_validation_start_date
1349     ,p_validation_end_date              => l_validation_end_date
1350     );
1351   --
1352   -- Update the row.
1353   --
1354   update_dml
1355     (p_rec                              => p_rec
1356     ,p_effective_date                   => p_effective_date
1357     ,p_datetrack_mode                   => p_datetrack_mode
1358     ,p_validation_start_date            => l_validation_start_date
1359     ,p_validation_end_date                  => l_validation_end_date
1360     );
1361   --
1362   -- Call the supporting post-update operation
1363   --
1364   post_update
1365     (p_rec                              => p_rec
1366     ,p_effective_date                   => p_effective_date
1367     ,p_datetrack_mode                   => p_datetrack_mode
1368     ,p_validation_start_date            => l_validation_start_date
1369     ,p_validation_end_date              => l_validation_end_date
1370     );
1371   --
1372   -- Call to raise any errors on multi-message list
1373   hr_multi_message.end_validation_set;
1374 End upd;
1375 --
1376 -- ----------------------------------------------------------------------------
1377 -- |------------------------------< upd >-------------------------------------|
1378 -- ----------------------------------------------------------------------------
1379 Procedure upd
1380   (p_effective_date               in     date
1381   ,p_datetrack_mode               in     varchar2
1382   ,p_element_type_id              in     number
1383   ,p_object_version_number        in out nocopy number
1384   ,p_classification_id            in     number    default hr_api.g_number
1385   ,p_additional_entry_allowed_fla in     varchar2  default hr_api.g_varchar2
1386   ,p_adjustment_only_flag         in     varchar2  default hr_api.g_varchar2
1387   ,p_closed_for_entry_flag        in     varchar2  default hr_api.g_varchar2
1388   ,p_element_name                 in     varchar2  default hr_api.g_varchar2
1389   ,p_indirect_only_flag           in     varchar2  default hr_api.g_varchar2
1390   ,p_multiple_entries_allowed_fla in     varchar2  default hr_api.g_varchar2
1391   ,p_multiply_value_flag          in     varchar2  default hr_api.g_varchar2
1392   ,p_post_termination_rule        in     varchar2  default hr_api.g_varchar2
1393   ,p_process_in_run_flag          in     varchar2  default hr_api.g_varchar2
1394   ,p_processing_priority          in     number    default hr_api.g_number
1395   ,p_processing_type              in     varchar2  default hr_api.g_varchar2
1396   ,p_standard_link_flag           in     varchar2  default hr_api.g_varchar2
1397   ,p_business_group_id            in     number    default hr_api.g_number
1398   ,p_legislation_code             in     varchar2  default hr_api.g_varchar2
1399   ,p_formula_id                   in     number    default hr_api.g_number
1400   ,p_input_currency_code          in     varchar2  default hr_api.g_varchar2
1401   ,p_output_currency_code         in     varchar2  default hr_api.g_varchar2
1402   ,p_benefit_classification_id    in     number    default hr_api.g_number
1403   ,p_comments                     in     varchar2  default hr_api.g_varchar2
1404   ,p_description                  in     varchar2  default hr_api.g_varchar2
1405   ,p_legislation_subgroup         in     varchar2  default hr_api.g_varchar2
1406   ,p_qualifying_age               in     number    default hr_api.g_number
1407   ,p_qualifying_length_of_service in     number    default hr_api.g_number
1408   ,p_qualifying_units             in     varchar2  default hr_api.g_varchar2
1409   ,p_reporting_name               in     varchar2  default hr_api.g_varchar2
1410   ,p_attribute_category           in     varchar2  default hr_api.g_varchar2
1411   ,p_attribute1                   in     varchar2  default hr_api.g_varchar2
1412   ,p_attribute2                   in     varchar2  default hr_api.g_varchar2
1413   ,p_attribute3                   in     varchar2  default hr_api.g_varchar2
1414   ,p_attribute4                   in     varchar2  default hr_api.g_varchar2
1415   ,p_attribute5                   in     varchar2  default hr_api.g_varchar2
1416   ,p_attribute6                   in     varchar2  default hr_api.g_varchar2
1417   ,p_attribute7                   in     varchar2  default hr_api.g_varchar2
1418   ,p_attribute8                   in     varchar2  default hr_api.g_varchar2
1419   ,p_attribute9                   in     varchar2  default hr_api.g_varchar2
1420   ,p_attribute10                  in     varchar2  default hr_api.g_varchar2
1421   ,p_attribute11                  in     varchar2  default hr_api.g_varchar2
1422   ,p_attribute12                  in     varchar2  default hr_api.g_varchar2
1423   ,p_attribute13                  in     varchar2  default hr_api.g_varchar2
1424   ,p_attribute14                  in     varchar2  default hr_api.g_varchar2
1425   ,p_attribute15                  in     varchar2  default hr_api.g_varchar2
1426   ,p_attribute16                  in     varchar2  default hr_api.g_varchar2
1427   ,p_attribute17                  in     varchar2  default hr_api.g_varchar2
1428   ,p_attribute18                  in     varchar2  default hr_api.g_varchar2
1429   ,p_attribute19                  in     varchar2  default hr_api.g_varchar2
1430   ,p_attribute20                  in     varchar2  default hr_api.g_varchar2
1431   ,p_element_information_category in     varchar2  default hr_api.g_varchar2
1432   ,p_element_information1         in     varchar2  default hr_api.g_varchar2
1433   ,p_element_information2         in     varchar2  default hr_api.g_varchar2
1434   ,p_element_information3         in     varchar2  default hr_api.g_varchar2
1435   ,p_element_information4         in     varchar2  default hr_api.g_varchar2
1436   ,p_element_information5         in     varchar2  default hr_api.g_varchar2
1437   ,p_element_information6         in     varchar2  default hr_api.g_varchar2
1438   ,p_element_information7         in     varchar2  default hr_api.g_varchar2
1439   ,p_element_information8         in     varchar2  default hr_api.g_varchar2
1440   ,p_element_information9         in     varchar2  default hr_api.g_varchar2
1441   ,p_element_information10        in     varchar2  default hr_api.g_varchar2
1442   ,p_element_information11        in     varchar2  default hr_api.g_varchar2
1443   ,p_element_information12        in     varchar2  default hr_api.g_varchar2
1444   ,p_element_information13        in     varchar2  default hr_api.g_varchar2
1445   ,p_element_information14        in     varchar2  default hr_api.g_varchar2
1446   ,p_element_information15        in     varchar2  default hr_api.g_varchar2
1447   ,p_element_information16        in     varchar2  default hr_api.g_varchar2
1448   ,p_element_information17        in     varchar2  default hr_api.g_varchar2
1449   ,p_element_information18        in     varchar2  default hr_api.g_varchar2
1450   ,p_element_information19        in     varchar2  default hr_api.g_varchar2
1451   ,p_element_information20        in     varchar2  default hr_api.g_varchar2
1452   ,p_third_party_pay_only_flag    in     varchar2  default hr_api.g_varchar2
1453   ,p_iterative_flag               in     varchar2  default hr_api.g_varchar2
1454   ,p_iterative_formula_id         in     number    default hr_api.g_number
1455   ,p_iterative_priority           in     number    default hr_api.g_number
1456   ,p_creator_type                 in     varchar2  default hr_api.g_varchar2
1457   ,p_retro_summ_ele_id            in     number    default hr_api.g_number
1458   ,p_grossup_flag                 in     varchar2  default hr_api.g_varchar2
1459   ,p_process_mode                 in     varchar2  default hr_api.g_varchar2
1460   ,p_advance_indicator            in     varchar2  default hr_api.g_varchar2
1461   ,p_advance_payable              in     varchar2  default hr_api.g_varchar2
1462   ,p_advance_deduction            in     varchar2  default hr_api.g_varchar2
1463   ,p_process_advance_entry        in     varchar2  default hr_api.g_varchar2
1464   ,p_proration_group_id           in     number    default hr_api.g_number
1465   ,p_proration_formula_id         in     number    default hr_api.g_number
1466   ,p_recalc_event_group_id        in     number    default hr_api.g_number
1467   ,p_once_each_period_flag        in     varchar2  default hr_api.g_varchar2
1468   ,p_time_definition_type	  in     varchar2  default hr_api.g_varchar2
1469   ,p_time_definition_id	          in     number    default hr_api.g_number
1470   ,p_advance_element_type_id	  in     number    default hr_api.g_number
1471   ,p_deduction_element_type_id	  in     number    default hr_api.g_number
1472   ,p_effective_start_date            out nocopy date
1473   ,p_effective_end_date              out nocopy date
1474   ,p_comment_id                      out nocopy number
1475   ,p_processing_priority_warning     out nocopy boolean
1476   ) is
1477 --
1478   l_rec         				pay_etp_shd.g_rec_type;
1479   l_proc        				varchar2(72) := g_package||'upd';
1480   l_processing_priority_warning boolean;
1481 --
1482 Begin
1483   hr_utility.set_location('Entering:'||l_proc, 5);
1484   --
1485   -- Call conversion function to turn arguments into the
1486   -- l_rec structure.
1487   --
1488   l_rec :=
1489   pay_etp_shd.convert_args
1490     (p_element_type_id
1491     ,null
1492     ,null
1493     ,p_business_group_id
1494     ,p_legislation_code
1495     ,p_formula_id
1496     ,p_input_currency_code
1497     ,p_output_currency_code
1498     ,p_classification_id
1499     ,p_benefit_classification_id
1500     ,p_additional_entry_allowed_fla
1501     ,p_adjustment_only_flag
1502     ,p_closed_for_entry_flag
1503     ,p_element_name
1504     ,p_indirect_only_flag
1505     ,p_multiple_entries_allowed_fla
1506     ,p_multiply_value_flag
1507     ,p_post_termination_rule
1508     ,p_process_in_run_flag
1509     ,p_processing_priority
1510     ,p_processing_type
1511     ,p_standard_link_flag
1512     ,hr_api.g_number
1513     ,p_comments
1514     ,p_description
1515     ,p_legislation_subgroup
1516     ,p_qualifying_age
1517     ,p_qualifying_length_of_service
1518     ,p_qualifying_units
1519     ,p_reporting_name
1520     ,p_attribute_category
1521     ,p_attribute1
1522     ,p_attribute2
1523     ,p_attribute3
1524     ,p_attribute4
1525     ,p_attribute5
1526     ,p_attribute6
1527     ,p_attribute7
1528     ,p_attribute8
1529     ,p_attribute9
1530     ,p_attribute10
1531     ,p_attribute11
1532     ,p_attribute12
1533     ,p_attribute13
1534     ,p_attribute14
1535     ,p_attribute15
1536     ,p_attribute16
1537     ,p_attribute17
1538     ,p_attribute18
1539     ,p_attribute19
1540     ,p_attribute20
1541     ,p_element_information_category
1542     ,p_element_information1
1543     ,p_element_information2
1544     ,p_element_information3
1545     ,p_element_information4
1546     ,p_element_information5
1547     ,p_element_information6
1548     ,p_element_information7
1549     ,p_element_information8
1550     ,p_element_information9
1551     ,p_element_information10
1552     ,p_element_information11
1553     ,p_element_information12
1554     ,p_element_information13
1555     ,p_element_information14
1556     ,p_element_information15
1557     ,p_element_information16
1558     ,p_element_information17
1559     ,p_element_information18
1560     ,p_element_information19
1561     ,p_element_information20
1562     ,p_third_party_pay_only_flag
1563     ,p_object_version_number
1564     ,p_iterative_flag
1565     ,p_iterative_formula_id
1566     ,p_iterative_priority
1567     ,p_creator_type
1568     ,p_retro_summ_ele_id
1569     ,p_grossup_flag
1570     ,p_process_mode
1571     ,p_advance_indicator
1572     ,p_advance_payable
1573     ,p_advance_deduction
1574     ,p_process_advance_entry
1575     ,p_proration_group_id
1576     ,p_proration_formula_id
1577     ,p_recalc_event_group_id
1578     ,p_once_each_period_flag
1579     ,p_time_definition_type
1580     ,p_time_definition_id
1581     ,p_advance_element_type_id
1582     ,p_deduction_element_type_id
1583     );
1584   --
1585   -- Having converted the arguments into the
1586   -- plsql record structure we call the corresponding record
1587   -- business process.
1588   --
1589   pay_etp_upd.upd
1590     (p_effective_date
1591     ,p_datetrack_mode
1592     ,l_rec
1593     ,l_processing_priority_warning
1594     );
1595   --
1596   -- Set the out parameters
1597   --
1598   p_object_version_number            := l_rec.object_version_number;
1599   p_effective_start_date             := l_rec.effective_start_date;
1600   p_effective_end_date               := l_rec.effective_end_date;
1601   p_comment_id                       := l_rec.comment_id;
1602   p_processing_priority_warning		 := l_processing_priority_warning;
1603   --
1604   hr_utility.set_location(' Leaving:'||l_proc, 10);
1605 End upd;
1606 --
1607 end pay_etp_upd;