[Home] [Help]
PACKAGE BODY: APPS.PER_BPR_SHD
Source
1 Package Body per_bpr_shd as
2 /* $Header: pebprrhi.pkb 115.6 2002/12/02 14:33:23 apholt noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_bpr_shd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |---------------------------< constraint_error >---------------------------|
12 -- ----------------------------------------------------------------------------
13 Procedure constraint_error
14 (p_constraint_name in all_constraints.constraint_name%TYPE) Is
15 --
16 l_proc varchar2(72) := g_package||'constraint_error';
17 --
18 Begin
19 hr_utility.set_location('Entering:'||l_proc, 5);
20 --
21 If (p_constraint_name = 'PER_BF_PAYROLL_RUNS_FK1') Then
22 fnd_message.set_name('PER', 'PER_289357_BF_BG_ID_INVALID');
23 fnd_message.set_token('PROCEDURE', l_proc);
24 fnd_message.set_token('STEP','5');
25 fnd_message.raise_error;
26 ElsIf (p_constraint_name = 'PER_BF_PAYROLL_RUNS_PK') Then
27 fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
28 fnd_message.set_token('PROCEDURE', l_proc);
29 fnd_message.set_token('STEP','10');
30 fnd_message.raise_error;
31 ElsIf (p_constraint_name = 'PER_BF_PAYROLL_RUNS_UK1') Then
32 fnd_message.set_name('PER', 'HR_52931_IDENTIFIER_NOT_UNQ');
33 fnd_message.set_token('PROCEDURE', l_proc);
34 fnd_message.set_token('STEP','15');
35 fnd_message.raise_error;
36 ElsIf (p_constraint_name = 'PER_BF_PAYROLL_RUNS_REX') Then
37 fnd_message.set_name('PER', 'PER_289359_BF_PROC_ASG_EXISTS');
38 fnd_message.set_token('PROCEDURE', l_proc);
39 fnd_message.set_token('STEP','20');
40 fnd_message.raise_error;
41 Else
42 fnd_message.set_name('PER', 'HR_7877_API_INVALID_CONSTRAINT');
43 fnd_message.set_token('PROCEDURE', l_proc);
44 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
45 fnd_message.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_payroll_run_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 payroll_run_id,
66 payroll_id,
67 business_group_id,
68 payroll_identifier,
69 period_start_date,
70 period_end_date,
71 processing_date,
72 object_version_number,
73 bpr_attribute_category,
74 bpr_attribute1,
75 bpr_attribute2,
76 bpr_attribute3,
77 bpr_attribute4,
78 bpr_attribute5,
79 bpr_attribute6,
80 bpr_attribute7,
81 bpr_attribute8,
82 bpr_attribute9,
83 bpr_attribute10,
84 bpr_attribute11,
85 bpr_attribute12,
86 bpr_attribute13,
87 bpr_attribute14,
88 bpr_attribute15,
89 bpr_attribute16,
90 bpr_attribute17,
91 bpr_attribute18,
92 bpr_attribute19,
93 bpr_attribute20,
94 bpr_attribute21,
95 bpr_attribute22,
96 bpr_attribute23,
97 bpr_attribute24,
98 bpr_attribute25,
99 bpr_attribute26,
100 bpr_attribute27,
101 bpr_attribute28,
102 bpr_attribute29,
103 bpr_attribute30
104 from per_bf_payroll_runs
105 where payroll_run_id = p_payroll_run_id;
106 --
107 l_proc varchar2(72) := g_package||'api_updating';
108 l_fct_ret boolean;
109 --
110 Begin
111 hr_utility.set_location('Entering:'||l_proc, 5);
112 --
113 If (
114 p_payroll_run_id is null and
115 p_object_version_number is null
116 ) Then
117 --
118 -- One of the primary key arguments is null therefore we must
119 -- set the returning function value to false
120 --
121 l_fct_ret := false;
122 Else
123 If (
124 p_payroll_run_id = g_old_rec.payroll_run_id and
125 p_object_version_number = g_old_rec.object_version_number
126 ) Then
127 hr_utility.set_location(l_proc, 10);
128 --
129 -- The g_old_rec is current therefore we must
130 -- set the returning function to true
131 --
132 l_fct_ret := true;
133 Else
134 --
135 -- Select the current row into g_old_rec
136 --
137 Open C_Sel1;
138 Fetch C_Sel1 Into g_old_rec;
139 If C_Sel1%notfound Then
140 Close C_Sel1;
141 --
142 -- The primary key is invalid therefore we must error
143 --
144 fnd_message.set_name('PER', 'HR_7220_INVALID_PRIMARY_KEY');
145 fnd_message.raise_error;
146 End If;
147 Close C_Sel1;
148 If (p_object_version_number <> g_old_rec.object_version_number) Then
149 fnd_message.set_name('PER', 'HR_7155_OBJECT_INVALID');
150 fnd_message.raise_error;
151 End If;
152 hr_utility.set_location(l_proc, 15);
153 l_fct_ret := true;
154 End If;
155 End If;
156 hr_utility.set_location(' Leaving:'||l_proc, 20);
157 Return (l_fct_ret);
158 --
159 End api_updating;
160 --
161 -- ----------------------------------------------------------------------------
162 -- |---------------------------------< lck >----------------------------------|
163 -- ----------------------------------------------------------------------------
164 Procedure lck
165 (
166 p_payroll_run_id in number,
167 p_object_version_number in number
168 ) is
169 --
170 -- Cursor selects the 'current' row from the HR Schema
171 --
172 Cursor C_Sel1 is
173 select payroll_run_id,
174 payroll_id,
175 business_group_id,
176 payroll_identifier,
177 period_start_date,
178 period_end_date,
179 processing_date,
180 object_version_number,
181 bpr_attribute_category,
182 bpr_attribute1,
183 bpr_attribute2,
184 bpr_attribute3,
185 bpr_attribute4,
186 bpr_attribute5,
187 bpr_attribute6,
188 bpr_attribute7,
189 bpr_attribute8,
190 bpr_attribute9,
191 bpr_attribute10,
192 bpr_attribute11,
193 bpr_attribute12,
194 bpr_attribute13,
195 bpr_attribute14,
196 bpr_attribute15,
197 bpr_attribute16,
198 bpr_attribute17,
199 bpr_attribute18,
200 bpr_attribute19,
201 bpr_attribute20,
202 bpr_attribute21,
203 bpr_attribute22,
204 bpr_attribute23,
205 bpr_attribute24,
206 bpr_attribute25,
207 bpr_attribute26,
208 bpr_attribute27,
209 bpr_attribute28,
210 bpr_attribute29,
211 bpr_attribute30
212 from per_bf_payroll_runs
213 where payroll_run_id = p_payroll_run_id
214 for update nowait;
215 --
216 l_proc varchar2(72) := g_package||'lck';
217 --
218 Begin
219 hr_utility.set_location('Entering:'||l_proc, 5);
220 --
221 -- Add any mandatory argument checking here:
222 -- Example:
223 -- hr_api.mandatory_arg_error
224 -- (p_api_name => l_proc,
225 -- p_argument => 'object_version_number',
226 -- p_argument_value => p_object_version_number);
227 --
228 hr_api.mandatory_arg_error(p_api_name => l_proc,
229 p_argument => 'PAYROLL_RUN_ID',
230 p_argument_value => p_payroll_run_id);
231 Open C_Sel1;
232 Fetch C_Sel1 Into g_old_rec;
233 If C_Sel1%notfound then
234 Close C_Sel1;
235 --
236 -- The primary key is invalid therefore we must error
237 --
238 fnd_message.set_name('PER', 'HR_7220_INVALID_PRIMARY_KEY');
239 fnd_message.raise_error;
240 End If;
241 Close C_Sel1;
242 If (p_object_version_number <> g_old_rec.object_version_number) Then
243 fnd_message.set_name('PER', 'HR_7155_OBJECT_INVALID');
244 fnd_message.raise_error;
245 End If;
246 --
247 hr_utility.set_location(' Leaving:'||l_proc, 10);
248 --
249 -- We need to trap the ORA LOCK exception
250 --
251 Exception
252 When HR_Api.Object_Locked then
253 --
254 -- The object is locked therefore we need to supply a meaningful
255 -- error message.
256 --
257 fnd_message.set_name('PER', 'HR_7165_OBJECT_LOCKED');
258 fnd_message.set_token('TABLE_NAME', 'per_bf_payroll_runs');
259 fnd_message.raise_error;
260 End lck;
261 --
262 -- ----------------------------------------------------------------------------
263 -- |-----------------------------< convert_args >-----------------------------|
264 -- ----------------------------------------------------------------------------
265 Function convert_args
266 (
267 p_payroll_run_id in number,
268 p_payroll_id in number,
269 p_business_group_id in number,
270 p_payroll_identifier in varchar2,
271 p_period_start_date in date,
272 p_period_end_date in date,
273 p_processing_date in date,
274 p_object_version_number in number,
275 p_bpr_attribute_category in varchar2,
276 p_bpr_attribute1 in varchar2,
277 p_bpr_attribute2 in varchar2,
278 p_bpr_attribute3 in varchar2,
279 p_bpr_attribute4 in varchar2,
280 p_bpr_attribute5 in varchar2,
281 p_bpr_attribute6 in varchar2,
282 p_bpr_attribute7 in varchar2,
283 p_bpr_attribute8 in varchar2,
284 p_bpr_attribute9 in varchar2,
285 p_bpr_attribute10 in varchar2,
286 p_bpr_attribute11 in varchar2,
287 p_bpr_attribute12 in varchar2,
288 p_bpr_attribute13 in varchar2,
289 p_bpr_attribute14 in varchar2,
290 p_bpr_attribute15 in varchar2,
291 p_bpr_attribute16 in varchar2,
292 p_bpr_attribute17 in varchar2,
293 p_bpr_attribute18 in varchar2,
294 p_bpr_attribute19 in varchar2,
295 p_bpr_attribute20 in varchar2,
296 p_bpr_attribute21 in varchar2,
297 p_bpr_attribute22 in varchar2,
298 p_bpr_attribute23 in varchar2,
299 p_bpr_attribute24 in varchar2,
300 p_bpr_attribute25 in varchar2,
301 p_bpr_attribute26 in varchar2,
302 p_bpr_attribute27 in varchar2,
303 p_bpr_attribute28 in varchar2,
304 p_bpr_attribute29 in varchar2,
305 p_bpr_attribute30 in varchar2
306 )
307 Return g_rec_type is
308 --
309 l_rec g_rec_type;
310 l_proc varchar2(72) := g_package||'convert_args';
311 --
312 Begin
313 --
314 hr_utility.set_location('Entering:'||l_proc, 5);
315 --
316 -- Convert arguments into local l_rec structure.
317 --
318 l_rec.payroll_run_id := p_payroll_run_id;
319 l_rec.payroll_id := p_payroll_id;
320 l_rec.business_group_id := p_business_group_id;
321 l_rec.payroll_identifier := p_payroll_identifier;
322 l_rec.period_start_date := p_period_start_date;
323 l_rec.period_end_date := p_period_end_date;
324 l_rec.processing_date := p_processing_date;
325 l_rec.object_version_number := p_object_version_number;
326 l_rec.bpr_attribute_category := p_bpr_attribute_category;
327 l_rec.bpr_attribute1 := p_bpr_attribute1;
328 l_rec.bpr_attribute2 := p_bpr_attribute2;
329 l_rec.bpr_attribute3 := p_bpr_attribute3;
330 l_rec.bpr_attribute4 := p_bpr_attribute4;
331 l_rec.bpr_attribute5 := p_bpr_attribute5;
332 l_rec.bpr_attribute6 := p_bpr_attribute6;
333 l_rec.bpr_attribute7 := p_bpr_attribute7;
334 l_rec.bpr_attribute8 := p_bpr_attribute8;
335 l_rec.bpr_attribute9 := p_bpr_attribute9;
336 l_rec.bpr_attribute10 := p_bpr_attribute10;
337 l_rec.bpr_attribute11 := p_bpr_attribute11;
338 l_rec.bpr_attribute12 := p_bpr_attribute12;
339 l_rec.bpr_attribute13 := p_bpr_attribute13;
340 l_rec.bpr_attribute14 := p_bpr_attribute14;
341 l_rec.bpr_attribute15 := p_bpr_attribute15;
342 l_rec.bpr_attribute16 := p_bpr_attribute16;
343 l_rec.bpr_attribute17 := p_bpr_attribute17;
344 l_rec.bpr_attribute18 := p_bpr_attribute18;
345 l_rec.bpr_attribute19 := p_bpr_attribute19;
346 l_rec.bpr_attribute20 := p_bpr_attribute20;
347 l_rec.bpr_attribute21 := p_bpr_attribute21;
348 l_rec.bpr_attribute22 := p_bpr_attribute22;
349 l_rec.bpr_attribute23 := p_bpr_attribute23;
350 l_rec.bpr_attribute24 := p_bpr_attribute24;
351 l_rec.bpr_attribute25 := p_bpr_attribute25;
352 l_rec.bpr_attribute26 := p_bpr_attribute26;
353 l_rec.bpr_attribute27 := p_bpr_attribute27;
354 l_rec.bpr_attribute28 := p_bpr_attribute28;
355 l_rec.bpr_attribute29 := p_bpr_attribute29;
356 l_rec.bpr_attribute30 := p_bpr_attribute30;
357 --
358 -- Return the plsql record structure.
359 --
360 hr_utility.set_location(' Leaving:'||l_proc, 10);
361 Return(l_rec);
362 --
363 End convert_args;
364 --
365 end per_bpr_shd;