[Home] [Help]
PACKAGE BODY: APPS.PER_PDP_SHD
Source
1 Package Body per_pdp_shd as
2 /* $Header: pepdprhi.pkb 115.8 2004/01/29 05:53:10 adudekul noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_pdp_shd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |---------------------------< constraint_error >---------------------------|
12 -- ----------------------------------------------------------------------------
13 Procedure constraint_error
14 (p_constraint_name in all_constraints.constraint_name%TYPE
15 ) Is
16 --
17 l_proc varchar2(72) := g_package||'constraint_error';
18 --
19 Begin
20 --
21 If (p_constraint_name = 'PER_PERIODS_OF_PLACEMENT_PK') Then
22 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
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_PERIODS_OF_PLACEMENT_UK1') Then
27 fnd_message.set_name('PAY', '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 Else
32 fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
33 fnd_message.set_token('PROCEDURE', l_proc);
34 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
35 fnd_message.raise_error;
36 End If;
37 --
38 End constraint_error;
39 --
40 -- ----------------------------------------------------------------------------
41 -- |-----------------------------< api_updating >-----------------------------|
42 -- ----------------------------------------------------------------------------
43 Function api_updating
44 (p_period_of_placement_id in number
45 ,p_object_version_number in number
46 )
47 Return Boolean Is
48 --
49 --
50 -- Cursor selects the 'current' row from the HR Schema
51 --
52 Cursor C_Sel1 is
53 select
54 object_version_number
55 ,business_group_id
56 ,person_id
57 ,date_start
58 ,actual_termination_date
59 ,projected_termination_date
60 ,termination_reason
61 ,attribute_category
62 ,attribute1
63 ,attribute2
64 ,attribute3
65 ,attribute4
66 ,attribute5
67 ,attribute6
68 ,attribute7
69 ,attribute8
70 ,attribute9
71 ,attribute10
72 ,attribute11
73 ,attribute12
74 ,attribute13
75 ,attribute14
76 ,attribute15
77 ,attribute16
78 ,attribute17
79 ,attribute18
80 ,attribute19
81 ,attribute20
82 ,attribute21
83 ,attribute22
84 ,attribute23
85 ,attribute24
86 ,attribute25
87 ,attribute26
88 ,attribute27
89 ,attribute28
90 ,attribute29
91 ,attribute30
92 ,information_category
93 ,information1
94 ,information2
95 ,information3
96 ,information4
97 ,information5
98 ,information6
99 ,information7
100 ,information8
101 ,information9
102 ,information10
103 ,information11
104 ,information12
105 ,information13
106 ,information14
107 ,information15
108 ,information16
109 ,information17
110 ,information18
111 ,information19
112 ,information20
113 ,information21
114 ,information22
115 ,information23
116 ,information24
117 ,information25
118 ,information26
119 ,information27
120 ,information28
121 ,information29
122 ,information30
123 ,period_of_placement_id
124 ,final_process_date
125 ,last_standard_process_date
126 from per_periods_of_placement
127 where period_of_placement_id = p_period_of_placement_id;
128 --
129 l_fct_ret boolean;
130 --
131 Begin
132 --
133 If (p_object_version_number is null and
134 p_period_of_placement_id is null
135 ) Then
136 --
137 -- One of the primary key arguments is null therefore we must
138 -- set the returning function value to false
139 --
140 l_fct_ret := false;
141 Else
142 If (p_object_version_number
143 = per_pdp_shd.g_old_rec.object_version_number and
144 p_period_of_placement_id
145 = per_pdp_shd.g_old_rec.period_of_placement_id
146 ) Then
147 --
148 -- The g_old_rec is current therefore we must
149 -- set the returning function to true
150 --
151 l_fct_ret := true;
152 Else
153 --
154 -- Select the current row into g_old_rec
155 --
156 Open C_Sel1;
157 Fetch C_Sel1 Into per_pdp_shd.g_old_rec;
158 If C_Sel1%notfound Then
159 Close C_Sel1;
160 --
161 -- The primary key is invalid therefore we must error
162 --
163 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
164 fnd_message.raise_error;
165 End If;
166 Close C_Sel1;
167 If (p_object_version_number
168 <> per_pdp_shd.g_old_rec.object_version_number) Then
169 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
170 fnd_message.raise_error;
171 End If;
172 l_fct_ret := true;
173 End If;
174 End If;
175 Return (l_fct_ret);
176 --
177 End api_updating;
178 --
179 -- ----------------------------------------------------------------------------
180 -- |---------------------------------< lck >----------------------------------|
181 -- ----------------------------------------------------------------------------
182 Procedure lck
183 (p_period_of_placement_id in number
184 ,p_object_version_number in number
185 ) is
186 --
187 -- Cursor selects the 'current' row from the HR Schema
188 --
189 Cursor C_Sel1 is
190 select
191 object_version_number
192 ,business_group_id
193 ,person_id
194 ,date_start
195 ,actual_termination_date
196 ,projected_termination_date
197 ,termination_reason
198 ,attribute_category
199 ,attribute1
200 ,attribute2
201 ,attribute3
202 ,attribute4
203 ,attribute5
204 ,attribute6
205 ,attribute7
206 ,attribute8
207 ,attribute9
208 ,attribute10
209 ,attribute11
210 ,attribute12
211 ,attribute13
212 ,attribute14
213 ,attribute15
214 ,attribute16
215 ,attribute17
216 ,attribute18
217 ,attribute19
218 ,attribute20
219 ,attribute21
220 ,attribute22
221 ,attribute23
222 ,attribute24
223 ,attribute25
224 ,attribute26
225 ,attribute27
226 ,attribute28
227 ,attribute29
228 ,attribute30
229 ,information_category
230 ,information1
231 ,information2
232 ,information3
233 ,information4
234 ,information5
235 ,information6
236 ,information7
237 ,information8
238 ,information9
239 ,information10
240 ,information11
241 ,information12
242 ,information13
243 ,information14
244 ,information15
245 ,information16
246 ,information17
247 ,information18
248 ,information19
249 ,information20
250 ,information21
251 ,information22
252 ,information23
253 ,information24
254 ,information25
255 ,information26
256 ,information27
257 ,information28
258 ,information29
259 ,information30
260 ,period_of_placement_id
261 ,final_process_date
262 ,last_standard_process_date
263 from per_periods_of_placement
264 where period_of_placement_id = p_period_of_placement_id
265 for update nowait;
266 --
267 l_proc varchar2(72) := g_package||'lck';
268 --
269 Begin
270 hr_utility.set_location('Entering:'||l_proc, 5);
271 --
272 hr_api.mandatory_arg_error
273 (p_api_name => l_proc
274 ,p_argument => 'OBJECT_VERSION_NUMBER'
275 ,p_argument_value => p_object_version_number
276 );
277 hr_utility.set_location(l_proc,6);
278 hr_api.mandatory_arg_error
279 (p_api_name => l_proc
280 ,p_argument => 'PERIOD_OF_PLACEMENT_ID'
281 ,p_argument_value => p_period_of_placement_id
282 );
283 --
284 Open C_Sel1;
285 Fetch C_Sel1 Into per_pdp_shd.g_old_rec;
286 If C_Sel1%notfound then
287 Close C_Sel1;
288 --
289 -- The primary key is invalid therefore we must error
290 --
291 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
292 fnd_message.raise_error;
293 End If;
294 Close C_Sel1;
295 If (p_object_version_number
296 <> per_pdp_shd.g_old_rec.object_version_number) Then
297 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
298 fnd_message.raise_error;
299 End If;
300 --
301 hr_utility.set_location(' Leaving:'||l_proc, 10);
302 --
303 -- We need to trap the ORA LOCK exception
304 --
305 Exception
306 When HR_Api.Object_Locked then
307 --
308 -- The object is locked therefore we need to supply a meaningful
309 -- error message.
310 --
311 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
312 fnd_message.set_token('TABLE_NAME', 'per_periods_of_placement');
313 fnd_message.raise_error;
314 End lck;
315 --
316 -- ----------------------------------------------------------------------------
317 -- |-----------------------------< convert_args >-----------------------------|
318 -- ----------------------------------------------------------------------------
319 Function convert_args
320 (p_object_version_number in number
321 ,p_business_group_id in number
322 ,p_person_id in number
323 ,p_date_start in date
324 ,p_actual_termination_date in date
325 ,p_projected_termination_date in date
326 ,p_termination_reason in varchar2
327 ,p_attribute_category in varchar2
328 ,p_attribute1 in varchar2
329 ,p_attribute2 in varchar2
330 ,p_attribute3 in varchar2
331 ,p_attribute4 in varchar2
332 ,p_attribute5 in varchar2
333 ,p_attribute6 in varchar2
334 ,p_attribute7 in varchar2
335 ,p_attribute8 in varchar2
336 ,p_attribute9 in varchar2
337 ,p_attribute10 in varchar2
338 ,p_attribute11 in varchar2
339 ,p_attribute12 in varchar2
340 ,p_attribute13 in varchar2
341 ,p_attribute14 in varchar2
342 ,p_attribute15 in varchar2
343 ,p_attribute16 in varchar2
344 ,p_attribute17 in varchar2
345 ,p_attribute18 in varchar2
346 ,p_attribute19 in varchar2
347 ,p_attribute20 in varchar2
348 ,p_attribute21 in varchar2
349 ,p_attribute22 in varchar2
350 ,p_attribute23 in varchar2
351 ,p_attribute24 in varchar2
352 ,p_attribute25 in varchar2
353 ,p_attribute26 in varchar2
354 ,p_attribute27 in varchar2
355 ,p_attribute28 in varchar2
356 ,p_attribute29 in varchar2
357 ,p_attribute30 in varchar2
358 ,p_information_category in varchar2
359 ,p_information1 in varchar2
360 ,p_information2 in varchar2
361 ,p_information3 in varchar2
362 ,p_information4 in varchar2
363 ,p_information5 in varchar2
364 ,p_information6 in varchar2
365 ,p_information7 in varchar2
366 ,p_information8 in varchar2
367 ,p_information9 in varchar2
368 ,p_information10 in varchar2
369 ,p_information11 in varchar2
370 ,p_information12 in varchar2
371 ,p_information13 in varchar2
372 ,p_information14 in varchar2
373 ,p_information15 in varchar2
374 ,p_information16 in varchar2
375 ,p_information17 in varchar2
376 ,p_information18 in varchar2
377 ,p_information19 in varchar2
378 ,p_information20 in varchar2
379 ,p_information21 in varchar2
380 ,p_information22 in varchar2
381 ,p_information23 in varchar2
382 ,p_information24 in varchar2
383 ,p_information25 in varchar2
384 ,p_information26 in varchar2
385 ,p_information27 in varchar2
386 ,p_information28 in varchar2
387 ,p_information29 in varchar2
388 ,p_information30 in varchar2
389 ,p_period_of_placement_id in number
390 ,p_final_process_date in date
391 ,p_last_standard_process_date in date
392 )
393 Return g_rec_type is
394 --
395 l_rec g_rec_type;
396 --
397 Begin
398 --
399 -- Convert arguments into local l_rec structure.
400 --
401 l_rec.object_version_number := p_object_version_number;
402 l_rec.business_group_id := p_business_group_id;
403 l_rec.person_id := p_person_id;
404 l_rec.date_start := p_date_start;
405 l_rec.actual_termination_date := p_actual_termination_date;
406 l_rec.projected_termination_date := p_projected_termination_date;
407 l_rec.termination_reason := p_termination_reason;
408 l_rec.attribute_category := p_attribute_category;
409 l_rec.attribute1 := p_attribute1;
410 l_rec.attribute2 := p_attribute2;
411 l_rec.attribute3 := p_attribute3;
412 l_rec.attribute4 := p_attribute4;
413 l_rec.attribute5 := p_attribute5;
414 l_rec.attribute6 := p_attribute6;
415 l_rec.attribute7 := p_attribute7;
416 l_rec.attribute8 := p_attribute8;
417 l_rec.attribute9 := p_attribute9;
418 l_rec.attribute10 := p_attribute10;
419 l_rec.attribute11 := p_attribute11;
420 l_rec.attribute12 := p_attribute12;
421 l_rec.attribute13 := p_attribute13;
422 l_rec.attribute14 := p_attribute14;
426 l_rec.attribute18 := p_attribute18;
423 l_rec.attribute15 := p_attribute15;
424 l_rec.attribute16 := p_attribute16;
425 l_rec.attribute17 := p_attribute17;
427 l_rec.attribute19 := p_attribute19;
428 l_rec.attribute20 := p_attribute20;
429 l_rec.attribute21 := p_attribute21;
430 l_rec.attribute22 := p_attribute22;
431 l_rec.attribute23 := p_attribute23;
432 l_rec.attribute24 := p_attribute24;
433 l_rec.attribute25 := p_attribute25;
434 l_rec.attribute26 := p_attribute26;
435 l_rec.attribute27 := p_attribute27;
436 l_rec.attribute28 := p_attribute28;
437 l_rec.attribute29 := p_attribute29;
438 l_rec.attribute30 := p_attribute30;
439 l_rec.information_category := p_information_category;
440 l_rec.information1 := p_information1;
441 l_rec.information2 := p_information2;
442 l_rec.information3 := p_information3;
443 l_rec.information4 := p_information4;
444 l_rec.information5 := p_information5;
445 l_rec.information6 := p_information6;
446 l_rec.information7 := p_information7;
447 l_rec.information8 := p_information8;
448 l_rec.information9 := p_information9;
449 l_rec.information10 := p_information10;
450 l_rec.information11 := p_information11;
451 l_rec.information12 := p_information12;
452 l_rec.information13 := p_information13;
453 l_rec.information14 := p_information14;
454 l_rec.information15 := p_information15;
455 l_rec.information16 := p_information16;
456 l_rec.information17 := p_information17;
457 l_rec.information18 := p_information18;
458 l_rec.information19 := p_information19;
459 l_rec.information20 := p_information20;
460 l_rec.information21 := p_information21;
461 l_rec.information22 := p_information22;
462 l_rec.information23 := p_information23;
463 l_rec.information24 := p_information24;
464 l_rec.information25 := p_information25;
465 l_rec.information26 := p_information26;
466 l_rec.information27 := p_information27;
467 l_rec.information28 := p_information28;
468 l_rec.information29 := p_information29;
469 l_rec.information30 := p_information30;
470 l_rec.period_of_placement_id := p_period_of_placement_id;
471 l_rec.final_process_date := p_final_process_date;
472 l_rec.last_standard_process_date := p_last_standard_process_date;
473 --
474 -- Return the plsql record structure.
475 --
476 Return(l_rec);
477 --
478 End convert_args;
479 --
480 end per_pdp_shd;