[Home] [Help]
PACKAGE BODY: APPS.BEN_EPR_SHD
Source
1 Package Body ben_epr_shd as
2 /* $Header: beeprrhi.pkb 115.5 2002/12/09 12:52:58 lakrish ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_epr_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_ENRT_PREM_FK1') 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_ENRT_PREM_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_ENRT_PREM_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 ElsIf (p_constraint_name = 'BEN_ENRT_PREM_PK') Then
52 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
53 fnd_message.set_token('PROCEDURE', l_proc);
54 fnd_message.set_token('STEP','20');
55 fnd_message.raise_error;
56 Else
57 fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
58 fnd_message.set_token('PROCEDURE', l_proc);
59 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
60 fnd_message.raise_error;
61 End If;
62 --
63 hr_utility.set_location(' Leaving:'||l_proc, 10);
64 End constraint_error;
65 --
66 -- ----------------------------------------------------------------------------
67 -- |-----------------------------< api_updating >-----------------------------|
68 -- ----------------------------------------------------------------------------
69 Function api_updating
70 ( p_enrt_prem_id in number,
71 p_object_version_number in number
72 ) Return Boolean Is
73 --
74 --
75 -- Cursor selects the 'current' row from the HR Schema
76 --
77 Cursor C_Sel1 is
78 select
79 enrt_prem_id,
80 val,
81 uom,
82 elig_per_elctbl_chc_id,
83 enrt_bnft_id,
84 actl_prem_id,
85 business_group_id,
86 epr_attribute_category,
87 epr_attribute1,
88 epr_attribute2,
89 epr_attribute3,
90 epr_attribute4,
91 epr_attribute5,
92 epr_attribute6,
93 epr_attribute7,
94 epr_attribute8,
95 epr_attribute9,
96 epr_attribute10,
97 epr_attribute11,
98 epr_attribute12,
99 epr_attribute13,
100 epr_attribute14,
101 epr_attribute15,
102 epr_attribute16,
103 epr_attribute17,
104 epr_attribute18,
105 epr_attribute19,
106 epr_attribute20,
107 epr_attribute21,
108 epr_attribute22,
109 epr_attribute23,
110 epr_attribute24,
111 epr_attribute25,
112 epr_attribute26,
113 epr_attribute27,
114 epr_attribute28,
115 epr_attribute29,
116 epr_attribute30,
117 object_version_number,
118 request_id,
119 program_application_id,
120 program_id,
121 program_update_date
122 from ben_enrt_prem
123 where enrt_prem_id = p_enrt_prem_id;
124 --
125 l_proc varchar2(72) := g_package||'api_updating';
126 l_fct_ret boolean;
127 --
128 Begin
129 hr_utility.set_location('Entering:'||l_proc, 5);
130 --
131 If (
132 p_enrt_prem_id is null and
133 p_object_version_number is null
134 ) Then
135 --
136 -- One of the primary key arguments is null therefore we must
137 -- set the returning function value to false
138 --
139 l_fct_ret := false;
140 Else
141 If (
142 p_enrt_prem_id = g_old_rec.enrt_prem_id and
143 p_object_version_number = g_old_rec.object_version_number
144 ) Then
145 hr_utility.set_location(l_proc, 10);
146 --
147 -- The g_old_rec is current therefore we must
148 -- set the returning function to true
149 --
150 l_fct_ret := true;
151 Else
152 --
153 -- Select the current row into g_old_rec
154 --
155 Open C_Sel1;
156 Fetch C_Sel1 Into g_old_rec;
157 If C_Sel1%notfound Then
158 Close C_Sel1;
159 --
160 -- The primary key is invalid therefore we must error
161 --
162 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
163 fnd_message.raise_error;
164 End If;
165 Close C_Sel1;
166 If (p_object_version_number <> g_old_rec.object_version_number) Then
167 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
168 fnd_message.raise_error;
169 End If;
170 hr_utility.set_location(l_proc, 15);
171 l_fct_ret := true;
172 End If;
173 End If;
174 hr_utility.set_location(' Leaving:'||l_proc, 20);
175 Return (l_fct_ret);
176 --
177 End api_updating;
178 --
179 -- ----------------------------------------------------------------------------
180 -- |---------------------------------< lck >----------------------------------|
181 -- ----------------------------------------------------------------------------
182 Procedure lck
183 (
184 p_enrt_prem_id in number,
185 p_object_version_number in number
186 ) is
187 --
188 -- Cursor selects the 'current' row from the HR Schema
189 --
190 Cursor C_Sel1 is
191 select enrt_prem_id,
192 val,
193 uom,
194 elig_per_elctbl_chc_id,
195 enrt_bnft_id,
196 actl_prem_id,
197 business_group_id,
198 epr_attribute_category,
199 epr_attribute1,
200 epr_attribute2,
201 epr_attribute3,
202 epr_attribute4,
203 epr_attribute5,
204 epr_attribute6,
205 epr_attribute7,
206 epr_attribute8,
207 epr_attribute9,
208 epr_attribute10,
209 epr_attribute11,
210 epr_attribute12,
211 epr_attribute13,
212 epr_attribute14,
213 epr_attribute15,
214 epr_attribute16,
215 epr_attribute17,
216 epr_attribute18,
217 epr_attribute19,
218 epr_attribute20,
219 epr_attribute21,
220 epr_attribute22,
221 epr_attribute23,
222 epr_attribute24,
223 epr_attribute25,
224 epr_attribute26,
225 epr_attribute27,
226 epr_attribute28,
227 epr_attribute29,
228 epr_attribute30,
229 object_version_number,
230 request_id,
231 program_application_id,
232 program_id,
233 program_update_date
234 from ben_enrt_prem
235 where enrt_prem_id = p_enrt_prem_id
236 for update nowait;
237 --
238 l_proc varchar2(72) := g_package||'lck';
239 --
240 Begin
241 hr_utility.set_location('Entering:'||l_proc, 5);
242 --
243 -- Add any mandatory argument checking here:
244 -- Example:
245 -- hr_api.mandatory_arg_error
246 -- (p_api_name => l_proc,
247 -- p_argument => 'object_version_number',
248 -- p_argument_value => p_object_version_number);
249 --
250 Open C_Sel1;
251 Fetch C_Sel1 Into g_old_rec;
252 If C_Sel1%notfound then
253 Close C_Sel1;
254 --
255 -- The primary key is invalid therefore we must error
256 --
257 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
258 fnd_message.raise_error;
259 End If;
260 Close C_Sel1;
261 If (p_object_version_number <> g_old_rec.object_version_number) Then
262 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
263 fnd_message.raise_error;
264 End If;
265 --
266 hr_utility.set_location(' Leaving:'||l_proc, 10);
267 --
268 -- We need to trap the ORA LOCK exception
269 --
270 Exception
271 When HR_Api.Object_Locked then
272 --
273 -- The object is locked therefore we need to supply a meaningful
274 -- error message.
275 --
276 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
277 fnd_message.set_token('TABLE_NAME', 'ben_enrt_prem');
278 fnd_message.raise_error;
279 End lck;
280 --
281 -- ----------------------------------------------------------------------------
282 -- |-----------------------------< convert_args >-----------------------------|
283 -- ----------------------------------------------------------------------------
284 Function convert_args
285 (
286 p_enrt_prem_id in number,
287 p_val in number,
288 p_uom in varchar2,
289 p_elig_per_elctbl_chc_id in number,
290 p_enrt_bnft_id in number,
291 p_actl_prem_id in number,
292 p_business_group_id in number,
293 p_epr_attribute_category in varchar2,
294 p_epr_attribute1 in varchar2,
295 p_epr_attribute2 in varchar2,
296 p_epr_attribute3 in varchar2,
297 p_epr_attribute4 in varchar2,
298 p_epr_attribute5 in varchar2,
299 p_epr_attribute6 in varchar2,
300 p_epr_attribute7 in varchar2,
301 p_epr_attribute8 in varchar2,
302 p_epr_attribute9 in varchar2,
303 p_epr_attribute10 in varchar2,
304 p_epr_attribute11 in varchar2,
305 p_epr_attribute12 in varchar2,
306 p_epr_attribute13 in varchar2,
307 p_epr_attribute14 in varchar2,
308 p_epr_attribute15 in varchar2,
309 p_epr_attribute16 in varchar2,
310 p_epr_attribute17 in varchar2,
311 p_epr_attribute18 in varchar2,
312 p_epr_attribute19 in varchar2,
313 p_epr_attribute20 in varchar2,
314 p_epr_attribute21 in varchar2,
315 p_epr_attribute22 in varchar2,
316 p_epr_attribute23 in varchar2,
317 p_epr_attribute24 in varchar2,
318 p_epr_attribute25 in varchar2,
319 p_epr_attribute26 in varchar2,
320 p_epr_attribute27 in varchar2,
321 p_epr_attribute28 in varchar2,
322 p_epr_attribute29 in varchar2,
323 p_epr_attribute30 in varchar2,
324 p_object_version_number in number,
325 p_request_id in number,
326 p_program_application_id in number,
327 p_program_id in number,
328 p_program_update_date in date
329 )
330 Return g_rec_type is
331 --
332 l_rec g_rec_type;
333 l_proc varchar2(72) := g_package||'convert_args';
334 --
335 Begin
336 --
337 hr_utility.set_location('Entering:'||l_proc, 5);
338 --
339 -- Convert arguments into local l_rec structure.
340 --
341 l_rec.enrt_prem_id := p_enrt_prem_id;
342 l_rec.val := p_val;
343 l_rec.uom := p_uom;
344 l_rec.elig_per_elctbl_chc_id := p_elig_per_elctbl_chc_id;
345 l_rec.enrt_bnft_id := p_enrt_bnft_id;
346 l_rec.actl_prem_id := p_actl_prem_id;
347 l_rec.business_group_id := p_business_group_id;
348 l_rec.epr_attribute_category := p_epr_attribute_category;
349 l_rec.epr_attribute1 := p_epr_attribute1;
350 l_rec.epr_attribute2 := p_epr_attribute2;
351 l_rec.epr_attribute3 := p_epr_attribute3;
355 l_rec.epr_attribute7 := p_epr_attribute7;
352 l_rec.epr_attribute4 := p_epr_attribute4;
353 l_rec.epr_attribute5 := p_epr_attribute5;
354 l_rec.epr_attribute6 := p_epr_attribute6;
356 l_rec.epr_attribute8 := p_epr_attribute8;
357 l_rec.epr_attribute9 := p_epr_attribute9;
358 l_rec.epr_attribute10 := p_epr_attribute10;
359 l_rec.epr_attribute11 := p_epr_attribute11;
360 l_rec.epr_attribute12 := p_epr_attribute12;
361 l_rec.epr_attribute13 := p_epr_attribute13;
362 l_rec.epr_attribute14 := p_epr_attribute14;
363 l_rec.epr_attribute15 := p_epr_attribute15;
364 l_rec.epr_attribute16 := p_epr_attribute16;
365 l_rec.epr_attribute17 := p_epr_attribute17;
366 l_rec.epr_attribute18 := p_epr_attribute18;
367 l_rec.epr_attribute19 := p_epr_attribute19;
368 l_rec.epr_attribute20 := p_epr_attribute20;
369 l_rec.epr_attribute21 := p_epr_attribute21;
370 l_rec.epr_attribute22 := p_epr_attribute22;
371 l_rec.epr_attribute23 := p_epr_attribute23;
372 l_rec.epr_attribute24 := p_epr_attribute24;
373 l_rec.epr_attribute25 := p_epr_attribute25;
374 l_rec.epr_attribute26 := p_epr_attribute26;
375 l_rec.epr_attribute27 := p_epr_attribute27;
376 l_rec.epr_attribute28 := p_epr_attribute28;
377 l_rec.epr_attribute29 := p_epr_attribute29;
378 l_rec.epr_attribute30 := p_epr_attribute30;
379 l_rec.object_version_number := p_object_version_number;
380 l_rec.request_id := p_request_id;
381 l_rec.program_application_id := p_program_application_id;
382 l_rec.program_id := p_program_id;
383 l_rec.program_update_date := p_program_update_date;
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_epr_shd;