[Home] [Help]
PACKAGE BODY: APPS.BEN_CRT_SHD
Source
1 Package Body ben_crt_shd as
2 /* $Header: becrtrhi.pkb 115.11 2004/06/22 07:52:16 rpgupta ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_crt_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 -- ----------------------------------------------------------------------------
29 (p_constraint_name in all_constraints.constraint_name%TYPE) Is
26 -- |---------------------------< constraint_error >---------------------------|
27 -- ----------------------------------------------------------------------------
28 Procedure constraint_error
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_CRT_ORDR_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_CRT_ORDR_PK') 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_CRT_ORDR_CVRD_PER_FK1') Then
47 ben_utility.child_exists_error(p_table_name => 'BEN_CRT_ORDR_CVRD_PER');
48 Else
49 fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
50 fnd_message.set_token('PROCEDURE', l_proc);
51 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
52 fnd_message.raise_error;
53 End If;
54 --
55 hr_utility.set_location(' Leaving:'||l_proc, 10);
56 End constraint_error;
57 --
58 -- ----------------------------------------------------------------------------
59 -- |-----------------------------< api_updating >-----------------------------|
60 -- ----------------------------------------------------------------------------
61 Function api_updating
62 (
63 p_crt_ordr_id in number,
64 p_object_version_number in number
65 ) Return Boolean Is
66 --
67 --
68 -- Cursor selects the 'current' row from the HR Schema
69 --
70 Cursor C_Sel1 is
71 select
72 crt_ordr_id,
73 crt_ordr_typ_cd,
74 apls_perd_endg_dt,
75 apls_perd_strtg_dt,
76 crt_ident,
77 description,
78 detd_qlfd_ordr_dt,
79 issue_dt,
80 qdro_amt,
81 qdro_dstr_mthd_cd,
82 qdro_pct,
83 rcvd_dt,
84 uom,
85 crt_issng,
86 pl_id,
87 person_id,
88 business_group_id,
89 crt_attribute_category,
90 crt_attribute1,
91 crt_attribute2,
92 crt_attribute3,
93 crt_attribute4,
94 crt_attribute5,
95 crt_attribute6,
96 crt_attribute7,
97 crt_attribute8,
98 crt_attribute9,
99 crt_attribute10,
100 crt_attribute11,
101 crt_attribute12,
102 crt_attribute13,
103 crt_attribute14,
104 crt_attribute15,
105 crt_attribute16,
106 crt_attribute17,
107 crt_attribute18,
108 crt_attribute19,
109 crt_attribute20,
110 crt_attribute21,
111 crt_attribute22,
112 crt_attribute23,
113 crt_attribute24,
114 crt_attribute25,
115 crt_attribute26,
116 crt_attribute27,
117 crt_attribute28,
118 crt_attribute29,
119 crt_attribute30,
120 object_version_number,
121 qdro_num_pymt_val,
122 qdro_per_perd_cd,
123 pl_typ_id
124 from ben_crt_ordr
125 where crt_ordr_id = p_crt_ordr_id;
126 --
127 l_proc varchar2(72) := g_package||'api_updating';
128 l_fct_ret boolean;
129 --
130 Begin
131 hr_utility.set_location('Entering:'||l_proc, 5);
132 --
133 If (
134 p_crt_ordr_id is null and
135 p_object_version_number is null
136 ) Then
137 --
138 -- One of the primary key arguments is null therefore we must
139 -- set the returning function value to false
140 --
141 l_fct_ret := false;
142 Else
143 If (
144 p_crt_ordr_id = g_old_rec.crt_ordr_id and
145 p_object_version_number = g_old_rec.object_version_number
146 ) Then
147 hr_utility.set_location(l_proc, 10);
148 --
149 -- The g_old_rec is current therefore we must
150 -- set the returning function to true
151 --
152 l_fct_ret := true;
153 Else
154 --
155 -- Select the current row into g_old_rec
156 --
157 Open C_Sel1;
158 Fetch C_Sel1 Into g_old_rec;
159 If C_Sel1%notfound Then
160 Close C_Sel1;
161 --
162 -- The primary key is invalid therefore we must error
163 --
164 fnd_message.set_name('BEN', 'HR_7220_INVALID_PRIMARY_KEY');
165 fnd_message.raise_error;
166 End If;
167 Close C_Sel1;
168 If (p_object_version_number <> g_old_rec.object_version_number) Then
169 fnd_message.set_name('BEN', 'HR_7155_OBJECT_INVALID');
170 fnd_message.raise_error;
171 End If;
172 hr_utility.set_location(l_proc, 15);
173 l_fct_ret := true;
174 End If;
175 End If;
176 hr_utility.set_location(' Leaving:'||l_proc, 20);
177 Return (l_fct_ret);
178 --
179 End api_updating;
180 --
181 -- ----------------------------------------------------------------------------
182 -- |---------------------------------< lck >----------------------------------|
183 -- ----------------------------------------------------------------------------
184 Procedure lck
185 (
186 p_crt_ordr_id in number,
187 p_object_version_number in number
188 ) is
189 --
190 -- Cursor selects the 'current' row from the HR Schema
191 --
192 Cursor C_Sel1 is
193 select crt_ordr_id,
194 crt_ordr_typ_cd,
195 apls_perd_endg_dt,
196 apls_perd_strtg_dt,
197 crt_ident,
198 description,
199 detd_qlfd_ordr_dt,
200 issue_dt,
201 qdro_amt,
202 qdro_dstr_mthd_cd,
203 qdro_pct,
204 rcvd_dt,
205 uom,
206 crt_issng,
207 pl_id,
208 person_id,
209 business_group_id,
210 crt_attribute_category,
211 crt_attribute1,
212 crt_attribute2,
213 crt_attribute3,
214 crt_attribute4,
215 crt_attribute5,
216 crt_attribute6,
217 crt_attribute7,
218 crt_attribute8,
219 crt_attribute9,
220 crt_attribute10,
221 crt_attribute11,
222 crt_attribute12,
223 crt_attribute13,
224 crt_attribute14,
225 crt_attribute15,
226 crt_attribute16,
227 crt_attribute17,
228 crt_attribute18,
229 crt_attribute19,
230 crt_attribute20,
231 crt_attribute21,
232 crt_attribute22,
233 crt_attribute23,
234 crt_attribute24,
235 crt_attribute25,
236 crt_attribute26,
237 crt_attribute27,
238 crt_attribute28,
239 crt_attribute29,
240 crt_attribute30,
241 object_version_number,
242 qdro_num_pymt_val,
243 qdro_per_perd_cd,
244 pl_typ_id
245 from ben_crt_ordr
246 where crt_ordr_id = p_crt_ordr_id
247 for update nowait;
248 --
249 l_proc varchar2(72) := g_package||'lck';
250 --
251 Begin
252 hr_utility.set_location('Entering:'||l_proc, 5);
253 --
254 -- Add any mandatory argument checking here:
255 -- Example:
256 -- hr_api.mandatory_arg_error
257 -- (p_api_name => l_proc,
258 -- p_argument => 'object_version_number',
259 -- p_argument_value => p_object_version_number);
260 --
261 Open C_Sel1;
262 Fetch C_Sel1 Into g_old_rec;
263 If C_Sel1%notfound then
264 Close C_Sel1;
265 --
266 -- The primary key is invalid therefore we must error
267 --
268 fnd_message.set_name('BEN', 'HR_7220_INVALID_PRIMARY_KEY');
269 fnd_message.raise_error;
270 End If;
271 Close C_Sel1;
272 If (p_object_version_number <> g_old_rec.object_version_number) Then
273 fnd_message.set_name('BEN', 'HR_7155_OBJECT_INVALID');
274 fnd_message.raise_error;
275 End If;
276 --
277 hr_utility.set_location(' Leaving:'||l_proc, 10);
278 --
279 -- We need to trap the ORA LOCK exception
280 --
281 Exception
282 When HR_Api.Object_Locked then
283 --
284 -- The object is locked therefore we need to supply a meaningful
285 -- error message.
286 --
287 fnd_message.set_name('BEN', 'HR_7165_OBJECT_LOCKED');
288 fnd_message.set_token('TABLE_NAME', 'ben_crt_ordr');
289 fnd_message.raise_error;
290 End lck;
291 --
292 -- ----------------------------------------------------------------------------
293 -- |-----------------------------< convert_args >-----------------------------|
294 -- ----------------------------------------------------------------------------
295 Function convert_args
296 (
297 p_crt_ordr_id in number,
298 p_crt_ordr_typ_cd in varchar2,
299 p_apls_perd_endg_dt in date,
300 p_apls_perd_strtg_dt in date,
301 p_crt_ident in varchar2,
302 p_description in varchar2,
303 p_detd_qlfd_ordr_dt in date,
304 p_issue_dt in date,
305 p_qdro_amt in number,
306 p_qdro_dstr_mthd_cd in varchar2,
307 p_qdro_pct in number,
308 p_rcvd_dt in date,
309 p_uom in varchar2,
310 p_crt_issng in varchar2,
311 p_pl_id in number,
312 p_person_id in number,
313 p_business_group_id in number,
314 p_crt_attribute_category in varchar2,
315 p_crt_attribute1 in varchar2,
316 p_crt_attribute2 in varchar2,
317 p_crt_attribute3 in varchar2,
318 p_crt_attribute4 in varchar2,
319 p_crt_attribute5 in varchar2,
320 p_crt_attribute6 in varchar2,
321 p_crt_attribute7 in varchar2,
322 p_crt_attribute8 in varchar2,
323 p_crt_attribute9 in varchar2,
324 p_crt_attribute10 in varchar2,
325 p_crt_attribute11 in varchar2,
326 p_crt_attribute12 in varchar2,
327 p_crt_attribute13 in varchar2,
328 p_crt_attribute14 in varchar2,
329 p_crt_attribute15 in varchar2,
330 p_crt_attribute16 in varchar2,
331 p_crt_attribute17 in varchar2,
332 p_crt_attribute18 in varchar2,
333 p_crt_attribute19 in varchar2,
334 p_crt_attribute20 in varchar2,
335 p_crt_attribute21 in varchar2,
336 p_crt_attribute22 in varchar2,
337 p_crt_attribute23 in varchar2,
338 p_crt_attribute24 in varchar2,
339 p_crt_attribute25 in varchar2,
340 p_crt_attribute26 in varchar2,
341 p_crt_attribute27 in varchar2,
342 p_crt_attribute28 in varchar2,
343 p_crt_attribute29 in varchar2,
344 p_crt_attribute30 in varchar2,
345 p_object_version_number in number,
346 p_qdro_num_pymt_val in number,
347 p_qdro_per_perd_cd in varchar2,
348 p_pl_typ_id in number
349 )
350 Return g_rec_type is
351 --
352 l_rec g_rec_type;
353 l_proc varchar2(72) := g_package||'convert_args';
354 --
355 Begin
356 --
357 hr_utility.set_location('Entering:'||l_proc, 5);
358 --
359 -- Convert arguments into local l_rec structure.
360 --
361 l_rec.crt_ordr_id := p_crt_ordr_id;
362 l_rec.crt_ordr_typ_cd := p_crt_ordr_typ_cd;
363 l_rec.apls_perd_endg_dt := p_apls_perd_endg_dt;
364 l_rec.apls_perd_strtg_dt := p_apls_perd_strtg_dt;
365 l_rec.crt_ident := p_crt_ident;
366 l_rec.description := p_description;
367 l_rec.detd_qlfd_ordr_dt := p_detd_qlfd_ordr_dt;
368 l_rec.issue_dt := p_issue_dt;
369 l_rec.qdro_amt := p_qdro_amt;
370 l_rec.qdro_dstr_mthd_cd := p_qdro_dstr_mthd_cd;
371 l_rec.qdro_pct := p_qdro_pct;
372 l_rec.rcvd_dt := p_rcvd_dt;
373 l_rec.uom := p_uom;
374 l_rec.crt_issng := p_crt_issng;
375 l_rec.pl_id := p_pl_id;
376 l_rec.person_id := p_person_id;
377 l_rec.business_group_id := p_business_group_id;
378 l_rec.crt_attribute_category := p_crt_attribute_category;
379 l_rec.crt_attribute1 := p_crt_attribute1;
380 l_rec.crt_attribute2 := p_crt_attribute2;
381 l_rec.crt_attribute3 := p_crt_attribute3;
382 l_rec.crt_attribute4 := p_crt_attribute4;
383 l_rec.crt_attribute5 := p_crt_attribute5;
384 l_rec.crt_attribute6 := p_crt_attribute6;
385 l_rec.crt_attribute7 := p_crt_attribute7;
386 l_rec.crt_attribute8 := p_crt_attribute8;
387 l_rec.crt_attribute9 := p_crt_attribute9;
388 l_rec.crt_attribute10 := p_crt_attribute10;
389 l_rec.crt_attribute11 := p_crt_attribute11;
390 l_rec.crt_attribute12 := p_crt_attribute12;
391 l_rec.crt_attribute13 := p_crt_attribute13;
392 l_rec.crt_attribute14 := p_crt_attribute14;
393 l_rec.crt_attribute15 := p_crt_attribute15;
394 l_rec.crt_attribute16 := p_crt_attribute16;
395 l_rec.crt_attribute17 := p_crt_attribute17;
396 l_rec.crt_attribute18 := p_crt_attribute18;
397 l_rec.crt_attribute19 := p_crt_attribute19;
398 l_rec.crt_attribute20 := p_crt_attribute20;
399 l_rec.crt_attribute21 := p_crt_attribute21;
400 l_rec.crt_attribute22 := p_crt_attribute22;
401 l_rec.crt_attribute23 := p_crt_attribute23;
402 l_rec.crt_attribute24 := p_crt_attribute24;
403 l_rec.crt_attribute25 := p_crt_attribute25;
404 l_rec.crt_attribute26 := p_crt_attribute26;
405 l_rec.crt_attribute27 := p_crt_attribute27;
406 l_rec.crt_attribute28 := p_crt_attribute28;
407 l_rec.crt_attribute29 := p_crt_attribute29;
408 l_rec.crt_attribute30 := p_crt_attribute30;
409 l_rec.object_version_number := p_object_version_number;
410 l_rec.qdro_num_pymt_val := p_qdro_num_pymt_val;
411 l_rec.qdro_per_perd_cd := p_qdro_per_perd_cd;
412 l_rec.pl_typ_id := p_pl_typ_id;
413 --
414 -- Return the plsql record structure.
415 --
416 hr_utility.set_location(' Leaving:'||l_proc, 10);
417 Return(l_rec);
418 --
419 End convert_args;
420 --
421 end ben_crt_shd;