[Home] [Help]
PACKAGE BODY: APPS.BEN_ECC_SHD
Source
1 Package Body ben_ecc_shd as
2 /* $Header: beeccrhi.pkb 120.0 2005/05/28 01:49:03 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_ecc_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 = 'AVCON_BEN_E_RQD_F_000') 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_ELCTBL_CHC_CTFN_FK2') Then
42 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
43 fnd_message.set_token('PROCEDURE', l_proc);
44 fnd_message.set_token('STEP','10');
45 fnd_message.raise_error;
46 ElsIf (p_constraint_name = 'BEN_ELCTBL_CHC_CTFN_FK3') Then
47 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
48 fnd_message.set_token('PROCEDURE', l_proc);
49 fnd_message.set_token('STEP','15');
50 fnd_message.raise_error;
51 Else
52 fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
53 fnd_message.set_token('PROCEDURE', l_proc);
54 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
55 fnd_message.raise_error;
56 End If;
57 --
58 hr_utility.set_location(' Leaving:'||l_proc, 10);
59 End constraint_error;
60 --
61 -- ----------------------------------------------------------------------------
62 -- |-----------------------------< api_updating >-----------------------------|
63 -- ----------------------------------------------------------------------------
64 Function api_updating
65 (
66 p_elctbl_chc_ctfn_id in number,
67 p_object_version_number in number
68 ) Return Boolean Is
69 --
70 --
71 -- Cursor selects the 'current' row from the HR Schema
72 --
73 Cursor C_Sel1 is
74 select
75 elctbl_chc_ctfn_id,
76 enrt_ctfn_typ_cd,
77 rqd_flag,
78 elig_per_elctbl_chc_id,
79 enrt_bnft_id,
80 business_group_id,
81 ecc_attribute_category,
82 ecc_attribute1,
83 ecc_attribute2,
84 ecc_attribute3,
85 ecc_attribute4,
86 ecc_attribute5,
87 ecc_attribute6,
88 ecc_attribute7,
89 ecc_attribute8,
90 ecc_attribute9,
91 ecc_attribute10,
92 ecc_attribute11,
93 ecc_attribute12,
94 ecc_attribute13,
95 ecc_attribute14,
96 ecc_attribute15,
97 ecc_attribute16,
98 ecc_attribute17,
99 ecc_attribute18,
100 ecc_attribute19,
101 ecc_attribute20,
102 ecc_attribute21,
103 ecc_attribute22,
104 ecc_attribute23,
105 ecc_attribute24,
106 ecc_attribute25,
107 ecc_attribute26,
108 ecc_attribute27,
109 ecc_attribute28,
110 ecc_attribute29,
111 ecc_attribute30,
112 susp_if_ctfn_not_prvd_flag,
113 ctfn_determine_cd,
114 request_id,
115 program_application_id,
116 program_id,
117 program_update_date,
118 object_version_number
122 l_proc varchar2(72) := g_package||'api_updating';
119 from ben_elctbl_chc_ctfn
120 where elctbl_chc_ctfn_id = p_elctbl_chc_ctfn_id;
121 --
123 l_fct_ret boolean;
124 --
125 Begin
126 hr_utility.set_location('Entering:'||l_proc, 5);
127 --
128 If (
129 p_elctbl_chc_ctfn_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_elctbl_chc_ctfn_id = g_old_rec.elctbl_chc_ctfn_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_elctbl_chc_ctfn_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 elctbl_chc_ctfn_id,
189 enrt_ctfn_typ_cd,
190 rqd_flag,
191 elig_per_elctbl_chc_id,
192 enrt_bnft_id,
193 business_group_id,
194 ecc_attribute_category,
195 ecc_attribute1,
196 ecc_attribute2,
197 ecc_attribute3,
198 ecc_attribute4,
199 ecc_attribute5,
200 ecc_attribute6,
201 ecc_attribute7,
202 ecc_attribute8,
203 ecc_attribute9,
204 ecc_attribute10,
205 ecc_attribute11,
206 ecc_attribute12,
207 ecc_attribute13,
208 ecc_attribute14,
209 ecc_attribute15,
210 ecc_attribute16,
211 ecc_attribute17,
212 ecc_attribute18,
213 ecc_attribute19,
214 ecc_attribute20,
215 ecc_attribute21,
216 ecc_attribute22,
217 ecc_attribute23,
218 ecc_attribute24,
219 ecc_attribute25,
220 ecc_attribute26,
221 ecc_attribute27,
222 ecc_attribute28,
223 ecc_attribute29,
224 ecc_attribute30,
225 susp_if_ctfn_not_prvd_flag,
226 ctfn_determine_cd,
227 request_id,
228 program_application_id,
229 program_id,
230 program_update_date,
231 object_version_number
232 from ben_elctbl_chc_ctfn
233 where elctbl_chc_ctfn_id = p_elctbl_chc_ctfn_id
234 for update nowait;
235 --
236 l_proc varchar2(72) := g_package||'lck';
237 --
238 Begin
239 hr_utility.set_location('Entering:'||l_proc, 5);
240 --
241 -- Add any mandatory argument checking here:
242 -- Example:
243 -- hr_api.mandatory_arg_error
244 -- (p_api_name => l_proc,
245 -- p_argument => 'object_version_number',
246 -- p_argument_value => p_object_version_number);
247 --
248 Open C_Sel1;
249 Fetch C_Sel1 Into g_old_rec;
250 If C_Sel1%notfound then
251 Close C_Sel1;
252 --
253 -- The primary key is invalid therefore we must error
254 --
255 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
256 fnd_message.raise_error;
257 End If;
258 Close C_Sel1;
259 If (p_object_version_number <> g_old_rec.object_version_number) Then
260 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
261 fnd_message.raise_error;
262 End If;
263 --
264 hr_utility.set_location(' Leaving:'||l_proc, 10);
265 --
266 -- We need to trap the ORA LOCK exception
267 --
268 Exception
269 When HR_Api.Object_Locked then
270 --
271 -- The object is locked therefore we need to supply a meaningful
272 -- error message.
273 --
274 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
275 fnd_message.set_token('TABLE_NAME', 'ben_elctbl_chc_ctfn');
276 fnd_message.raise_error;
277 End lck;
278 --
279 -- ----------------------------------------------------------------------------
280 -- |-----------------------------< convert_args >-----------------------------|
281 -- ----------------------------------------------------------------------------
282 Function convert_args
283 (
284 p_elctbl_chc_ctfn_id in number,
285 p_enrt_ctfn_typ_cd in varchar2,
286 p_rqd_flag in varchar2,
287 p_elig_per_elctbl_chc_id in number,
288 p_enrt_bnft_id in number,
289 p_business_group_id in number,
293 p_ecc_attribute3 in varchar2,
290 p_ecc_attribute_category in varchar2,
291 p_ecc_attribute1 in varchar2,
292 p_ecc_attribute2 in varchar2,
294 p_ecc_attribute4 in varchar2,
295 p_ecc_attribute5 in varchar2,
296 p_ecc_attribute6 in varchar2,
297 p_ecc_attribute7 in varchar2,
298 p_ecc_attribute8 in varchar2,
299 p_ecc_attribute9 in varchar2,
300 p_ecc_attribute10 in varchar2,
301 p_ecc_attribute11 in varchar2,
302 p_ecc_attribute12 in varchar2,
303 p_ecc_attribute13 in varchar2,
304 p_ecc_attribute14 in varchar2,
305 p_ecc_attribute15 in varchar2,
306 p_ecc_attribute16 in varchar2,
307 p_ecc_attribute17 in varchar2,
308 p_ecc_attribute18 in varchar2,
309 p_ecc_attribute19 in varchar2,
310 p_ecc_attribute20 in varchar2,
311 p_ecc_attribute21 in varchar2,
312 p_ecc_attribute22 in varchar2,
313 p_ecc_attribute23 in varchar2,
314 p_ecc_attribute24 in varchar2,
315 p_ecc_attribute25 in varchar2,
316 p_ecc_attribute26 in varchar2,
317 p_ecc_attribute27 in varchar2,
318 p_ecc_attribute28 in varchar2,
319 p_ecc_attribute29 in varchar2,
320 p_ecc_attribute30 in varchar2,
321 p_susp_if_ctfn_not_prvd_flag in varchar2,
322 p_ctfn_determine_cd in varchar2,
323 p_request_id in number,
324 p_program_application_id in number,
325 p_program_id in number,
326 p_program_update_date in date,
327 p_object_version_number in number
328 )
329 Return g_rec_type is
330 --
331 l_rec g_rec_type;
332 l_proc varchar2(72) := g_package||'convert_args';
333 --
334 Begin
335 --
336 hr_utility.set_location('Entering:'||l_proc, 5);
337 --
338 -- Convert arguments into local l_rec structure.
339 --
340 l_rec.elctbl_chc_ctfn_id := p_elctbl_chc_ctfn_id;
341 l_rec.enrt_ctfn_typ_cd := p_enrt_ctfn_typ_cd;
342 l_rec.rqd_flag := p_rqd_flag;
343 l_rec.elig_per_elctbl_chc_id := p_elig_per_elctbl_chc_id;
344 l_rec.enrt_bnft_id := p_enrt_bnft_id;
345 l_rec.business_group_id := p_business_group_id;
346 l_rec.ecc_attribute_category := p_ecc_attribute_category;
347 l_rec.ecc_attribute1 := p_ecc_attribute1;
348 l_rec.ecc_attribute2 := p_ecc_attribute2;
349 l_rec.ecc_attribute3 := p_ecc_attribute3;
350 l_rec.ecc_attribute4 := p_ecc_attribute4;
351 l_rec.ecc_attribute5 := p_ecc_attribute5;
352 l_rec.ecc_attribute6 := p_ecc_attribute6;
353 l_rec.ecc_attribute7 := p_ecc_attribute7;
354 l_rec.ecc_attribute8 := p_ecc_attribute8;
355 l_rec.ecc_attribute9 := p_ecc_attribute9;
356 l_rec.ecc_attribute10 := p_ecc_attribute10;
357 l_rec.ecc_attribute11 := p_ecc_attribute11;
358 l_rec.ecc_attribute12 := p_ecc_attribute12;
359 l_rec.ecc_attribute13 := p_ecc_attribute13;
360 l_rec.ecc_attribute14 := p_ecc_attribute14;
361 l_rec.ecc_attribute15 := p_ecc_attribute15;
362 l_rec.ecc_attribute16 := p_ecc_attribute16;
363 l_rec.ecc_attribute17 := p_ecc_attribute17;
364 l_rec.ecc_attribute18 := p_ecc_attribute18;
365 l_rec.ecc_attribute19 := p_ecc_attribute19;
366 l_rec.ecc_attribute20 := p_ecc_attribute20;
367 l_rec.ecc_attribute21 := p_ecc_attribute21;
368 l_rec.ecc_attribute22 := p_ecc_attribute22;
369 l_rec.ecc_attribute23 := p_ecc_attribute23;
370 l_rec.ecc_attribute24 := p_ecc_attribute24;
371 l_rec.ecc_attribute25 := p_ecc_attribute25;
372 l_rec.ecc_attribute26 := p_ecc_attribute26;
373 l_rec.ecc_attribute27 := p_ecc_attribute27;
374 l_rec.ecc_attribute28 := p_ecc_attribute28;
375 l_rec.ecc_attribute29 := p_ecc_attribute29;
376 l_rec.ecc_attribute30 := p_ecc_attribute30;
377 l_rec.susp_if_ctfn_not_prvd_flag := nvl(p_susp_if_ctfn_not_prvd_flag,'Y');
378 l_rec.ctfn_determine_cd := p_ctfn_determine_cd;
379 l_rec.request_id := p_request_id;
380 l_rec.program_application_id := p_program_application_id;
381 l_rec.program_id := p_program_id;
382 l_rec.program_update_date := p_program_update_date;
383 l_rec.object_version_number := p_object_version_number;
384 --
385 -- Return the plsql record structure.
386 --
387 hr_utility.set_location(' Leaving:'||l_proc, 10);
388 Return(l_rec);
389 --
390 End convert_args;
391 --
392 end ben_ecc_shd;