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