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