DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_CAGR_GRADE_STRUCTURES_API

Source


1 Package Body hr_cagr_grade_structures_api as
2 /* $Header: pegrsapi.pkb 115.3 2002/12/11 11:04:23 pkakar ship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  hr_cagr_grade_structures_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------- -------------< create_cagr_grade_structures >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_cagr_grade_structures
13   (p_validate                       in  boolean   default false
14   ,p_cagr_grade_structure_id        out nocopy number
15   ,p_collective_agreement_id        in  number    default null
16   ,p_object_version_number          out nocopy number
17   ,p_id_flex_num                    in  number    default null
18   ,p_dynamic_insert_allowed         in  varchar2  default null
19   ,p_attribute_category             in  varchar2  default null
20   ,p_attribute1                     in  varchar2  default null
21   ,p_attribute2                     in  varchar2  default null
22   ,p_attribute3                     in  varchar2  default null
23   ,p_attribute4                     in  varchar2  default null
24   ,p_attribute5                     in  varchar2  default null
25   ,p_attribute6                     in  varchar2  default null
26   ,p_attribute7                     in  varchar2  default null
27   ,p_attribute8                     in  varchar2  default null
28   ,p_attribute9                     in  varchar2  default null
29   ,p_attribute10                    in  varchar2  default null
30   ,p_attribute11                    in  varchar2  default null
31   ,p_attribute12                    in  varchar2  default null
32   ,p_attribute13                    in  varchar2  default null
33   ,p_attribute14                    in  varchar2  default null
34   ,p_attribute15                    in  varchar2  default null
35   ,p_attribute16                    in  varchar2  default null
36   ,p_attribute17                    in  varchar2  default null
37   ,p_attribute18                    in  varchar2  default null
38   ,p_attribute19                    in  varchar2  default null
39   ,p_attribute20                    in  varchar2  default null
40   ,p_effective_date		    in  date
41   ) is
42   --
43   -- Declare cursors and local variables
44   --
45   l_cagr_grade_structure_id per_cagr_grade_structures.cagr_grade_structure_id%TYPE;
46   l_proc varchar2(72) := g_package||'create_cagr_grade_structures';
47   l_object_version_number per_cagr_grade_structures.object_version_number%TYPE;
48   --
49 begin
50   --
51   hr_utility.set_location('Entering:'|| l_proc, 10);
52   --
53   -- Issue a savepoint if operating in validation only mode
54   --
55   savepoint create_cagr_grade_structures;
56   --
57   hr_utility.set_location(l_proc, 20);
58   --
59   -- Process Logic
60   --
61   begin
62     --
63     -- Start of API User Hook for the before hook of create_cagr_grade_structures
64     --
65     hr_cagr_grade_structures_bk1.create_cagr_grade_structures_b
66       (
67        p_collective_agreement_id        =>  p_collective_agreement_id
68       ,p_id_flex_num                    =>  p_id_flex_num
69       ,p_dynamic_insert_allowed         =>  p_dynamic_insert_allowed
70       ,p_attribute_category             =>  p_attribute_category
71       ,p_attribute1                     =>  p_attribute1
72       ,p_attribute2                     =>  p_attribute2
73       ,p_attribute3                     =>  p_attribute3
74       ,p_attribute4                     =>  p_attribute4
75       ,p_attribute5                     =>  p_attribute5
76       ,p_attribute6                     =>  p_attribute6
77       ,p_attribute7                     =>  p_attribute7
78       ,p_attribute8                     =>  p_attribute8
79       ,p_attribute9                     =>  p_attribute9
80       ,p_attribute10                    =>  p_attribute10
81       ,p_attribute11                    =>  p_attribute11
82       ,p_attribute12                    =>  p_attribute12
83       ,p_attribute13                    =>  p_attribute13
84       ,p_attribute14                    =>  p_attribute14
85       ,p_attribute15                    =>  p_attribute15
86       ,p_attribute16                    =>  p_attribute16
87       ,p_attribute17                    =>  p_attribute17
88       ,p_attribute18                    =>  p_attribute18
89       ,p_attribute19                    =>  p_attribute19
90       ,p_attribute20                    =>  p_attribute20
91       ,p_effective_date			=>  trunc(p_effective_date)
92       );
93   exception
94     when hr_api.cannot_find_prog_unit then
95       hr_api.cannot_find_prog_unit_error
96         (
97          p_module_name => 'CREATE_CAGR_GRADE_STRUCTURES'
98         ,p_hook_type   => 'BP'
99         );
100     --
101     -- End of API User Hook for the before hook of create_cagr_grade_structures
102     --
103   end;
104   --
105   per_grs_ins.ins
106     (
107      p_cagr_grade_structure_id       => l_cagr_grade_structure_id
108     ,p_collective_agreement_id       => p_collective_agreement_id
109     ,p_object_version_number         => l_object_version_number
110     ,p_id_flex_num                   => p_id_flex_num
111     ,p_dynamic_insert_allowed        => p_dynamic_insert_allowed
112     ,p_attribute_category            => p_attribute_category
113     ,p_attribute1                    => p_attribute1
114     ,p_attribute2                    => p_attribute2
115     ,p_attribute3                    => p_attribute3
116     ,p_attribute4                    => p_attribute4
117     ,p_attribute5                    => p_attribute5
118     ,p_attribute6                    => p_attribute6
119     ,p_attribute7                    => p_attribute7
120     ,p_attribute8                    => p_attribute8
121     ,p_attribute9                    => p_attribute9
122     ,p_attribute10                   => p_attribute10
123     ,p_attribute11                   => p_attribute11
124     ,p_attribute12                   => p_attribute12
125     ,p_attribute13                   => p_attribute13
126     ,p_attribute14                   => p_attribute14
127     ,p_attribute15                   => p_attribute15
128     ,p_attribute16                   => p_attribute16
129     ,p_attribute17                   => p_attribute17
130     ,p_attribute18                   => p_attribute18
131     ,p_attribute19                   => p_attribute19
132     ,p_attribute20                   => p_attribute20
133     ,p_effective_date		     =>  trunc(p_effective_date)
134     );
135   --
136   begin
137     --
138     -- Start of API User Hook for the after hook of create_cagr_grade_structures
139     --
140     hr_cagr_grade_structures_bk1.create_cagr_grade_structures_a
141       (
142        p_cagr_grade_structure_id        =>  l_cagr_grade_structure_id
143       ,p_collective_agreement_id        =>  p_collective_agreement_id
144       ,p_object_version_number          =>  l_object_version_number
145       ,p_id_flex_num                    =>  p_id_flex_num
146       ,p_dynamic_insert_allowed         =>  p_dynamic_insert_allowed
147       ,p_attribute_category             =>  p_attribute_category
148       ,p_attribute1                     =>  p_attribute1
149       ,p_attribute2                     =>  p_attribute2
150       ,p_attribute3                     =>  p_attribute3
151       ,p_attribute4                     =>  p_attribute4
152       ,p_attribute5                     =>  p_attribute5
153       ,p_attribute6                     =>  p_attribute6
154       ,p_attribute7                     =>  p_attribute7
155       ,p_attribute8                     =>  p_attribute8
156       ,p_attribute9                     =>  p_attribute9
157       ,p_attribute10                    =>  p_attribute10
158       ,p_attribute11                    =>  p_attribute11
159       ,p_attribute12                    =>  p_attribute12
160       ,p_attribute13                    =>  p_attribute13
161       ,p_attribute14                    =>  p_attribute14
162       ,p_attribute15                    =>  p_attribute15
163       ,p_attribute16                    =>  p_attribute16
164       ,p_attribute17                    =>  p_attribute17
165       ,p_attribute18                    =>  p_attribute18
166       ,p_attribute19                    =>  p_attribute19
167       ,p_attribute20                    =>  p_attribute20
168       ,p_effective_date			=>  trunc(p_effective_date)
169       );
170   exception
171     when hr_api.cannot_find_prog_unit then
172       hr_api.cannot_find_prog_unit_error
173         (p_module_name => 'CREATE_CAGR_GRADE_SRUCTURE'
174         ,p_hook_type   => 'AP'
175         );
176     --
177     -- End of API User Hook for the after hook of create_cagr_grade_structures
178     --
179   end;
180   --
181   hr_utility.set_location(l_proc, 60);
182   --
183   -- When in validation only mode raise the Validate_Enabled exception
184   --
185   if p_validate then
186     raise hr_api.validate_enabled;
187   end if;
188   --
189   -- Set all output arguments
190   --
191   p_cagr_grade_structure_id := l_cagr_grade_structure_id;
192   p_object_version_number := l_object_version_number;
193   --
194   hr_utility.set_location(' Leaving:'||l_proc, 70);
195   --
196 exception
197   --
198   when hr_api.validate_enabled then
199     --
200     -- As the Validate_Enabled exception has been raised
201     -- we must rollback to the savepoint
202     --
203     ROLLBACK TO create_cagr_grade_structures;
204     --
205     -- Only set output warning arguments
206     -- (Any key or derived arguments must be set to null
207     -- when validation only mode is being used.)
208     --
209     p_cagr_grade_structure_id := null;
210     p_object_version_number  := null;
211     hr_utility.set_location(' Leaving:'||l_proc, 80);
212     --
213   when others then
214     --
215     -- A validation or unexpected error has occured
216     --
217     ROLLBACK TO create_cagr_grade_structures;
218     --
219     -- set in out parameters and set out parameters
220     --
221      p_cagr_grade_structure_id := null;
222     p_object_version_number  := null;
223     raise;
224     --
225 end create_cagr_grade_structures;
226 -- ----------------------------------------------------------------------------
227 -- |----------------------< update_cagr_grade_structures >--------------------|
228 -- ----------------------------------------------------------------------------
229 --
230 procedure update_cagr_grade_structures
231   (p_validate                       in  boolean   default false
232   ,p_cagr_grade_structure_id        in  number
233   ,p_object_version_number          in out nocopy number
234   ,p_dynamic_insert_allowed         in  varchar2  default hr_api.g_varchar2
235   ,p_attribute_category             in  varchar2  default hr_api.g_varchar2
236   ,p_attribute1                     in  varchar2  default hr_api.g_varchar2
237   ,p_attribute2                     in  varchar2  default hr_api.g_varchar2
238   ,p_attribute3                     in  varchar2  default hr_api.g_varchar2
239   ,p_attribute4                     in  varchar2  default hr_api.g_varchar2
240   ,p_attribute5                     in  varchar2  default hr_api.g_varchar2
241   ,p_attribute6                     in  varchar2  default hr_api.g_varchar2
242   ,p_attribute7                     in  varchar2  default hr_api.g_varchar2
243   ,p_attribute8                     in  varchar2  default hr_api.g_varchar2
244   ,p_attribute9                     in  varchar2  default hr_api.g_varchar2
245   ,p_attribute10                    in  varchar2  default hr_api.g_varchar2
246   ,p_attribute11                    in  varchar2  default hr_api.g_varchar2
247   ,p_attribute12                    in  varchar2  default hr_api.g_varchar2
248   ,p_attribute13                    in  varchar2  default hr_api.g_varchar2
249   ,p_attribute14                    in  varchar2  default hr_api.g_varchar2
250   ,p_attribute15                    in  varchar2  default hr_api.g_varchar2
251   ,p_attribute16                    in  varchar2  default hr_api.g_varchar2
252   ,p_attribute17                    in  varchar2  default hr_api.g_varchar2
253   ,p_attribute18                    in  varchar2  default hr_api.g_varchar2
254   ,p_attribute19                    in  varchar2  default hr_api.g_varchar2
255   ,p_attribute20                    in  varchar2  default hr_api.g_varchar2
256   ,p_effective_date	            in  date
257   ) is
258   --
259   -- Declare cursors and local variables
260   --
261   l_proc varchar2(72) := g_package||'update_cagr_grade_structures';
262   l_object_version_number per_cagr_grade_structures.object_version_number%TYPE;
263   l_ovn per_cagr_grade_structures.object_version_number%TYPE := p_object_version_number;
264   --
265 begin
266   --
267   hr_utility.set_location('Entering:'|| l_proc, 10);
268   --
269   -- Issue a savepoint if operating in validation only mode
270   --
271   savepoint update_cagr_grade_structures;
272   --
273   hr_utility.set_location(l_proc, 20);
274   --
275   -- Process Logic
276   --
277   l_object_version_number := p_object_version_number;
278   --
279   begin
280     --
281     -- Start of API User Hook for the before hook of update_cagr_grade_structures
282     --
283     hr_cagr_grade_structures_bk2.update_cagr_grade_structures_b
284       (
285        p_cagr_grade_structure_id        =>  p_cagr_grade_structure_id
286       ,p_object_version_number          =>  p_object_version_number
287       ,p_dynamic_insert_allowed         =>  p_dynamic_insert_allowed
288       ,p_attribute_category             =>  p_attribute_category
289       ,p_attribute1                     =>  p_attribute1
290       ,p_attribute2                     =>  p_attribute2
291       ,p_attribute3                     =>  p_attribute3
292       ,p_attribute4                     =>  p_attribute4
293       ,p_attribute5                     =>  p_attribute5
294       ,p_attribute6                     =>  p_attribute6
295       ,p_attribute7                     =>  p_attribute7
296       ,p_attribute8                     =>  p_attribute8
297       ,p_attribute9                     =>  p_attribute9
298       ,p_attribute10                    =>  p_attribute10
299       ,p_attribute11                    =>  p_attribute11
300       ,p_attribute12                    =>  p_attribute12
301       ,p_attribute13                    =>  p_attribute13
302       ,p_attribute14                    =>  p_attribute14
303       ,p_attribute15                    =>  p_attribute15
304       ,p_attribute16                    =>  p_attribute16
305       ,p_attribute17                    =>  p_attribute17
306       ,p_attribute18                    =>  p_attribute18
307       ,p_attribute19                    =>  p_attribute19
308       ,p_attribute20                    =>  p_attribute20
309       ,p_effective_date			=>  trunc(p_effective_date)
310       );
311   exception
312     when hr_api.cannot_find_prog_unit then
313       hr_api.cannot_find_prog_unit_error
314         (p_module_name => 'UPDATE_CAGR_GRADE_STRUCTURES'
315         ,p_hook_type   => 'BP'
316         );
317     --
318     -- End of API User Hook for the before hook of update_cagr_grade_structures
319     --
320   end;
321   --
322   per_grs_upd.upd
323     (
324      p_cagr_grade_structure_id       => p_cagr_grade_structure_id
325     ,p_object_version_number         => l_object_version_number
326     ,p_dynamic_insert_allowed        => p_dynamic_insert_allowed
327     ,p_attribute_category            => p_attribute_category
328     ,p_attribute1                    => p_attribute1
329     ,p_attribute2                    => p_attribute2
330     ,p_attribute3                    => p_attribute3
331     ,p_attribute4                    => p_attribute4
332     ,p_attribute5                    => p_attribute5
333     ,p_attribute6                    => p_attribute6
334     ,p_attribute7                    => p_attribute7
335     ,p_attribute8                    => p_attribute8
336     ,p_attribute9                    => p_attribute9
337     ,p_attribute10                   => p_attribute10
338     ,p_attribute11                   => p_attribute11
339     ,p_attribute12                   => p_attribute12
340     ,p_attribute13                   => p_attribute13
341     ,p_attribute14                   => p_attribute14
342     ,p_attribute15                   => p_attribute15
343     ,p_attribute16                   => p_attribute16
344     ,p_attribute17                   => p_attribute17
345     ,p_attribute18                   => p_attribute18
346     ,p_attribute19                   => p_attribute19
347     ,p_attribute20                   => p_attribute20
348     ,p_effective_date		     =>  trunc(p_effective_date)
349     );
350   --
351   begin
352     --
353     -- Start of API User Hook for the after hook of update_BP_NOT_FOUND
354     --
355     hr_cagr_grade_structures_bk2.update_cagr_grade_structures_a
356       (
357        p_cagr_grade_structure_id        =>  p_cagr_grade_structure_id
358       ,p_object_version_number          =>  l_object_version_number
359       ,p_dynamic_insert_allowed         =>  p_dynamic_insert_allowed
360       ,p_attribute_category             =>  p_attribute_category
361       ,p_attribute1                     =>  p_attribute1
362       ,p_attribute2                     =>  p_attribute2
363       ,p_attribute3                     =>  p_attribute3
364       ,p_attribute4                     =>  p_attribute4
365       ,p_attribute5                     =>  p_attribute5
366       ,p_attribute6                     =>  p_attribute6
367       ,p_attribute7                     =>  p_attribute7
368       ,p_attribute8                     =>  p_attribute8
369       ,p_attribute9                     =>  p_attribute9
370       ,p_attribute10                    =>  p_attribute10
371       ,p_attribute11                    =>  p_attribute11
372       ,p_attribute12                    =>  p_attribute12
373       ,p_attribute13                    =>  p_attribute13
374       ,p_attribute14                    =>  p_attribute14
375       ,p_attribute15                    =>  p_attribute15
376       ,p_attribute16                    =>  p_attribute16
377       ,p_attribute17                    =>  p_attribute17
378       ,p_attribute18                    =>  p_attribute18
379       ,p_attribute19                    =>  p_attribute19
380       ,p_attribute20                    =>  p_attribute20
381       ,p_effective_date			=>  trunc(p_effective_date)
382       );
383   exception
384     when hr_api.cannot_find_prog_unit then
385       hr_api.cannot_find_prog_unit_error
386         (p_module_name => 'UPDATE_CAGR_GRADE_STRUCTURES'
387         ,p_hook_type   => 'AP'
388         );
389     --
390     -- End of API User Hook for the after hook of update_cagr_grade_structures
391     --
392   end;
393   --
394   hr_utility.set_location(l_proc, 60);
395   --
396   -- When in validation only mode raise the Validate_Enabled exception
397   --
398   if p_validate then
399     raise hr_api.validate_enabled;
400   end if;
401   --
402   -- Set all output arguments
403   --
404   p_object_version_number := l_object_version_number;
405   --
406   hr_utility.set_location(' Leaving:'||l_proc, 70);
407   --
408 exception
409   --
410   when hr_api.validate_enabled then
411     --
412     -- As the Validate_Enabled exception has been raised
413     -- we must rollback to the savepoint
414     --
415     ROLLBACK TO update_cagr_grade_structures;
416     --
417     -- Only set output warning arguments
418     -- (Any key or derived arguments must be set to null
419     -- when validation only mode is being used.)
420     --
421     hr_utility.set_location(' Leaving:'||l_proc, 80);
422     --
423   when others then
424     --
425     -- A validation or unexpected error has occured
426     --
427     ROLLBACK TO update_cagr_grade_structures;
428     --
429     -- set in out parameters and set out parameters
430     --
431     p_object_version_number := l_ovn;
432     raise;
433     --
434 end update_cagr_grade_structures;
435 -- ----------------------------------------------------------------------------
436 -- |--------------------< delete_cagr_grade_structures >----------------------|
437 -- ----------------------------------------------------------------------------
438 --
439 procedure delete_cagr_grade_structures
440   (p_validate                       in  boolean  default false
441   ,p_cagr_grade_structure_id        in  number
442   ,p_object_version_number          in out nocopy number
443   ,p_effective_date		    in  date
444   ) is
445   --
446   -- Declare cursors and local variables
447   --
448   l_proc varchar2(72) := g_package||'update_cagr_grade_structures';
449   l_object_version_number per_cagr_grade_structures.object_version_number%TYPE;
450   l_ovn per_cagr_grade_structures.object_version_number%TYPE := p_object_version_number;
451   --
452 begin
453   --
454   hr_utility.set_location('Entering:'|| l_proc, 10);
455   --
456   -- Issue a savepoint if operating in validation only mode
457   --
458   savepoint delete_cagr_grade_structures;
459   --
460   hr_utility.set_location(l_proc, 20);
461   --
462   -- Process Logic
463   --
464   l_object_version_number := p_object_version_number;
465   --
466   --
467   begin
468     --
469     -- Start of API User Hook for the before hook of delete_BP_NOT_FOUND
470     --
471    hr_cagr_grade_structures_bk3.delete_cagr_grade_structures_b
472       (
473        p_cagr_grade_structure_id        =>  p_cagr_grade_structure_id
474       ,p_object_version_number          =>  p_object_version_number
475       ,p_effective_date			=>  trunc(p_effective_date)
476       );
477   exception
478     when hr_api.cannot_find_prog_unit then
479       hr_api.cannot_find_prog_unit_error
480         (p_module_name => 'DELETE_CAGR_GRADES_STRUCTURES'
481         ,p_hook_type   => 'BP'
482         );
483     --
484     -- End of API User Hook for the before hook of delete_cagr_grade_structures
485     --
486   end;
487   --
488   per_grs_del.del
489     (
490      p_cagr_grade_structure_id       => p_cagr_grade_structure_id
491     ,p_object_version_number         => l_object_version_number
492     ,p_effective_date	             =>  trunc(p_effective_date)
493     );
494   --
495   begin
496     --
497     -- Start of API User Hook for the after hook of delete_cagr_grade_structures
498     --
499     hr_cagr_grade_structures_bk3.delete_cagr_grade_structures_a
500       (
501        p_cagr_grade_structure_id        =>  p_cagr_grade_structure_id
502       ,p_object_version_number          =>  l_object_version_number
503       ,p_effective_date			=>  trunc(p_effective_date)
504       );
505   exception
506     when hr_api.cannot_find_prog_unit then
507       hr_api.cannot_find_prog_unit_error
508         (p_module_name => 'DELETE_CAGR_GRADE_STRUCTURES'
509         ,p_hook_type   => 'AP'
510         );
511     --
512     -- End of API User Hook for the after hook of delete_cagr_grade_structures
513     --
514   end;
515   --
516   hr_utility.set_location(l_proc, 60);
517   --
518   -- When in validation only mode raise the Validate_Enabled exception
519   --
520   if p_validate then
521     raise hr_api.validate_enabled;
522   end if;
523   --
524   hr_utility.set_location(' Leaving:'||l_proc, 70);
525   --
526 exception
527   --
528   when hr_api.validate_enabled then
529     --
530     -- As the Validate_Enabled exception has been raised
531     -- we must rollback to the savepoint
532     --
533     ROLLBACK TO delete_cagr_grade_structures;
534     --
535     -- Only set output warning arguments
536     -- (Any key or derived arguments must be set to null
537     -- when validation only mode is being used.)
538     --
539     --
540   when others then
541     --
542     -- A validation or unexpected error has occured
543     --
544     ROLLBACK TO delete_cagr_grade_structures;
545     --
546     -- set in out parameters and set out parameters
547     --
548     p_object_version_number := l_ovn;
549     raise;
550     --
551 end delete_cagr_grade_structures;
552 --
553 -- ----------------------------------------------------------------------------
554 -- |-------------------------------< lck >------------------------------------|
555 -- ----------------------------------------------------------------------------
556 --
557 procedure lck
558   (
559    p_cagr_grade_structure_id                   in     number
560   ,p_object_version_number          in     number
561   ,p_effective_date	   in date
562   ) is
563   --
564   --
565   -- Declare cursors and local variables
566   --
567   l_proc varchar2(72) := g_package||'lck';
568   --
569 begin
570   --
571   hr_utility.set_location('Entering:'|| l_proc, 10);
572   --
573   per_grs_shd.lck
574     (
575       p_cagr_grade_structure_id    => p_cagr_grade_structure_id
576      ,p_object_version_number      => p_object_version_number
577      ,p_effective_date		   =>  trunc(p_effective_date)
578     );
579   --
580   hr_utility.set_location(' Leaving:'||l_proc, 70);
581   --
582 end lck;
583 --
584 end hr_cagr_grade_structures_api;