[Home] [Help]
PACKAGE BODY: APPS.BEN_PIL_SHD
Source
1 Package Body ben_pil_shd as
2 /* $Header: bepilrhi.pkb 120.4 2011/09/02 10:55:27 pvelvano ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_pil_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_PER_IN_LER_PK') Then
37 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
38 hr_utility.set_message_token('PROCEDURE', l_proc);
39 hr_utility.set_message_token('STEP','5');
40 hr_utility.raise_error;
41 Else
42 hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
43 hr_utility.set_message_token('PROCEDURE', l_proc);
44 hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
45 hr_utility.raise_error;
46 End If;
47 --
48 hr_utility.set_location(' Leaving:'||l_proc, 10);
49 End constraint_error;
50 --
51 -- ----------------------------------------------------------------------------
52 -- |-----------------------------< api_updating >-----------------------------|
53 -- ----------------------------------------------------------------------------
54 Function api_updating
55 (
56 p_per_in_ler_id in number,
57 p_object_version_number in number
58 ) Return Boolean Is
59 --
60 --
61 -- Cursor selects the 'current' row from the HR Schema
62 --
63 Cursor C_Sel1 is
64 select
65 per_in_ler_id,
66 per_in_ler_stat_cd,
67 prvs_stat_cd,
68 lf_evt_ocrd_dt,
69 trgr_table_pk_id, --ABSE changes
70 procd_dt,
71 strtd_dt,
72 voidd_dt,
73 bckt_dt,
74 clsd_dt,
75 ntfn_dt,
76 ptnl_ler_for_per_id,
77 bckt_per_in_ler_id,
78 ler_id,
79 person_id,
80 business_group_id,
81 ASSIGNMENT_ID,
82 WS_MGR_ID,
83 GROUP_PL_ID,
84 MGR_OVRID_PERSON_ID,
85 MGR_OVRID_DT,
86 pil_attribute_category,
87 pil_attribute1,
88 pil_attribute2,
89 pil_attribute3,
90 pil_attribute4,
91 pil_attribute5,
92 pil_attribute6,
93 pil_attribute7,
94 pil_attribute8,
95 pil_attribute9,
96 pil_attribute10,
97 pil_attribute11,
98 pil_attribute12,
99 pil_attribute13,
100 pil_attribute14,
101 pil_attribute15,
102 pil_attribute16,
103 pil_attribute17,
104 pil_attribute18,
105 pil_attribute19,
106 pil_attribute20,
107 pil_attribute21,
108 pil_attribute22,
109 pil_attribute23,
110 pil_attribute24,
111 pil_attribute25,
112 pil_attribute26,
113 pil_attribute27,
114 pil_attribute28,
115 pil_attribute29,
116 pil_attribute30,
117 request_id,
118 program_application_id,
119 program_id,
120 program_update_date,
124 --
121 object_version_number
122 from ben_per_in_ler
123 where per_in_ler_id = p_per_in_ler_id;
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_per_in_ler_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_per_in_ler_id = g_old_rec.per_in_ler_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 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
163 hr_utility.raise_error;
164 End If;
165 Close C_Sel1;
166 If (p_object_version_number <> g_old_rec.object_version_number) Then
167 hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
168 hr_utility.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_per_in_ler_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 per_in_ler_id,
192 per_in_ler_stat_cd,
193 prvs_stat_cd ,
194 lf_evt_ocrd_dt,
195 trgr_table_pk_id, --ABSE change
196 procd_dt,
197 strtd_dt,
198 voidd_dt,
199 bckt_dt,
200 clsd_dt,
201 ntfn_dt,
202 ptnl_ler_for_per_id,
203 bckt_per_in_ler_id,
204 ler_id,
205 person_id,
206 business_group_id,
207 ASSIGNMENT_ID,
208 WS_MGR_ID,
209 GROUP_PL_ID,
210 MGR_OVRID_PERSON_ID,
211 MGR_OVRID_DT,
212 pil_attribute_category,
213 pil_attribute1,
214 pil_attribute2,
215 pil_attribute3,
216 pil_attribute4,
217 pil_attribute5,
218 pil_attribute6,
219 pil_attribute7,
220 pil_attribute8,
221 pil_attribute9,
222 pil_attribute10,
223 pil_attribute11,
224 pil_attribute12,
225 pil_attribute13,
226 pil_attribute14,
227 pil_attribute15,
228 pil_attribute16,
229 pil_attribute17,
230 pil_attribute18,
231 pil_attribute19,
232 pil_attribute20,
233 pil_attribute21,
234 pil_attribute22,
235 pil_attribute23,
236 pil_attribute24,
237 pil_attribute25,
238 pil_attribute26,
239 pil_attribute27,
240 pil_attribute28,
241 pil_attribute29,
242 pil_attribute30,
243 request_id,
244 program_application_id,
245 program_id,
246 program_update_date,
247 object_version_number
248 from ben_per_in_ler
249 where per_in_ler_id = p_per_in_ler_id
250 for update nowait;
251 --
252 l_proc varchar2(72) := g_package||'lck';
253 --
254 Begin
255 hr_utility.set_location('Entering:'||l_proc, 5);
256 --
257 -- Add any mandatory argument checking here:
258 -- Example:
259 -- hr_api.mandatory_arg_error
260 -- (p_api_name => l_proc,
261 -- p_argument => 'object_version_number',
262 -- p_argument_value => p_object_version_number);
263 --
264 Open C_Sel1;
265 Fetch C_Sel1 Into g_old_rec;
266 If C_Sel1%notfound then
267 Close C_Sel1;
268 --
269 -- The primary key is invalid therefore we must error
270 --
271 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
272 hr_utility.raise_error;
273 End If;
274 Close C_Sel1;
275 If (p_object_version_number <> g_old_rec.object_version_number) Then
276 hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
277 hr_utility.raise_error;
278 End If;
279 --
280 hr_utility.set_location(' Leaving:'||l_proc, 10);
281 --
282 -- We need to trap the ORA LOCK exception
283 --
284 Exception
285 When HR_Api.Object_Locked then
286 --
287 -- The object is locked therefore we need to supply a meaningful
288 -- error message.
289 --
290 hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
291 hr_utility.set_message_token('TABLE_NAME', 'ben_per_in_ler');
292 hr_utility.raise_error;
293 End lck;
294 --
295 -- ----------------------------------------------------------------------------
296 -- |-----------------------------< convert_args >-----------------------------|
300 p_per_in_ler_id in number,
297 -- ----------------------------------------------------------------------------
298 Function convert_args
299 (
301 p_per_in_ler_stat_cd in varchar2,
302 p_prvs_stat_cd in varchar2,
303 p_lf_evt_ocrd_dt in date,
304 p_trgr_table_pk_id in number, --ABSE change
305 p_procd_dt in date,
306 p_strtd_dt in date,
307 p_voidd_dt in date,
308 p_bckt_dt in date,
309 p_clsd_dt in date,
310 p_ntfn_dt in date,
311 p_ptnl_ler_for_per_id in number,
312 p_bckt_per_in_ler_id in number,
313 p_ler_id in number,
314 p_person_id in number,
315 p_business_group_id in number,
316 p_ASSIGNMENT_ID in number,
317 p_WS_MGR_ID in number,
318 p_GROUP_PL_ID in number,
319 p_MGR_OVRID_PERSON_ID in number,
320 p_MGR_OVRID_DT in date,
321 p_pil_attribute_category in varchar2,
322 p_pil_attribute1 in varchar2,
323 p_pil_attribute2 in varchar2,
324 p_pil_attribute3 in varchar2,
325 p_pil_attribute4 in varchar2,
326 p_pil_attribute5 in varchar2,
327 p_pil_attribute6 in varchar2,
328 p_pil_attribute7 in varchar2,
329 p_pil_attribute8 in varchar2,
330 p_pil_attribute9 in varchar2,
331 p_pil_attribute10 in varchar2,
332 p_pil_attribute11 in varchar2,
333 p_pil_attribute12 in varchar2,
334 p_pil_attribute13 in varchar2,
335 p_pil_attribute14 in varchar2,
336 p_pil_attribute15 in varchar2,
337 p_pil_attribute16 in varchar2,
338 p_pil_attribute17 in varchar2,
339 p_pil_attribute18 in varchar2,
340 p_pil_attribute19 in varchar2,
341 p_pil_attribute20 in varchar2,
342 p_pil_attribute21 in varchar2,
343 p_pil_attribute22 in varchar2,
344 p_pil_attribute23 in varchar2,
345 p_pil_attribute24 in varchar2,
346 p_pil_attribute25 in varchar2,
347 p_pil_attribute26 in varchar2,
348 p_pil_attribute27 in varchar2,
349 p_pil_attribute28 in varchar2,
350 p_pil_attribute29 in varchar2,
351 p_pil_attribute30 in varchar2,
352 p_request_id in number,
353 p_program_application_id in number,
354 p_program_id in number,
355 p_program_update_date in date,
356 p_object_version_number in number
357 )
358 Return g_rec_type is
359 --
360 l_rec g_rec_type;
361 l_proc varchar2(72) := g_package||'convert_args';
362 --
363 Begin
364 --
365 hr_utility.set_location('Entering:'||l_proc, 5);
366 --
367 -- Convert arguments into local l_rec structure.
368 --
369 l_rec.per_in_ler_id := p_per_in_ler_id;
370 l_rec.per_in_ler_stat_cd := p_per_in_ler_stat_cd;
371 l_rec.prvs_stat_cd := p_prvs_stat_cd;
372 l_rec.lf_evt_ocrd_dt := p_lf_evt_ocrd_dt;
373 l_rec.trgr_table_pk_id := p_trgr_table_pk_id;
374 l_rec.procd_dt := p_procd_dt;
375 l_rec.strtd_dt := p_strtd_dt;
376 l_rec.voidd_dt := p_voidd_dt;
377 l_rec.bckt_dt := p_bckt_dt;
378 l_rec.clsd_dt := p_clsd_dt;
379 l_rec.ntfn_dt := p_ntfn_dt;
380 l_rec.ptnl_ler_for_per_id := p_ptnl_ler_for_per_id;
381 l_rec.bckt_per_in_ler_id := p_bckt_per_in_ler_id;
382 l_rec.ler_id := p_ler_id;
383 l_rec.person_id := p_person_id;
384 l_rec.business_group_id := p_business_group_id;
385 l_rec.ASSIGNMENT_ID := p_ASSIGNMENT_ID;
386 l_rec.WS_MGR_ID := p_WS_MGR_ID;
387 l_rec.GROUP_PL_ID := p_GROUP_PL_ID;
388 l_rec.MGR_OVRID_PERSON_ID := p_MGR_OVRID_PERSON_ID;
389 l_rec.MGR_OVRID_DT := p_MGR_OVRID_DT;
390 l_rec.pil_attribute_category := p_pil_attribute_category;
391 l_rec.pil_attribute1 := p_pil_attribute1;
392 l_rec.pil_attribute2 := p_pil_attribute2;
393 l_rec.pil_attribute3 := p_pil_attribute3;
394 l_rec.pil_attribute4 := p_pil_attribute4;
395 l_rec.pil_attribute5 := p_pil_attribute5;
396 l_rec.pil_attribute6 := p_pil_attribute6;
397 l_rec.pil_attribute7 := p_pil_attribute7;
398 l_rec.pil_attribute8 := p_pil_attribute8;
399 l_rec.pil_attribute9 := p_pil_attribute9;
400 l_rec.pil_attribute10 := p_pil_attribute10;
401 l_rec.pil_attribute11 := p_pil_attribute11;
402 l_rec.pil_attribute12 := p_pil_attribute12;
403 l_rec.pil_attribute13 := p_pil_attribute13;
404 l_rec.pil_attribute14 := p_pil_attribute14;
405 l_rec.pil_attribute15 := p_pil_attribute15;
406 l_rec.pil_attribute16 := p_pil_attribute16;
407 l_rec.pil_attribute17 := p_pil_attribute17;
408 l_rec.pil_attribute18 := p_pil_attribute18;
409 l_rec.pil_attribute19 := p_pil_attribute19;
410 l_rec.pil_attribute20 := p_pil_attribute20;
411 l_rec.pil_attribute21 := p_pil_attribute21;
412 l_rec.pil_attribute22 := p_pil_attribute22;
413 l_rec.pil_attribute23 := p_pil_attribute23;
414 l_rec.pil_attribute24 := p_pil_attribute24;
415 l_rec.pil_attribute25 := p_pil_attribute25;
416 l_rec.pil_attribute26 := p_pil_attribute26;
417 l_rec.pil_attribute27 := p_pil_attribute27;
418 l_rec.pil_attribute28 := p_pil_attribute28;
419 l_rec.pil_attribute29 := p_pil_attribute29;
420 l_rec.pil_attribute30 := p_pil_attribute30;
421 l_rec.request_id := p_request_id;
422 l_rec.program_application_id := p_program_application_id;
423 l_rec.program_id := p_program_id;
424 l_rec.program_update_date := p_program_update_date;
425 l_rec.object_version_number := p_object_version_number;
426 --
427 -- Return the plsql record structure.
428 --
429 hr_utility.set_location(' Leaving:'||l_proc, 10);
430 Return(l_rec);
431 --
432 End convert_args;
433 --
434 end ben_pil_shd;