[Home] [Help]
PACKAGE BODY: APPS.PAY_COST_ALLOCATION_SWI
Source
1 Package Body pay_cost_allocation_swi As
2 /* $Header: pycalswi.pkb 120.0 2008/02/21 05:40:05 pkagrawa noship $ */
3 --
4 -- Package variables
5 --
6 g_package varchar2(33) := 'pay_cost_allocation_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_cost_allocation >------------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_cost_allocation
12 (p_validate in number default hr_api.g_false_num
13 ,p_effective_date in date
14 ,p_assignment_id in number
15 ,p_proportion in number
16 ,p_business_group_id in number
17 ,p_segment1 in varchar2 default null
18 ,p_segment2 in varchar2 default null
19 ,p_segment3 in varchar2 default null
20 ,p_segment4 in varchar2 default null
21 ,p_segment5 in varchar2 default null
22 ,p_segment6 in varchar2 default null
23 ,p_segment7 in varchar2 default null
24 ,p_segment8 in varchar2 default null
25 ,p_segment9 in varchar2 default null
26 ,p_segment10 in varchar2 default null
27 ,p_segment11 in varchar2 default null
28 ,p_segment12 in varchar2 default null
29 ,p_segment13 in varchar2 default null
30 ,p_segment14 in varchar2 default null
31 ,p_segment15 in varchar2 default null
32 ,p_segment16 in varchar2 default null
33 ,p_segment17 in varchar2 default null
34 ,p_segment18 in varchar2 default null
35 ,p_segment19 in varchar2 default null
36 ,p_segment20 in varchar2 default null
37 ,p_segment21 in varchar2 default null
38 ,p_segment22 in varchar2 default null
39 ,p_segment23 in varchar2 default null
40 ,p_segment24 in varchar2 default null
41 ,p_segment25 in varchar2 default null
42 ,p_segment26 in varchar2 default null
43 ,p_segment27 in varchar2 default null
44 ,p_segment28 in varchar2 default null
45 ,p_segment29 in varchar2 default null
46 ,p_segment30 in varchar2 default null
47 ,p_concat_segments in varchar2 default null
48 ,p_request_id in number default null
49 ,p_program_application_id in number default null
50 ,p_program_id in number default null
51 ,p_program_update_date in date default null
52 ,p_combination_name out nocopy varchar2
53 ,p_cost_allocation_id in number
54 ,p_effective_start_date out nocopy date
55 ,p_effective_end_date out nocopy date
56 ,p_cost_allocation_keyflex_id in out nocopy number
57 ,p_object_version_number out nocopy number
58 ,p_return_status out nocopy varchar2
59 ) is
60 --
61 -- Variables for API Boolean parameters
62 l_validate boolean;
63 --
64 -- Variables for IN/OUT parameters
65 l_cost_allocation_keyflex_id number;
66 --
67 -- Other variables
68 l_cost_allocation_id number;
69 l_proc varchar2(72) := g_package ||'create_cost_allocation';
70 Begin
71 hr_utility.set_location(' Entering:' || l_proc,10);
72 --
73 -- Issue a savepoint
74 --
75 savepoint create_cost_allocation_swi;
76 --
77 -- Initialise Multiple Message Detection
78 --
79 hr_multi_message.enable_message_list;
80 --
81 -- Remember IN OUT parameter IN values
82 --
83 l_cost_allocation_keyflex_id := p_cost_allocation_keyflex_id;
84 --
85 -- Convert constant values to their corresponding boolean value
86 --
87 l_validate :=
88 hr_api.constant_to_boolean
89 (p_constant_value => p_validate);
90 --
91 -- Register Surrogate ID or user key values
92 --
93 pay_cal_ins.set_base_key_value
94 (p_cost_allocation_id => p_cost_allocation_id
95 );
96 --
97 -- Call API
98 --
99 pay_cost_allocation_api.create_cost_allocation
100 (p_validate => l_validate
101 ,p_effective_date => p_effective_date
102 ,p_assignment_id => p_assignment_id
103 ,p_proportion => p_proportion
104 ,p_business_group_id => p_business_group_id
105 ,p_segment1 => p_segment1
106 ,p_segment2 => p_segment2
107 ,p_segment3 => p_segment3
108 ,p_segment4 => p_segment4
109 ,p_segment5 => p_segment5
110 ,p_segment6 => p_segment6
111 ,p_segment7 => p_segment7
112 ,p_segment8 => p_segment8
113 ,p_segment9 => p_segment9
114 ,p_segment10 => p_segment10
115 ,p_segment11 => p_segment11
116 ,p_segment12 => p_segment12
117 ,p_segment13 => p_segment13
118 ,p_segment14 => p_segment14
119 ,p_segment15 => p_segment15
120 ,p_segment16 => p_segment16
121 ,p_segment17 => p_segment17
122 ,p_segment18 => p_segment18
123 ,p_segment19 => p_segment19
124 ,p_segment20 => p_segment20
125 ,p_segment21 => p_segment21
126 ,p_segment22 => p_segment22
127 ,p_segment23 => p_segment23
128 ,p_segment24 => p_segment24
129 ,p_segment25 => p_segment25
130 ,p_segment26 => p_segment26
131 ,p_segment27 => p_segment27
132 ,p_segment28 => p_segment28
133 ,p_segment29 => p_segment29
134 ,p_segment30 => p_segment30
135 ,p_concat_segments => p_concat_segments
136 ,p_request_id => p_request_id
137 ,p_program_application_id => p_program_application_id
138 ,p_program_id => p_program_id
139 ,p_program_update_date => p_program_update_date
140 ,p_combination_name => p_combination_name
141 ,p_cost_allocation_id => l_cost_allocation_id
142 ,p_effective_start_date => p_effective_start_date
143 ,p_effective_end_date => p_effective_end_date
144 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
145 ,p_object_version_number => p_object_version_number
146 );
147 --
148 -- Convert API warning boolean parameter values to specific
149 -- messages and add them to Multiple Message List
150 --
151 --
152 -- Convert API non-warning boolean parameter values
153 --
154 --
155 -- Derive the API return status value based on whether
156 -- messages of any type exist in the Multiple Message List.
157 -- Also disable Multiple Message Detection.
158 --
159 p_return_status := hr_multi_message.get_return_status_disable;
160 hr_utility.set_location(' Leaving:' || l_proc,20);
161 --
162 exception
163 when hr_multi_message.error_message_exist then
164 --
165 -- Catch the Multiple Message List exception which
166 -- indicates API processing has been aborted because
167 -- at least one message exists in the list.
168 --
169 rollback to create_cost_allocation_swi;
170 --
171 -- Reset IN OUT parameters and set OUT parameters
172 --
173 p_combination_name := null;
174 p_effective_start_date := null;
175 p_effective_end_date := null;
176 p_cost_allocation_keyflex_id := l_cost_allocation_keyflex_id;
177 p_object_version_number := null;
178 p_return_status := hr_multi_message.get_return_status_disable;
179 hr_utility.set_location(' Leaving:' || l_proc, 30);
180 when others then
181 --
182 -- When Multiple Message Detection is enabled catch
183 -- any Application specific or other unexpected
184 -- exceptions. Adding appropriate details to the
185 -- Multiple Message List. Otherwise re-raise the
186 -- error.
187 --
188 rollback to create_cost_allocation_swi;
189 if hr_multi_message.unexpected_error_add(l_proc) then
190 hr_utility.set_location(' Leaving:' || l_proc,40);
191 raise;
192 end if;
193 --
194 -- Reset IN OUT and set OUT parameters
195 --
196 p_combination_name := null;
197 p_effective_start_date := null;
198 p_effective_end_date := null;
199 p_cost_allocation_keyflex_id := l_cost_allocation_keyflex_id;
200 p_object_version_number := null;
201 p_return_status := hr_multi_message.get_return_status_disable;
202 hr_utility.set_location(' Leaving:' || l_proc,50);
203 end create_cost_allocation;
204 -- ----------------------------------------------------------------------------
205 -- |------------------------< delete_cost_allocation >------------------------|
206 -- ----------------------------------------------------------------------------
207 PROCEDURE delete_cost_allocation
208 (p_validate in number default hr_api.g_false_num
209 ,p_effective_date in date
210 ,p_datetrack_delete_mode in varchar2
211 ,p_cost_allocation_id in number
212 ,p_object_version_number in out nocopy number
213 ,p_effective_start_date out nocopy date
214 ,p_effective_end_date out nocopy date
215 ,p_return_status out nocopy varchar2
216 ) is
217 --
218 -- Variables for API Boolean parameters
219 l_validate boolean;
220 --
221 -- Variables for IN/OUT parameters
222 l_object_version_number number;
223 --
224 -- Other variables
225 l_proc varchar2(72) := g_package ||'delete_cost_allocation';
226 Begin
227 hr_utility.set_location(' Entering:' || l_proc,10);
228 --
229 -- Issue a savepoint
230 --
231 savepoint delete_cost_allocation_swi;
232 --
233 -- Initialise Multiple Message Detection
234 --
235 hr_multi_message.enable_message_list;
236 --
237 -- Remember IN OUT parameter IN values
238 --
239 l_object_version_number := p_object_version_number;
240 --
241 -- Convert constant values to their corresponding boolean value
242 --
243 l_validate :=
244 hr_api.constant_to_boolean
245 (p_constant_value => p_validate);
246 --
247 -- Register Surrogate ID or user key values
248 --
249 --
250 -- Call API
251 --
252 pay_cost_allocation_api.delete_cost_allocation
253 (p_validate => l_validate
254 ,p_effective_date => p_effective_date
255 ,p_datetrack_delete_mode => p_datetrack_delete_mode
256 ,p_cost_allocation_id => p_cost_allocation_id
257 ,p_object_version_number => p_object_version_number
258 ,p_effective_start_date => p_effective_start_date
259 ,p_effective_end_date => p_effective_end_date
260 );
261 --
262 -- Convert API warning boolean parameter values to specific
263 -- messages and add them to Multiple Message List
264 --
265 --
266 -- Convert API non-warning boolean parameter values
267 --
268 --
269 -- Derive the API return status value based on whether
270 -- messages of any type exist in the Multiple Message List.
271 -- Also disable Multiple Message Detection.
272 --
273 p_return_status := hr_multi_message.get_return_status_disable;
274 hr_utility.set_location(' Leaving:' || l_proc,20);
275 --
276 exception
277 when hr_multi_message.error_message_exist then
278 --
279 -- Catch the Multiple Message List exception which
280 -- indicates API processing has been aborted because
281 -- at least one message exists in the list.
282 --
283 rollback to delete_cost_allocation_swi;
284 --
285 -- Reset IN OUT parameters and set OUT parameters
286 --
287 p_object_version_number := l_object_version_number;
288 p_effective_start_date := null;
289 p_effective_end_date := null;
290 p_return_status := hr_multi_message.get_return_status_disable;
291 hr_utility.set_location(' Leaving:' || l_proc, 30);
292 when others then
293 --
294 -- When Multiple Message Detection is enabled catch
295 -- any Application specific or other unexpected
296 -- exceptions. Adding appropriate details to the
297 -- Multiple Message List. Otherwise re-raise the
298 -- error.
299 --
300 rollback to delete_cost_allocation_swi;
301 if hr_multi_message.unexpected_error_add(l_proc) then
302 hr_utility.set_location(' Leaving:' || l_proc,40);
303 raise;
304 end if;
305 --
306 -- Reset IN OUT and set OUT parameters
307 --
308 p_object_version_number := l_object_version_number;
309 p_effective_start_date := null;
310 p_effective_end_date := null;
311 p_return_status := hr_multi_message.get_return_status_disable;
312 hr_utility.set_location(' Leaving:' || l_proc,50);
313 end delete_cost_allocation;
314 -- ----------------------------------------------------------------------------
315 -- |------------------------< update_cost_allocation >------------------------|
316 -- ----------------------------------------------------------------------------
317 PROCEDURE update_cost_allocation
318 (p_validate in number default hr_api.g_false_num
319 ,p_effective_date in date
320 ,p_datetrack_update_mode in varchar2
321 ,p_cost_allocation_id in number
322 ,p_object_version_number in out nocopy number
323 ,p_proportion in number default hr_api.g_number
324 ,p_segment1 in varchar2 default hr_api.g_varchar2
325 ,p_segment2 in varchar2 default hr_api.g_varchar2
326 ,p_segment3 in varchar2 default hr_api.g_varchar2
327 ,p_segment4 in varchar2 default hr_api.g_varchar2
328 ,p_segment5 in varchar2 default hr_api.g_varchar2
329 ,p_segment6 in varchar2 default hr_api.g_varchar2
330 ,p_segment7 in varchar2 default hr_api.g_varchar2
331 ,p_segment8 in varchar2 default hr_api.g_varchar2
332 ,p_segment9 in varchar2 default hr_api.g_varchar2
333 ,p_segment10 in varchar2 default hr_api.g_varchar2
334 ,p_segment11 in varchar2 default hr_api.g_varchar2
335 ,p_segment12 in varchar2 default hr_api.g_varchar2
336 ,p_segment13 in varchar2 default hr_api.g_varchar2
337 ,p_segment14 in varchar2 default hr_api.g_varchar2
338 ,p_segment15 in varchar2 default hr_api.g_varchar2
339 ,p_segment16 in varchar2 default hr_api.g_varchar2
340 ,p_segment17 in varchar2 default hr_api.g_varchar2
341 ,p_segment18 in varchar2 default hr_api.g_varchar2
342 ,p_segment19 in varchar2 default hr_api.g_varchar2
343 ,p_segment20 in varchar2 default hr_api.g_varchar2
344 ,p_segment21 in varchar2 default hr_api.g_varchar2
345 ,p_segment22 in varchar2 default hr_api.g_varchar2
346 ,p_segment23 in varchar2 default hr_api.g_varchar2
347 ,p_segment24 in varchar2 default hr_api.g_varchar2
348 ,p_segment25 in varchar2 default hr_api.g_varchar2
349 ,p_segment26 in varchar2 default hr_api.g_varchar2
350 ,p_segment27 in varchar2 default hr_api.g_varchar2
351 ,p_segment28 in varchar2 default hr_api.g_varchar2
352 ,p_segment29 in varchar2 default hr_api.g_varchar2
353 ,p_segment30 in varchar2 default hr_api.g_varchar2
354 ,p_concat_segments in varchar2 default hr_api.g_varchar2
355 ,p_request_id in number default hr_api.g_number
356 ,p_program_application_id in number default hr_api.g_number
357 ,p_program_id in number default hr_api.g_number
358 ,p_program_update_date in date default hr_api.g_date
359 ,p_combination_name out nocopy varchar2
360 ,p_cost_allocation_keyflex_id in out nocopy number
361 ,p_effective_start_date out nocopy date
362 ,p_effective_end_date out nocopy date
363 ,p_return_status out nocopy varchar2
364 ) is
365 --
366 -- Variables for API Boolean parameters
367 l_validate boolean;
368 --
369 -- Variables for IN/OUT parameters
370 l_object_version_number number;
371 l_cost_allocation_keyflex_id number;
372 --
373 -- Other variables
374 l_proc varchar2(72) := g_package ||'update_cost_allocation';
375 Begin
376 hr_utility.set_location(' Entering:' || l_proc,10);
377 --
378 -- Issue a savepoint
379 --
380 savepoint update_cost_allocation_swi;
381 --
382 -- Initialise Multiple Message Detection
383 --
384 hr_multi_message.enable_message_list;
385 --
386 -- Remember IN OUT parameter IN values
387 --
388 l_object_version_number := p_object_version_number;
389 l_cost_allocation_keyflex_id := p_cost_allocation_keyflex_id;
390 --
391 -- Convert constant values to their corresponding boolean value
392 --
393 l_validate :=
394 hr_api.constant_to_boolean
395 (p_constant_value => p_validate);
396 --
397 -- Register Surrogate ID or user key values
398 --
399 --
400 -- Call API
401 --
402 pay_cost_allocation_api.update_cost_allocation
403 (p_validate => l_validate
404 ,p_effective_date => p_effective_date
405 ,p_datetrack_update_mode => p_datetrack_update_mode
406 ,p_cost_allocation_id => p_cost_allocation_id
407 ,p_object_version_number => p_object_version_number
408 ,p_proportion => p_proportion
409 ,p_segment1 => p_segment1
410 ,p_segment2 => p_segment2
411 ,p_segment3 => p_segment3
412 ,p_segment4 => p_segment4
413 ,p_segment5 => p_segment5
414 ,p_segment6 => p_segment6
415 ,p_segment7 => p_segment7
416 ,p_segment8 => p_segment8
417 ,p_segment9 => p_segment9
418 ,p_segment10 => p_segment10
419 ,p_segment11 => p_segment11
420 ,p_segment12 => p_segment12
421 ,p_segment13 => p_segment13
422 ,p_segment14 => p_segment14
423 ,p_segment15 => p_segment15
424 ,p_segment16 => p_segment16
425 ,p_segment17 => p_segment17
426 ,p_segment18 => p_segment18
427 ,p_segment19 => p_segment19
428 ,p_segment20 => p_segment20
429 ,p_segment21 => p_segment21
430 ,p_segment22 => p_segment22
431 ,p_segment23 => p_segment23
432 ,p_segment24 => p_segment24
433 ,p_segment25 => p_segment25
434 ,p_segment26 => p_segment26
435 ,p_segment27 => p_segment27
436 ,p_segment28 => p_segment28
437 ,p_segment29 => p_segment29
438 ,p_segment30 => p_segment30
439 ,p_concat_segments => p_concat_segments
440 ,p_request_id => p_request_id
441 ,p_program_application_id => p_program_application_id
442 ,p_program_id => p_program_id
443 ,p_program_update_date => p_program_update_date
444 ,p_combination_name => p_combination_name
445 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
446 ,p_effective_start_date => p_effective_start_date
447 ,p_effective_end_date => p_effective_end_date
448 );
449 --
450 -- Convert API warning boolean parameter values to specific
451 -- messages and add them to Multiple Message List
452 --
453 --
454 -- Convert API non-warning boolean parameter values
455 --
456 --
457 -- Derive the API return status value based on whether
458 -- messages of any type exist in the Multiple Message List.
459 -- Also disable Multiple Message Detection.
460 --
461 p_return_status := hr_multi_message.get_return_status_disable;
462 hr_utility.set_location(' Leaving:' || l_proc,20);
463 --
464 exception
465 when hr_multi_message.error_message_exist then
466 --
467 -- Catch the Multiple Message List exception which
468 -- indicates API processing has been aborted because
469 -- at least one message exists in the list.
470 --
471 rollback to update_cost_allocation_swi;
472 --
473 -- Reset IN OUT parameters and set OUT parameters
474 --
475 p_object_version_number := l_object_version_number;
476 p_combination_name := null;
477 p_cost_allocation_keyflex_id := l_cost_allocation_keyflex_id;
478 p_effective_start_date := null;
479 p_effective_end_date := null;
480 p_return_status := hr_multi_message.get_return_status_disable;
481 hr_utility.set_location(' Leaving:' || l_proc, 30);
482 when others then
483 --
484 -- When Multiple Message Detection is enabled catch
485 -- any Application specific or other unexpected
486 -- exceptions. Adding appropriate details to the
487 -- Multiple Message List. Otherwise re-raise the
488 -- error.
489 --
490 rollback to update_cost_allocation_swi;
491 if hr_multi_message.unexpected_error_add(l_proc) then
492 hr_utility.set_location(' Leaving:' || l_proc,40);
493 raise;
494 end if;
495 --
496 -- Reset IN OUT and set OUT parameters
497 --
498 p_object_version_number := l_object_version_number;
499 p_combination_name := null;
500 p_cost_allocation_keyflex_id := l_cost_allocation_keyflex_id;
501 p_effective_start_date := null;
502 p_effective_end_date := null;
503 p_return_status := hr_multi_message.get_return_status_disable;
504 hr_utility.set_location(' Leaving:' || l_proc,50);
505 end update_cost_allocation;
506 end pay_cost_allocation_swi;