DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_DE_VLDOPR_SWI

Source


1 Package Body pqh_de_vldopr_swi As
2 /* $Header: pqopsswi.pkb 115.1 2002/12/03 20:41:58 rpasapul noship $ */
3 --
4 -- Package variables
5 --
6 g_package  varchar2(33) := 'pqh_de_vldopr_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |---------------------------< delete_vldtn_oprn >--------------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE delete_vldtn_oprn
12   (p_validate                     in     number    default hr_api.g_false_num
13   ,p_wrkplc_vldtn_op_id           in     number
14   ,p_object_version_number        in     number
15   ,p_return_status                   out nocopy varchar2
16   ) is
17   --
18   -- Variables for API Boolean parameters
19   l_validate                      boolean;
20   --
21   -- Variables for IN/OUT parameters
22   --
23   -- Other variables
24   l_proc    varchar2(72) := g_package ||'delete_vldtn_oprn';
25 Begin
26   hr_utility.set_location(' Entering:' || l_proc,10);
27   --
28   -- Issue a savepoint
29   --
30   savepoint delete_vldtn_oprn_swi;
31   --
32   -- Initialise Multiple Message Detection
33   --
34   hr_multi_message.enable_message_list;
35   --
36   -- Remember IN OUT parameter IN values
37   --
38   --
39   -- Convert constant values to their corresponding boolean value
40   --
41   l_validate :=
42     hr_api.constant_to_boolean
43       (p_constant_value => p_validate);
44   --
45   -- Register Surrogate ID or user key values
46   --
47   --
48   -- Call API
49   --
50   pqh_de_vldopr_api.delete_vldtn_oprn
51     (p_validate                     => l_validate
52     ,p_wrkplc_vldtn_op_id           => p_wrkplc_vldtn_op_id
53     ,p_object_version_number        => p_object_version_number
54     );
55   --
56   -- Convert API warning boolean parameter values to specific
57   -- messages and add them to Multiple Message List
58   --
59   --
60   -- Convert API non-warning boolean parameter values
61   --
62   --
63   -- Derive the API return status value based on whether
64   -- messages of any type exist in the Multiple Message List.
65   -- Also disable Multiple Message Detection.
66   --
67   p_return_status := hr_multi_message.get_return_status_disable;
68   hr_utility.set_location(' Leaving:' || l_proc,20);
69   --
70 exception
71   when hr_multi_message.error_message_exist then
72     --
73     -- Catch the Multiple Message List exception which
74     -- indicates API processing has been aborted because
75     -- at least one message exists in the list.
76     --
77     rollback to delete_vldtn_oprn_swi;
78     --
79     -- Reset IN OUT parameters and set OUT parameters
80     --
81     p_return_status := hr_multi_message.get_return_status_disable;
82     hr_utility.set_location(' Leaving:' || l_proc, 30);
83   when others then
84     --
85     -- When Multiple Message Detection is enabled catch
86     -- any Application specific or other unexpected
87     -- exceptions.  Adding appropriate details to the
88     -- Multiple Message List.  Otherwise re-raise the
89     -- error.
90     --
91     rollback to delete_vldtn_oprn_swi;
92     if hr_multi_message.unexpected_error_add(l_proc) then
93        hr_utility.set_location(' Leaving:' || l_proc,40);
94        raise;
95     end if;
96     --
97     -- Reset IN OUT and set OUT parameters
98     --
99     p_return_status := hr_multi_message.get_return_status_disable;
100     hr_utility.set_location(' Leaving:' || l_proc,50);
101 end delete_vldtn_oprn;
102 -- ----------------------------------------------------------------------------
103 -- |---------------------------< insert_vldtn_oprn >--------------------------|
104 -- ----------------------------------------------------------------------------
105 PROCEDURE insert_vldtn_oprn
106   (p_validate                     in     number    default hr_api.g_false_num
107   ,p_effective_date               in     date
108   ,p_business_group_id            in     number
109   ,p_wrkplc_vldtn_ver_id          in     number
110   ,p_wrkplc_operation_id          in     number
111   ,p_description                  in     varchar2
112   ,p_unit_percentage              in     number
113   ,p_wrkplc_vldtn_op_id              out nocopy number
114   ,p_object_version_number           out nocopy number
115   ,p_return_status                   out nocopy varchar2
116   ) is
117   --
118   -- Variables for API Boolean parameters
119   l_validate                      boolean;
120   --
121   -- Variables for IN/OUT parameters
122   --
123   -- Other variables
124   l_proc    varchar2(72) := g_package ||'insert_vldtn_oprn';
125 Begin
126   hr_utility.set_location(' Entering:' || l_proc,10);
127   --
128   -- Issue a savepoint
129   --
130   savepoint insert_vldtn_oprn_swi;
131   --
132   -- Initialise Multiple Message Detection
133   --
134   hr_multi_message.enable_message_list;
135   --
136   -- Remember IN OUT parameter IN values
137   --
138   --
139   -- Convert constant values to their corresponding boolean value
140   --
141   l_validate :=
142     hr_api.constant_to_boolean
143       (p_constant_value => p_validate);
144   --
145   -- Register Surrogate ID or user key values
146   --
147   pqh_ops_ins.set_base_key_value
148     (p_wrkplc_vldtn_op_id => p_wrkplc_vldtn_op_id
149     );
150   --
151   -- Call API
152   --
153   pqh_de_vldopr_api.insert_vldtn_oprn
154     (p_validate                     => l_validate
155     ,p_effective_date               => p_effective_date
156     ,p_business_group_id            => p_business_group_id
157     ,p_wrkplc_vldtn_ver_id          => p_wrkplc_vldtn_ver_id
158     ,p_wrkplc_operation_id          => p_wrkplc_operation_id
159     ,p_description                  => p_description
160     ,p_unit_percentage              => p_unit_percentage
161     ,p_wrkplc_vldtn_op_id           => p_wrkplc_vldtn_op_id
162     ,p_object_version_number        => p_object_version_number
163     );
164   --
165   -- Convert API warning boolean parameter values to specific
166   -- messages and add them to Multiple Message List
167   --
168   --
169   -- Convert API non-warning boolean parameter values
170   --
171   --
172   -- Derive the API return status value based on whether
173   -- messages of any type exist in the Multiple Message List.
174   -- Also disable Multiple Message Detection.
175   --
176   p_return_status := hr_multi_message.get_return_status_disable;
177   hr_utility.set_location(' Leaving:' || l_proc,20);
178   --
179 exception
180   when hr_multi_message.error_message_exist then
181     --
182     -- Catch the Multiple Message List exception which
183     -- indicates API processing has been aborted because
184     -- at least one message exists in the list.
185     --
186     rollback to insert_vldtn_oprn_swi;
187     --
188     -- Reset IN OUT parameters and set OUT parameters
189     --
190     p_wrkplc_vldtn_op_id           := null;
191     p_object_version_number        := null;
192     p_return_status := hr_multi_message.get_return_status_disable;
193     hr_utility.set_location(' Leaving:' || l_proc, 30);
194   when others then
195     --
196     -- When Multiple Message Detection is enabled catch
197     -- any Application specific or other unexpected
198     -- exceptions.  Adding appropriate details to the
199     -- Multiple Message List.  Otherwise re-raise the
200     -- error.
201     --
202     rollback to insert_vldtn_oprn_swi;
203     if hr_multi_message.unexpected_error_add(l_proc) then
204        hr_utility.set_location(' Leaving:' || l_proc,40);
205        raise;
206     end if;
207     --
208     -- Reset IN OUT and set OUT parameters
209     --
210     p_wrkplc_vldtn_op_id           := null;
211     p_object_version_number        := null;
212     p_return_status := hr_multi_message.get_return_status_disable;
213     hr_utility.set_location(' Leaving:' || l_proc,50);
214 end insert_vldtn_oprn;
215 -- ----------------------------------------------------------------------------
216 -- |---------------------------< update_vldtn_oprn >--------------------------|
217 -- ----------------------------------------------------------------------------
218 PROCEDURE update_vldtn_oprn
219   (p_validate                     in     number    default hr_api.g_false_num
220   ,p_effective_date               in     date
221   ,p_business_group_id            in     number    default hr_api.g_number
222   ,p_wrkplc_vldtn_ver_id          in     number    default hr_api.g_number
223   ,p_wrkplc_operation_id          in     number    default hr_api.g_number
224   ,p_description                  in     varchar2  default hr_api.g_varchar2
225   ,p_unit_percentage              in     number    default hr_api.g_number
226   ,p_wrkplc_vldtn_op_id           in     number
227   ,p_object_version_number        in out nocopy number
228   ,p_return_status                   out nocopy varchar2
229   ) is
230   --
231   -- Variables for API Boolean parameters
232   l_validate                      boolean;
233   --
234   -- Variables for IN/OUT parameters
235   l_object_version_number         number;
236   --
237   -- Other variables
238   l_proc    varchar2(72) := g_package ||'update_vldtn_oprn';
239 Begin
240   hr_utility.set_location(' Entering:' || l_proc,10);
241   --
242   -- Issue a savepoint
243   --
244   savepoint update_vldtn_oprn_swi;
245   --
246   -- Initialise Multiple Message Detection
247   --
248   hr_multi_message.enable_message_list;
249   --
250   -- Remember IN OUT parameter IN values
251   --
252   l_object_version_number         := p_object_version_number;
253   --
254   -- Convert constant values to their corresponding boolean value
255   --
256   l_validate :=
257     hr_api.constant_to_boolean
258       (p_constant_value => p_validate);
259   --
260   -- Register Surrogate ID or user key values
261   --
262   --
263   -- Call API
264   --
265   pqh_de_vldopr_api.update_vldtn_oprn
266     (p_validate                     => l_validate
267     ,p_effective_date               => p_effective_date
268     ,p_business_group_id            => p_business_group_id
269     ,p_wrkplc_vldtn_ver_id          => p_wrkplc_vldtn_ver_id
270     ,p_wrkplc_operation_id          => p_wrkplc_operation_id
271     ,p_description                  => p_description
272     ,p_unit_percentage              => p_unit_percentage
273     ,p_wrkplc_vldtn_op_id           => p_wrkplc_vldtn_op_id
274     ,p_object_version_number        => p_object_version_number
275     );
276   --
277   -- Convert API warning boolean parameter values to specific
278   -- messages and add them to Multiple Message List
279   --
280   --
281   -- Convert API non-warning boolean parameter values
282   --
283   --
284   -- Derive the API return status value based on whether
285   -- messages of any type exist in the Multiple Message List.
286   -- Also disable Multiple Message Detection.
287   --
288   p_return_status := hr_multi_message.get_return_status_disable;
289   hr_utility.set_location(' Leaving:' || l_proc,20);
290   --
291 exception
292   when hr_multi_message.error_message_exist then
293     --
294     -- Catch the Multiple Message List exception which
295     -- indicates API processing has been aborted because
296     -- at least one message exists in the list.
297     --
298     rollback to update_vldtn_oprn_swi;
299     --
300     -- Reset IN OUT parameters and set OUT parameters
301     --
302     p_object_version_number        := l_object_version_number;
303     p_return_status := hr_multi_message.get_return_status_disable;
304     hr_utility.set_location(' Leaving:' || l_proc, 30);
305   when others then
306     --
307     -- When Multiple Message Detection is enabled catch
308     -- any Application specific or other unexpected
309     -- exceptions.  Adding appropriate details to the
310     -- Multiple Message List.  Otherwise re-raise the
311     -- error.
312     --
313     rollback to update_vldtn_oprn_swi;
314     if hr_multi_message.unexpected_error_add(l_proc) then
315        hr_utility.set_location(' Leaving:' || l_proc,40);
316        raise;
317     end if;
318     --
319     -- Reset IN OUT and set OUT parameters
320     --
321     p_object_version_number        := l_object_version_number;
322     p_return_status := hr_multi_message.get_return_status_disable;
323     hr_utility.set_location(' Leaving:' || l_proc,50);
324 end update_vldtn_oprn;
325 end pqh_de_vldopr_swi;