[Home] [Help]
PACKAGE BODY: APPS.BEN_HWF_SHD
Source
4 -- ----------------------------------------------------------------------------
1 Package Body ben_hwf_shd as
2 /* $Header: behwfrhi.pkb 120.0 2005/05/28 03:12:16 appldev noship $ */
3 --
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_hwf_shd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------< return_api_dml_status >-------------------------|
12 -- ----------------------------------------------------------------------------
13 Function return_api_dml_status Return Boolean Is
14 --
15 l_proc varchar2(72) := g_package||'return_api_dml_status';
16 --
17 Begin
18 hr_utility.set_location('Entering:'||l_proc, 5);
19 --
20 Return (nvl(g_api_dml, false));
21 --
22 hr_utility.set_location(' Leaving:'||l_proc, 10);
23 End return_api_dml_status;
24 --
25 -- ----------------------------------------------------------------------------
26 -- |---------------------------< constraint_error >---------------------------|
27 -- ----------------------------------------------------------------------------
28 Procedure constraint_error
29 (p_constraint_name in all_constraints.constraint_name%TYPE) Is
30 --
31 l_proc varchar2(72) := g_package||'constraint_error';
32 --
33 Begin
34 hr_utility.set_location('Entering:'||l_proc, 5);
35 --
36 If (p_constraint_name = 'BEN_HRS_WKD_IN_PERD_FCTR_PK') Then
37 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
38 fnd_message.set_token('PROCEDURE', l_proc);
39 fnd_message.set_token('STEP','5');
40 fnd_message.raise_error;
41 ElsIf (p_constraint_name = 'BEN_ELIG_HRS_WKD_FK1') Then
42 ben_utility.child_exists_error(p_table_name => 'BEN_ELIG_HRS_WKD_PRTE_F');
43 ElsIf (p_constraint_name = 'BEN_HRS_WORKED_IN_PERD_RT_FK1') Then
44 ben_utility.child_exists_error(p_table_name => 'BEN_HRS_WKD_IN_PERD_RT_F');
45 Else
46 fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
47 fnd_message.set_token('PROCEDURE', l_proc);
48 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
49 fnd_message.raise_error;
50 End If;
51 --
52 hr_utility.set_location(' Leaving:'||l_proc, 10);
53 End constraint_error;
54 --
55 -- ----------------------------------------------------------------------------
56 -- |-----------------------------< api_updating >-----------------------------|
57 -- ----------------------------------------------------------------------------
58 Function api_updating
59 (
60 p_hrs_wkd_in_perd_fctr_id in number,
61 p_object_version_number in number
62 ) Return Boolean Is
63 --
64 --
65 -- Cursor selects the 'current' row from the HR Schema
66 --
67 Cursor C_Sel1 is
68 select
69 hrs_wkd_in_perd_fctr_id,
70 name,
71 business_group_id,
72 hrs_src_cd,
73 rndg_cd,
74 rndg_rl,
75 hrs_wkd_det_cd,
76 hrs_wkd_det_rl,
77 no_mn_hrs_wkd_flag,
78 mx_hrs_num,
79 no_mx_hrs_wkd_flag,
80 once_r_cntug_cd,
81 mn_hrs_num,
82 hrs_alt_val_to_use_cd,
83 pyrl_freq_cd,
84 hrs_wkd_calc_rl,
85 defined_balance_id,
86 bnfts_bal_id,
87 hwf_attribute_category,
88 hwf_attribute1,
89 hwf_attribute2,
90 hwf_attribute3,
91 hwf_attribute4,
92 hwf_attribute5,
93 hwf_attribute6,
94 hwf_attribute7,
95 hwf_attribute8,
96 hwf_attribute9,
97 hwf_attribute10,
98 hwf_attribute11,
99 hwf_attribute12,
100 hwf_attribute13,
101 hwf_attribute14,
102 hwf_attribute15,
103 hwf_attribute16,
104 hwf_attribute17,
105 hwf_attribute18,
106 hwf_attribute19,
107 hwf_attribute20,
108 hwf_attribute21,
109 hwf_attribute22,
110 hwf_attribute23,
111 hwf_attribute24,
112 hwf_attribute25,
113 hwf_attribute26,
114 hwf_attribute27,
115 hwf_attribute28,
116 hwf_attribute29,
117 hwf_attribute30,
118 object_version_number
119 from ben_hrs_wkd_in_perd_fctr
120 where hrs_wkd_in_perd_fctr_id = p_hrs_wkd_in_perd_fctr_id;
121 --
122 l_proc varchar2(72) := g_package||'api_updating';
123 l_fct_ret boolean;
124 --
125 Begin
126 hr_utility.set_location('Entering:'||l_proc, 5);
127 --
128 If (
129 p_hrs_wkd_in_perd_fctr_id is null and
130 p_object_version_number is null
131 ) Then
132 --
133 -- One of the primary key arguments is null therefore we must
134 -- set the returning function value to false
135 --
136 l_fct_ret := false;
137 Else
138 If (
139 p_hrs_wkd_in_perd_fctr_id = g_old_rec.hrs_wkd_in_perd_fctr_id and
140 p_object_version_number = g_old_rec.object_version_number
141 ) Then
142 hr_utility.set_location(l_proc, 10);
143 --
144 -- The g_old_rec is current therefore we must
145 -- set the returning function to true
146 --
147 l_fct_ret := true;
148 Else
149 --
150 -- Select the current row into g_old_rec
151 --
152 Open C_Sel1;
153 Fetch C_Sel1 Into g_old_rec;
154 If C_Sel1%notfound Then
155 Close C_Sel1;
156 --
157 -- The primary key is invalid therefore we must error
158 --
159 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
160 fnd_message.raise_error;
161 End If;
162 Close C_Sel1;
163 If (p_object_version_number <> g_old_rec.object_version_number) Then
164 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
165 fnd_message.raise_error;
166 End If;
167 hr_utility.set_location(l_proc, 15);
168 l_fct_ret := true;
169 End If;
170 End If;
171 hr_utility.set_location(' Leaving:'||l_proc, 20);
172 Return (l_fct_ret);
173 --
174 End api_updating;
175 --
176 -- ----------------------------------------------------------------------------
177 -- |---------------------------------< lck >----------------------------------|
178 -- ----------------------------------------------------------------------------
179 Procedure lck
180 (
181 p_hrs_wkd_in_perd_fctr_id in number,
182 p_object_version_number in number
183 ) is
184 --
185 -- Cursor selects the 'current' row from the HR Schema
186 --
187 Cursor C_Sel1 is
188 select hrs_wkd_in_perd_fctr_id,
189 name,
190 business_group_id,
191 hrs_src_cd,
195 hrs_wkd_det_rl,
192 rndg_cd,
193 rndg_rl,
194 hrs_wkd_det_cd,
196 no_mn_hrs_wkd_flag,
197 mx_hrs_num,
198 no_mx_hrs_wkd_flag,
199 once_r_cntug_cd,
200 mn_hrs_num,
201 hrs_alt_val_to_use_cd,
202 pyrl_freq_cd,
203 hrs_wkd_calc_rl,
204 defined_balance_id,
205 bnfts_bal_id,
206 hwf_attribute_category,
207 hwf_attribute1,
208 hwf_attribute2,
209 hwf_attribute3,
210 hwf_attribute4,
211 hwf_attribute5,
212 hwf_attribute6,
213 hwf_attribute7,
214 hwf_attribute8,
215 hwf_attribute9,
216 hwf_attribute10,
217 hwf_attribute11,
218 hwf_attribute12,
219 hwf_attribute13,
220 hwf_attribute14,
221 hwf_attribute15,
222 hwf_attribute16,
223 hwf_attribute17,
224 hwf_attribute18,
225 hwf_attribute19,
226 hwf_attribute20,
227 hwf_attribute21,
228 hwf_attribute22,
229 hwf_attribute23,
230 hwf_attribute24,
231 hwf_attribute25,
232 hwf_attribute26,
233 hwf_attribute27,
234 hwf_attribute28,
235 hwf_attribute29,
236 hwf_attribute30,
237 object_version_number
238 from ben_hrs_wkd_in_perd_fctr
239 where hrs_wkd_in_perd_fctr_id = p_hrs_wkd_in_perd_fctr_id
240 for update nowait;
241 --
242 l_proc varchar2(72) := g_package||'lck';
243 --
244 Begin
245 hr_utility.set_location('Entering:'||l_proc, 5);
246 --
247 -- Add any mandatory argument checking here:
248 -- Example:
249 -- hr_api.mandatory_arg_error
250 -- (p_api_name => l_proc,
251 -- p_argument => 'object_version_number',
252 -- p_argument_value => p_object_version_number);
253 --
254 Open C_Sel1;
255 Fetch C_Sel1 Into g_old_rec;
256 If C_Sel1%notfound then
257 Close C_Sel1;
258 --
259 -- The primary key is invalid therefore we must error
260 --
261 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
262 fnd_message.raise_error;
263 End If;
264 Close C_Sel1;
265 If (p_object_version_number <> g_old_rec.object_version_number) Then
266 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
267 fnd_message.raise_error;
268 End If;
269 --
270 hr_utility.set_location(' Leaving:'||l_proc, 10);
271 --
272 -- We need to trap the ORA LOCK exception
273 --
274 Exception
275 When HR_Api.Object_Locked then
276 --
277 -- The object is locked therefore we need to supply a meaningful
278 -- error message.
279 --
280 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
281 fnd_message.set_token('TABLE_NAME', 'ben_hrs_wkd_in_perd_fctr');
282 fnd_message.raise_error;
283 End lck;
284 --
285 -- ----------------------------------------------------------------------------
286 -- |-----------------------------< convert_args >-----------------------------|
287 -- ----------------------------------------------------------------------------
288 Function convert_args
289 (
290 p_hrs_wkd_in_perd_fctr_id in number,
291 p_name in varchar2,
292 p_business_group_id in number,
293 p_hrs_src_cd in varchar2,
294 p_rndg_cd in varchar2,
295 p_rndg_rl in number,
296 p_hrs_wkd_det_cd in varchar2,
297 p_hrs_wkd_det_rl in number,
298 p_no_mn_hrs_wkd_flag in varchar2,
299 p_mx_hrs_num in number,
300 p_no_mx_hrs_wkd_flag in varchar2,
301 p_once_r_cntug_cd in varchar2,
302 p_mn_hrs_num in number,
303 p_hrs_alt_val_to_use_cd in varchar2,
304 p_pyrl_freq_cd in varchar2,
305 p_hrs_wkd_calc_rl in number,
306 p_defined_balance_id in number,
307 p_bnfts_bal_id in number,
308 p_hwf_attribute_category in varchar2,
309 p_hwf_attribute1 in varchar2,
310 p_hwf_attribute2 in varchar2,
311 p_hwf_attribute3 in varchar2,
312 p_hwf_attribute4 in varchar2,
313 p_hwf_attribute5 in varchar2,
314 p_hwf_attribute6 in varchar2,
315 p_hwf_attribute7 in varchar2,
316 p_hwf_attribute8 in varchar2,
317 p_hwf_attribute9 in varchar2,
318 p_hwf_attribute10 in varchar2,
319 p_hwf_attribute11 in varchar2,
320 p_hwf_attribute12 in varchar2,
321 p_hwf_attribute13 in varchar2,
322 p_hwf_attribute14 in varchar2,
323 p_hwf_attribute15 in varchar2,
324 p_hwf_attribute16 in varchar2,
325 p_hwf_attribute17 in varchar2,
326 p_hwf_attribute18 in varchar2,
327 p_hwf_attribute19 in varchar2,
328 p_hwf_attribute20 in varchar2,
329 p_hwf_attribute21 in varchar2,
330 p_hwf_attribute22 in varchar2,
331 p_hwf_attribute23 in varchar2,
332 p_hwf_attribute24 in varchar2,
333 p_hwf_attribute25 in varchar2,
334 p_hwf_attribute26 in varchar2,
335 p_hwf_attribute27 in varchar2,
336 p_hwf_attribute28 in varchar2,
337 p_hwf_attribute29 in varchar2,
338 p_hwf_attribute30 in varchar2,
339 p_object_version_number in number
340 )
341 Return g_rec_type is
342 --
343 l_rec g_rec_type;
344 l_proc varchar2(72) := g_package||'convert_args';
345 --
346 Begin
347 --
348 hr_utility.set_location('Entering:'||l_proc, 5);
349 --
350 -- Convert arguments into local l_rec structure.
351 --
352 l_rec.hrs_wkd_in_perd_fctr_id := p_hrs_wkd_in_perd_fctr_id;
353 l_rec.name := p_name;
354 l_rec.business_group_id := p_business_group_id;
355 l_rec.hrs_src_cd := p_hrs_src_cd;
356 l_rec.rndg_cd := p_rndg_cd;
357 l_rec.rndg_rl := p_rndg_rl;
358 l_rec.hrs_wkd_det_cd := p_hrs_wkd_det_cd;
359 l_rec.hrs_wkd_det_rl := p_hrs_wkd_det_rl;
360 l_rec.no_mn_hrs_wkd_flag := p_no_mn_hrs_wkd_flag;
361 l_rec.mx_hrs_num := p_mx_hrs_num;
362 l_rec.no_mx_hrs_wkd_flag := p_no_mx_hrs_wkd_flag;
363 l_rec.once_r_cntug_cd := p_once_r_cntug_cd;
364 l_rec.mn_hrs_num := p_mn_hrs_num;
365 l_rec.hrs_alt_val_to_use_cd := p_hrs_alt_val_to_use_cd;
366 l_rec.pyrl_freq_cd := p_pyrl_freq_cd;
367 l_rec.hrs_wkd_calc_rl := p_hrs_wkd_calc_rl;
368 l_rec.defined_balance_id := p_defined_balance_id;
369 l_rec.bnfts_bal_id := p_bnfts_bal_id;
370 l_rec.hwf_attribute_category := p_hwf_attribute_category;
371 l_rec.hwf_attribute1 := p_hwf_attribute1;
372 l_rec.hwf_attribute2 := p_hwf_attribute2;
373 l_rec.hwf_attribute3 := p_hwf_attribute3;
374 l_rec.hwf_attribute4 := p_hwf_attribute4;
375 l_rec.hwf_attribute5 := p_hwf_attribute5;
376 l_rec.hwf_attribute6 := p_hwf_attribute6;
377 l_rec.hwf_attribute7 := p_hwf_attribute7;
378 l_rec.hwf_attribute8 := p_hwf_attribute8;
379 l_rec.hwf_attribute9 := p_hwf_attribute9;
380 l_rec.hwf_attribute10 := p_hwf_attribute10;
381 l_rec.hwf_attribute11 := p_hwf_attribute11;
382 l_rec.hwf_attribute12 := p_hwf_attribute12;
383 l_rec.hwf_attribute13 := p_hwf_attribute13;
384 l_rec.hwf_attribute14 := p_hwf_attribute14;
385 l_rec.hwf_attribute15 := p_hwf_attribute15;
386 l_rec.hwf_attribute16 := p_hwf_attribute16;
387 l_rec.hwf_attribute17 := p_hwf_attribute17;
388 l_rec.hwf_attribute18 := p_hwf_attribute18;
389 l_rec.hwf_attribute19 := p_hwf_attribute19;
390 l_rec.hwf_attribute20 := p_hwf_attribute20;
391 l_rec.hwf_attribute21 := p_hwf_attribute21;
392 l_rec.hwf_attribute22 := p_hwf_attribute22;
393 l_rec.hwf_attribute23 := p_hwf_attribute23;
394 l_rec.hwf_attribute24 := p_hwf_attribute24;
395 l_rec.hwf_attribute25 := p_hwf_attribute25;
396 l_rec.hwf_attribute26 := p_hwf_attribute26;
397 l_rec.hwf_attribute27 := p_hwf_attribute27;
398 l_rec.hwf_attribute28 := p_hwf_attribute28;
399 l_rec.hwf_attribute29 := p_hwf_attribute29;
400 l_rec.hwf_attribute30 := p_hwf_attribute30;
401 l_rec.object_version_number := p_object_version_number;
402 --
403 -- Return the plsql record structure.
404 --
405 hr_utility.set_location(' Leaving:'||l_proc, 10);
406 Return(l_rec);
407 --
408 End convert_args;
409 --
410 end ben_hwf_shd;