[Home] [Help]
PACKAGE BODY: APPS.BEN_BNFT_VRBL_RT_API
Source
1 Package Body ben_bnft_vrbl_rt_api as
2 /* $Header: bebvrapi.pkb 120.0 2005/05/28 00:54:24 appldev noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' ben_bnft_vrbl_rt_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_bnft_vrbl_rt >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_bnft_vrbl_rt
13 (p_validate in boolean default false
14 ,p_bnft_vrbl_rt_id out nocopy number
15 ,p_effective_start_date out nocopy date
16 ,p_effective_end_date out nocopy date
17 ,p_cvg_amt_calc_mthd_id in number default null
18 ,p_vrbl_rt_prfl_id in number default null
19 ,p_business_group_id in number default null
20 ,p_bvr_attribute_category in varchar2 default null
21 ,p_bvr_attribute1 in varchar2 default null
22 ,p_bvr_attribute2 in varchar2 default null
23 ,p_bvr_attribute3 in varchar2 default null
24 ,p_bvr_attribute4 in varchar2 default null
25 ,p_bvr_attribute5 in varchar2 default null
26 ,p_bvr_attribute6 in varchar2 default null
27 ,p_bvr_attribute7 in varchar2 default null
28 ,p_bvr_attribute8 in varchar2 default null
29 ,p_bvr_attribute9 in varchar2 default null
30 ,p_bvr_attribute10 in varchar2 default null
31 ,p_bvr_attribute11 in varchar2 default null
32 ,p_bvr_attribute12 in varchar2 default null
33 ,p_bvr_attribute13 in varchar2 default null
34 ,p_bvr_attribute14 in varchar2 default null
35 ,p_bvr_attribute15 in varchar2 default null
36 ,p_bvr_attribute16 in varchar2 default null
37 ,p_bvr_attribute17 in varchar2 default null
38 ,p_bvr_attribute18 in varchar2 default null
39 ,p_bvr_attribute19 in varchar2 default null
40 ,p_bvr_attribute20 in varchar2 default null
41 ,p_bvr_attribute21 in varchar2 default null
42 ,p_bvr_attribute22 in varchar2 default null
43 ,p_bvr_attribute23 in varchar2 default null
44 ,p_bvr_attribute24 in varchar2 default null
45 ,p_bvr_attribute25 in varchar2 default null
46 ,p_bvr_attribute26 in varchar2 default null
47 ,p_bvr_attribute27 in varchar2 default null
48 ,p_bvr_attribute28 in varchar2 default null
49 ,p_bvr_attribute29 in varchar2 default null
50 ,p_bvr_attribute30 in varchar2 default null
51 ,p_object_version_number out nocopy number
52 ,p_ordr_num in number default null
53 ,p_effective_date in date
54 ) is
55 --
56 -- Declare cursors and local variables
57 --
58 l_bnft_vrbl_rt_id ben_bnft_vrbl_rt_f.bnft_vrbl_rt_id%TYPE;
59 l_effective_start_date ben_bnft_vrbl_rt_f.effective_start_date%TYPE;
60 l_effective_end_date ben_bnft_vrbl_rt_f.effective_end_date%TYPE;
61 l_proc varchar2(72) := g_package||'create_bnft_vrbl_rt';
62 l_object_version_number ben_bnft_vrbl_rt_f.object_version_number%TYPE;
63 --
64 cursor c1 is
65 select pl_id,
66 oipl_id,
67 plip_id
68 from ben_cvg_amt_calc_mthd_f
69 where cvg_amt_calc_mthd_id = p_cvg_amt_calc_mthd_id;
70 --
71 l_c1 c1%rowtype;
72 --
73 begin
74 --
75 hr_utility.set_location('Entering:'|| l_proc, 10);
76 --
77 -- Issue a savepoint if operating in validation only mode
78 --
79 savepoint create_bnft_vrbl_rt;
80 --
81 hr_utility.set_location(l_proc, 20);
82 --
83 -- Process Logic
84 --
85 begin
86 --
87 -- Start of API User Hook for the before hook of create_bnft_vrbl_rt
88 --
89 ben_bnft_vrbl_rt_bk1.create_bnft_vrbl_rt_b
90 (
91 p_cvg_amt_calc_mthd_id => p_cvg_amt_calc_mthd_id
92 ,p_vrbl_rt_prfl_id => p_vrbl_rt_prfl_id
93 ,p_business_group_id => p_business_group_id
94 ,p_bvr_attribute_category => p_bvr_attribute_category
95 ,p_bvr_attribute1 => p_bvr_attribute1
96 ,p_bvr_attribute2 => p_bvr_attribute2
97 ,p_bvr_attribute3 => p_bvr_attribute3
98 ,p_bvr_attribute4 => p_bvr_attribute4
99 ,p_bvr_attribute5 => p_bvr_attribute5
100 ,p_bvr_attribute6 => p_bvr_attribute6
101 ,p_bvr_attribute7 => p_bvr_attribute7
102 ,p_bvr_attribute8 => p_bvr_attribute8
103 ,p_bvr_attribute9 => p_bvr_attribute9
104 ,p_bvr_attribute10 => p_bvr_attribute10
105 ,p_bvr_attribute11 => p_bvr_attribute11
106 ,p_bvr_attribute12 => p_bvr_attribute12
107 ,p_bvr_attribute13 => p_bvr_attribute13
108 ,p_bvr_attribute14 => p_bvr_attribute14
109 ,p_bvr_attribute15 => p_bvr_attribute15
110 ,p_bvr_attribute16 => p_bvr_attribute16
111 ,p_bvr_attribute17 => p_bvr_attribute17
112 ,p_bvr_attribute18 => p_bvr_attribute18
113 ,p_bvr_attribute19 => p_bvr_attribute19
114 ,p_bvr_attribute20 => p_bvr_attribute20
115 ,p_bvr_attribute21 => p_bvr_attribute21
116 ,p_bvr_attribute22 => p_bvr_attribute22
117 ,p_bvr_attribute23 => p_bvr_attribute23
118 ,p_bvr_attribute24 => p_bvr_attribute24
119 ,p_bvr_attribute25 => p_bvr_attribute25
120 ,p_bvr_attribute26 => p_bvr_attribute26
121 ,p_bvr_attribute27 => p_bvr_attribute27
122 ,p_bvr_attribute28 => p_bvr_attribute28
123 ,p_bvr_attribute29 => p_bvr_attribute29
124 ,p_bvr_attribute30 => p_bvr_attribute30
125 ,p_ordr_num => p_ordr_num
126 ,p_effective_date => trunc(p_effective_date)
127 );
128 exception
129 when hr_api.cannot_find_prog_unit then
130 hr_api.cannot_find_prog_unit_error
131 (
132 p_module_name => 'CREATE_bnft_vrbl_rt'
133 ,p_hook_type => 'BP'
134 );
135 --
136 -- End of API User Hook for the before hook of create_bnft_vrbl_rt
137 --
138 end;
139 --
140 ben_bvr_ins.ins
141 (
142 p_bnft_vrbl_rt_id => l_bnft_vrbl_rt_id
143 ,p_effective_start_date => l_effective_start_date
144 ,p_effective_end_date => l_effective_end_date
145 ,p_cvg_amt_calc_mthd_id => p_cvg_amt_calc_mthd_id
146 ,p_vrbl_rt_prfl_id => p_vrbl_rt_prfl_id
147 ,p_business_group_id => p_business_group_id
148 ,p_bvr_attribute_category => p_bvr_attribute_category
149 ,p_bvr_attribute1 => p_bvr_attribute1
150 ,p_bvr_attribute2 => p_bvr_attribute2
151 ,p_bvr_attribute3 => p_bvr_attribute3
152 ,p_bvr_attribute4 => p_bvr_attribute4
153 ,p_bvr_attribute5 => p_bvr_attribute5
154 ,p_bvr_attribute6 => p_bvr_attribute6
155 ,p_bvr_attribute7 => p_bvr_attribute7
156 ,p_bvr_attribute8 => p_bvr_attribute8
157 ,p_bvr_attribute9 => p_bvr_attribute9
158 ,p_bvr_attribute10 => p_bvr_attribute10
159 ,p_bvr_attribute11 => p_bvr_attribute11
160 ,p_bvr_attribute12 => p_bvr_attribute12
161 ,p_bvr_attribute13 => p_bvr_attribute13
162 ,p_bvr_attribute14 => p_bvr_attribute14
163 ,p_bvr_attribute15 => p_bvr_attribute15
164 ,p_bvr_attribute16 => p_bvr_attribute16
165 ,p_bvr_attribute17 => p_bvr_attribute17
166 ,p_bvr_attribute18 => p_bvr_attribute18
167 ,p_bvr_attribute19 => p_bvr_attribute19
168 ,p_bvr_attribute20 => p_bvr_attribute20
169 ,p_bvr_attribute21 => p_bvr_attribute21
170 ,p_bvr_attribute22 => p_bvr_attribute22
171 ,p_bvr_attribute23 => p_bvr_attribute23
172 ,p_bvr_attribute24 => p_bvr_attribute24
173 ,p_bvr_attribute25 => p_bvr_attribute25
174 ,p_bvr_attribute26 => p_bvr_attribute26
175 ,p_bvr_attribute27 => p_bvr_attribute27
176 ,p_bvr_attribute28 => p_bvr_attribute28
177 ,p_bvr_attribute29 => p_bvr_attribute29
178 ,p_bvr_attribute30 => p_bvr_attribute30
179 ,p_object_version_number => l_object_version_number
180 ,p_ordr_num => p_ordr_num
181 ,p_effective_date => trunc(p_effective_date)
182 );
183 --
184 begin
185 --
186 -- Start of API User Hook for the after hook of create_bnft_vrbl_rt
187 --
188 ben_bnft_vrbl_rt_bk1.create_bnft_vrbl_rt_a
189 (
190 p_bnft_vrbl_rt_id => l_bnft_vrbl_rt_id
191 ,p_effective_start_date => l_effective_start_date
192 ,p_effective_end_date => l_effective_end_date
193 ,p_cvg_amt_calc_mthd_id => p_cvg_amt_calc_mthd_id
194 ,p_vrbl_rt_prfl_id => p_vrbl_rt_prfl_id
195 ,p_business_group_id => p_business_group_id
196 ,p_bvr_attribute_category => p_bvr_attribute_category
197 ,p_bvr_attribute1 => p_bvr_attribute1
198 ,p_bvr_attribute2 => p_bvr_attribute2
199 ,p_bvr_attribute3 => p_bvr_attribute3
200 ,p_bvr_attribute4 => p_bvr_attribute4
201 ,p_bvr_attribute5 => p_bvr_attribute5
202 ,p_bvr_attribute6 => p_bvr_attribute6
203 ,p_bvr_attribute7 => p_bvr_attribute7
204 ,p_bvr_attribute8 => p_bvr_attribute8
205 ,p_bvr_attribute9 => p_bvr_attribute9
206 ,p_bvr_attribute10 => p_bvr_attribute10
207 ,p_bvr_attribute11 => p_bvr_attribute11
208 ,p_bvr_attribute12 => p_bvr_attribute12
209 ,p_bvr_attribute13 => p_bvr_attribute13
210 ,p_bvr_attribute14 => p_bvr_attribute14
211 ,p_bvr_attribute15 => p_bvr_attribute15
212 ,p_bvr_attribute16 => p_bvr_attribute16
213 ,p_bvr_attribute17 => p_bvr_attribute17
214 ,p_bvr_attribute18 => p_bvr_attribute18
215 ,p_bvr_attribute19 => p_bvr_attribute19
216 ,p_bvr_attribute20 => p_bvr_attribute20
217 ,p_bvr_attribute21 => p_bvr_attribute21
218 ,p_bvr_attribute22 => p_bvr_attribute22
219 ,p_bvr_attribute23 => p_bvr_attribute23
220 ,p_bvr_attribute24 => p_bvr_attribute24
221 ,p_bvr_attribute25 => p_bvr_attribute25
222 ,p_bvr_attribute26 => p_bvr_attribute26
223 ,p_bvr_attribute27 => p_bvr_attribute27
224 ,p_bvr_attribute28 => p_bvr_attribute28
225 ,p_bvr_attribute29 => p_bvr_attribute29
226 ,p_bvr_attribute30 => p_bvr_attribute30
227 ,p_object_version_number => l_object_version_number
228 ,p_ordr_num => p_ordr_num
229 ,p_effective_date => trunc(p_effective_date)
230 );
231 exception
232 when hr_api.cannot_find_prog_unit then
233 hr_api.cannot_find_prog_unit_error
234 (p_module_name => 'CREATE_bnft_vrbl_rt'
235 ,p_hook_type => 'AP'
236 );
237 --
238 -- End of API User Hook for the after hook of create_bnft_vrbl_rt
239 --
240 end;
241 --
242 open c1;
243 --
244 fetch c1 into l_c1;
245 --
246 close c1;
247 --
248 if l_c1.pl_id is not null then
249 --
250 ben_derivable_rate.rate_prfl_handler('CREATE','ben_pl_f','pl_id',l_c1.pl_id);
251 --
252 elsif l_c1.oipl_id is not null then
253 --
254 ben_derivable_rate.rate_prfl_handler('CREATE','ben_oipl_f','oipl_id',l_c1.oipl_id);
255 --
256 elsif l_c1.plip_id is not null then
257 --
258 ben_derivable_rate.rate_prfl_handler('CREATE','ben_plip_f','plip_id',l_c1.plip_id);
259 --
260 end if;
261 --
262 hr_utility.set_location(l_proc, 60);
263 --
264 -- When in validation only mode raise the Validate_Enabled exception
265 --
266 if p_validate then
267 raise hr_api.validate_enabled;
268 end if;
269 --
270 -- Set all output arguments
271 --
272 p_bnft_vrbl_rt_id := l_bnft_vrbl_rt_id;
273 p_effective_start_date := l_effective_start_date;
274 p_effective_end_date := l_effective_end_date;
275 p_object_version_number := l_object_version_number;
276 --
277 hr_utility.set_location(' Leaving:'||l_proc, 70);
278 --
279 exception
280 --
281 when hr_api.validate_enabled then
282 --
283 -- As the Validate_Enabled exception has been raised
284 -- we must rollback to the savepoint
285 --
286 ROLLBACK TO create_bnft_vrbl_rt;
287 --
288 -- Only set output warning arguments
289 -- (Any key or derived arguments must be set to null
290 -- when validation only mode is being used.)
291 --
292 p_bnft_vrbl_rt_id := null;
293 p_effective_start_date := null;
294 p_effective_end_date := null;
295 p_object_version_number := null;
296 hr_utility.set_location(' Leaving:'||l_proc, 80);
297 --
298 when others then
299 --
300 -- A validation or unexpected error has occured
301 --
302 ROLLBACK TO create_bnft_vrbl_rt;
303 -- NOCOPY Changes
304 p_bnft_vrbl_rt_id := null;
305 p_effective_start_date := null;
306 p_effective_end_date := null;
307 p_object_version_number := null ;
308 hr_utility.set_location(' Leaving:'||l_proc, 90);
309 raise;
310 --
311 end create_bnft_vrbl_rt;
312 -- ----------------------------------------------------------------------------
313 -- |------------------------< update_bnft_vrbl_rt >--- ------------------|
314 -- ----------------------------------------------------------------------------
315 --
316 procedure update_bnft_vrbl_rt
317 (p_validate in boolean default false
318 ,p_bnft_vrbl_rt_id in number
319 ,p_effective_start_date out nocopy date
320 ,p_effective_end_date out nocopy date
321 ,p_cvg_amt_calc_mthd_id in number default hr_api.g_number
322 ,p_vrbl_rt_prfl_id in number default hr_api.g_number
323 ,p_business_group_id in number default hr_api.g_number
324 ,p_bvr_attribute_category in varchar2 default hr_api.g_varchar2
325 ,p_bvr_attribute1 in varchar2 default hr_api.g_varchar2
329 ,p_bvr_attribute5 in varchar2 default hr_api.g_varchar2
326 ,p_bvr_attribute2 in varchar2 default hr_api.g_varchar2
327 ,p_bvr_attribute3 in varchar2 default hr_api.g_varchar2
328 ,p_bvr_attribute4 in varchar2 default hr_api.g_varchar2
330 ,p_bvr_attribute6 in varchar2 default hr_api.g_varchar2
331 ,p_bvr_attribute7 in varchar2 default hr_api.g_varchar2
332 ,p_bvr_attribute8 in varchar2 default hr_api.g_varchar2
333 ,p_bvr_attribute9 in varchar2 default hr_api.g_varchar2
334 ,p_bvr_attribute10 in varchar2 default hr_api.g_varchar2
335 ,p_bvr_attribute11 in varchar2 default hr_api.g_varchar2
336 ,p_bvr_attribute12 in varchar2 default hr_api.g_varchar2
337 ,p_bvr_attribute13 in varchar2 default hr_api.g_varchar2
338 ,p_bvr_attribute14 in varchar2 default hr_api.g_varchar2
339 ,p_bvr_attribute15 in varchar2 default hr_api.g_varchar2
340 ,p_bvr_attribute16 in varchar2 default hr_api.g_varchar2
341 ,p_bvr_attribute17 in varchar2 default hr_api.g_varchar2
342 ,p_bvr_attribute18 in varchar2 default hr_api.g_varchar2
343 ,p_bvr_attribute19 in varchar2 default hr_api.g_varchar2
344 ,p_bvr_attribute20 in varchar2 default hr_api.g_varchar2
345 ,p_bvr_attribute21 in varchar2 default hr_api.g_varchar2
346 ,p_bvr_attribute22 in varchar2 default hr_api.g_varchar2
347 ,p_bvr_attribute23 in varchar2 default hr_api.g_varchar2
348 ,p_bvr_attribute24 in varchar2 default hr_api.g_varchar2
349 ,p_bvr_attribute25 in varchar2 default hr_api.g_varchar2
350 ,p_bvr_attribute26 in varchar2 default hr_api.g_varchar2
351 ,p_bvr_attribute27 in varchar2 default hr_api.g_varchar2
352 ,p_bvr_attribute28 in varchar2 default hr_api.g_varchar2
353 ,p_bvr_attribute29 in varchar2 default hr_api.g_varchar2
354 ,p_bvr_attribute30 in varchar2 default hr_api.g_varchar2
355 ,p_object_version_number in out nocopy number
356 ,p_ordr_num in number default hr_api.g_number
357 ,p_effective_date in date
358 ,p_datetrack_mode in varchar2
359 ) is
360 --
361 -- Declare cursors and local variables
362 --
363 l_proc varchar2(72) := g_package||'update_bnft_vrbl_rt';
364 l_object_version_number ben_bnft_vrbl_rt_f.object_version_number%TYPE;
365 l_effective_start_date ben_bnft_vrbl_rt_f.effective_start_date%TYPE;
366 l_effective_end_date ben_bnft_vrbl_rt_f.effective_end_date%TYPE;
367 --
368 begin
369 --
370 hr_utility.set_location('Entering:'|| l_proc, 10);
371 --
372 -- Issue a savepoint if operating in validation only mode
373 --
374 savepoint update_bnft_vrbl_rt;
375 --
376 hr_utility.set_location(l_proc, 20);
377 --
378 -- Process Logic
379 --
380 l_object_version_number := p_object_version_number;
381 --
382 begin
383 --
384 -- Start of API User Hook for the before hook of update_bnft_vrbl_rt
385 --
386 ben_bnft_vrbl_rt_bk2.update_bnft_vrbl_rt_b
387 (
388 p_bnft_vrbl_rt_id => p_bnft_vrbl_rt_id
389 ,p_cvg_amt_calc_mthd_id => p_cvg_amt_calc_mthd_id
390 ,p_vrbl_rt_prfl_id => p_vrbl_rt_prfl_id
391 ,p_business_group_id => p_business_group_id
392 ,p_bvr_attribute_category => p_bvr_attribute_category
393 ,p_bvr_attribute1 => p_bvr_attribute1
394 ,p_bvr_attribute2 => p_bvr_attribute2
395 ,p_bvr_attribute3 => p_bvr_attribute3
396 ,p_bvr_attribute4 => p_bvr_attribute4
397 ,p_bvr_attribute5 => p_bvr_attribute5
398 ,p_bvr_attribute6 => p_bvr_attribute6
399 ,p_bvr_attribute7 => p_bvr_attribute7
400 ,p_bvr_attribute8 => p_bvr_attribute8
401 ,p_bvr_attribute9 => p_bvr_attribute9
402 ,p_bvr_attribute10 => p_bvr_attribute10
403 ,p_bvr_attribute11 => p_bvr_attribute11
404 ,p_bvr_attribute12 => p_bvr_attribute12
405 ,p_bvr_attribute13 => p_bvr_attribute13
406 ,p_bvr_attribute14 => p_bvr_attribute14
407 ,p_bvr_attribute15 => p_bvr_attribute15
408 ,p_bvr_attribute16 => p_bvr_attribute16
409 ,p_bvr_attribute17 => p_bvr_attribute17
410 ,p_bvr_attribute18 => p_bvr_attribute18
411 ,p_bvr_attribute19 => p_bvr_attribute19
412 ,p_bvr_attribute20 => p_bvr_attribute20
413 ,p_bvr_attribute21 => p_bvr_attribute21
414 ,p_bvr_attribute22 => p_bvr_attribute22
415 ,p_bvr_attribute23 => p_bvr_attribute23
416 ,p_bvr_attribute24 => p_bvr_attribute24
417 ,p_bvr_attribute25 => p_bvr_attribute25
418 ,p_bvr_attribute26 => p_bvr_attribute26
419 ,p_bvr_attribute27 => p_bvr_attribute27
420 ,p_bvr_attribute28 => p_bvr_attribute28
421 ,p_bvr_attribute29 => p_bvr_attribute29
422 ,p_bvr_attribute30 => p_bvr_attribute30
426 ,p_datetrack_mode => p_datetrack_mode
423 ,p_object_version_number => p_object_version_number
424 ,p_ordr_num => p_ordr_num
425 ,p_effective_date => trunc(p_effective_date)
427 );
428 exception
429 when hr_api.cannot_find_prog_unit then
430 hr_api.cannot_find_prog_unit_error
431 (p_module_name => 'UPDATE_bnft_vrbl_rt'
432 ,p_hook_type => 'BP'
433 );
434 --
435 -- End of API User Hook for the before hook of update_bnft_vrbl_rt
436 --
437 end;
438 --
439 ben_bvr_upd.upd
440 (
441 p_bnft_vrbl_rt_id => p_bnft_vrbl_rt_id
442 ,p_effective_start_date => l_effective_start_date
443 ,p_effective_end_date => l_effective_end_date
444 ,p_cvg_amt_calc_mthd_id => p_cvg_amt_calc_mthd_id
445 ,p_vrbl_rt_prfl_id => p_vrbl_rt_prfl_id
446 ,p_business_group_id => p_business_group_id
447 ,p_bvr_attribute_category => p_bvr_attribute_category
448 ,p_bvr_attribute1 => p_bvr_attribute1
449 ,p_bvr_attribute2 => p_bvr_attribute2
450 ,p_bvr_attribute3 => p_bvr_attribute3
451 ,p_bvr_attribute4 => p_bvr_attribute4
452 ,p_bvr_attribute5 => p_bvr_attribute5
453 ,p_bvr_attribute6 => p_bvr_attribute6
454 ,p_bvr_attribute7 => p_bvr_attribute7
455 ,p_bvr_attribute8 => p_bvr_attribute8
456 ,p_bvr_attribute9 => p_bvr_attribute9
457 ,p_bvr_attribute10 => p_bvr_attribute10
458 ,p_bvr_attribute11 => p_bvr_attribute11
459 ,p_bvr_attribute12 => p_bvr_attribute12
460 ,p_bvr_attribute13 => p_bvr_attribute13
461 ,p_bvr_attribute14 => p_bvr_attribute14
462 ,p_bvr_attribute15 => p_bvr_attribute15
463 ,p_bvr_attribute16 => p_bvr_attribute16
464 ,p_bvr_attribute17 => p_bvr_attribute17
465 ,p_bvr_attribute18 => p_bvr_attribute18
466 ,p_bvr_attribute19 => p_bvr_attribute19
467 ,p_bvr_attribute20 => p_bvr_attribute20
468 ,p_bvr_attribute21 => p_bvr_attribute21
469 ,p_bvr_attribute22 => p_bvr_attribute22
470 ,p_bvr_attribute23 => p_bvr_attribute23
471 ,p_bvr_attribute24 => p_bvr_attribute24
472 ,p_bvr_attribute25 => p_bvr_attribute25
473 ,p_bvr_attribute26 => p_bvr_attribute26
474 ,p_bvr_attribute27 => p_bvr_attribute27
475 ,p_bvr_attribute28 => p_bvr_attribute28
476 ,p_bvr_attribute29 => p_bvr_attribute29
477 ,p_bvr_attribute30 => p_bvr_attribute30
478 ,p_object_version_number => l_object_version_number
479 ,p_ordr_num => p_ordr_num
480 ,p_effective_date => trunc(p_effective_date)
481 ,p_datetrack_mode => p_datetrack_mode
482 );
483 --
484 begin
485 --
486 -- Start of API User Hook for the after hook of update_bnft_vrbl_rt
487 --
488 ben_bnft_vrbl_rt_bk2.update_bnft_vrbl_rt_a
489 (
490 p_bnft_vrbl_rt_id => p_bnft_vrbl_rt_id
491 ,p_effective_start_date => l_effective_start_date
492 ,p_effective_end_date => l_effective_end_date
493 ,p_cvg_amt_calc_mthd_id => p_cvg_amt_calc_mthd_id
494 ,p_vrbl_rt_prfl_id => p_vrbl_rt_prfl_id
495 ,p_business_group_id => p_business_group_id
496 ,p_bvr_attribute_category => p_bvr_attribute_category
497 ,p_bvr_attribute1 => p_bvr_attribute1
498 ,p_bvr_attribute2 => p_bvr_attribute2
499 ,p_bvr_attribute3 => p_bvr_attribute3
500 ,p_bvr_attribute4 => p_bvr_attribute4
501 ,p_bvr_attribute5 => p_bvr_attribute5
502 ,p_bvr_attribute6 => p_bvr_attribute6
503 ,p_bvr_attribute7 => p_bvr_attribute7
504 ,p_bvr_attribute8 => p_bvr_attribute8
505 ,p_bvr_attribute9 => p_bvr_attribute9
506 ,p_bvr_attribute10 => p_bvr_attribute10
507 ,p_bvr_attribute11 => p_bvr_attribute11
508 ,p_bvr_attribute12 => p_bvr_attribute12
509 ,p_bvr_attribute13 => p_bvr_attribute13
510 ,p_bvr_attribute14 => p_bvr_attribute14
511 ,p_bvr_attribute15 => p_bvr_attribute15
512 ,p_bvr_attribute16 => p_bvr_attribute16
513 ,p_bvr_attribute17 => p_bvr_attribute17
514 ,p_bvr_attribute18 => p_bvr_attribute18
515 ,p_bvr_attribute19 => p_bvr_attribute19
516 ,p_bvr_attribute20 => p_bvr_attribute20
517 ,p_bvr_attribute21 => p_bvr_attribute21
518 ,p_bvr_attribute22 => p_bvr_attribute22
519 ,p_bvr_attribute23 => p_bvr_attribute23
520 ,p_bvr_attribute24 => p_bvr_attribute24
521 ,p_bvr_attribute25 => p_bvr_attribute25
522 ,p_bvr_attribute26 => p_bvr_attribute26
523 ,p_bvr_attribute27 => p_bvr_attribute27
527 ,p_object_version_number => l_object_version_number
524 ,p_bvr_attribute28 => p_bvr_attribute28
525 ,p_bvr_attribute29 => p_bvr_attribute29
526 ,p_bvr_attribute30 => p_bvr_attribute30
528 ,p_ordr_num => p_ordr_num
529 ,p_effective_date => trunc(p_effective_date)
530 ,p_datetrack_mode => p_datetrack_mode
531 );
532 exception
533 when hr_api.cannot_find_prog_unit then
534 hr_api.cannot_find_prog_unit_error
535 (p_module_name => 'UPDATE_bnft_vrbl_rt'
536 ,p_hook_type => 'AP'
537 );
538 --
539 -- End of API User Hook for the after hook of update_bnft_vrbl_rt
540 --
541 end;
542 --
543 hr_utility.set_location(l_proc, 60);
544 --
545 -- When in validation only mode raise the Validate_Enabled exception
546 --
547 if p_validate then
548 raise hr_api.validate_enabled;
549 end if;
550 --
551 -- Set all output arguments
552 --
553 p_object_version_number := l_object_version_number;
554 p_effective_start_date := l_effective_start_date;
555 p_effective_end_date := l_effective_end_date;
556 --
557 hr_utility.set_location(' Leaving:'||l_proc, 70);
558 --
559 exception
560 --
561 when hr_api.validate_enabled then
562 --
563 -- As the Validate_Enabled exception has been raised
564 -- we must rollback to the savepoint
565 --
566 ROLLBACK TO update_bnft_vrbl_rt;
567 --
568 -- Only set output warning arguments
569 -- (Any key or derived arguments must be set to null
570 -- when validation only mode is being used.)
571 --
572 hr_utility.set_location(' Leaving:'||l_proc, 80);
573 --
574 when others then
575 --
576 -- A validation or unexpected error has occured
577 --
578 ROLLBACK TO update_bnft_vrbl_rt;
579 -- NOCOPY Changes
580 p_effective_start_date := null;
581 p_effective_end_date := null;
582 p_object_version_number := l_object_version_number ;
583 hr_utility.set_location(' Leaving:'||l_proc, 90);
584 raise;
585 --
586 end update_bnft_vrbl_rt;
587 -- ----------------------------------------------------------------------------
588 -- |------------------------< delete_bnft_vrbl_rt >----------------------|
589 -- ----------------------------------------------------------------------------
590 --
591 procedure delete_bnft_vrbl_rt
592 (p_validate in boolean default false
593 ,p_bnft_vrbl_rt_id in number
594 ,p_effective_start_date out nocopy date
595 ,p_effective_end_date out nocopy date
596 ,p_object_version_number in out nocopy number
597 ,p_effective_date in date
598 ,p_datetrack_mode in varchar2
599 ) is
600 --
601 -- Declare cursors and local variables
602 --
603 l_proc varchar2(72) := g_package||'update_bnft_vrbl_rt';
604 l_object_version_number ben_bnft_vrbl_rt_f.object_version_number%TYPE;
605 l_effective_start_date ben_bnft_vrbl_rt_f.effective_start_date%TYPE;
606 l_effective_end_date ben_bnft_vrbl_rt_f.effective_end_date%TYPE;
607 --
608 cursor c1 is
609 select plip_id,
610 pl_id,
611 oipl_id
612 from ben_cvg_amt_calc_mthd_f ccm,
613 ben_bnft_vrbl_rt_f bvr
614 where ccm.cvg_amt_calc_mthd_id = bvr.cvg_amt_calc_mthd_id
615 and bvr.bnft_vrbl_rt_id = p_bnft_vrbl_rt_id;
616 --
617 l_c1 c1%rowtype;
618 --
619 begin
620 --
621 hr_utility.set_location('Entering:'|| l_proc, 10);
622 --
623 -- Issue a savepoint if operating in validation only mode
624 --
625 savepoint delete_bnft_vrbl_rt;
626 --
627 hr_utility.set_location(l_proc, 20);
628 --
629 -- Process Logic
630 --
631 l_object_version_number := p_object_version_number;
632 --
633 --
634 begin
635 --
636 -- Start of API User Hook for the before hook of delete_bnft_vrbl_rt
637 --
638 ben_bnft_vrbl_rt_bk3.delete_bnft_vrbl_rt_b
639 (
640 p_bnft_vrbl_rt_id => p_bnft_vrbl_rt_id
641 ,p_object_version_number => p_object_version_number
642 ,p_effective_date => trunc(p_effective_date)
643 ,p_datetrack_mode => p_datetrack_mode
644 );
645 exception
646 when hr_api.cannot_find_prog_unit then
647 hr_api.cannot_find_prog_unit_error
648 (p_module_name => 'DELETE_bnft_vrbl_rt'
649 ,p_hook_type => 'BP'
650 );
651 --
652 -- End of API User Hook for the before hook of delete_bnft_vrbl_rt
653 --
654 end;
655 --
656 ben_bvr_del.del
657 (
658 p_bnft_vrbl_rt_id => p_bnft_vrbl_rt_id
659 ,p_effective_start_date => l_effective_start_date
660 ,p_effective_end_date => l_effective_end_date
661 ,p_object_version_number => l_object_version_number
662 ,p_effective_date => p_effective_date
663 ,p_datetrack_mode => p_datetrack_mode
664 );
665 --
666 begin
667 --
671 (
668 -- Start of API User Hook for the after hook of delete_bnft_vrbl_rt
669 --
670 ben_bnft_vrbl_rt_bk3.delete_bnft_vrbl_rt_a
672 p_bnft_vrbl_rt_id => p_bnft_vrbl_rt_id
673 ,p_effective_start_date => l_effective_start_date
674 ,p_effective_end_date => l_effective_end_date
675 ,p_object_version_number => l_object_version_number
676 ,p_effective_date => trunc(p_effective_date)
677 ,p_datetrack_mode => p_datetrack_mode
678 );
679 exception
680 when hr_api.cannot_find_prog_unit then
681 hr_api.cannot_find_prog_unit_error
682 (p_module_name => 'DELETE_bnft_vrbl_rt'
683 ,p_hook_type => 'AP'
684 );
685 --
686 -- End of API User Hook for the after hook of delete_bnft_vrbl_rt
687 --
688 end;
689 --
690 open c1;
691 --
692 fetch c1 into l_c1;
693 --
694 close c1;
695 --
696 if l_c1.pl_id is not null then
697 --
698 ben_derivable_rate.rate_prfl_handler('DELETE','ben_pl_f','pl_id',l_c1.pl_id);
699 --
700 elsif l_c1.oipl_id is not null then
701 --
702 ben_derivable_rate.rate_prfl_handler('DELETE','ben_oipl_f','oipl_id',l_c1.oipl_id);
703 --
704 elsif l_c1.plip_id is not null then
705 --
706 ben_derivable_rate.rate_prfl_handler('DELETE','ben_plip_f','plip_id',l_c1.plip_id);
707 --
708 end if;
709 --
710 hr_utility.set_location(l_proc, 60);
711 --
712 -- When in validation only mode raise the Validate_Enabled exception
713 --
714 if p_validate then
715 raise hr_api.validate_enabled;
716 end if;
717 --
718 hr_utility.set_location(' Leaving:'||l_proc, 70);
719 --
720 exception
721 --
722 when hr_api.validate_enabled then
723 --
724 -- As the Validate_Enabled exception has been raised
725 -- we must rollback to the savepoint
726 --
727 ROLLBACK TO delete_bnft_vrbl_rt;
728 --
729 -- Only set output warning arguments
730 -- (Any key or derived arguments must be set to null
731 -- when validation only mode is being used.)
732 --
733 p_effective_start_date := null;
734 p_effective_end_date := null;
735 --
736 when others then
737 --
738 -- A validation or unexpected error has occured
739 --
740 ROLLBACK TO delete_bnft_vrbl_rt;
741 -- NOCOPY Changes
742 p_effective_start_date := null;
743 p_effective_end_date := null;
744 p_object_version_number := l_object_version_number ;
745 hr_utility.set_location(' Leaving:'||l_proc, 90);
746 raise;
747 --
748 end delete_bnft_vrbl_rt;
749 --
750 -- ----------------------------------------------------------------------------
751 -- |-------------------------------< lck >------------------------------------|
752 -- ----------------------------------------------------------------------------
753 --
754 procedure lck
755 (
756 p_bnft_vrbl_rt_id in number
757 ,p_object_version_number in number
758 ,p_effective_date in date
759 ,p_datetrack_mode in varchar2
760 ,p_validation_start_date out nocopy date
761 ,p_validation_end_date out nocopy date
762 ) is
763 --
764 --
765 -- Declare cursors and local variables
766 --
767 l_proc varchar2(72) := g_package||'lck';
768 l_validation_start_date date;
769 l_validation_end_date date;
770 --
771 begin
772 --
773 hr_utility.set_location('Entering:'|| l_proc, 10);
774 --
775 ben_bvr_shd.lck
776 (
777 p_bnft_vrbl_rt_id => p_bnft_vrbl_rt_id
778 ,p_validation_start_date => l_validation_start_date
779 ,p_validation_end_date => l_validation_end_date
780 ,p_object_version_number => p_object_version_number
781 ,p_effective_date => p_effective_date
782 ,p_datetrack_mode => p_datetrack_mode
783 );
784 --
785 hr_utility.set_location(' Leaving:'||l_proc, 70);
786 --
787 end lck;
788 --
789 end ben_bnft_vrbl_rt_api;