DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_ETP_UPD_ND

Source


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