[Home] [Help]
PACKAGE BODY: APPS.BEN_PCG_SHD
Source
1 Package Body ben_pcg_shd as
2 /* $Header: bepcgrhi.pkb 115.8 2002/12/16 11:58:08 vsethi ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_pcg_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_PRTT_CLM_GD_OR_SVC_TYP_FK3') 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_PRTT_CLM_GD_OR_SVC_TYP_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_PRTT_REIMBMT_RQST_F_FK2') Then
47 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
48 fnd_message.set_token('PROCEDURE', l_proc);
49 fnd_message.set_token('STEP','15');
50 fnd_message.raise_error;
51 Else
52 fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
53 fnd_message.set_token('PROCEDURE', l_proc);
54 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
55 fnd_message.raise_error;
56 End If;
57 --
58 hr_utility.set_location(' Leaving:'||l_proc, 10);
59 End constraint_error;
60 --
61 -- ----------------------------------------------------------------------------
62 -- |-----------------------------< api_updating >-----------------------------|
63 -- ----------------------------------------------------------------------------
64 Function api_updating
65 (
66 p_prtt_clm_gd_or_svc_typ_id in number,
67 p_object_version_number in number
68 ) Return Boolean Is
69 --
70 --
71 -- Cursor selects the 'current' row from the HR Schema
72 --
73 Cursor C_Sel1 is
74 select
75 prtt_clm_gd_or_svc_typ_id,
76 prtt_reimbmt_rqst_id,
77 gd_or_svc_typ_id,
78 business_group_id,
79 pcg_attribute_category,
80 pcg_attribute1,
81 pcg_attribute2,
82 pcg_attribute3,
83 pcg_attribute4,
84 pcg_attribute5,
85 pcg_attribute6,
86 pcg_attribute7,
87 pcg_attribute8,
88 pcg_attribute9,
89 pcg_attribute10,
90 pcg_attribute11,
91 pcg_attribute12,
92 pcg_attribute13,
93 pcg_attribute14,
94 pcg_attribute15,
95 pcg_attribute16,
96 pcg_attribute17,
97 pcg_attribute18,
98 pcg_attribute19,
99 pcg_attribute20,
100 pcg_attribute21,
101 pcg_attribute22,
102 pcg_attribute23,
103 pcg_attribute24,
104 pcg_attribute25,
105 pcg_attribute26,
106 pcg_attribute27,
107 pcg_attribute28,
108 pcg_attribute29,
109 pcg_attribute30,
110 object_version_number,
111 pl_gd_or_svc_id
112 from ben_prtt_clm_gd_or_svc_typ
113 where prtt_clm_gd_or_svc_typ_id = p_prtt_clm_gd_or_svc_typ_id;
114 --
115 l_proc varchar2(72) := g_package||'api_updating';
116 l_fct_ret boolean;
117 --
118 Begin
119 hr_utility.set_location('Entering:'||l_proc, 5);
120 --
121 If (
122 p_prtt_clm_gd_or_svc_typ_id is null and
123 p_object_version_number is null
124 ) Then
125 --
126 -- One of the primary key arguments is null therefore we must
127 -- set the returning function value to false
128 --
129 l_fct_ret := false;
130 Else
131 If (
132 p_prtt_clm_gd_or_svc_typ_id = g_old_rec.prtt_clm_gd_or_svc_typ_id and
133 p_object_version_number = g_old_rec.object_version_number
134 ) Then
135 hr_utility.set_location(l_proc, 10);
136 --
137 -- The g_old_rec is current therefore we must
138 -- set the returning function to true
139 --
140 l_fct_ret := true;
141 Else
142 --
143 -- Select the current row into g_old_rec
144 --
145 Open C_Sel1;
146 Fetch C_Sel1 Into g_old_rec;
147 If C_Sel1%notfound Then
148 Close C_Sel1;
149 --
150 -- The primary key is invalid therefore we must error
151 --
152 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
153 fnd_message.raise_error;
154 End If;
155 Close C_Sel1;
156 If (p_object_version_number <> g_old_rec.object_version_number) Then
157 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
158 fnd_message.raise_error;
159 End If;
160 hr_utility.set_location(l_proc, 15);
161 l_fct_ret := true;
162 End If;
163 End If;
164 hr_utility.set_location(' Leaving:'||l_proc, 20);
165 Return (l_fct_ret);
166 --
167 End api_updating;
168 --
169 -- ----------------------------------------------------------------------------
170 -- |---------------------------------< lck >----------------------------------|
171 -- ----------------------------------------------------------------------------
172 Procedure lck
173 (
174 p_prtt_clm_gd_or_svc_typ_id in number,
175 p_object_version_number in number
176 ) is
177 --
178 -- Cursor selects the 'current' row from the HR Schema
179 --
180 Cursor C_Sel1 is
181 select prtt_clm_gd_or_svc_typ_id,
182 prtt_reimbmt_rqst_id,
183 gd_or_svc_typ_id,
184 business_group_id,
185 pcg_attribute_category,
186 pcg_attribute1,
187 pcg_attribute2,
188 pcg_attribute3,
189 pcg_attribute4,
190 pcg_attribute5,
191 pcg_attribute6,
192 pcg_attribute7,
193 pcg_attribute8,
194 pcg_attribute9,
195 pcg_attribute10,
196 pcg_attribute11,
197 pcg_attribute12,
198 pcg_attribute13,
199 pcg_attribute14,
200 pcg_attribute15,
201 pcg_attribute16,
202 pcg_attribute17,
203 pcg_attribute18,
204 pcg_attribute19,
205 pcg_attribute20,
206 pcg_attribute21,
207 pcg_attribute22,
208 pcg_attribute23,
209 pcg_attribute24,
210 pcg_attribute25,
211 pcg_attribute26,
212 pcg_attribute27,
213 pcg_attribute28,
214 pcg_attribute29,
215 pcg_attribute30,
216 object_version_number,
217 pl_gd_or_svc_id
218 from ben_prtt_clm_gd_or_svc_typ
219 where prtt_clm_gd_or_svc_typ_id = p_prtt_clm_gd_or_svc_typ_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 -- Add any mandatory argument checking here:
228 -- Example:
229 -- hr_api.mandatory_arg_error
230 -- (p_api_name => l_proc,
231 -- p_argument => 'object_version_number',
232 -- p_argument_value => p_object_version_number);
233 --
234 Open C_Sel1;
235 Fetch C_Sel1 Into g_old_rec;
236 If C_Sel1%notfound then
237 Close C_Sel1;
238 --
239 -- The primary key is invalid therefore we must error
240 --
241 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
242 fnd_message.raise_error;
243 End If;
244 Close C_Sel1;
245 If (p_object_version_number <> g_old_rec.object_version_number) Then
246 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
247 fnd_message.raise_error;
248 End If;
249 --
250 hr_utility.set_location(' Leaving:'||l_proc, 10);
251 --
252 -- We need to trap the ORA LOCK exception
253 --
254 Exception
255 When HR_Api.Object_Locked then
256 --
257 -- The object is locked therefore we need to supply a meaningful
258 -- error message.
259 --
260 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
261 fnd_message.set_token('TABLE_NAME', 'ben_prtt_clm_gd_or_svc_typ');
262 fnd_message.raise_error;
263 End lck;
264 --
265 -- ----------------------------------------------------------------------------
266 -- |-----------------------------< convert_args >-----------------------------|
267 -- ----------------------------------------------------------------------------
268 Function convert_args
269 (
270 p_prtt_clm_gd_or_svc_typ_id in number,
271 p_prtt_reimbmt_rqst_id in number,
272 p_gd_or_svc_typ_id in number,
273 p_business_group_id in number,
274 p_pcg_attribute_category in varchar2,
275 p_pcg_attribute1 in varchar2,
276 p_pcg_attribute2 in varchar2,
277 p_pcg_attribute3 in varchar2,
278 p_pcg_attribute4 in varchar2,
279 p_pcg_attribute5 in varchar2,
280 p_pcg_attribute6 in varchar2,
281 p_pcg_attribute7 in varchar2,
282 p_pcg_attribute8 in varchar2,
283 p_pcg_attribute9 in varchar2,
284 p_pcg_attribute10 in varchar2,
285 p_pcg_attribute11 in varchar2,
286 p_pcg_attribute12 in varchar2,
287 p_pcg_attribute13 in varchar2,
288 p_pcg_attribute14 in varchar2,
289 p_pcg_attribute15 in varchar2,
290 p_pcg_attribute16 in varchar2,
291 p_pcg_attribute17 in varchar2,
292 p_pcg_attribute18 in varchar2,
293 p_pcg_attribute19 in varchar2,
294 p_pcg_attribute20 in varchar2,
295 p_pcg_attribute21 in varchar2,
296 p_pcg_attribute22 in varchar2,
297 p_pcg_attribute23 in varchar2,
298 p_pcg_attribute24 in varchar2,
299 p_pcg_attribute25 in varchar2,
300 p_pcg_attribute26 in varchar2,
301 p_pcg_attribute27 in varchar2,
302 p_pcg_attribute28 in varchar2,
303 p_pcg_attribute29 in varchar2,
304 p_pcg_attribute30 in varchar2,
305 p_object_version_number in number ,
306 p_pl_gd_or_svc_id in number
307 )
308 Return g_rec_type is
309 --
310 l_rec g_rec_type;
311 l_proc varchar2(72) := g_package||'convert_args';
312 --
313 Begin
314 --
315 hr_utility.set_location('Entering:'||l_proc, 5);
316 --
317 -- Convert arguments into local l_rec structure.
318 --
319 l_rec.prtt_clm_gd_or_svc_typ_id := p_prtt_clm_gd_or_svc_typ_id;
320 l_rec.prtt_reimbmt_rqst_id := p_prtt_reimbmt_rqst_id;
321 l_rec.gd_or_svc_typ_id := p_gd_or_svc_typ_id;
322 l_rec.business_group_id := p_business_group_id;
323 l_rec.pcg_attribute_category := p_pcg_attribute_category;
324 l_rec.pcg_attribute1 := p_pcg_attribute1;
325 l_rec.pcg_attribute2 := p_pcg_attribute2;
326 l_rec.pcg_attribute3 := p_pcg_attribute3;
327 l_rec.pcg_attribute4 := p_pcg_attribute4;
328 l_rec.pcg_attribute5 := p_pcg_attribute5;
329 l_rec.pcg_attribute6 := p_pcg_attribute6;
330 l_rec.pcg_attribute7 := p_pcg_attribute7;
331 l_rec.pcg_attribute8 := p_pcg_attribute8;
332 l_rec.pcg_attribute9 := p_pcg_attribute9;
333 l_rec.pcg_attribute10 := p_pcg_attribute10;
334 l_rec.pcg_attribute11 := p_pcg_attribute11;
335 l_rec.pcg_attribute12 := p_pcg_attribute12;
336 l_rec.pcg_attribute13 := p_pcg_attribute13;
337 l_rec.pcg_attribute14 := p_pcg_attribute14;
338 l_rec.pcg_attribute15 := p_pcg_attribute15;
339 l_rec.pcg_attribute16 := p_pcg_attribute16;
340 l_rec.pcg_attribute17 := p_pcg_attribute17;
341 l_rec.pcg_attribute18 := p_pcg_attribute18;
342 l_rec.pcg_attribute19 := p_pcg_attribute19;
343 l_rec.pcg_attribute20 := p_pcg_attribute20;
344 l_rec.pcg_attribute21 := p_pcg_attribute21;
345 l_rec.pcg_attribute22 := p_pcg_attribute22;
346 l_rec.pcg_attribute23 := p_pcg_attribute23;
347 l_rec.pcg_attribute24 := p_pcg_attribute24;
348 l_rec.pcg_attribute25 := p_pcg_attribute25;
349 l_rec.pcg_attribute26 := p_pcg_attribute26;
350 l_rec.pcg_attribute27 := p_pcg_attribute27;
351 l_rec.pcg_attribute28 := p_pcg_attribute28;
352 l_rec.pcg_attribute29 := p_pcg_attribute29;
353 l_rec.pcg_attribute30 := p_pcg_attribute30;
354 l_rec.object_version_number := p_object_version_number;
355 l_rec.pl_gd_or_svc_id := p_pl_gd_or_svc_id ;
356 --
357 -- Return the plsql record structure.
358 --
359 hr_utility.set_location(' Leaving:'||l_proc, 10);
360 Return(l_rec);
361 --
362 End convert_args;
363 --
364 end ben_pcg_shd;