DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_BPD_SHD

Source


1 Package Body per_bpd_shd as
2 /* $Header: pebpdrhi.pkb 115.6 2002/12/02 13:52:43 apholt noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  per_bpd_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_PAYMENT_DETAILS_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_PAYMENT_DETAILS_FK2') Then
27 fnd_message.set_name('PER', 'HR_52948_BAD_PROCESSED_ASG_ID');
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_PAYMENT_DETAILS_PK') Then
32 fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
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_PAYMENT_DETAILS_UK1') Then
37 fnd_message.set_name('PER', 'PER_289358_BF_ASG_PPM_NOT_UNQ');
38 fnd_message.set_token('PROCEDURE', l_proc);
39 fnd_message.set_token('STEP','15');
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_payment_detail_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 payment_detail_id,
66 processed_assignment_id,
67 personal_payment_method_id,
68 business_group_id,
69 check_number,
70 payment_date,
71 amount,
72 check_type,
73 object_version_number,
74 bpd_attribute_category,
75 bpd_attribute1,
76 bpd_attribute2,
77 bpd_attribute3,
78 bpd_attribute4,
79 bpd_attribute5,
80 bpd_attribute6,
81 bpd_attribute7,
82 bpd_attribute8,
83 bpd_attribute9,
84 bpd_attribute10,
85 bpd_attribute11,
86 bpd_attribute12,
87 bpd_attribute13,
88 bpd_attribute14,
89 bpd_attribute15,
90 bpd_attribute16,
91 bpd_attribute17,
92 bpd_attribute18,
93 bpd_attribute19,
94 bpd_attribute20,
95 bpd_attribute21,
96 bpd_attribute22,
97 bpd_attribute23,
98 bpd_attribute24,
99 bpd_attribute25,
100 bpd_attribute26,
101 bpd_attribute27,
102 bpd_attribute28,
103 bpd_attribute29,
104 bpd_attribute30
105 from	per_bf_payment_details
106 where	payment_detail_id = p_payment_detail_id;
107 --
108 l_proc	varchar2(72)	:= g_package||'api_updating';
109 l_fct_ret	boolean;
110 --
111 Begin
112 hr_utility.set_location('Entering:'||l_proc, 5);
113 --
114 If (
115 p_payment_detail_id is null and
116 p_object_version_number is null
117 ) Then
118 --
119 -- One of the primary key arguments is null therefore we must
120 -- set the returning function value to false
121 --
122 l_fct_ret := false;
123 Else
124 If (
125 p_payment_detail_id = g_old_rec.payment_detail_id and
126 p_object_version_number = g_old_rec.object_version_number
127 ) Then
128 hr_utility.set_location(l_proc, 10);
129 --
130 -- The g_old_rec is current therefore we must
131 -- set the returning function to true
132 --
133 l_fct_ret := true;
134 Else
135 --
136 -- Select the current row into g_old_rec
137 --
138 Open C_Sel1;
139 Fetch C_Sel1 Into g_old_rec;
140 If C_Sel1%notfound Then
141 Close C_Sel1;
142 --
143 -- The primary key is invalid therefore we must error
144 --
145 fnd_message.set_name('PER', 'HR_7220_INVALID_PRIMARY_KEY');
146 fnd_message.raise_error;
147 End If;
148 Close C_Sel1;
149 If (p_object_version_number <> g_old_rec.object_version_number) Then
150 fnd_message.set_name('PER', 'HR_7155_OBJECT_INVALID');
151 fnd_message.raise_error;
152 End If;
153 hr_utility.set_location(l_proc, 15);
154 l_fct_ret := true;
155 End If;
156 End If;
157 hr_utility.set_location(' Leaving:'||l_proc, 20);
158 Return (l_fct_ret);
159 --
160 End api_updating;
161 --
162 -- ----------------------------------------------------------------------------
163 -- |---------------------------------< lck >----------------------------------|
164 -- ----------------------------------------------------------------------------
165 Procedure lck
166 (
167 p_payment_detail_id                    in number,
168 p_object_version_number              in number
169 ) is
170 --
171 -- Cursor selects the 'current' row from the HR Schema
172 --
173 Cursor C_Sel1 is
174 select       payment_detail_id,
175 processed_assignment_id,
176 personal_payment_method_id,
177 business_group_id,
178 check_number,
179 payment_date,
180 amount,
181 check_type,
182 object_version_number,
183 bpd_attribute_category,
184 bpd_attribute1,
185 bpd_attribute2,
186 bpd_attribute3,
187 bpd_attribute4,
188 bpd_attribute5,
189 bpd_attribute6,
190 bpd_attribute7,
191 bpd_attribute8,
192 bpd_attribute9,
193 bpd_attribute10,
194 bpd_attribute11,
195 bpd_attribute12,
196 bpd_attribute13,
197 bpd_attribute14,
198 bpd_attribute15,
199 bpd_attribute16,
200 bpd_attribute17,
201 bpd_attribute18,
202 bpd_attribute19,
203 bpd_attribute20,
204 bpd_attribute21,
205 bpd_attribute22,
206 bpd_attribute23,
207 bpd_attribute24,
208 bpd_attribute25,
209 bpd_attribute26,
210 bpd_attribute27,
211 bpd_attribute28,
212 bpd_attribute29,
213 bpd_attribute30
214 from	per_bf_payment_details
215 where	payment_detail_id = p_payment_detail_id
216 for	update nowait;
217 --
218 l_proc	varchar2(72) := g_package||'lck';
219 --
220 Begin
221 hr_utility.set_location('Entering:'||l_proc, 5);
222 --
223 -- Add any mandatory argument checking here:
224 -- Example:
225 -- hr_api.mandatory_arg_error
226 --   (p_api_name       => l_proc,
227 --    p_argument       => 'object_version_number',
228 --    p_argument_value => p_object_version_number);
229 --
230 hr_api.mandatory_arg_error(p_api_name           => l_proc,
231 		       p_argument           => 'PAYMENT_DETAIL_ID',
232 		       p_argument_value     => p_payment_detail_id);
233 Open  C_Sel1;
234 Fetch C_Sel1 Into g_old_rec;
235 If C_Sel1%notfound then
236 Close C_Sel1;
237 --
238 -- The primary key is invalid therefore we must error
239 --
240 fnd_message.set_name('PER', 'HR_7220_INVALID_PRIMARY_KEY');
241 fnd_message.raise_error;
242 End If;
243 Close C_Sel1;
244 If (p_object_version_number <> g_old_rec.object_version_number) Then
245 fnd_message.set_name('PER', 'HR_7155_OBJECT_INVALID');
246 fnd_message.raise_error;
247 End If;
248 --
249 hr_utility.set_location(' Leaving:'||l_proc, 10);
250 --
251 -- We need to trap the ORA LOCK exception
252 --
253 Exception
254 When HR_Api.Object_Locked then
255 --
256 -- The object is locked therefore we need to supply a meaningful
257 -- error message.
258 --
259 fnd_message.set_name('PER', 'HR_7165_OBJECT_LOCKED');
260 fnd_message.set_token('TABLE_NAME', 'per_bf_payment_details');
261 fnd_message.raise_error;
262 End lck;
263 --
264 -- ----------------------------------------------------------------------------
265 -- |-----------------------------< convert_args >-----------------------------|
266 -- ----------------------------------------------------------------------------
267 Function convert_args
268 (
269 p_payment_detail_id            in number,
270 p_processed_assignment_id      in number,
271 p_personal_payment_method_id   in number,
272 p_business_group_id            in number,
273 p_check_number                 in number,
274 p_payment_date                   in date,
275 p_amount                       in number,
276 p_check_type                   in varchar2,
277 p_object_version_number        in number,
278 p_bpd_attribute_category           in varchar2,
279 p_bpd_attribute1                   in varchar2,
280 p_bpd_attribute2                   in varchar2,
281 p_bpd_attribute3                   in varchar2,
282 p_bpd_attribute4                   in varchar2,
283 p_bpd_attribute5                   in varchar2,
284 p_bpd_attribute6                   in varchar2,
285 p_bpd_attribute7                   in varchar2,
286 p_bpd_attribute8                   in varchar2,
287 p_bpd_attribute9                   in varchar2,
288 p_bpd_attribute10                  in varchar2,
289 p_bpd_attribute11                  in varchar2,
290 p_bpd_attribute12                  in varchar2,
291 p_bpd_attribute13                  in varchar2,
292 p_bpd_attribute14                  in varchar2,
293 p_bpd_attribute15                  in varchar2,
294 p_bpd_attribute16                  in varchar2,
295 p_bpd_attribute17                  in varchar2,
296 p_bpd_attribute18                  in varchar2,
297 p_bpd_attribute19                  in varchar2,
298 p_bpd_attribute20                  in varchar2,
299 p_bpd_attribute21                  in varchar2,
300 p_bpd_attribute22                  in varchar2,
301 p_bpd_attribute23                  in varchar2,
302 p_bpd_attribute24                  in varchar2,
303 p_bpd_attribute25                  in varchar2,
304 p_bpd_attribute26                  in varchar2,
305 p_bpd_attribute27                  in varchar2,
306 p_bpd_attribute28                  in varchar2,
307 p_bpd_attribute29                  in varchar2,
308 p_bpd_attribute30                  in varchar2
309 )
310 Return g_rec_type is
311 --
312 l_rec         g_rec_type;
313 l_proc  varchar2(72) := g_package||'convert_args';
314 --
315 Begin
316 --
317 hr_utility.set_location('Entering:'||l_proc, 5);
318 --
319 -- Convert arguments into local l_rec structure.
320 --
321 l_rec.payment_detail_id                := p_payment_detail_id;
322 l_rec.processed_assignment_id          := p_processed_assignment_id;
323 l_rec.personal_payment_method_id       := p_personal_payment_method_id;
324 l_rec.business_group_id                := p_business_group_id;
325 l_rec.check_number                     := p_check_number;
326 l_rec.payment_date                     := p_payment_date;
327 l_rec.amount                           := p_amount;
328 l_rec.check_type                       := p_check_type;
329 l_rec.object_version_number            := p_object_version_number;
330 l_rec.bpd_attribute_category           := p_bpd_attribute_category;
331 l_rec.bpd_attribute1                   := p_bpd_attribute1;
332 l_rec.bpd_attribute2                   := p_bpd_attribute2;
333 l_rec.bpd_attribute3                   := p_bpd_attribute3;
334 l_rec.bpd_attribute4                   := p_bpd_attribute4;
335 l_rec.bpd_attribute5                   := p_bpd_attribute5;
336 l_rec.bpd_attribute6                   := p_bpd_attribute6;
337 l_rec.bpd_attribute7                   := p_bpd_attribute7;
338 l_rec.bpd_attribute8                   := p_bpd_attribute8;
339 l_rec.bpd_attribute9                   := p_bpd_attribute9;
340 l_rec.bpd_attribute10                  := p_bpd_attribute10;
341 l_rec.bpd_attribute11                  := p_bpd_attribute11;
342 l_rec.bpd_attribute12                  := p_bpd_attribute12;
343 l_rec.bpd_attribute13                  := p_bpd_attribute13;
344 l_rec.bpd_attribute14                  := p_bpd_attribute14;
345 l_rec.bpd_attribute15                  := p_bpd_attribute15;
346 l_rec.bpd_attribute16                  := p_bpd_attribute16;
347 l_rec.bpd_attribute17                  := p_bpd_attribute17;
348 l_rec.bpd_attribute18                  := p_bpd_attribute18;
349 l_rec.bpd_attribute19                  := p_bpd_attribute19;
350 l_rec.bpd_attribute20                  := p_bpd_attribute20;
351 l_rec.bpd_attribute21                  := p_bpd_attribute21;
352 l_rec.bpd_attribute22                  := p_bpd_attribute22;
353 l_rec.bpd_attribute23                  := p_bpd_attribute23;
354 l_rec.bpd_attribute24                  := p_bpd_attribute24;
355 l_rec.bpd_attribute25                  := p_bpd_attribute25;
356 l_rec.bpd_attribute26                  := p_bpd_attribute26;
357 l_rec.bpd_attribute27                  := p_bpd_attribute27;
358 l_rec.bpd_attribute28                  := p_bpd_attribute28;
359 l_rec.bpd_attribute29                  := p_bpd_attribute29;
360 l_rec.bpd_attribute30                  := p_bpd_attribute30;
361 --
362 -- Return the plsql record structure.
363 --
364 hr_utility.set_location(' Leaving:'||l_proc, 10);
365 Return(l_rec);
366 --
367 End convert_args;
368 --
369 end per_bpd_shd;