DBA Data[Home] [Help]

PACKAGE BODY: APPS.AME_APT_UPD

Source


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