DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PER_CM_USG_API

Source


1 Package Body ben_PER_CM_USG_api as
2 /* $Header: bepcuapi.pkb 120.0 2005/05/28 10:19:14 appldev noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  ben_PER_CM_USG_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_PER_CM_USG >-----------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_PER_CM_USG
13   (p_validate                       in  boolean   default false
14   ,p_per_cm_usg_id                  out nocopy number
15   ,p_effective_start_date           out nocopy date
16   ,p_effective_end_date             out nocopy date
17   ,p_per_cm_id                      in  number    default null
18   ,p_cm_typ_usg_id                  in  number    default null
19   ,p_business_group_id              in  number    default null
20   ,p_pcu_attribute_category         in  varchar2  default null
21   ,p_pcu_attribute1                 in  varchar2  default null
22   ,p_pcu_attribute2                 in  varchar2  default null
23   ,p_pcu_attribute3                 in  varchar2  default null
24   ,p_pcu_attribute4                 in  varchar2  default null
25   ,p_pcu_attribute5                 in  varchar2  default null
26   ,p_pcu_attribute6                 in  varchar2  default null
27   ,p_pcu_attribute7                 in  varchar2  default null
28   ,p_pcu_attribute8                 in  varchar2  default null
29   ,p_pcu_attribute9                 in  varchar2  default null
30   ,p_pcu_attribute10                in  varchar2  default null
31   ,p_pcu_attribute11                in  varchar2  default null
32   ,p_pcu_attribute12                in  varchar2  default null
33   ,p_pcu_attribute13                in  varchar2  default null
34   ,p_pcu_attribute14                in  varchar2  default null
35   ,p_pcu_attribute15                in  varchar2  default null
36   ,p_pcu_attribute16                in  varchar2  default null
37   ,p_pcu_attribute17                in  varchar2  default null
38   ,p_pcu_attribute18                in  varchar2  default null
39   ,p_pcu_attribute19                in  varchar2  default null
40   ,p_pcu_attribute20                in  varchar2  default null
41   ,p_pcu_attribute21                in  varchar2  default null
42   ,p_pcu_attribute22                in  varchar2  default null
43   ,p_pcu_attribute23                in  varchar2  default null
44   ,p_pcu_attribute24                in  varchar2  default null
45   ,p_pcu_attribute25                in  varchar2  default null
46   ,p_pcu_attribute26                in  varchar2  default null
47   ,p_pcu_attribute27                in  varchar2  default null
48   ,p_pcu_attribute28                in  varchar2  default null
49   ,p_pcu_attribute29                in  varchar2  default null
50   ,p_pcu_attribute30                in  varchar2  default null
51   ,p_request_id                     in  number    default null
52   ,p_program_application_id         in  number    default null
53   ,p_program_id                     in  number    default null
54   ,p_program_update_date            in  date      default null
55   ,p_object_version_number          out nocopy number
56   ,p_effective_date                 in  date) is
57   --
58   -- Declare cursors and local variables
59   --
60   l_per_cm_usg_id ben_per_cm_usg_f.per_cm_usg_id%TYPE;
61   l_effective_start_date ben_per_cm_usg_f.effective_start_date%TYPE;
62   l_effective_end_date ben_per_cm_usg_f.effective_end_date%TYPE;
63   l_proc varchar2(72) := g_package||'create_PER_CM_USG';
64   l_object_version_number ben_per_cm_usg_f.object_version_number%TYPE;
65   --
66 begin
67   --
68   hr_utility.set_location('Entering:'|| l_proc, 10);
69   --
70   -- Issue a savepoint if operating in validation only mode
71   --
72   savepoint create_PER_CM_USG;
73   --
74   hr_utility.set_location(l_proc, 20);
75   --
76   -- Process Logic
77   --
78   begin
79     --
80     -- Start of API User Hook for the before hook of create_PER_CM_USG
81     --
82     ben_PER_CM_USG_bk1.create_PER_CM_USG_b
83       (p_per_cm_id                      =>  p_per_cm_id
84       ,p_cm_typ_usg_id                  =>  p_cm_typ_usg_id
85       ,p_business_group_id              =>  p_business_group_id
86       ,p_pcu_attribute_category         =>  p_pcu_attribute_category
87       ,p_pcu_attribute1                 =>  p_pcu_attribute1
88       ,p_pcu_attribute2                 =>  p_pcu_attribute2
89       ,p_pcu_attribute3                 =>  p_pcu_attribute3
90       ,p_pcu_attribute4                 =>  p_pcu_attribute4
91       ,p_pcu_attribute5                 =>  p_pcu_attribute5
92       ,p_pcu_attribute6                 =>  p_pcu_attribute6
93       ,p_pcu_attribute7                 =>  p_pcu_attribute7
94       ,p_pcu_attribute8                 =>  p_pcu_attribute8
95       ,p_pcu_attribute9                 =>  p_pcu_attribute9
96       ,p_pcu_attribute10                =>  p_pcu_attribute10
97       ,p_pcu_attribute11                =>  p_pcu_attribute11
98       ,p_pcu_attribute12                =>  p_pcu_attribute12
99       ,p_pcu_attribute13                =>  p_pcu_attribute13
100       ,p_pcu_attribute14                =>  p_pcu_attribute14
101       ,p_pcu_attribute15                =>  p_pcu_attribute15
102       ,p_pcu_attribute16                =>  p_pcu_attribute16
103       ,p_pcu_attribute17                =>  p_pcu_attribute17
104       ,p_pcu_attribute18                =>  p_pcu_attribute18
105       ,p_pcu_attribute19                =>  p_pcu_attribute19
106       ,p_pcu_attribute20                =>  p_pcu_attribute20
107       ,p_pcu_attribute21                =>  p_pcu_attribute21
108       ,p_pcu_attribute22                =>  p_pcu_attribute22
109       ,p_pcu_attribute23                =>  p_pcu_attribute23
110       ,p_pcu_attribute24                =>  p_pcu_attribute24
111       ,p_pcu_attribute25                =>  p_pcu_attribute25
112       ,p_pcu_attribute26                =>  p_pcu_attribute26
113       ,p_pcu_attribute27                =>  p_pcu_attribute27
114       ,p_pcu_attribute28                =>  p_pcu_attribute28
115       ,p_pcu_attribute29                =>  p_pcu_attribute29
116       ,p_pcu_attribute30                =>  p_pcu_attribute30
117       ,p_request_id                     =>  p_request_id
118       ,p_program_application_id         =>  p_program_application_id
119       ,p_program_id                     =>  p_program_id
120       ,p_program_update_date            =>  p_program_update_date
121       ,p_effective_date                 => trunc(p_effective_date));
122     --
123   exception
124     --
125     when hr_api.cannot_find_prog_unit then
126       --
127       hr_api.cannot_find_prog_unit_error
128         (p_module_name => 'CREATE_PER_CM_USG'
129         ,p_hook_type   => 'BP');
130     --
131     -- End of API User Hook for the before hook of create_PER_CM_USG
132     --
133   end;
134   --
135   ben_pcu_ins.ins
136     (p_per_cm_usg_id                 => l_per_cm_usg_id
137     ,p_effective_start_date          => l_effective_start_date
138     ,p_effective_end_date            => l_effective_end_date
139     ,p_per_cm_id                     => p_per_cm_id
140     ,p_cm_typ_usg_id                 => p_cm_typ_usg_id
141     ,p_business_group_id             => p_business_group_id
142     ,p_pcu_attribute_category        => p_pcu_attribute_category
143     ,p_pcu_attribute1                => p_pcu_attribute1
144     ,p_pcu_attribute2                => p_pcu_attribute2
145     ,p_pcu_attribute3                => p_pcu_attribute3
146     ,p_pcu_attribute4                => p_pcu_attribute4
147     ,p_pcu_attribute5                => p_pcu_attribute5
148     ,p_pcu_attribute6                => p_pcu_attribute6
149     ,p_pcu_attribute7                => p_pcu_attribute7
150     ,p_pcu_attribute8                => p_pcu_attribute8
151     ,p_pcu_attribute9                => p_pcu_attribute9
152     ,p_pcu_attribute10               => p_pcu_attribute10
153     ,p_pcu_attribute11               => p_pcu_attribute11
154     ,p_pcu_attribute12               => p_pcu_attribute12
155     ,p_pcu_attribute13               => p_pcu_attribute13
156     ,p_pcu_attribute14               => p_pcu_attribute14
157     ,p_pcu_attribute15               => p_pcu_attribute15
158     ,p_pcu_attribute16               => p_pcu_attribute16
159     ,p_pcu_attribute17               => p_pcu_attribute17
160     ,p_pcu_attribute18               => p_pcu_attribute18
161     ,p_pcu_attribute19               => p_pcu_attribute19
162     ,p_pcu_attribute20               => p_pcu_attribute20
163     ,p_pcu_attribute21               => p_pcu_attribute21
164     ,p_pcu_attribute22               => p_pcu_attribute22
165     ,p_pcu_attribute23               => p_pcu_attribute23
166     ,p_pcu_attribute24               => p_pcu_attribute24
167     ,p_pcu_attribute25               => p_pcu_attribute25
168     ,p_pcu_attribute26               => p_pcu_attribute26
169     ,p_pcu_attribute27               => p_pcu_attribute27
170     ,p_pcu_attribute28               => p_pcu_attribute28
171     ,p_pcu_attribute29               => p_pcu_attribute29
172     ,p_pcu_attribute30               => p_pcu_attribute30
173     ,p_request_id                    => p_request_id
174     ,p_program_application_id        => p_program_application_id
175     ,p_program_id                    => p_program_id
176     ,p_program_update_date           => p_program_update_date
177     ,p_object_version_number         => l_object_version_number
178     ,p_effective_date                => trunc(p_effective_date));
179   --
180   begin
181     --
182     -- Start of API User Hook for the after hook of create_PER_CM_USG
183     --
184     ben_PER_CM_USG_bk1.create_PER_CM_USG_a
185       (p_per_cm_usg_id                  =>  l_per_cm_usg_id
186       ,p_effective_start_date           =>  l_effective_start_date
187       ,p_effective_end_date             =>  l_effective_end_date
188       ,p_per_cm_id                      =>  p_per_cm_id
189       ,p_cm_typ_usg_id                  =>  p_cm_typ_usg_id
190       ,p_business_group_id              =>  p_business_group_id
191       ,p_pcu_attribute_category         =>  p_pcu_attribute_category
192       ,p_pcu_attribute1                 =>  p_pcu_attribute1
193       ,p_pcu_attribute2                 =>  p_pcu_attribute2
194       ,p_pcu_attribute3                 =>  p_pcu_attribute3
195       ,p_pcu_attribute4                 =>  p_pcu_attribute4
196       ,p_pcu_attribute5                 =>  p_pcu_attribute5
197       ,p_pcu_attribute6                 =>  p_pcu_attribute6
198       ,p_pcu_attribute7                 =>  p_pcu_attribute7
199       ,p_pcu_attribute8                 =>  p_pcu_attribute8
200       ,p_pcu_attribute9                 =>  p_pcu_attribute9
201       ,p_pcu_attribute10                =>  p_pcu_attribute10
202       ,p_pcu_attribute11                =>  p_pcu_attribute11
203       ,p_pcu_attribute12                =>  p_pcu_attribute12
204       ,p_pcu_attribute13                =>  p_pcu_attribute13
205       ,p_pcu_attribute14                =>  p_pcu_attribute14
206       ,p_pcu_attribute15                =>  p_pcu_attribute15
207       ,p_pcu_attribute16                =>  p_pcu_attribute16
208       ,p_pcu_attribute17                =>  p_pcu_attribute17
209       ,p_pcu_attribute18                =>  p_pcu_attribute18
210       ,p_pcu_attribute19                =>  p_pcu_attribute19
211       ,p_pcu_attribute20                =>  p_pcu_attribute20
212       ,p_pcu_attribute21                =>  p_pcu_attribute21
213       ,p_pcu_attribute22                =>  p_pcu_attribute22
214       ,p_pcu_attribute23                =>  p_pcu_attribute23
215       ,p_pcu_attribute24                =>  p_pcu_attribute24
216       ,p_pcu_attribute25                =>  p_pcu_attribute25
217       ,p_pcu_attribute26                =>  p_pcu_attribute26
218       ,p_pcu_attribute27                =>  p_pcu_attribute27
219       ,p_pcu_attribute28                =>  p_pcu_attribute28
220       ,p_pcu_attribute29                =>  p_pcu_attribute29
221       ,p_pcu_attribute30                =>  p_pcu_attribute30
222       ,p_request_id                     =>  p_request_id
223       ,p_program_application_id         =>  p_program_application_id
224       ,p_program_id                     =>  p_program_id
225       ,p_program_update_date            =>  p_program_update_date
226       ,p_object_version_number          =>  l_object_version_number
227       ,p_effective_date                 =>  trunc(p_effective_date));
228     --
229   exception
230     --
231     when hr_api.cannot_find_prog_unit then
232       --
233       hr_api.cannot_find_prog_unit_error
234         (p_module_name => 'CREATE_PER_CM_USG'
235         ,p_hook_type   => 'AP');
236     --
237     -- End of API User Hook for the after hook of create_PER_CM_USG
238     --
239   end;
240   --
241   hr_utility.set_location(l_proc, 60);
242   --
243   -- When in validation only mode raise the Validate_Enabled exception
244   --
245   if p_validate then
246     raise hr_api.validate_enabled;
247   end if;
248   --
249   -- Set all output arguments
250   --
251   p_per_cm_usg_id := l_per_cm_usg_id;
252   p_effective_start_date := l_effective_start_date;
253   p_effective_end_date := l_effective_end_date;
254   p_object_version_number := l_object_version_number;
255   --
256   hr_utility.set_location(' Leaving:'||l_proc, 70);
257   --
258 exception
259   --
260   when hr_api.validate_enabled then
261     --
262     -- As the Validate_Enabled exception has been raised
263     -- we must rollback to the savepoint
264     --
265     ROLLBACK TO create_PER_CM_USG;
266     --
267     -- Only set output warning arguments
268     -- (Any key or derived arguments must be set to null
269     -- when validation only mode is being used.)
270     --
271     p_per_cm_usg_id := null;
272     p_effective_start_date := null;
273     p_effective_end_date := null;
274     p_object_version_number  := null;
275     hr_utility.set_location(' Leaving:'||l_proc, 80);
276     --
277   when others then
278     --
279     -- A validation or unexpected error has occured
280     --
281     ROLLBACK TO create_PER_CM_USG;
282     --
283     p_per_cm_usg_id := null;
284     p_effective_start_date := null;
285     p_effective_end_date := null;
286     p_object_version_number  := null;
287     hr_utility.set_location(' Leaving:'||l_proc, 80);
288     --
289     raise;
290     --
291 end create_PER_CM_USG;
292 -- ----------------------------------------------------------------------------
293 -- |------------------------< create_PER_CM_USG_perf >------------------------|
294 -- ----------------------------------------------------------------------------
295 --
296 procedure create_PER_CM_USG_perf
297   (p_validate                       in  boolean   default false
298   ,p_per_cm_usg_id                  out nocopy number
299   ,p_effective_start_date           out nocopy date
300   ,p_effective_end_date             out nocopy date
301   ,p_per_cm_id                      in  number    default null
302   ,p_cm_typ_usg_id                  in  number    default null
303   ,p_business_group_id              in  number    default null
304   ,p_pcu_attribute_category         in  varchar2  default null
305   ,p_pcu_attribute1                 in  varchar2  default null
306   ,p_pcu_attribute2                 in  varchar2  default null
307   ,p_pcu_attribute3                 in  varchar2  default null
308   ,p_pcu_attribute4                 in  varchar2  default null
309   ,p_pcu_attribute5                 in  varchar2  default null
310   ,p_pcu_attribute6                 in  varchar2  default null
311   ,p_pcu_attribute7                 in  varchar2  default null
312   ,p_pcu_attribute8                 in  varchar2  default null
313   ,p_pcu_attribute9                 in  varchar2  default null
314   ,p_pcu_attribute10                in  varchar2  default null
315   ,p_pcu_attribute11                in  varchar2  default null
316   ,p_pcu_attribute12                in  varchar2  default null
317   ,p_pcu_attribute13                in  varchar2  default null
318   ,p_pcu_attribute14                in  varchar2  default null
319   ,p_pcu_attribute15                in  varchar2  default null
320   ,p_pcu_attribute16                in  varchar2  default null
321   ,p_pcu_attribute17                in  varchar2  default null
322   ,p_pcu_attribute18                in  varchar2  default null
323   ,p_pcu_attribute19                in  varchar2  default null
324   ,p_pcu_attribute20                in  varchar2  default null
325   ,p_pcu_attribute21                in  varchar2  default null
326   ,p_pcu_attribute22                in  varchar2  default null
327   ,p_pcu_attribute23                in  varchar2  default null
328   ,p_pcu_attribute24                in  varchar2  default null
329   ,p_pcu_attribute25                in  varchar2  default null
330   ,p_pcu_attribute26                in  varchar2  default null
331   ,p_pcu_attribute27                in  varchar2  default null
332   ,p_pcu_attribute28                in  varchar2  default null
333   ,p_pcu_attribute29                in  varchar2  default null
334   ,p_pcu_attribute30                in  varchar2  default null
335   ,p_request_id                     in  number    default null
336   ,p_program_application_id         in  number    default null
337   ,p_program_id                     in  number    default null
338   ,p_program_update_date            in  date      default null
339   ,p_object_version_number          out nocopy number
340   ,p_effective_date                 in  date) is
341   --
342   -- Declare cursors and local variables
343   --
344   l_per_cm_usg_id ben_per_cm_usg_f.per_cm_usg_id%TYPE;
345   l_effective_start_date ben_per_cm_usg_f.effective_start_date%TYPE;
346   l_effective_end_date ben_per_cm_usg_f.effective_end_date%TYPE;
347   l_proc varchar2(72) := g_package||'create_PER_CM_USG';
348   l_object_version_number ben_per_cm_usg_f.object_version_number%TYPE;
349   --
350   cursor c_seq is
351     select ben_per_cm_usg_f_s.nextval
352     from   sys.dual;
353   --
354   l_validation_start_date date;
355   l_validation_end_date date;
356   --
357 begin
358   --
359   -- Issue a savepoint if operating in validation only mode
360   --
361   savepoint create_PER_CM_USG;
362   --
363   -- Process Logic
364   --
365   begin
366     --
367     -- Start of API User Hook for the before hook of create_PER_CM_USG
368     --
369     ben_PER_CM_USG_bk1.create_PER_CM_USG_b
370       (p_per_cm_id                      =>  p_per_cm_id
371       ,p_cm_typ_usg_id                  =>  p_cm_typ_usg_id
372       ,p_business_group_id              =>  p_business_group_id
373       ,p_pcu_attribute_category         =>  p_pcu_attribute_category
374       ,p_pcu_attribute1                 =>  p_pcu_attribute1
375       ,p_pcu_attribute2                 =>  p_pcu_attribute2
376       ,p_pcu_attribute3                 =>  p_pcu_attribute3
377       ,p_pcu_attribute4                 =>  p_pcu_attribute4
378       ,p_pcu_attribute5                 =>  p_pcu_attribute5
379       ,p_pcu_attribute6                 =>  p_pcu_attribute6
380       ,p_pcu_attribute7                 =>  p_pcu_attribute7
381       ,p_pcu_attribute8                 =>  p_pcu_attribute8
382       ,p_pcu_attribute9                 =>  p_pcu_attribute9
383       ,p_pcu_attribute10                =>  p_pcu_attribute10
384       ,p_pcu_attribute11                =>  p_pcu_attribute11
385       ,p_pcu_attribute12                =>  p_pcu_attribute12
386       ,p_pcu_attribute13                =>  p_pcu_attribute13
387       ,p_pcu_attribute14                =>  p_pcu_attribute14
388       ,p_pcu_attribute15                =>  p_pcu_attribute15
389       ,p_pcu_attribute16                =>  p_pcu_attribute16
390       ,p_pcu_attribute17                =>  p_pcu_attribute17
391       ,p_pcu_attribute18                =>  p_pcu_attribute18
392       ,p_pcu_attribute19                =>  p_pcu_attribute19
393       ,p_pcu_attribute20                =>  p_pcu_attribute20
394       ,p_pcu_attribute21                =>  p_pcu_attribute21
395       ,p_pcu_attribute22                =>  p_pcu_attribute22
396       ,p_pcu_attribute23                =>  p_pcu_attribute23
397       ,p_pcu_attribute24                =>  p_pcu_attribute24
398       ,p_pcu_attribute25                =>  p_pcu_attribute25
399       ,p_pcu_attribute26                =>  p_pcu_attribute26
400       ,p_pcu_attribute27                =>  p_pcu_attribute27
401       ,p_pcu_attribute28                =>  p_pcu_attribute28
402       ,p_pcu_attribute29                =>  p_pcu_attribute29
403       ,p_pcu_attribute30                =>  p_pcu_attribute30
404       ,p_request_id                     =>  p_request_id
405       ,p_program_application_id         =>  p_program_application_id
406       ,p_program_id                     =>  p_program_id
407       ,p_program_update_date            =>  p_program_update_date
408       ,p_effective_date                 => trunc(p_effective_date));
409     --
410   exception
411     --
412     when hr_api.cannot_find_prog_unit then
413       --
414       hr_api.cannot_find_prog_unit_error
415         (p_module_name => 'CREATE_PER_CM_USG'
416         ,p_hook_type   => 'BP');
417     --
418     -- End of API User Hook for the before hook of create_PER_CM_USG
419     --
420   end;
421   --
422   open c_seq;
423     --
424     fetch c_seq into l_per_cm_usg_id;
425     --
426   close c_seq;
427   --
428   -- Post insert row handler hook
429   --
430   dt_api.validate_dt_mode
431     (p_effective_date          => p_effective_date,
432      p_datetrack_mode          => 'INSERT',
433      p_base_table_name         => 'ben_per_cm_usg_f',
434      p_base_key_column         => 'per_cm_usg_id',
435      p_base_key_value          => p_per_cm_usg_id,
436      p_parent_table_name1      => 'ben_cm_typ_usg_f',
437      p_parent_key_column1      => 'cm_typ_usg_id',
438      p_parent_key_value1       => p_cm_typ_usg_id,
439      p_parent_table_name2      => 'ben_per_cm_f',
440      p_parent_key_column2      => 'per_cm_id',
441      p_parent_key_value2       => p_per_cm_id,
442      p_enforce_foreign_locking => false,
443      p_validation_start_date   => l_validation_start_date,
444      p_validation_end_date     => l_validation_end_date);
445   --
446   l_effective_start_date := l_validation_start_date;
447   l_effective_end_date := l_validation_end_date;
448   l_object_version_number := 1;
449   --
450   insert into ben_per_cm_usg_f
451     (per_cm_usg_id
452     ,effective_start_date
453     ,effective_end_date
454     ,per_cm_id
455     ,cm_typ_usg_id
456     ,business_group_id
457     ,pcu_attribute_category
458     ,pcu_attribute1
459     ,pcu_attribute2
460     ,pcu_attribute3
461     ,pcu_attribute4
462     ,pcu_attribute5
463     ,pcu_attribute6
464     ,pcu_attribute7
465     ,pcu_attribute8
466     ,pcu_attribute9
467     ,pcu_attribute10
468     ,pcu_attribute11
469     ,pcu_attribute12
470     ,pcu_attribute13
471     ,pcu_attribute14
472     ,pcu_attribute15
473     ,pcu_attribute16
474     ,pcu_attribute17
475     ,pcu_attribute18
476     ,pcu_attribute19
477     ,pcu_attribute20
478     ,pcu_attribute21
479     ,pcu_attribute22
480     ,pcu_attribute23
481     ,pcu_attribute24
482     ,pcu_attribute25
483     ,pcu_attribute26
484     ,pcu_attribute27
485     ,pcu_attribute28
486     ,pcu_attribute29
487     ,pcu_attribute30
488     ,request_id
489     ,program_application_id
490     ,program_id
491     ,program_update_date
492     ,object_version_number)
493   values
494     (l_per_cm_usg_id
495     ,l_effective_start_date
496     ,l_effective_end_date
497     ,p_per_cm_id
498     ,p_cm_typ_usg_id
499     ,p_business_group_id
500     ,p_pcu_attribute_category
501     ,p_pcu_attribute1
502     ,p_pcu_attribute2
503     ,p_pcu_attribute3
504     ,p_pcu_attribute4
505     ,p_pcu_attribute5
506     ,p_pcu_attribute6
507     ,p_pcu_attribute7
508     ,p_pcu_attribute8
509     ,p_pcu_attribute9
510     ,p_pcu_attribute10
511     ,p_pcu_attribute11
512     ,p_pcu_attribute12
513     ,p_pcu_attribute13
514     ,p_pcu_attribute14
515     ,p_pcu_attribute15
516     ,p_pcu_attribute16
517     ,p_pcu_attribute17
518     ,p_pcu_attribute18
519     ,p_pcu_attribute19
520     ,p_pcu_attribute20
521     ,p_pcu_attribute21
522     ,p_pcu_attribute22
523     ,p_pcu_attribute23
524     ,p_pcu_attribute24
525     ,p_pcu_attribute25
526     ,p_pcu_attribute26
527     ,p_pcu_attribute27
528     ,p_pcu_attribute28
529     ,p_pcu_attribute29
530     ,p_pcu_attribute30
531     ,p_request_id
532     ,p_program_application_id
533     ,p_program_id
534     ,p_program_update_date
535     ,l_object_version_number);
536   --
537   -- Start of API User Hook for post_insert.
538   --
539   begin
540     --
541     ben_pcu_rki.after_insert
542       (p_per_cm_usg_id                 =>l_per_cm_usg_id
543       ,p_effective_start_date          =>l_effective_start_date
544       ,p_effective_end_date            =>l_effective_end_date
545       ,p_per_cm_id                     =>p_per_cm_id
546       ,p_cm_typ_usg_id                 =>p_cm_typ_usg_id
547       ,p_business_group_id             =>p_business_group_id
548       ,p_pcu_attribute_category        =>p_pcu_attribute_category
549       ,p_pcu_attribute1                =>p_pcu_attribute1
550       ,p_pcu_attribute2                =>p_pcu_attribute2
551       ,p_pcu_attribute3                =>p_pcu_attribute3
552       ,p_pcu_attribute4                =>p_pcu_attribute4
553       ,p_pcu_attribute5                =>p_pcu_attribute5
554       ,p_pcu_attribute6                =>p_pcu_attribute6
555       ,p_pcu_attribute7                =>p_pcu_attribute7
556       ,p_pcu_attribute8                =>p_pcu_attribute8
557       ,p_pcu_attribute9                =>p_pcu_attribute9
558       ,p_pcu_attribute10               =>p_pcu_attribute10
559       ,p_pcu_attribute11               =>p_pcu_attribute11
560       ,p_pcu_attribute12               =>p_pcu_attribute12
561       ,p_pcu_attribute13               =>p_pcu_attribute13
562       ,p_pcu_attribute14               =>p_pcu_attribute14
563       ,p_pcu_attribute15               =>p_pcu_attribute15
564       ,p_pcu_attribute16               =>p_pcu_attribute16
565       ,p_pcu_attribute17               =>p_pcu_attribute17
566       ,p_pcu_attribute18               =>p_pcu_attribute18
567       ,p_pcu_attribute19               =>p_pcu_attribute19
568       ,p_pcu_attribute20               =>p_pcu_attribute20
569       ,p_pcu_attribute21               =>p_pcu_attribute21
570       ,p_pcu_attribute22               =>p_pcu_attribute22
571       ,p_pcu_attribute23               =>p_pcu_attribute23
572       ,p_pcu_attribute24               =>p_pcu_attribute24
573       ,p_pcu_attribute25               =>p_pcu_attribute25
574       ,p_pcu_attribute26               =>p_pcu_attribute26
575       ,p_pcu_attribute27               =>p_pcu_attribute27
576       ,p_pcu_attribute28               =>p_pcu_attribute28
577       ,p_pcu_attribute29               =>p_pcu_attribute29
578       ,p_pcu_attribute30               =>p_pcu_attribute30
579       ,p_request_id                    =>p_request_id
580       ,p_program_application_id        =>p_program_application_id
581       ,p_program_id                    =>p_program_id
582       ,p_program_update_date           =>p_program_update_date
583       ,p_object_version_number         =>l_object_version_number
584       ,p_effective_date                =>p_effective_date
585       ,p_validation_start_date         =>l_validation_start_date
586       ,p_validation_end_date           =>l_validation_end_date);
587     --
588   exception
589     --
590     when hr_api.cannot_find_prog_unit then
591       --
592       hr_api.cannot_find_prog_unit_error
593         (p_module_name => 'ben_per_cm_usg_f'
594         ,p_hook_type   => 'AI');
595       --
596   end;
597   --
598   -- End of API User Hook for post_insert.
599   --
600   begin
601     --
602     -- Start of API User Hook for the after hook of create_PER_CM_USG
603     --
604     ben_PER_CM_USG_bk1.create_PER_CM_USG_a
605       (p_per_cm_usg_id                  =>  l_per_cm_usg_id
606       ,p_effective_start_date           =>  l_effective_start_date
607       ,p_effective_end_date             =>  l_effective_end_date
608       ,p_per_cm_id                      =>  p_per_cm_id
609       ,p_cm_typ_usg_id                  =>  p_cm_typ_usg_id
610       ,p_business_group_id              =>  p_business_group_id
611       ,p_pcu_attribute_category         =>  p_pcu_attribute_category
612       ,p_pcu_attribute1                 =>  p_pcu_attribute1
613       ,p_pcu_attribute2                 =>  p_pcu_attribute2
614       ,p_pcu_attribute3                 =>  p_pcu_attribute3
615       ,p_pcu_attribute4                 =>  p_pcu_attribute4
616       ,p_pcu_attribute5                 =>  p_pcu_attribute5
617       ,p_pcu_attribute6                 =>  p_pcu_attribute6
618       ,p_pcu_attribute7                 =>  p_pcu_attribute7
619       ,p_pcu_attribute8                 =>  p_pcu_attribute8
620       ,p_pcu_attribute9                 =>  p_pcu_attribute9
621       ,p_pcu_attribute10                =>  p_pcu_attribute10
622       ,p_pcu_attribute11                =>  p_pcu_attribute11
623       ,p_pcu_attribute12                =>  p_pcu_attribute12
624       ,p_pcu_attribute13                =>  p_pcu_attribute13
625       ,p_pcu_attribute14                =>  p_pcu_attribute14
626       ,p_pcu_attribute15                =>  p_pcu_attribute15
627       ,p_pcu_attribute16                =>  p_pcu_attribute16
628       ,p_pcu_attribute17                =>  p_pcu_attribute17
629       ,p_pcu_attribute18                =>  p_pcu_attribute18
630       ,p_pcu_attribute19                =>  p_pcu_attribute19
631       ,p_pcu_attribute20                =>  p_pcu_attribute20
632       ,p_pcu_attribute21                =>  p_pcu_attribute21
633       ,p_pcu_attribute22                =>  p_pcu_attribute22
634       ,p_pcu_attribute23                =>  p_pcu_attribute23
635       ,p_pcu_attribute24                =>  p_pcu_attribute24
636       ,p_pcu_attribute25                =>  p_pcu_attribute25
637       ,p_pcu_attribute26                =>  p_pcu_attribute26
638       ,p_pcu_attribute27                =>  p_pcu_attribute27
639       ,p_pcu_attribute28                =>  p_pcu_attribute28
640       ,p_pcu_attribute29                =>  p_pcu_attribute29
641       ,p_pcu_attribute30                =>  p_pcu_attribute30
642       ,p_request_id                     =>  p_request_id
643       ,p_program_application_id         =>  p_program_application_id
644       ,p_program_id                     =>  p_program_id
645       ,p_program_update_date            =>  p_program_update_date
646       ,p_object_version_number          =>  l_object_version_number
647       ,p_effective_date                 =>  trunc(p_effective_date));
648     --
649   exception
650     --
651     when hr_api.cannot_find_prog_unit then
652       --
653       hr_api.cannot_find_prog_unit_error
654         (p_module_name => 'CREATE_PER_CM_USG'
655         ,p_hook_type   => 'AP');
656     --
657     -- End of API User Hook for the after hook of create_PER_CM_USG
658     --
659   end;
660   --
661   -- When in validation only mode raise the Validate_Enabled exception
662   --
663   if p_validate then
664     raise hr_api.validate_enabled;
665   end if;
666   --
667   -- Set all output arguments
668   --
669   p_per_cm_usg_id := l_per_cm_usg_id;
670   p_effective_start_date := l_effective_start_date;
671   p_effective_end_date := l_effective_end_date;
672   p_object_version_number := l_object_version_number;
673   --
674 exception
675   --
676   when hr_api.validate_enabled then
677     --
678     -- As the Validate_Enabled exception has been raised
679     -- we must rollback to the savepoint
680     --
681     ROLLBACK TO create_PER_CM_USG;
682     --
683     -- Only set output warning arguments
684     -- (Any key or derived arguments must be set to null
685     -- when validation only mode is being used.)
686     --
687     p_per_cm_usg_id := null;
688     p_effective_start_date := null;
689     p_effective_end_date := null;
690     p_object_version_number  := null;
691     --
692   when others then
693     --
694     -- A validation or unexpected error has occured
695     --
696     ROLLBACK TO create_PER_CM_USG;
697     --
698     p_per_cm_usg_id := null;
699     p_effective_start_date := null;
700     p_effective_end_date := null;
701     p_object_version_number  := null;
702     --
703     raise;
704     --
705 end create_PER_CM_USG_perf;
706 -- ----------------------------------------------------------------------------
707 -- |------------------------< update_PER_CM_USG >-----------------------------|
708 -- ----------------------------------------------------------------------------
709 --
710 procedure update_PER_CM_USG
711   (p_validate                       in  boolean   default false
712   ,p_per_cm_usg_id                  in  number
713   ,p_effective_start_date           out nocopy date
714   ,p_effective_end_date             out nocopy date
715   ,p_per_cm_id                      in  number    default hr_api.g_number
716   ,p_cm_typ_usg_id                  in  number    default hr_api.g_number
717   ,p_business_group_id              in  number    default hr_api.g_number
718   ,p_pcu_attribute_category         in  varchar2  default hr_api.g_varchar2
719   ,p_pcu_attribute1                 in  varchar2  default hr_api.g_varchar2
720   ,p_pcu_attribute2                 in  varchar2  default hr_api.g_varchar2
721   ,p_pcu_attribute3                 in  varchar2  default hr_api.g_varchar2
722   ,p_pcu_attribute4                 in  varchar2  default hr_api.g_varchar2
723   ,p_pcu_attribute5                 in  varchar2  default hr_api.g_varchar2
724   ,p_pcu_attribute6                 in  varchar2  default hr_api.g_varchar2
725   ,p_pcu_attribute7                 in  varchar2  default hr_api.g_varchar2
726   ,p_pcu_attribute8                 in  varchar2  default hr_api.g_varchar2
727   ,p_pcu_attribute9                 in  varchar2  default hr_api.g_varchar2
728   ,p_pcu_attribute10                in  varchar2  default hr_api.g_varchar2
729   ,p_pcu_attribute11                in  varchar2  default hr_api.g_varchar2
730   ,p_pcu_attribute12                in  varchar2  default hr_api.g_varchar2
731   ,p_pcu_attribute13                in  varchar2  default hr_api.g_varchar2
732   ,p_pcu_attribute14                in  varchar2  default hr_api.g_varchar2
733   ,p_pcu_attribute15                in  varchar2  default hr_api.g_varchar2
734   ,p_pcu_attribute16                in  varchar2  default hr_api.g_varchar2
735   ,p_pcu_attribute17                in  varchar2  default hr_api.g_varchar2
736   ,p_pcu_attribute18                in  varchar2  default hr_api.g_varchar2
737   ,p_pcu_attribute19                in  varchar2  default hr_api.g_varchar2
738   ,p_pcu_attribute20                in  varchar2  default hr_api.g_varchar2
739   ,p_pcu_attribute21                in  varchar2  default hr_api.g_varchar2
740   ,p_pcu_attribute22                in  varchar2  default hr_api.g_varchar2
741   ,p_pcu_attribute23                in  varchar2  default hr_api.g_varchar2
742   ,p_pcu_attribute24                in  varchar2  default hr_api.g_varchar2
743   ,p_pcu_attribute25                in  varchar2  default hr_api.g_varchar2
744   ,p_pcu_attribute26                in  varchar2  default hr_api.g_varchar2
745   ,p_pcu_attribute27                in  varchar2  default hr_api.g_varchar2
746   ,p_pcu_attribute28                in  varchar2  default hr_api.g_varchar2
747   ,p_pcu_attribute29                in  varchar2  default hr_api.g_varchar2
748   ,p_pcu_attribute30                in  varchar2  default hr_api.g_varchar2
749   ,p_request_id                     in  number    default hr_api.g_number
750   ,p_program_application_id         in  number    default hr_api.g_number
751   ,p_program_id                     in  number    default hr_api.g_number
752   ,p_program_update_date            in  date      default hr_api.g_date
753   ,p_object_version_number          in out nocopy number
754   ,p_effective_date                 in  date
755   ,p_datetrack_mode                 in  varchar2) is
756   --
757   -- Declare cursors and local variables
758   --
759   l_proc varchar2(72) := g_package||'update_PER_CM_USG';
760   l_object_version_number ben_per_cm_usg_f.object_version_number%TYPE;
761   l_effective_start_date ben_per_cm_usg_f.effective_start_date%TYPE;
762   l_effective_end_date ben_per_cm_usg_f.effective_end_date%TYPE;
763   --
764 begin
765   --
766   hr_utility.set_location('Entering:'|| l_proc, 10);
767   --
768   -- Issue a savepoint if operating in validation only mode
769   --
770   savepoint update_PER_CM_USG;
771   --
772   hr_utility.set_location(l_proc, 20);
773   --
774   -- Process Logic
775   --
776   l_object_version_number := p_object_version_number;
777   --
778   begin
779     --
780     -- Start of API User Hook for the before hook of update_PER_CM_USG
781     --
782     ben_PER_CM_USG_bk2.update_PER_CM_USG_b
783       (p_per_cm_usg_id                  =>  p_per_cm_usg_id
784       ,p_per_cm_id                      =>  p_per_cm_id
785       ,p_cm_typ_usg_id                  =>  p_cm_typ_usg_id
786       ,p_business_group_id              =>  p_business_group_id
787       ,p_pcu_attribute_category         =>  p_pcu_attribute_category
788       ,p_pcu_attribute1                 =>  p_pcu_attribute1
789       ,p_pcu_attribute2                 =>  p_pcu_attribute2
790       ,p_pcu_attribute3                 =>  p_pcu_attribute3
791       ,p_pcu_attribute4                 =>  p_pcu_attribute4
792       ,p_pcu_attribute5                 =>  p_pcu_attribute5
793       ,p_pcu_attribute6                 =>  p_pcu_attribute6
794       ,p_pcu_attribute7                 =>  p_pcu_attribute7
795       ,p_pcu_attribute8                 =>  p_pcu_attribute8
796       ,p_pcu_attribute9                 =>  p_pcu_attribute9
797       ,p_pcu_attribute10                =>  p_pcu_attribute10
798       ,p_pcu_attribute11                =>  p_pcu_attribute11
799       ,p_pcu_attribute12                =>  p_pcu_attribute12
800       ,p_pcu_attribute13                =>  p_pcu_attribute13
801       ,p_pcu_attribute14                =>  p_pcu_attribute14
802       ,p_pcu_attribute15                =>  p_pcu_attribute15
803       ,p_pcu_attribute16                =>  p_pcu_attribute16
804       ,p_pcu_attribute17                =>  p_pcu_attribute17
805       ,p_pcu_attribute18                =>  p_pcu_attribute18
806       ,p_pcu_attribute19                =>  p_pcu_attribute19
807       ,p_pcu_attribute20                =>  p_pcu_attribute20
808       ,p_pcu_attribute21                =>  p_pcu_attribute21
809       ,p_pcu_attribute22                =>  p_pcu_attribute22
810       ,p_pcu_attribute23                =>  p_pcu_attribute23
811       ,p_pcu_attribute24                =>  p_pcu_attribute24
812       ,p_pcu_attribute25                =>  p_pcu_attribute25
813       ,p_pcu_attribute26                =>  p_pcu_attribute26
814       ,p_pcu_attribute27                =>  p_pcu_attribute27
815       ,p_pcu_attribute28                =>  p_pcu_attribute28
816       ,p_pcu_attribute29                =>  p_pcu_attribute29
817       ,p_pcu_attribute30                =>  p_pcu_attribute30
818       ,p_request_id                     =>  p_request_id
819       ,p_program_application_id         =>  p_program_application_id
820       ,p_program_id                     =>  p_program_id
821       ,p_program_update_date            =>  p_program_update_date
822       ,p_object_version_number          =>  p_object_version_number
823       ,p_effective_date                 =>  trunc(p_effective_date)
824       ,p_datetrack_mode                 =>  p_datetrack_mode);
825     --
826   exception
827     --
828     when hr_api.cannot_find_prog_unit then
829       --
830       hr_api.cannot_find_prog_unit_error
831         (p_module_name => 'UPDATE_PER_CM_USG'
832         ,p_hook_type   => 'BP');
833     --
834     -- End of API User Hook for the before hook of update_PER_CM_USG
835     --
836   end;
837   --
838   ben_pcu_upd.upd
839     (p_per_cm_usg_id                 => p_per_cm_usg_id
840     ,p_effective_start_date          => l_effective_start_date
841     ,p_effective_end_date            => l_effective_end_date
842     ,p_per_cm_id                     => p_per_cm_id
843     ,p_cm_typ_usg_id                 => p_cm_typ_usg_id
844     ,p_business_group_id             => p_business_group_id
845     ,p_pcu_attribute_category        => p_pcu_attribute_category
846     ,p_pcu_attribute1                => p_pcu_attribute1
847     ,p_pcu_attribute2                => p_pcu_attribute2
848     ,p_pcu_attribute3                => p_pcu_attribute3
849     ,p_pcu_attribute4                => p_pcu_attribute4
850     ,p_pcu_attribute5                => p_pcu_attribute5
851     ,p_pcu_attribute6                => p_pcu_attribute6
852     ,p_pcu_attribute7                => p_pcu_attribute7
853     ,p_pcu_attribute8                => p_pcu_attribute8
854     ,p_pcu_attribute9                => p_pcu_attribute9
855     ,p_pcu_attribute10               => p_pcu_attribute10
856     ,p_pcu_attribute11               => p_pcu_attribute11
857     ,p_pcu_attribute12               => p_pcu_attribute12
858     ,p_pcu_attribute13               => p_pcu_attribute13
859     ,p_pcu_attribute14               => p_pcu_attribute14
860     ,p_pcu_attribute15               => p_pcu_attribute15
861     ,p_pcu_attribute16               => p_pcu_attribute16
862     ,p_pcu_attribute17               => p_pcu_attribute17
863     ,p_pcu_attribute18               => p_pcu_attribute18
864     ,p_pcu_attribute19               => p_pcu_attribute19
865     ,p_pcu_attribute20               => p_pcu_attribute20
866     ,p_pcu_attribute21               => p_pcu_attribute21
867     ,p_pcu_attribute22               => p_pcu_attribute22
868     ,p_pcu_attribute23               => p_pcu_attribute23
869     ,p_pcu_attribute24               => p_pcu_attribute24
870     ,p_pcu_attribute25               => p_pcu_attribute25
871     ,p_pcu_attribute26               => p_pcu_attribute26
872     ,p_pcu_attribute27               => p_pcu_attribute27
873     ,p_pcu_attribute28               => p_pcu_attribute28
874     ,p_pcu_attribute29               => p_pcu_attribute29
875     ,p_pcu_attribute30               => p_pcu_attribute30
876     ,p_request_id                    => p_request_id
877     ,p_program_application_id        => p_program_application_id
878     ,p_program_id                    => p_program_id
879     ,p_program_update_date           => p_program_update_date
880     ,p_object_version_number         => l_object_version_number
881     ,p_effective_date                => trunc(p_effective_date)
882     ,p_datetrack_mode                => p_datetrack_mode);
883   --
884   begin
885     --
886     -- Start of API User Hook for the after hook of update_PER_CM_USG
887     --
888     ben_PER_CM_USG_bk2.update_PER_CM_USG_a
889       (p_per_cm_usg_id                  =>  p_per_cm_usg_id
890       ,p_effective_start_date           =>  l_effective_start_date
891       ,p_effective_end_date             =>  l_effective_end_date
892       ,p_per_cm_id                      =>  p_per_cm_id
893       ,p_cm_typ_usg_id                  =>  p_cm_typ_usg_id
894       ,p_business_group_id              =>  p_business_group_id
895       ,p_pcu_attribute_category         =>  p_pcu_attribute_category
896       ,p_pcu_attribute1                 =>  p_pcu_attribute1
897       ,p_pcu_attribute2                 =>  p_pcu_attribute2
898       ,p_pcu_attribute3                 =>  p_pcu_attribute3
899       ,p_pcu_attribute4                 =>  p_pcu_attribute4
900       ,p_pcu_attribute5                 =>  p_pcu_attribute5
901       ,p_pcu_attribute6                 =>  p_pcu_attribute6
902       ,p_pcu_attribute7                 =>  p_pcu_attribute7
903       ,p_pcu_attribute8                 =>  p_pcu_attribute8
904       ,p_pcu_attribute9                 =>  p_pcu_attribute9
905       ,p_pcu_attribute10                =>  p_pcu_attribute10
906       ,p_pcu_attribute11                =>  p_pcu_attribute11
907       ,p_pcu_attribute12                =>  p_pcu_attribute12
908       ,p_pcu_attribute13                =>  p_pcu_attribute13
909       ,p_pcu_attribute14                =>  p_pcu_attribute14
910       ,p_pcu_attribute15                =>  p_pcu_attribute15
911       ,p_pcu_attribute16                =>  p_pcu_attribute16
912       ,p_pcu_attribute17                =>  p_pcu_attribute17
913       ,p_pcu_attribute18                =>  p_pcu_attribute18
914       ,p_pcu_attribute19                =>  p_pcu_attribute19
915       ,p_pcu_attribute20                =>  p_pcu_attribute20
916       ,p_pcu_attribute21                =>  p_pcu_attribute21
917       ,p_pcu_attribute22                =>  p_pcu_attribute22
918       ,p_pcu_attribute23                =>  p_pcu_attribute23
919       ,p_pcu_attribute24                =>  p_pcu_attribute24
920       ,p_pcu_attribute25                =>  p_pcu_attribute25
921       ,p_pcu_attribute26                =>  p_pcu_attribute26
922       ,p_pcu_attribute27                =>  p_pcu_attribute27
923       ,p_pcu_attribute28                =>  p_pcu_attribute28
924       ,p_pcu_attribute29                =>  p_pcu_attribute29
925       ,p_pcu_attribute30                =>  p_pcu_attribute30
926       ,p_request_id                     =>  p_request_id
927       ,p_program_application_id         =>  p_program_application_id
928       ,p_program_id                     =>  p_program_id
929       ,p_program_update_date            =>  p_program_update_date
930       ,p_object_version_number          =>  l_object_version_number
931       ,p_effective_date                 =>  trunc(p_effective_date)
932       ,p_datetrack_mode                 =>  p_datetrack_mode);
933     --
934   exception
935     --
936     when hr_api.cannot_find_prog_unit then
937       --
938       hr_api.cannot_find_prog_unit_error
939         (p_module_name => 'UPDATE_PER_CM_USG'
940         ,p_hook_type   => 'AP');
941     --
942     -- End of API User Hook for the after hook of update_PER_CM_USG
943     --
944   end;
945   --
946   hr_utility.set_location(l_proc, 60);
947   --
948   -- When in validation only mode raise the Validate_Enabled exception
949   --
950   if p_validate then
951     raise hr_api.validate_enabled;
952   end if;
953   --
954   -- Set all output arguments
955   --
956   p_object_version_number := l_object_version_number;
957   p_effective_start_date := l_effective_start_date;
958   p_effective_end_date := l_effective_end_date;
959   --
960   hr_utility.set_location(' Leaving:'||l_proc, 70);
961   --
962 exception
963   --
964   when hr_api.validate_enabled then
965     --
966     -- As the Validate_Enabled exception has been raised
967     -- we must rollback to the savepoint
968     --
969     ROLLBACK TO update_PER_CM_USG;
970     --
971     -- Only set output warning arguments
972     -- (Any key or derived arguments must be set to null
973     -- when validation only mode is being used.)
974     --
975     hr_utility.set_location(' Leaving:'||l_proc, 80);
976     --
977   when others then
978     --
979     -- A validation or unexpected error has occured
980     --
981     ROLLBACK TO update_PER_CM_USG;
982     --
983     p_effective_start_date := null;
984     p_effective_end_date := null;
985     p_object_version_number  := l_object_version_number;
986     --
987     raise;
988     --
989 end update_PER_CM_USG;
990 -- ----------------------------------------------------------------------------
991 -- |------------------------< delete_PER_CM_USG >-----------------------------|
992 -- ----------------------------------------------------------------------------
993 --
994 procedure delete_PER_CM_USG
995   (p_validate                       in  boolean  default false
996   ,p_per_cm_usg_id                  in  number
997   ,p_effective_start_date           out nocopy date
998   ,p_effective_end_date             out nocopy date
999   ,p_object_version_number          in out nocopy number
1000   ,p_effective_date                 in  date
1001   ,p_datetrack_mode                 in  varchar2) is
1002   --
1003   -- Declare cursors and local variables
1004   --
1005   l_proc varchar2(72) := g_package||'update_PER_CM_USG';
1006   l_object_version_number ben_per_cm_usg_f.object_version_number%TYPE;
1007   l_effective_start_date ben_per_cm_usg_f.effective_start_date%TYPE;
1008   l_effective_end_date ben_per_cm_usg_f.effective_end_date%TYPE;
1009   --
1010 begin
1011   --
1012   hr_utility.set_location('Entering:'|| l_proc, 10);
1013   --
1014   -- Issue a savepoint if operating in validation only mode
1015   --
1016   savepoint delete_PER_CM_USG;
1017   --
1018   hr_utility.set_location(l_proc, 20);
1019   --
1020   -- Process Logic
1021   --
1022   l_object_version_number := p_object_version_number;
1023   --
1024   --
1025   begin
1026     --
1027     -- Start of API User Hook for the before hook of delete_PER_CM_USG
1028     --
1029     ben_PER_CM_USG_bk3.delete_PER_CM_USG_b
1030       (p_per_cm_usg_id                  =>  p_per_cm_usg_id
1031       ,p_object_version_number          =>  p_object_version_number
1032       ,p_effective_date                 =>  trunc(p_effective_date)
1033       ,p_datetrack_mode                 =>  p_datetrack_mode);
1034     --
1035   exception
1036     --
1037     when hr_api.cannot_find_prog_unit then
1038       --
1039       hr_api.cannot_find_prog_unit_error
1040         (p_module_name => 'DELETE_PER_CM_USG'
1041         ,p_hook_type   => 'BP');
1042     --
1043     -- End of API User Hook for the before hook of delete_PER_CM_USG
1044     --
1045   end;
1046   --
1047   ben_pcu_del.del
1048     (p_per_cm_usg_id                 => p_per_cm_usg_id
1049     ,p_effective_start_date          => l_effective_start_date
1050     ,p_effective_end_date            => l_effective_end_date
1051     ,p_object_version_number         => l_object_version_number
1052     ,p_effective_date                => p_effective_date
1053     ,p_datetrack_mode                => p_datetrack_mode);
1054   --
1055   begin
1056     --
1057     -- Start of API User Hook for the after hook of delete_PER_CM_USG
1058     --
1059     ben_PER_CM_USG_bk3.delete_PER_CM_USG_a
1060       (p_per_cm_usg_id                  =>  p_per_cm_usg_id
1061       ,p_effective_start_date           =>  l_effective_start_date
1062       ,p_effective_end_date             =>  l_effective_end_date
1063       ,p_object_version_number          =>  l_object_version_number
1064       ,p_effective_date                 =>  trunc(p_effective_date)
1065       ,p_datetrack_mode                 =>  p_datetrack_mode);
1066     --
1067   exception
1068     --
1069     when hr_api.cannot_find_prog_unit then
1070       --
1071       hr_api.cannot_find_prog_unit_error
1072         (p_module_name => 'DELETE_PER_CM_USG'
1073         ,p_hook_type   => 'AP');
1074     --
1075     -- End of API User Hook for the after hook of delete_PER_CM_USG
1076     --
1077   end;
1078   --
1079   hr_utility.set_location(l_proc, 60);
1080   --
1081   -- When in validation only mode raise the Validate_Enabled exception
1082   --
1083   if p_validate then
1084     raise hr_api.validate_enabled;
1085   end if;
1086   --
1087   hr_utility.set_location(' Leaving:'||l_proc, 70);
1088   --
1089 exception
1090   --
1091   when hr_api.validate_enabled then
1092     --
1093     -- As the Validate_Enabled exception has been raised
1094     -- we must rollback to the savepoint
1095     --
1096     ROLLBACK TO delete_PER_CM_USG;
1097     --
1098     -- Only set output warning arguments
1099     -- (Any key or derived arguments must be set to null
1100     -- when validation only mode is being used.)
1101     --
1102     p_effective_start_date := null;
1103     p_effective_end_date := null;
1104     --
1105   when others then
1106     --
1107     -- A validation or unexpected error has occured
1108     --
1109     ROLLBACK TO delete_PER_CM_USG;
1110     --
1111     p_effective_start_date := null;
1112     p_effective_end_date := null;
1113     p_object_version_number  := l_object_version_number;
1114     --
1115     raise;
1116     --
1117 end delete_PER_CM_USG;
1118 --
1119 -- ----------------------------------------------------------------------------
1120 -- |-------------------------------< lck >------------------------------------|
1121 -- ----------------------------------------------------------------------------
1122 --
1123 procedure lck
1124   (p_per_cm_usg_id                  in     number
1125   ,p_object_version_number          in     number
1126   ,p_effective_date                 in     date
1127   ,p_datetrack_mode                 in     varchar2
1128   ,p_validation_start_date          out nocopy    date
1129   ,p_validation_end_date            out nocopy    date) is
1130   --
1131   -- Declare cursors and local variables
1132   --
1133   l_proc varchar2(72) := g_package||'lck';
1134   l_validation_start_date date;
1135   l_validation_end_date date;
1136   --
1137 begin
1138   --
1139   hr_utility.set_location('Entering:'|| l_proc, 10);
1140   --
1141   ben_pcu_shd.lck
1142      (p_per_cm_usg_id              => p_per_cm_usg_id
1143      ,p_validation_start_date      => l_validation_start_date
1144      ,p_validation_end_date        => l_validation_end_date
1145      ,p_object_version_number      => p_object_version_number
1146      ,p_effective_date             => p_effective_date
1147      ,p_datetrack_mode             => p_datetrack_mode);
1148   --
1149   hr_utility.set_location(' Leaving:'||l_proc, 70);
1150   --
1151 end lck;
1152 --
1153 end ben_PER_CM_USG_api;