[Home] [Help]
PACKAGE BODY: APPS.BEN_CWB_MATRIX_DTL_API
Source
1 Package Body ben_cwb_matrix_dtl_api as
2 /* $Header: bebcdapi.pkb 120.0 2005/05/28 00:34:22 appldev noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' ben_cwb_matrix_dtl_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< create_cwb_matrix_dtl >------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_cwb_matrix_dtl
13 (p_validate in boolean default false
14 ,p_business_group_id in number
15 ,p_cwb_matrix_id in number
16 ,p_row_crit_val in varchar2
17 ,p_col_crit_val in varchar2 default null
18 ,p_pct_emp_cndr in number default null
19 ,p_pct_val in number default null
20 ,p_emp_amt in number default null
21 ,p_cwb_matrix_dtl_id out nocopy number
22 ,p_object_version_number out nocopy number
23 ) is
24 --
25 -- Declare cursors and local variables
26 --
27 l_cwb_matrix_dtl_id ben_cwb_matrix_dtl.cwb_matrix_dtl_id%TYPE;
28 l_object_version_number ben_cwb_matrix_dtl.object_version_number%TYPE;
29 l_proc varchar2(72) := g_package||'create_cwb_matrix_dtl';
30 --
31 begin
32 hr_utility.set_location('Entering:'|| l_proc, 10);
33 --
34 -- Issue a savepoint
35 --
36 savepoint create_cwb_matrix_dtl;
37 --
38 -- Call Before Process User Hook
39 --
40 begin
41 ben_cwb_matrix_dtl_bk1.create_cwb_matrix_dtl_b
42 (p_cwb_matrix_id => p_cwb_matrix_id
43 ,p_business_group_id => p_business_group_id
44 ,p_row_crit_val => p_row_crit_val
45 ,p_col_crit_val => p_col_crit_val
46 ,p_pct_emp_cndr => p_pct_emp_cndr
47 ,p_pct_val => p_pct_val
48 ,p_emp_amt => p_emp_amt
49 );
50 exception
51 when hr_api.cannot_find_prog_unit then
52 hr_api.cannot_find_prog_unit_error
53 (p_module_name => 'create_cwb_matrix_dtl'
54 ,p_hook_type => 'BP'
55 );
56 end;
57 --
58 -- Process Logic
59 --
60 ben_bcd_ins.ins
61 (p_cwb_matrix_dtl_id => l_cwb_matrix_dtl_id
62 ,p_cwb_matrix_id => p_cwb_matrix_id
63 ,p_business_group_id => p_business_group_id
64 ,p_row_crit_val => p_row_crit_val
65 ,p_col_crit_val => p_col_crit_val
66 ,p_pct_emp_cndr => p_pct_emp_cndr
67 ,p_pct_val => p_pct_val
68 ,p_emp_amt => p_emp_amt
69 ,p_object_version_number => l_object_version_number
70 );
71 --
72 -- Call After Process User Hook
73 --
74 begin
75 ben_cwb_matrix_dtl_bk1.create_cwb_matrix_dtl_a
76 (p_cwb_matrix_dtl_id => l_cwb_matrix_dtl_id
77 ,p_cwb_matrix_id => p_cwb_matrix_id
78 ,p_business_group_id => p_business_group_id
79 ,p_row_crit_val => p_row_crit_val
80 ,p_col_crit_val => p_col_crit_val
81 ,p_pct_emp_cndr => p_pct_emp_cndr
82 ,p_pct_val => p_pct_val
83 ,p_emp_amt => p_emp_amt
84 ,p_object_version_number => l_object_version_number
85 );
86
87 exception
88 when hr_api.cannot_find_prog_unit then
89 hr_api.cannot_find_prog_unit_error
90 (p_module_name => 'create_cwb_matrix_dtl'
91 ,p_hook_type => 'AP'
92 );
93 end;
94 --
95 -- When in validation only mode raise the Validate_Enabled exception
96 --
97 if p_validate then
98 raise hr_api.validate_enabled;
99 end if;
100 --
101 -- Set all output arguments
102 --
103 p_cwb_matrix_dtl_id := l_cwb_matrix_dtl_id;
104 p_object_version_number := l_object_version_number;
105 --
106 hr_utility.set_location(' Leaving:'||l_proc, 70);
107 --
108 exception
109 when hr_api.validate_enabled then
110 --
111 -- As the Validate_Enabled exception has been raised
112 -- we must rollback to the savepoint
113 --
114 rollback to create_cwb_matrix_dtl;
115 --
116 -- Only set output warning arguments
117 -- (Any key or derived arguments must be set to null
118 -- when validation only mode is being used.)
119 --
120 p_cwb_matrix_dtl_id := null;
121 p_object_version_number := null;
122 hr_utility.set_location(' Leaving:'||l_proc, 80);
123 when others then
124 --
125 -- A validation or unexpected error has occured
126 --
127 rollback to create_cwb_matrix_dtl;
128 p_cwb_matrix_dtl_id := null; --nocopy changes
129 p_object_version_number := null; --nocopy changes
130
131 hr_utility.set_location(' Leaving:'||l_proc, 90);
132 raise;
133 end create_cwb_matrix_dtl;
134 --
135 -- ----------------------------------------------------------------------------
136 -- |--------------------------< update_cwb_matrix_dtl >------------------------|
137 -- ----------------------------------------------------------------------------
138 --
139 procedure update_cwb_matrix_dtl
140 (p_validate in boolean default false
141 ,p_cwb_matrix_dtl_id in number
142 ,p_cwb_matrix_id in number default hr_api.g_number
143 ,p_business_group_id in number default hr_api.g_number
144 ,p_row_crit_val in varchar2 default hr_api.g_varchar2
145 ,p_col_crit_val in varchar2 default hr_api.g_varchar2
146 ,p_pct_emp_cndr in number default hr_api.g_number
147 ,p_pct_val in number default hr_api.g_number
148 ,p_emp_amt in number default hr_api.g_number
149 ,p_object_version_number in out nocopy number
150 ) is
151 --
152 -- Declare cursors and local variables
153 --
154 l_object_version_number ben_cwb_matrix_dtl.object_version_number%TYPE;
155 l_proc varchar2(72) := g_package||'update_cwb_matrix_dtl';
156 --
157 begin
158 hr_utility.set_location('Entering:'|| l_proc, 10);
159 --
160 -- Issue a savepoint
161 --
162 savepoint update_cwb_matrix_dtl;
163 --
164 hr_utility.set_location(l_proc, 20);
165 --
166 -- Process Logic
167 --
168 l_object_version_number := p_object_version_number;
169 --
170 -- Call Before Process User Hook
171 --
172 begin
173 ben_cwb_matrix_dtl_bk2.update_cwb_matrix_dtl_b
174 (p_cwb_matrix_dtl_id => p_cwb_matrix_dtl_id
175 ,p_cwb_matrix_id => p_cwb_matrix_id
176 ,p_business_group_id => p_business_group_id
177 ,p_row_crit_val => p_row_crit_val
178 ,p_col_crit_val => p_col_crit_val
179 ,p_pct_emp_cndr => p_pct_emp_cndr
180 ,p_pct_val => p_pct_val
181 ,p_emp_amt => p_emp_amt
182 ,p_object_version_number => p_object_version_number
183 );
184
185 exception
186 when hr_api.cannot_find_prog_unit then
187 hr_api.cannot_find_prog_unit_error
188 (p_module_name => 'update_cwb_matrix_dtl'
189 ,p_hook_type => 'BP'
190 );
191 end;
192 --
193 -- Process Logic
194 --
195 ben_bcd_upd.upd
196 (p_cwb_matrix_dtl_id => p_cwb_matrix_dtl_id
197 ,p_cwb_matrix_id => p_cwb_matrix_id
198 ,p_row_crit_val => p_row_crit_val
199 ,p_col_crit_val => p_col_crit_val
200 ,p_business_group_id => p_business_group_id
201 ,p_pct_emp_cndr => p_pct_emp_cndr
202 ,p_pct_val => p_pct_val
203 ,p_emp_amt => p_emp_amt
204 ,p_object_version_number => l_object_version_number
205 );
206 --
207 -- Call After Process User Hook
208 --
209 begin
210 --
211 -- Start of API User Hook for the after hook of update_cwb_matrix_dtl
212 --
213 ben_cwb_matrix_dtl_bk2.update_cwb_matrix_dtl_a
214 (p_cwb_matrix_dtl_id => p_cwb_matrix_dtl_id
215 ,p_cwb_matrix_id => p_cwb_matrix_id
216 ,p_business_group_id => p_business_group_id
217 ,p_row_crit_val => p_row_crit_val
218 ,p_col_crit_val => p_col_crit_val
219 ,p_pct_emp_cndr => p_pct_emp_cndr
220 ,p_pct_val => p_pct_val
221 ,p_emp_amt => p_emp_amt
222 ,p_object_version_number => l_object_version_number
223 );
224
225 exception
226 when hr_api.cannot_find_prog_unit then
227 hr_api.cannot_find_prog_unit_error
228 (p_module_name => 'update_cwb_matrix_dtl'
229 ,p_hook_type => 'AP'
230 );
231 --
232 -- End of API User Hook for the after hook of update_cwb_matrix_dtl
233 --
234 end;
235 --
236 -- When in validation only mode raise the Validate_Enabled exception
237 --
238 if p_validate then
239 raise hr_api.validate_enabled;
240 end if;
241 --
242 -- Set all output arguments
243 --
244 p_object_version_number := l_object_version_number;
245 --
246 hr_utility.set_location(' Leaving:'||l_proc, 70);
247 --
248 exception
249 when hr_api.validate_enabled then
250 --
251 -- As the Validate_Enabled exception has been raised
252 -- we must rollback to the savepoint
253 --
254 rollback to update_cwb_matrix_dtl;
255 --
256 -- Only set output warning arguments
257 -- (Any key or derived arguments must be set to null
258 -- when validation only mode is being used.)
259 --
260 hr_utility.set_location(' Leaving:'||l_proc, 80);
261 --
262 when others then
263 --
264 -- A validation or unexpected error has occured
265 --
266 rollback to update_cwb_matrix_dtl;
267
268 hr_utility.set_location(' Leaving:'||l_proc, 90);
269 raise;
270 end update_cwb_matrix_dtl;
271 --
272 -- ----------------------------------------------------------------------------
273 -- |--------------------------< delete_cwb_matrix_dtl >------------------------|
274 -- ----------------------------------------------------------------------------
275 --
276 procedure delete_cwb_matrix_dtl
277 (p_validate in boolean default false
278 ,p_cwb_matrix_dtl_id in number
279 ,p_object_version_number in out nocopy number
280 ) is
281 --
282 -- Declare cursors and local variables
283 --
284 l_object_version_number ben_cwb_matrix_dtl.object_version_number%TYPE;
285 l_proc varchar2(72) := g_package||'delete_cwb_matrix_dtl';
286 --
287 begin
288 hr_utility.set_location('Entering:'|| l_proc, 10);
289 --
290 -- Issue a savepoint
291 --
292 savepoint delete_cwb_matrix_dtl;
293 --
294 hr_utility.set_location(l_proc, 20);
295 --
296 -- Process Logic
297 --
298 l_object_version_number := p_object_version_number;
299 --
300 -- Call Before Process User Hook
301 --
302 begin
303 ben_cwb_matrix_dtl_bk3.delete_cwb_matrix_dtl_b
304 (p_cwb_matrix_dtl_id => p_cwb_matrix_dtl_id
305 ,p_object_version_number => p_object_version_number
306 );
307
308 exception
309 when hr_api.cannot_find_prog_unit then
310 hr_api.cannot_find_prog_unit_error
311 (p_module_name => 'delete_cwb_matrix_dtl'
312 ,p_hook_type => 'BP'
313 );
314 end;
315 --
316 -- Process Logic
317 --
318 ben_bcd_del.del
319 (p_cwb_matrix_dtl_id => p_cwb_matrix_dtl_id
320 ,p_object_version_number => l_object_version_number
321 );
322 --
323 -- Call After Process User Hook
324 --
325 begin
326 --
327 -- Start of API User Hook for the after hook of delete_cwb_matrix_dtl
328 --
329 ben_cwb_matrix_dtl_bk3.delete_cwb_matrix_dtl_a
330 (p_cwb_matrix_dtl_id => p_cwb_matrix_dtl_id
331 ,p_object_version_number => l_object_version_number
332 );
333
334 exception
335 when hr_api.cannot_find_prog_unit then
336 hr_api.cannot_find_prog_unit_error
337 (p_module_name => 'delete_cwb_matrix_dtl'
338 ,p_hook_type => 'AP'
339 );
340 --
341 -- End of API User Hook for the after hook of delete_cwb_matrix_dtl
342 --
343 end;
344 --
345 -- When in validation only mode raise the Validate_Enabled exception
346 --
347 if p_validate then
348 raise hr_api.validate_enabled;
349 end if;
350 --
351
352
353 hr_utility.set_location(' Leaving:'||l_proc, 70);
354 --
355 exception
356 when hr_api.validate_enabled then
357 --
358 -- As the Validate_Enabled exception has been raised
359 -- we must rollback to the savepoint
360 --
361 rollback to delete_cwb_matrix_dtl;
362 --
363 -- Only set output warning arguments
364 -- (Any key or derived arguments must be set to null
365 -- when validation only mode is being used.)
366 --
367 hr_utility.set_location(' Leaving:'||l_proc, 80);
368 --
369 when others then
370 --
371 -- A validation or unexpected error has occured
372 --
373 rollback to delete_cwb_matrix_dtl;
374
375 hr_utility.set_location(' Leaving:'||l_proc, 90);
376 raise;
377 end delete_cwb_matrix_dtl;
378 --
379 -- ----------------------------------------------------------------------------
380 -- |-------------------------------< lck >------------------------------------|
381 -- ----------------------------------------------------------------------------
382 --
383 procedure lck
384 (p_cwb_matrix_dtl_id in number
385 ,p_object_version_number in number
386 ) is
387 --
388 --
389 -- Declare cursors and local variables
390 --
391 l_proc varchar2(72) := g_package||'lck';
392 --
393 begin
394 --
395 hr_utility.set_location('Entering:'|| l_proc, 10);
396 --
397 ben_bcd_shd.lck
398 (p_cwb_matrix_dtl_id => p_cwb_matrix_dtl_id
399 ,p_object_version_number => p_object_version_number
400 );
401 --
402 hr_utility.set_location(' Leaving:'||l_proc, 70);
403 --
404 end lck;
405 --
406 end ben_cwb_matrix_dtl_api;