[Home] [Help]
PACKAGE BODY: APPS.BEN_ELIG_RSLT_API
Source
1 Package Body ben_ELIG_RSLT_api as
2 /* $Header: beberapi.pkb 120.0 2005/05/28 00:39:50 appldev noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' ben_ELIG_RSLT_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_ELIG_RSLT >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_ELIG_RSLT
13 (p_validate in boolean default false
14 ,p_elig_rslt_id out nocopy number
15 ,p_effective_start_date out nocopy date
16 ,p_effective_end_date out nocopy date
17 ,p_business_group_id in number default null
18 ,p_elig_obj_id in number
19 ,p_person_id in number default null
20 ,p_assignment_id in number default null
21 ,p_elig_flag in varchar2
22 ,p_object_version_number out nocopy number
23 ,p_effective_date in date
24 ) is
25 --
26 -- Declare cursors and local variables
27 --
28 l_elig_rslt_id ben_elig_rslt_f.elig_rslt_id%TYPE;
29 l_effective_start_date ben_elig_rslt_f.effective_start_date%TYPE;
30 l_effective_end_date ben_elig_rslt_f.effective_end_date%TYPE;
31 l_proc varchar2(72) := g_package||'create_ELIG_RSLT';
32 l_object_version_number ben_elig_rslt_f.object_version_number%TYPE;
33 --
34 begin
35 --
36 hr_utility.set_location('Entering:'|| l_proc, 10);
37 --
38 -- Issue a savepoint if operating in validation only mode
39 --
40 savepoint create_ELIG_RSLT;
41 --
42 hr_utility.set_location(l_proc, 20);
43 --
44 -- Process Logic
45 --
46 begin
47 --
48 -- Start of API User Hook for the before hook of create_ELIG_RSLT
49 --
50 ben_ELIG_RSLT_bk1.create_ELIG_RSLT_b
51 (
52 p_business_group_id => p_business_group_id
53 ,p_elig_obj_id => p_elig_obj_id
54 ,p_person_id => p_person_id
55 ,p_assignment_id => p_assignment_id
56 ,p_elig_flag => p_elig_flag
57 ,p_effective_date => trunc(p_effective_date)
58 );
59 exception
60 when hr_api.cannot_find_prog_unit then
61 hr_api.cannot_find_prog_unit_error
62 (
63 p_module_name => 'CREATE_ELIG_RSLT'
64 ,p_hook_type => 'BP'
65 );
66 --
67 -- End of API User Hook for the before hook of create_ELIG_RSLT
68 --
69 end;
70 --
71 ben_ber_ins.ins
72 (
73 p_elig_rslt_id => l_elig_rslt_id
74 ,p_effective_start_date => l_effective_start_date
75 ,p_effective_end_date => l_effective_end_date
76 ,p_business_group_id => p_business_group_id
77 ,p_elig_obj_id => p_elig_obj_id
78 ,p_person_id => p_person_id
79 ,p_assignment_id => p_assignment_id
80 ,p_elig_flag => p_elig_flag
81 ,p_object_version_number => l_object_version_number
82 ,p_effective_date => trunc(p_effective_date)
83 );
84 --
85 begin
86 --
87 -- Start of API User Hook for the after hook of create_ELIG_RSLT
88 --
89 ben_ELIG_RSLT_bk1.create_ELIG_RSLT_a
90 (
91 p_elig_rslt_id => l_elig_rslt_id
92 ,p_effective_start_date => l_effective_start_date
93 ,p_effective_end_date => l_effective_end_date
94 ,p_business_group_id => p_business_group_id
95 ,p_elig_obj_id => p_elig_obj_id
96 ,p_person_id => p_person_id
97 ,p_assignment_id => p_assignment_id
98 ,p_elig_flag => p_elig_flag
99 ,p_object_version_number => l_object_version_number
100 ,p_effective_date => trunc(p_effective_date)
101 );
102 exception
103 when hr_api.cannot_find_prog_unit then
104 hr_api.cannot_find_prog_unit_error
105 (p_module_name => 'CREATE_ELIG_RSLT'
106 ,p_hook_type => 'AP'
107 );
108 --
109 -- End of API User Hook for the after hook of create_ELIG_RSLT
110 --
111 end;
112 --
113 hr_utility.set_location(l_proc, 60);
114 --
115 -- When in validation only mode raise the Validate_Enabled exception
116 --
117 if p_validate then
118 raise hr_api.validate_enabled;
119 end if;
120 --
121 -- Set all output arguments
122 --
123 p_elig_rslt_id := l_elig_rslt_id;
124 p_effective_start_date := l_effective_start_date;
125 p_effective_end_date := l_effective_end_date;
126 p_object_version_number := l_object_version_number;
127 --
128 hr_utility.set_location(' Leaving:'||l_proc, 70);
129 --
130 exception
131 --
132 when hr_api.validate_enabled then
133 --
134 -- As the Validate_Enabled exception has been raised
135 -- we must rollback to the savepoint
136 --
137 ROLLBACK TO create_ELIG_RSLT;
138 --
139 -- Only set output warning arguments
140 -- (Any key or derived arguments must be set to null
141 -- when validation only mode is being used.)
142 --
143 p_elig_rslt_id := null;
144 p_effective_start_date := null;
145 p_effective_end_date := null;
146 p_object_version_number := null;
147 hr_utility.set_location(' Leaving:'||l_proc, 80);
148 --
149 when others then
150 --
151 -- A validation or unexpected error has occured
152 --
153 ROLLBACK TO create_ELIG_RSLT;
154 raise;
155 --
156 end create_ELIG_RSLT;
157 -- ----------------------------------------------------------------------------
158 -- |------------------------< update_ELIG_RSLT >--- ------------------|
159 -- ----------------------------------------------------------------------------
160 --
161 procedure update_ELIG_RSLT
162 (p_validate in boolean default false
163 ,p_elig_rslt_id in number
164 ,p_effective_start_date out nocopy date
165 ,p_effective_end_date out nocopy date
166 ,p_business_group_id in number default hr_api.g_number
167 ,p_elig_obj_id in number default hr_api.g_number
168 ,p_person_id in number default hr_api.g_number
169 ,p_assignment_id in number default hr_api.g_number
170 ,p_elig_flag in varchar2 default hr_api.g_varchar2
171 ,p_object_version_number in out nocopy number
172 ,p_effective_date in date
173 ,p_datetrack_mode in varchar2
174 ) is
175 --
176 -- Declare cursors and local variables
177 --
178 l_proc varchar2(72) := g_package||'update_ELIG_RSLT';
179 l_object_version_number ben_elig_rslt_f.object_version_number%TYPE;
180 l_effective_start_date ben_elig_rslt_f.effective_start_date%TYPE;
181 l_effective_end_date ben_elig_rslt_f.effective_end_date%TYPE;
182 --
183 begin
184 --
185 hr_utility.set_location('Entering:'|| l_proc, 10);
186 --
187 -- Issue a savepoint if operating in validation only mode
188 --
189 savepoint update_ELIG_RSLT;
190 --
191 hr_utility.set_location(l_proc, 20);
192 --
193 -- Process Logic
194 --
195 l_object_version_number := p_object_version_number;
196 --
197 begin
198 --
199 -- Start of API User Hook for the before hook of update_ELIG_RSLT
200 --
201 ben_ELIG_RSLT_bk2.update_ELIG_RSLT_b
202 (
203 p_elig_rslt_id => p_elig_rslt_id
204 ,p_business_group_id => p_business_group_id
205 ,p_elig_obj_id => p_elig_obj_id
206 ,p_person_id => p_person_id
207 ,p_assignment_id => p_assignment_id
208 ,p_elig_flag => p_elig_flag
209 ,p_object_version_number => p_object_version_number
210 ,p_effective_date => trunc(p_effective_date)
211 ,p_datetrack_mode => p_datetrack_mode
212 );
213 exception
214 when hr_api.cannot_find_prog_unit then
215 hr_api.cannot_find_prog_unit_error
216 (p_module_name => 'UPDATE_ELIG_RSLT'
217 ,p_hook_type => 'BP'
218 );
219 --
220 -- End of API User Hook for the before hook of update_ELIG_RSLT
221 --
222 end;
223 --
224 ben_ber_upd.upd
225 (
226 p_elig_rslt_id => p_elig_rslt_id
227 ,p_effective_start_date => l_effective_start_date
228 ,p_effective_end_date => l_effective_end_date
229 ,p_business_group_id => p_business_group_id
230 ,p_elig_obj_id => p_elig_obj_id
231 ,p_person_id => p_person_id
232 ,p_assignment_id => p_assignment_id
233 ,p_elig_flag => p_elig_flag
234 ,p_object_version_number => l_object_version_number
235 ,p_effective_date => trunc(p_effective_date)
236 ,p_datetrack_mode => p_datetrack_mode
237 );
238 --
239 begin
240 --
241 -- Start of API User Hook for the after hook of update_ELIG_RSLT
242 --
243 ben_ELIG_RSLT_bk2.update_ELIG_RSLT_a
244 (
245 p_elig_rslt_id => p_elig_rslt_id
246 ,p_effective_start_date => l_effective_start_date
247 ,p_effective_end_date => l_effective_end_date
248 ,p_business_group_id => p_business_group_id
249 ,p_elig_obj_id => p_elig_obj_id
250 ,p_person_id => p_person_id
251 ,p_assignment_id => p_assignment_id
252 ,p_elig_flag => p_elig_flag
253 ,p_object_version_number => l_object_version_number
254 ,p_effective_date => trunc(p_effective_date)
255 ,p_datetrack_mode => p_datetrack_mode
256 );
257 exception
258 when hr_api.cannot_find_prog_unit then
259 hr_api.cannot_find_prog_unit_error
260 (p_module_name => 'UPDATE_ELIG_RSLT'
261 ,p_hook_type => 'AP'
262 );
263 --
264 -- End of API User Hook for the after hook of update_ELIG_RSLT
265 --
266 end;
267 --
268 hr_utility.set_location(l_proc, 60);
269 --
270 -- When in validation only mode raise the Validate_Enabled exception
271 --
272 if p_validate then
273 raise hr_api.validate_enabled;
274 end if;
275 --
276 -- Set all output arguments
277 --
278 p_object_version_number := l_object_version_number;
279 p_effective_start_date := l_effective_start_date;
280 p_effective_end_date := l_effective_end_date;
281 --
282 hr_utility.set_location(' Leaving:'||l_proc, 70);
283 --
284 exception
285 --
286 when hr_api.validate_enabled then
287 --
288 -- As the Validate_Enabled exception has been raised
289 -- we must rollback to the savepoint
290 --
291 ROLLBACK TO update_ELIG_RSLT;
292 --
293 -- Only set output warning arguments
294 -- (Any key or derived arguments must be set to null
295 -- when validation only mode is being used.)
296 --
297 hr_utility.set_location(' Leaving:'||l_proc, 80);
298 --
299 when others then
300 --
301 -- A validation or unexpected error has occured
302 --
303 ROLLBACK TO update_ELIG_RSLT;
304 raise;
305 --
306 end update_ELIG_RSLT;
307 -- ----------------------------------------------------------------------------
308 -- |------------------------< delete_ELIG_RSLT >----------------------|
309 -- ----------------------------------------------------------------------------
310 --
311 procedure delete_ELIG_RSLT
312 (p_validate in boolean default false
313 ,p_elig_rslt_id in number
314 ,p_effective_start_date out nocopy date
315 ,p_effective_end_date out nocopy date
316 ,p_object_version_number in out nocopy number
317 ,p_effective_date in date
318 ,p_datetrack_mode in varchar2
319 ) is
320 --
321 -- Declare cursors and local variables
322 --
323 l_proc varchar2(72) := g_package||'update_ELIG_RSLT';
324 l_object_version_number ben_elig_rslt_f.object_version_number%TYPE;
325 l_effective_start_date ben_elig_rslt_f.effective_start_date%TYPE;
326 l_effective_end_date ben_elig_rslt_f.effective_end_date%TYPE;
327 --
328 begin
329 --
330 hr_utility.set_location('Entering:'|| l_proc, 10);
331 --
332 -- Issue a savepoint if operating in validation only mode
333 --
334 savepoint delete_ELIG_RSLT;
335 --
336 hr_utility.set_location(l_proc, 20);
337 --
338 -- Process Logic
339 --
340 l_object_version_number := p_object_version_number;
341 --
342 --
343 begin
344 --
345 -- Start of API User Hook for the before hook of delete_ELIG_RSLT
346 --
347 ben_ELIG_RSLT_bk3.delete_ELIG_RSLT_b
348 (
349 p_elig_rslt_id => p_elig_rslt_id
350 ,p_object_version_number => p_object_version_number
351 ,p_effective_date => trunc(p_effective_date)
352 ,p_datetrack_mode => p_datetrack_mode
353 );
354 exception
355 when hr_api.cannot_find_prog_unit then
356 hr_api.cannot_find_prog_unit_error
357 (p_module_name => 'DELETE_ELIG_RSLT'
358 ,p_hook_type => 'BP'
359 );
360 --
361 -- End of API User Hook for the before hook of delete_ELIG_RSLT
362 --
363 end;
364 --
365 ben_ber_del.del
366 (
367 p_elig_rslt_id => p_elig_rslt_id
368 ,p_effective_start_date => l_effective_start_date
369 ,p_effective_end_date => l_effective_end_date
370 ,p_object_version_number => l_object_version_number
371 ,p_effective_date => p_effective_date
372 ,p_datetrack_mode => p_datetrack_mode
373 );
374 --
375 begin
376 --
377 -- Start of API User Hook for the after hook of delete_ELIG_RSLT
378 --
379 ben_ELIG_RSLT_bk3.delete_ELIG_RSLT_a
380 (
381 p_elig_rslt_id => p_elig_rslt_id
382 ,p_effective_start_date => l_effective_start_date
383 ,p_effective_end_date => l_effective_end_date
384 ,p_object_version_number => l_object_version_number
385 ,p_effective_date => trunc(p_effective_date)
386 ,p_datetrack_mode => p_datetrack_mode
387 );
388 exception
389 when hr_api.cannot_find_prog_unit then
390 hr_api.cannot_find_prog_unit_error
391 (p_module_name => 'DELETE_ELIG_RSLT'
392 ,p_hook_type => 'AP'
393 );
394 --
395 -- End of API User Hook for the after hook of delete_ELIG_RSLT
396 --
397 end;
398 --
399 hr_utility.set_location(l_proc, 60);
400 --
401 -- When in validation only mode raise the Validate_Enabled exception
402 --
403 if p_validate then
404 raise hr_api.validate_enabled;
405 end if;
406 --
407 hr_utility.set_location(' Leaving:'||l_proc, 70);
408 --
409 exception
410 --
411 when hr_api.validate_enabled then
412 --
413 -- As the Validate_Enabled exception has been raised
414 -- we must rollback to the savepoint
415 --
416 ROLLBACK TO delete_ELIG_RSLT;
417 --
418 -- Only set output warning arguments
419 -- (Any key or derived arguments must be set to null
420 -- when validation only mode is being used.)
421 --
422 p_effective_start_date := null;
423 p_effective_end_date := null;
424 --
425 when others then
426 --
427 -- A validation or unexpected error has occured
428 --
429 ROLLBACK TO delete_ELIG_RSLT;
430 raise;
431 --
432 end delete_ELIG_RSLT;
433 --
434 -- ----------------------------------------------------------------------------
435 -- |-------------------------------< lck >------------------------------------|
436 -- ----------------------------------------------------------------------------
437 --
438 procedure lck
439 (
440 p_elig_rslt_id in number
441 ,p_object_version_number in number
442 ,p_effective_date in date
443 ,p_datetrack_mode in varchar2
444 ,p_validation_start_date out nocopy date
445 ,p_validation_end_date out nocopy date
446 ) is
447 --
448 --
449 -- Declare cursors and local variables
450 --
451 l_proc varchar2(72) := g_package||'lck';
452 l_validation_start_date date;
453 l_validation_end_date date;
454 --
455 begin
456 --
457 hr_utility.set_location('Entering:'|| l_proc, 10);
458 --
459 ben_ber_shd.lck
460 (
461 p_elig_rslt_id => p_elig_rslt_id
462 ,p_validation_start_date => l_validation_start_date
463 ,p_validation_end_date => l_validation_end_date
464 ,p_object_version_number => p_object_version_number
465 ,p_effective_date => p_effective_date
466 ,p_datetrack_mode => p_datetrack_mode
467 );
468 --
469 hr_utility.set_location(' Leaving:'||l_proc, 70);
470 --
471 end lck;
472 --
473 end ben_ELIG_RSLT_api;