DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_POSITION_STRUCTURE_SWI

Source


1 Package Body per_position_structure_swi As
2 /* $Header: pepstswi.pkb 115.2 2002/12/04 17:14:38 eumenyio noship $ */
3 --
4 -- Package variables
5 --
6 g_package  varchar2(33) := 'per_position_structure_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-----------------------< create_position_structure >----------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_position_structure
12   (p_validate                     in     number    default hr_api.g_false_num
13   ,p_effective_date               in     date
14   ,p_name                         in     varchar2
15   ,p_business_group_id            in     number    default null
16   ,p_comments                     in     varchar2  default null
17   ,p_primary_position_flag        in     varchar2  default null
18   ,p_request_id                   in     number    default null
19   ,p_program_application_id       in     number    default null
20   ,p_program_id                   in     number    default null
21   ,p_program_update_date          in     date      default null
22   ,p_attribute_category           in     varchar2  default null
23   ,p_attribute1                   in     varchar2  default null
24   ,p_attribute2                   in     varchar2  default null
25   ,p_attribute3                   in     varchar2  default null
26   ,p_attribute4                   in     varchar2  default null
27   ,p_attribute5                   in     varchar2  default null
28   ,p_attribute6                   in     varchar2  default null
29   ,p_attribute7                   in     varchar2  default null
30   ,p_attribute8                   in     varchar2  default null
31   ,p_attribute9                   in     varchar2  default null
32   ,p_attribute10                  in     varchar2  default null
33   ,p_attribute11                  in     varchar2  default null
34   ,p_attribute12                  in     varchar2  default null
35   ,p_attribute13                  in     varchar2  default null
36   ,p_attribute14                  in     varchar2  default null
37   ,p_attribute15                  in     varchar2  default null
38   ,p_attribute16                  in     varchar2  default null
39   ,p_attribute17                  in     varchar2  default null
40   ,p_attribute18                  in     varchar2  default null
41   ,p_attribute19                  in     varchar2  default null
42   ,p_attribute20                  in     varchar2  default null
43   ,p_position_structure_id           out nocopy number
44   ,p_object_version_number           out nocopy number
45   ,p_return_status                   out nocopy varchar2
46   ) is
47   --
48   -- Variables for API Boolean parameters
49   l_validate                      boolean;
50   --
51   -- Variables for IN/OUT parameters
52   --
53   -- Other variables
54   l_proc    varchar2(72) := g_package ||'create_position_structure';
55 Begin
56   hr_utility.set_location(' Entering:' || l_proc,10);
57   --
58   -- Issue a savepoint
59   --
60   savepoint create_position_structure_swi;
61   --
62   -- Initialise Multiple Message Detection
63   --
64   hr_multi_message.enable_message_list;
65   --
66   -- Remember IN OUT parameter IN values
67   --
68   --
69   -- Convert constant values to their corresponding boolean value
70   --
71   l_validate :=
72     hr_api.constant_to_boolean
73       (p_constant_value => p_validate);
74   --
75   -- Register Surrogate ID or user key values
76   --
77   --
78   -- Call API
79   --
80   per_position_structure_api.create_position_structure
81     (p_validate                     => l_validate
82     ,p_effective_date               => p_effective_date
83     ,p_name                         => p_name
84     ,p_business_group_id            => p_business_group_id
85     ,p_comments                     => p_comments
86     ,p_primary_position_flag        => p_primary_position_flag
87     ,p_request_id                   => p_request_id
88     ,p_program_application_id       => p_program_application_id
89     ,p_program_id                   => p_program_id
90     ,p_program_update_date          => p_program_update_date
91     ,p_attribute_category           => p_attribute_category
92     ,p_attribute1                   => p_attribute1
93     ,p_attribute2                   => p_attribute2
94     ,p_attribute3                   => p_attribute3
95     ,p_attribute4                   => p_attribute4
96     ,p_attribute5                   => p_attribute5
97     ,p_attribute6                   => p_attribute6
98     ,p_attribute7                   => p_attribute7
99     ,p_attribute8                   => p_attribute8
100     ,p_attribute9                   => p_attribute9
101     ,p_attribute10                  => p_attribute10
102     ,p_attribute11                  => p_attribute11
103     ,p_attribute12                  => p_attribute12
104     ,p_attribute13                  => p_attribute13
105     ,p_attribute14                  => p_attribute14
106     ,p_attribute15                  => p_attribute15
107     ,p_attribute16                  => p_attribute16
108     ,p_attribute17                  => p_attribute17
109     ,p_attribute18                  => p_attribute18
110     ,p_attribute19                  => p_attribute19
111     ,p_attribute20                  => p_attribute20
112     ,p_position_structure_id        => p_position_structure_id
113     ,p_object_version_number        => p_object_version_number
114     );
115   --
116   -- Convert API warning boolean parameter values to specific
117   -- messages and add them to Multiple Message List
118   --
119   --
120   -- Convert API non-warning boolean parameter values
121   --
122   --
123   -- Derive the API return status value based on whether
124   -- messages of any type exist in the Multiple Message List.
125   -- Also disable Multiple Message Detection.
126   --
127   p_return_status := hr_multi_message.get_return_status_disable;
128   hr_utility.set_location(' Leaving:' || l_proc,20);
129   --
130 exception
131   when hr_multi_message.error_message_exist then
132     --
133     -- Catch the Multiple Message List exception which
134     -- indicates API processing has been aborted because
135     -- at least one message exists in the list.
136     --
137     rollback to create_position_structure_swi;
138     --
139     -- Reset IN OUT parameters and set OUT parameters
140     --
141     p_position_structure_id        := null;
142     p_object_version_number        := null;
143     p_return_status := hr_multi_message.get_return_status_disable;
144     hr_utility.set_location(' Leaving:' || l_proc, 30);
145   when others then
146     --
147     -- When Multiple Message Detection is enabled catch
148     -- any Application specific or other unexpected
149     -- exceptions.  Adding appropriate details to the
150     -- Multiple Message List.  Otherwise re-raise the
151     -- error.
152     --
153     rollback to create_position_structure_swi;
154     if hr_multi_message.unexpected_error_add(l_proc) then
155        hr_utility.set_location(' Leaving:' || l_proc,40);
156        raise;
157     end if;
158     --
159     -- Reset IN OUT and set OUT parameters
160     --
161     p_position_structure_id        := null;
162     p_object_version_number        := null;
163     p_return_status := hr_multi_message.get_return_status_disable;
164     hr_utility.set_location(' Leaving:' || l_proc,50);
165 end create_position_structure;
166 -- ----------------------------------------------------------------------------
167 -- |---------------------< create_pos_struct_and_def_ver >--------------------|
168 -- ----------------------------------------------------------------------------
169 PROCEDURE create_pos_struct_and_def_ver
170   (p_validate                     in     number    default hr_api.g_false_num
171   ,p_effective_date               in     date
172   ,p_name                         in     varchar2
173   ,p_business_group_id            in     number
174   ,p_comments                     in     varchar2  default null
175   ,p_primary_position_flag        in     varchar2  default null
176   ,p_request_id                   in     number    default null
177   ,p_program_application_id       in     number    default null
178   ,p_program_id                   in     number    default null
179   ,p_program_update_date          in     date      default null
180   ,p_attribute_category           in     varchar2  default null
181   ,p_attribute1                   in     varchar2  default null
182   ,p_attribute2                   in     varchar2  default null
183   ,p_attribute3                   in     varchar2  default null
184   ,p_attribute4                   in     varchar2  default null
185   ,p_attribute5                   in     varchar2  default null
186   ,p_attribute6                   in     varchar2  default null
187   ,p_attribute7                   in     varchar2  default null
188   ,p_attribute8                   in     varchar2  default null
189   ,p_attribute9                   in     varchar2  default null
190   ,p_attribute10                  in     varchar2  default null
191   ,p_attribute11                  in     varchar2  default null
192   ,p_attribute12                  in     varchar2  default null
193   ,p_attribute13                  in     varchar2  default null
194   ,p_attribute14                  in     varchar2  default null
195   ,p_attribute15                  in     varchar2  default null
196   ,p_attribute16                  in     varchar2  default null
197   ,p_attribute17                  in     varchar2  default null
198   ,p_attribute18                  in     varchar2  default null
199   ,p_attribute19                  in     varchar2  default null
200   ,p_attribute20                  in     varchar2  default null
201   ,p_position_structure_id           out nocopy number
202   ,p_object_version_number           out nocopy number
203   ,p_return_status                   out nocopy varchar2
204   ) is
205   --
206   -- Variables for API Boolean parameters
207   l_validate                      boolean;
208   --
209   -- Variables for IN/OUT parameters
210   --
211   -- Other variables
212   l_proc    varchar2(72) := g_package ||'create_pos_struct_and_def_ver';
213 Begin
214   hr_utility.set_location(' Entering:' || l_proc,10);
215   --
216   -- Issue a savepoint
217   --
218   savepoint create_pos_struct_def_ver_swi;
219   --
220   -- Initialise Multiple Message Detection
221   --
222   hr_multi_message.enable_message_list;
223   --
224   -- Remember IN OUT parameter IN values
225   --
226   --
227   -- Convert constant values to their corresponding boolean value
228   --
229   l_validate :=
230     hr_api.constant_to_boolean
231       (p_constant_value => p_validate);
232   --
233   -- Register Surrogate ID or user key values
234   --
235   --
236   -- Call API
237   --
238   per_position_structure_api.create_pos_struct_and_def_ver
239     (p_validate                     => l_validate
240     ,p_effective_date               => p_effective_date
241     ,p_name                         => p_name
242     ,p_business_group_id            => p_business_group_id
243     ,p_comments                     => p_comments
244     ,p_primary_position_flag        => p_primary_position_flag
245     ,p_request_id                   => p_request_id
246     ,p_program_application_id       => p_program_application_id
247     ,p_program_id                   => p_program_id
248     ,p_program_update_date          => p_program_update_date
249     ,p_attribute_category           => p_attribute_category
250     ,p_attribute1                   => p_attribute1
251     ,p_attribute2                   => p_attribute2
252     ,p_attribute3                   => p_attribute3
253     ,p_attribute4                   => p_attribute4
254     ,p_attribute5                   => p_attribute5
255     ,p_attribute6                   => p_attribute6
256     ,p_attribute7                   => p_attribute7
257     ,p_attribute8                   => p_attribute8
258     ,p_attribute9                   => p_attribute9
259     ,p_attribute10                  => p_attribute10
260     ,p_attribute11                  => p_attribute11
261     ,p_attribute12                  => p_attribute12
262     ,p_attribute13                  => p_attribute13
263     ,p_attribute14                  => p_attribute14
264     ,p_attribute15                  => p_attribute15
265     ,p_attribute16                  => p_attribute16
266     ,p_attribute17                  => p_attribute17
267     ,p_attribute18                  => p_attribute18
268     ,p_attribute19                  => p_attribute19
269     ,p_attribute20                  => p_attribute20
270     ,p_position_structure_id        => p_position_structure_id
271     ,p_object_version_number        => p_object_version_number
272     );
273   --
274   -- Convert API warning boolean parameter values to specific
275   -- messages and add them to Multiple Message List
276   --
277   --
278   -- Convert API non-warning boolean parameter values
279   --
280   --
281   -- Derive the API return status value based on whether
282   -- messages of any type exist in the Multiple Message List.
283   -- Also disable Multiple Message Detection.
284   --
285   p_return_status := hr_multi_message.get_return_status_disable;
286   hr_utility.set_location(' Leaving:' || l_proc,20);
287   --
288 exception
289   when hr_multi_message.error_message_exist then
290     --
291     -- Catch the Multiple Message List exception which
292     -- indicates API processing has been aborted because
293     -- at least one message exists in the list.
294     --
295     rollback to create_pos_struct_def_ver_swi;
296     --
297     -- Reset IN OUT parameters and set OUT parameters
298     --
299     p_position_structure_id        := null;
300     p_object_version_number        := null;
301     p_return_status := hr_multi_message.get_return_status_disable;
302     hr_utility.set_location(' Leaving:' || l_proc, 30);
303   when others then
304     --
305     -- When Multiple Message Detection is enabled catch
306     -- any Application specific or other unexpected
307     -- exceptions.  Adding appropriate details to the
308     -- Multiple Message List.  Otherwise re-raise the
309     -- error.
310     --
311     rollback to create_pos_struct_def_ver_swi;
312     if hr_multi_message.unexpected_error_add(l_proc) then
313        hr_utility.set_location(' Leaving:' || l_proc,40);
314        raise;
315     end if;
316     --
317     -- Reset IN OUT and set OUT parameters
318     --
319     p_position_structure_id        := null;
320     p_object_version_number        := null;
321     p_return_status := hr_multi_message.get_return_status_disable;
322     hr_utility.set_location(' Leaving:' || l_proc,50);
323 end create_pos_struct_and_def_ver;
324 -- ----------------------------------------------------------------------------
325 -- |-----------------------< delete_position_structure >----------------------|
326 -- ----------------------------------------------------------------------------
327 PROCEDURE delete_position_structure
328   (p_validate                     in     number    default hr_api.g_false_num
329   ,p_position_structure_id        in     number
330   ,p_object_version_number        in     number
331   ,p_return_status                   out nocopy varchar2
332   ) is
333   --
334   -- Variables for API Boolean parameters
335   l_validate                      boolean;
336   --
337   -- Variables for IN/OUT parameters
338   --
339   -- Other variables
340   l_proc    varchar2(72) := g_package ||'delete_position_structure';
341 Begin
342   hr_utility.set_location(' Entering:' || l_proc,10);
343   --
344   -- Issue a savepoint
345   --
346   savepoint delete_position_structure_swi;
347   --
348   -- Initialise Multiple Message Detection
349   --
350   hr_multi_message.enable_message_list;
351   --
352   -- Remember IN OUT parameter IN values
353   --
354   --
355   -- Convert constant values to their corresponding boolean value
356   --
357   l_validate :=
358     hr_api.constant_to_boolean
359       (p_constant_value => p_validate);
360   --
361   -- Register Surrogate ID or user key values
362   --
363   --
364   -- Call API
365   --
366   per_position_structure_api.delete_position_structure
367     (p_validate                     => l_validate
368     ,p_position_structure_id        => p_position_structure_id
369     ,p_object_version_number        => p_object_version_number
370     );
371   --
372   -- Convert API warning boolean parameter values to specific
373   -- messages and add them to Multiple Message List
374   --
375   --
376   -- Convert API non-warning boolean parameter values
377   --
378   --
379   -- Derive the API return status value based on whether
380   -- messages of any type exist in the Multiple Message List.
381   -- Also disable Multiple Message Detection.
382   --
383   p_return_status := hr_multi_message.get_return_status_disable;
384   hr_utility.set_location(' Leaving:' || l_proc,20);
385   --
386 exception
387   when hr_multi_message.error_message_exist then
388     --
389     -- Catch the Multiple Message List exception which
390     -- indicates API processing has been aborted because
391     -- at least one message exists in the list.
392     --
393     rollback to delete_position_structure_swi;
394     --
395     -- Reset IN OUT parameters and set OUT parameters
396     --
397     p_return_status := hr_multi_message.get_return_status_disable;
398     hr_utility.set_location(' Leaving:' || l_proc, 30);
399   when others then
400     --
401     -- When Multiple Message Detection is enabled catch
402     -- any Application specific or other unexpected
403     -- exceptions.  Adding appropriate details to the
404     -- Multiple Message List.  Otherwise re-raise the
405     -- error.
406     --
407     rollback to delete_position_structure_swi;
408     if hr_multi_message.unexpected_error_add(l_proc) then
409        hr_utility.set_location(' Leaving:' || l_proc,40);
410        raise;
411     end if;
412     --
413     -- Reset IN OUT and set OUT parameters
414     --
415     p_return_status := hr_multi_message.get_return_status_disable;
416     hr_utility.set_location(' Leaving:' || l_proc,50);
417 end delete_position_structure;
418 -- ----------------------------------------------------------------------------
419 -- |-----------------------< update_position_structure >----------------------|
420 -- ----------------------------------------------------------------------------
421 PROCEDURE update_position_structure
422   (p_validate                     in     number    default hr_api.g_false_num
423   ,p_effective_date               in     date
424   ,p_position_structure_id        in     number
425   ,p_name                         in     varchar2  default hr_api.g_varchar2
426   ,p_comments                     in     varchar2  default hr_api.g_varchar2
427   ,p_primary_position_flag        in     varchar2  default hr_api.g_varchar2
428   ,p_request_id                   in     number    default hr_api.g_number
429   ,p_program_application_id       in     number    default hr_api.g_number
430   ,p_program_id                   in     number    default hr_api.g_number
431   ,p_program_update_date          in     date      default hr_api.g_date
432   ,p_attribute_category           in     varchar2  default hr_api.g_varchar2
433   ,p_attribute1                   in     varchar2  default hr_api.g_varchar2
434   ,p_attribute2                   in     varchar2  default hr_api.g_varchar2
435   ,p_attribute3                   in     varchar2  default hr_api.g_varchar2
436   ,p_attribute4                   in     varchar2  default hr_api.g_varchar2
437   ,p_attribute5                   in     varchar2  default hr_api.g_varchar2
438   ,p_attribute6                   in     varchar2  default hr_api.g_varchar2
439   ,p_attribute7                   in     varchar2  default hr_api.g_varchar2
440   ,p_attribute8                   in     varchar2  default hr_api.g_varchar2
441   ,p_attribute9                   in     varchar2  default hr_api.g_varchar2
442   ,p_attribute10                  in     varchar2  default hr_api.g_varchar2
443   ,p_attribute11                  in     varchar2  default hr_api.g_varchar2
444   ,p_attribute12                  in     varchar2  default hr_api.g_varchar2
445   ,p_attribute13                  in     varchar2  default hr_api.g_varchar2
446   ,p_attribute14                  in     varchar2  default hr_api.g_varchar2
447   ,p_attribute15                  in     varchar2  default hr_api.g_varchar2
448   ,p_attribute16                  in     varchar2  default hr_api.g_varchar2
449   ,p_attribute17                  in     varchar2  default hr_api.g_varchar2
450   ,p_attribute18                  in     varchar2  default hr_api.g_varchar2
451   ,p_attribute19                  in     varchar2  default hr_api.g_varchar2
452   ,p_attribute20                  in     varchar2  default hr_api.g_varchar2
453   ,p_object_version_number        in out nocopy number
454   ,p_return_status                   out nocopy varchar2
455   ) is
456   --
457   -- Variables for API Boolean parameters
458   l_validate                      boolean;
459   --
460   -- Variables for IN/OUT parameters
461   l_object_version_number         number;
462   --
463   -- Other variables
464   l_proc    varchar2(72) := g_package ||'update_position_structure';
465 Begin
466   hr_utility.set_location(' Entering:' || l_proc,10);
467   --
468   -- Issue a savepoint
469   --
470   savepoint update_position_structure_swi;
471   --
472   -- Initialise Multiple Message Detection
473   --
474   hr_multi_message.enable_message_list;
475   --
476   -- Remember IN OUT parameter IN values
477   --
478   l_object_version_number         := p_object_version_number;
479   --
480   -- Convert constant values to their corresponding boolean value
481   --
482   l_validate :=
483     hr_api.constant_to_boolean
484       (p_constant_value => p_validate);
485   --
486   -- Register Surrogate ID or user key values
487   --
488   --
489   -- Call API
490   --
491   per_position_structure_api.update_position_structure
492     (p_validate                     => l_validate
493     ,p_effective_date               => p_effective_date
494     ,p_position_structure_id        => p_position_structure_id
495     ,p_name                         => p_name
496     ,p_comments                     => p_comments
497     ,p_primary_position_flag        => p_primary_position_flag
498     ,p_request_id                   => p_request_id
499     ,p_program_application_id       => p_program_application_id
500     ,p_program_id                   => p_program_id
501     ,p_program_update_date          => p_program_update_date
502     ,p_attribute_category           => p_attribute_category
503     ,p_attribute1                   => p_attribute1
504     ,p_attribute2                   => p_attribute2
505     ,p_attribute3                   => p_attribute3
506     ,p_attribute4                   => p_attribute4
507     ,p_attribute5                   => p_attribute5
508     ,p_attribute6                   => p_attribute6
509     ,p_attribute7                   => p_attribute7
510     ,p_attribute8                   => p_attribute8
511     ,p_attribute9                   => p_attribute9
512     ,p_attribute10                  => p_attribute10
513     ,p_attribute11                  => p_attribute11
514     ,p_attribute12                  => p_attribute12
515     ,p_attribute13                  => p_attribute13
516     ,p_attribute14                  => p_attribute14
517     ,p_attribute15                  => p_attribute15
518     ,p_attribute16                  => p_attribute16
519     ,p_attribute17                  => p_attribute17
520     ,p_attribute18                  => p_attribute18
521     ,p_attribute19                  => p_attribute19
522     ,p_attribute20                  => p_attribute20
523     ,p_object_version_number        => p_object_version_number
524     );
525   --
526   -- Convert API warning boolean parameter values to specific
527   -- messages and add them to Multiple Message List
528   --
529   --
530   -- Convert API non-warning boolean parameter values
531   --
532   --
533   -- Derive the API return status value based on whether
534   -- messages of any type exist in the Multiple Message List.
535   -- Also disable Multiple Message Detection.
536   --
537   p_return_status := hr_multi_message.get_return_status_disable;
538   hr_utility.set_location(' Leaving:' || l_proc,20);
539   --
540 exception
541   when hr_multi_message.error_message_exist then
542     --
543     -- Catch the Multiple Message List exception which
544     -- indicates API processing has been aborted because
545     -- at least one message exists in the list.
546     --
547     rollback to update_position_structure_swi;
548     --
549     -- Reset IN OUT parameters and set OUT parameters
550     --
551     p_object_version_number        := l_object_version_number;
552     p_return_status := hr_multi_message.get_return_status_disable;
553     hr_utility.set_location(' Leaving:' || l_proc, 30);
554   when others then
555     --
556     -- When Multiple Message Detection is enabled catch
557     -- any Application specific or other unexpected
558     -- exceptions.  Adding appropriate details to the
559     -- Multiple Message List.  Otherwise re-raise the
560     -- error.
561     --
562     rollback to update_position_structure_swi;
563     if hr_multi_message.unexpected_error_add(l_proc) then
564        hr_utility.set_location(' Leaving:' || l_proc,40);
565        raise;
566     end if;
567     --
568     -- Reset IN OUT and set OUT parameters
569     --
570     p_object_version_number        := l_object_version_number;
571     p_return_status := hr_multi_message.get_return_status_disable;
572     hr_utility.set_location(' Leaving:' || l_proc,50);
573 end update_position_structure;
574 end per_position_structure_swi;