[Home] [Help]
PACKAGE BODY: APPS.PER_PML_SHD
Source
1 Package Body per_pml_shd as
2 /* $Header: pepmlrhi.pkb 120.9.12020000.1 2012/06/29 01:50:07 appldev ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_pml_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_OBJECTIVES_LIBRARY_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 Else
27 fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
28 fnd_message.set_token('PROCEDURE', l_proc);
29 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
30 fnd_message.raise_error;
31 End If;
32 --
33 End constraint_error;
34 --
35 -- ----------------------------------------------------------------------------
36 -- |-----------------------------< api_updating >-----------------------------|
37 -- ----------------------------------------------------------------------------
38 Function api_updating
39 (p_objective_id in number
40 ,p_object_version_number in number
41 )
42 Return Boolean Is
43 --
44 --
45 -- Cursor selects the 'current' row from the HR Schema
46 --
47 Cursor C_Sel1 is
48 select
49 objective_id
50 ,object_version_number
51 ,objective_name
52 ,valid_from
53 ,valid_to
54 ,target_date
55 ,next_review_date
56 ,group_code
57 ,priority_code
58 ,appraise_flag
59 ,weighting_percent
60 ,measurement_style_code
61 ,measure_name
62 ,target_value
63 ,uom_code
64 ,measure_type_code
65 ,measure_comments
66 ,eligibility_type_code
67 ,details
68 ,success_criteria
69 ,comments
70 ,attribute_category
71 ,attribute1
72 ,attribute2
73 ,attribute3
74 ,attribute4
75 ,attribute5
76 ,attribute6
77 ,attribute7
78 ,attribute8
79 ,attribute9
80 ,attribute10
81 ,attribute11
82 ,attribute12
83 ,attribute13
84 ,attribute14
85 ,attribute15
86 ,attribute16
87 ,attribute17
88 ,attribute18
89 ,attribute19
90 ,attribute20
91 ,attribute21
92 ,attribute22
93 ,attribute23
94 ,attribute24
95 ,attribute25
96 ,attribute26
97 ,attribute27
98 ,attribute28
99 ,attribute29
100 ,attribute30
101 from per_objectives_library
102 where objective_id = p_objective_id;
103 --
104 l_fct_ret boolean;
105 --
106 Begin
107 --
108 If (p_objective_id is null and
109 p_object_version_number is null
110 ) Then
111 --
112 -- One of the primary key arguments is null therefore we must
113 -- set the returning function value to false
114 --
115 l_fct_ret := false;
116 Else
117 If (p_objective_id
118 = per_pml_shd.g_old_rec.objective_id and
119 p_object_version_number
120 = per_pml_shd.g_old_rec.object_version_number
121 ) Then
122 --
123 -- The g_old_rec is current therefore we must
124 -- set the returning function to true
125 --
126 l_fct_ret := true;
127 Else
128 --
129 -- Select the current row into g_old_rec
130 --
131 Open C_Sel1;
132 Fetch C_Sel1 Into per_pml_shd.g_old_rec;
133 If C_Sel1%notfound Then
134 Close C_Sel1;
135 --
136 -- The primary key is invalid therefore we must error
137 --
138 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
139 fnd_message.raise_error;
140 End If;
141 Close C_Sel1;
142 If (p_object_version_number
143 <> per_pml_shd.g_old_rec.object_version_number) Then
144 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
145 fnd_message.raise_error;
146 End If;
147 l_fct_ret := true;
148 End If;
149 End If;
150 Return (l_fct_ret);
151 --
152 End api_updating;
153 --
154 -- ----------------------------------------------------------------------------
155 -- |---------------------------------< lck >----------------------------------|
156 -- ----------------------------------------------------------------------------
157 Procedure lck
158 (p_objective_id in number
159 ,p_object_version_number in number
160 ) is
161 --
162 -- Cursor selects the 'current' row from the HR Schema
163 --
164 Cursor C_Sel1 is
165 select
166 objective_id
167 ,object_version_number
168 ,objective_name
169 ,valid_from
170 ,valid_to
171 ,target_date
172 ,next_review_date
173 ,group_code
174 ,priority_code
175 ,appraise_flag
176 ,weighting_percent
177 ,measurement_style_code
178 ,measure_name
179 ,target_value
180 ,uom_code
181 ,measure_type_code
182 ,measure_comments
183 ,eligibility_type_code
184 ,details
185 ,success_criteria
186 ,comments
187 ,attribute_category
188 ,attribute1
189 ,attribute2
190 ,attribute3
191 ,attribute4
192 ,attribute5
193 ,attribute6
194 ,attribute7
195 ,attribute8
196 ,attribute9
197 ,attribute10
198 ,attribute11
199 ,attribute12
200 ,attribute13
201 ,attribute14
202 ,attribute15
203 ,attribute16
204 ,attribute17
205 ,attribute18
206 ,attribute19
207 ,attribute20
208 ,attribute21
209 ,attribute22
210 ,attribute23
211 ,attribute24
212 ,attribute25
213 ,attribute26
214 ,attribute27
215 ,attribute28
216 ,attribute29
217 ,attribute30
218 from per_objectives_library
219 where objective_id = p_objective_id
220 for update nowait;
221 --
222 l_proc varchar2(72) := g_package||'lck';
223 --
224 Begin
225 hr_utility.set_location('Entering:'||l_proc, 5);
226 --
227 hr_api.mandatory_arg_error
228 (p_api_name => l_proc
229 ,p_argument => 'OBJECTIVE_ID'
230 ,p_argument_value => p_objective_id
231 );
232 hr_utility.set_location(l_proc,6);
233 hr_api.mandatory_arg_error
234 (p_api_name => l_proc
235 ,p_argument => 'OBJECT_VERSION_NUMBER'
236 ,p_argument_value => p_object_version_number
237 );
238 --
239 Open C_Sel1;
240 Fetch C_Sel1 Into per_pml_shd.g_old_rec;
241 If C_Sel1%notfound then
242 Close C_Sel1;
243 --
244 -- The primary key is invalid therefore we must error
245 --
249 Close C_Sel1;
246 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
247 fnd_message.raise_error;
248 End If;
250 If (p_object_version_number
251 <> per_pml_shd.g_old_rec.object_version_number) Then
252 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
253 fnd_message.raise_error;
254 End If;
255 --
256 hr_utility.set_location(' Leaving:'||l_proc, 10);
257 --
258 -- We need to trap the ORA LOCK exception
259 --
260 Exception
261 When HR_Api.Object_Locked then
262 --
263 -- The object is locked therefore we need to supply a meaningful
264 -- error message.
265 --
266 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
267 fnd_message.set_token('TABLE_NAME', 'per_objectives_library');
268 fnd_message.raise_error;
269 End lck;
270 --
271 -- ----------------------------------------------------------------------------
272 -- |-----------------------------< convert_args >-----------------------------|
273 -- ----------------------------------------------------------------------------
274 Function convert_args
275 (p_objective_id in number
276 ,p_object_version_number in number
277 ,p_objective_name in varchar2
278 ,p_valid_from in date
279 ,p_valid_to in date
280 ,p_target_date in date
281 ,p_next_review_date in date
282 ,p_group_code in varchar2
283 ,p_priority_code in varchar2
284 ,p_appraise_flag in varchar2
285 ,p_weighting_percent in number
286 ,p_measurement_style_code in varchar2
287 ,p_measure_name in varchar2
288 ,p_target_value in number
289 ,p_uom_code in varchar2
290 ,p_measure_type_code in varchar2
291 ,p_measure_comments in varchar2
292 ,p_eligibility_type_code in varchar2
293 ,p_details in varchar2
294 ,p_success_criteria in varchar2
295 ,p_comments in varchar2
296 ,p_attribute_category in varchar2
297 ,p_attribute1 in varchar2
298 ,p_attribute2 in varchar2
299 ,p_attribute3 in varchar2
300 ,p_attribute4 in varchar2
301 ,p_attribute5 in varchar2
302 ,p_attribute6 in varchar2
303 ,p_attribute7 in varchar2
304 ,p_attribute8 in varchar2
305 ,p_attribute9 in varchar2
306 ,p_attribute10 in varchar2
307 ,p_attribute11 in varchar2
308 ,p_attribute12 in varchar2
309 ,p_attribute13 in varchar2
310 ,p_attribute14 in varchar2
311 ,p_attribute15 in varchar2
312 ,p_attribute16 in varchar2
313 ,p_attribute17 in varchar2
314 ,p_attribute18 in varchar2
315 ,p_attribute19 in varchar2
316 ,p_attribute20 in varchar2
317 ,p_attribute21 in varchar2
318 ,p_attribute22 in varchar2
319 ,p_attribute23 in varchar2
320 ,p_attribute24 in varchar2
321 ,p_attribute25 in varchar2
322 ,p_attribute26 in varchar2
323 ,p_attribute27 in varchar2
324 ,p_attribute28 in varchar2
325 ,p_attribute29 in varchar2
326 ,p_attribute30 in varchar2
327 )
328 Return g_rec_type is
329 --
330 l_rec g_rec_type;
331 --
332 Begin
333 --
334 -- Convert arguments into local l_rec structure.
335 --
336 l_rec.objective_id := p_objective_id;
337 l_rec.object_version_number := p_object_version_number;
338 l_rec.objective_name := p_objective_name;
339 l_rec.valid_from := p_valid_from;
340 l_rec.valid_to := p_valid_to;
341 l_rec.target_date := p_target_date;
342 l_rec.next_review_date := p_next_review_date;
343 l_rec.group_code := p_group_code;
344 l_rec.priority_code := p_priority_code;
345 l_rec.appraise_flag := p_appraise_flag;
346 l_rec.weighting_percent := p_weighting_percent;
347 l_rec.measurement_style_code := p_measurement_style_code;
348 l_rec.measure_name := p_measure_name;
349 l_rec.target_value := p_target_value;
350 l_rec.uom_code := p_uom_code;
351 l_rec.measure_type_code := p_measure_type_code;
352 l_rec.measure_comments := p_measure_comments;
353 l_rec.eligibility_type_code := p_eligibility_type_code;
354 l_rec.details := p_details;
355 l_rec.success_criteria := p_success_criteria;
356 l_rec.comments := p_comments;
357 l_rec.attribute_category := p_attribute_category;
358 l_rec.attribute1 := p_attribute1;
359 l_rec.attribute2 := p_attribute2;
360 l_rec.attribute3 := p_attribute3;
361 l_rec.attribute4 := p_attribute4;
362 l_rec.attribute5 := p_attribute5;
363 l_rec.attribute6 := p_attribute6;
364 l_rec.attribute7 := p_attribute7;
365 l_rec.attribute8 := p_attribute8;
366 l_rec.attribute9 := p_attribute9;
367 l_rec.attribute10 := p_attribute10;
368 l_rec.attribute11 := p_attribute11;
369 l_rec.attribute12 := p_attribute12;
370 l_rec.attribute13 := p_attribute13;
371 l_rec.attribute14 := p_attribute14;
372 l_rec.attribute15 := p_attribute15;
373 l_rec.attribute16 := p_attribute16;
374 l_rec.attribute17 := p_attribute17;
375 l_rec.attribute18 := p_attribute18;
376 l_rec.attribute19 := p_attribute19;
377 l_rec.attribute20 := p_attribute20;
378 l_rec.attribute21 := p_attribute21;
379 l_rec.attribute22 := p_attribute22;
380 l_rec.attribute23 := p_attribute23;
381 l_rec.attribute24 := p_attribute24;
382 l_rec.attribute25 := p_attribute25;
383 l_rec.attribute26 := p_attribute26;
384 l_rec.attribute27 := p_attribute27;
385 l_rec.attribute28 := p_attribute28;
386 l_rec.attribute29 := p_attribute29;
387 l_rec.attribute30 := p_attribute30;
388 --
389 -- Return the plsql record structure.
390 --
391 Return(l_rec);
392 --
393 End convert_args;
394 --
395 end per_pml_shd;