DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PFF_SHD

Source


1 Package Body ben_pff_shd as
2 /* $Header: bepffrhi.pkb 120.0 2005/05/28 10:42:25 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_pff_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_PCT_FL_TM_FCTR_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_PCT_FL_TM_FCTR_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_ELIG_PCT_FL_FK1') Then
47     ben_utility.child_exists_error(p_table_name => 'BEN_ELIG_PCT_FL_TM_PRTE_F');
48   ElsIf (p_constraint_name = 'BEN_PCT_FL_TM_RT_FK1') Then
49     ben_utility.child_exists_error(p_table_name => 'BEN_PCT_FL_TM_RT_F');
50   Else
51     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
52     fnd_message.set_token('PROCEDURE', l_proc);
53     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
54     fnd_message.raise_error;
55   End If;
56   --
57   hr_utility.set_location(' Leaving:'||l_proc, 10);
58 End constraint_error;
59 --
60 -- ----------------------------------------------------------------------------
61 -- |-----------------------------< api_updating >-----------------------------|
62 -- ----------------------------------------------------------------------------
63 Function api_updating
64   (
65   p_pct_fl_tm_fctr_id                  in number,
66   p_object_version_number              in number
67   )      Return Boolean Is
68 --
69   --
70   -- Cursor selects the 'current' row from the HR Schema
71   --
72   Cursor C_Sel1 is
73     select
74 		pct_fl_tm_fctr_id,
75 	name,
76 	business_group_id,
77 	mx_pct_val,
78 	mn_pct_val,
79 	no_mn_pct_val_flag,
80 	no_mx_pct_val_flag,
81 	use_prmry_asnt_only_flag,
82 	use_sum_of_all_asnts_flag,
83 	rndg_cd,
84 	rndg_rl,
85 	pff_attribute_category,
86 	pff_attribute1,
87 	pff_attribute2,
88 	pff_attribute3,
89 	pff_attribute4,
90 	pff_attribute5,
91 	pff_attribute6,
92 	pff_attribute7,
93 	pff_attribute8,
94 	pff_attribute9,
95 	pff_attribute10,
96 	pff_attribute11,
97 	pff_attribute12,
98 	pff_attribute13,
99 	pff_attribute14,
100 	pff_attribute15,
101 	pff_attribute16,
102 	pff_attribute17,
103 	pff_attribute18,
104 	pff_attribute19,
105 	pff_attribute20,
106 	pff_attribute21,
107 	pff_attribute22,
108 	pff_attribute23,
109 	pff_attribute24,
110 	pff_attribute25,
111 	pff_attribute26,
112 	pff_attribute27,
113 	pff_attribute28,
114 	pff_attribute29,
115 	pff_attribute30,
116 	object_version_number
117     from	ben_pct_fl_tm_fctr
118     where	pct_fl_tm_fctr_id = p_pct_fl_tm_fctr_id;
119 --
120   l_proc	varchar2(72)	:= g_package||'api_updating';
121   l_fct_ret	boolean;
122 --
123 Begin
124   hr_utility.set_location('Entering:'||l_proc, 5);
125   --
126   If (
127 	p_pct_fl_tm_fctr_id is null and
128 	p_object_version_number is null
129      ) Then
130     --
131     -- One of the primary key arguments is null therefore we must
132     -- set the returning function value to false
133     --
134     l_fct_ret := false;
135   Else
136     If (
137 	p_pct_fl_tm_fctr_id = g_old_rec.pct_fl_tm_fctr_id and
138 	p_object_version_number = g_old_rec.object_version_number
139        ) Then
140       hr_utility.set_location(l_proc, 10);
141       --
142       -- The g_old_rec is current therefore we must
143       -- set the returning function to true
144       --
145       l_fct_ret := true;
146     Else
147       --
148       -- Select the current row into g_old_rec
149       --
150       Open C_Sel1;
151       Fetch C_Sel1 Into g_old_rec;
152       If C_Sel1%notfound Then
153         Close C_Sel1;
154         --
155         -- The primary key is invalid therefore we must error
156         --
157         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
158         fnd_message.raise_error;
159       End If;
160       Close C_Sel1;
161       If (p_object_version_number <> g_old_rec.object_version_number) Then
162         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
163         fnd_message.raise_error;
164       End If;
165       hr_utility.set_location(l_proc, 15);
166       l_fct_ret := true;
167     End If;
168   End If;
169   hr_utility.set_location(' Leaving:'||l_proc, 20);
170   Return (l_fct_ret);
171 --
172 End api_updating;
173 --
174 -- ----------------------------------------------------------------------------
175 -- |---------------------------------< lck >----------------------------------|
176 -- ----------------------------------------------------------------------------
177 Procedure lck
178   (
179   p_pct_fl_tm_fctr_id                  in number,
180   p_object_version_number              in number
181   ) is
182 --
183 -- Cursor selects the 'current' row from the HR Schema
184 --
185   Cursor C_Sel1 is
186     select 	pct_fl_tm_fctr_id,
187 	name,
188 	business_group_id,
189 	mx_pct_val,
190 	mn_pct_val,
191 	no_mn_pct_val_flag,
192 	no_mx_pct_val_flag,
193 	use_prmry_asnt_only_flag,
194 	use_sum_of_all_asnts_flag,
195 	rndg_cd,
196 	rndg_rl,
197 	pff_attribute_category,
198 	pff_attribute1,
199 	pff_attribute2,
200 	pff_attribute3,
201 	pff_attribute4,
202 	pff_attribute5,
203 	pff_attribute6,
204 	pff_attribute7,
205 	pff_attribute8,
206 	pff_attribute9,
207 	pff_attribute10,
208 	pff_attribute11,
209 	pff_attribute12,
210 	pff_attribute13,
211 	pff_attribute14,
212 	pff_attribute15,
213 	pff_attribute16,
214 	pff_attribute17,
215 	pff_attribute18,
216 	pff_attribute19,
217 	pff_attribute20,
218 	pff_attribute21,
219 	pff_attribute22,
220 	pff_attribute23,
221 	pff_attribute24,
222 	pff_attribute25,
223 	pff_attribute26,
224 	pff_attribute27,
225 	pff_attribute28,
226 	pff_attribute29,
227 	pff_attribute30,
228 	object_version_number
229     from	ben_pct_fl_tm_fctr
230     where	pct_fl_tm_fctr_id = p_pct_fl_tm_fctr_id
231     for	update nowait;
232 --
233   l_proc	varchar2(72) := g_package||'lck';
234 --
235 Begin
236   hr_utility.set_location('Entering:'||l_proc, 5);
237   --
238   -- Add any mandatory argument checking here:
239   -- Example:
240   -- hr_api.mandatory_arg_error
241   --   (p_api_name       => l_proc,
242   --    p_argument       => 'object_version_number',
243   --    p_argument_value => p_object_version_number);
244   --
245   Open  C_Sel1;
246   Fetch C_Sel1 Into g_old_rec;
247   If C_Sel1%notfound then
248     Close C_Sel1;
249     --
250     -- The primary key is invalid therefore we must error
251     --
252     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
253     fnd_message.raise_error;
254   End If;
255   Close C_Sel1;
256   If (p_object_version_number <> g_old_rec.object_version_number) Then
257         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
258         fnd_message.raise_error;
259       End If;
260 --
261   hr_utility.set_location(' Leaving:'||l_proc, 10);
262 --
263 -- We need to trap the ORA LOCK exception
264 --
265 Exception
266   When HR_Api.Object_Locked then
267     --
268     -- The object is locked therefore we need to supply a meaningful
269     -- error message.
270     --
271     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
272     fnd_message.set_token('TABLE_NAME', 'ben_pct_fl_tm_fctr');
273     fnd_message.raise_error;
274 End lck;
275 --
276 -- ----------------------------------------------------------------------------
277 -- |-----------------------------< convert_args >-----------------------------|
278 -- ----------------------------------------------------------------------------
279 Function convert_args
280 	(
281 	p_pct_fl_tm_fctr_id             in number,
282 	p_name                          in varchar2,
283 	p_business_group_id             in number,
284 	p_mx_pct_val                    in number,
285 	p_mn_pct_val                    in number,
286 	p_no_mn_pct_val_flag            in varchar2,
287 	p_no_mx_pct_val_flag            in varchar2,
288 	p_use_prmry_asnt_only_flag      in varchar2,
289 	p_use_sum_of_all_asnts_flag     in varchar2,
290 	p_rndg_cd                       in varchar2,
291 	p_rndg_rl                       in number,
292 	p_pff_attribute_category        in varchar2,
293 	p_pff_attribute1                in varchar2,
294 	p_pff_attribute2                in varchar2,
295 	p_pff_attribute3                in varchar2,
296 	p_pff_attribute4                in varchar2,
297 	p_pff_attribute5                in varchar2,
298 	p_pff_attribute6                in varchar2,
299 	p_pff_attribute7                in varchar2,
300 	p_pff_attribute8                in varchar2,
301 	p_pff_attribute9                in varchar2,
302 	p_pff_attribute10               in varchar2,
303 	p_pff_attribute11               in varchar2,
304 	p_pff_attribute12               in varchar2,
305 	p_pff_attribute13               in varchar2,
306 	p_pff_attribute14               in varchar2,
307 	p_pff_attribute15               in varchar2,
308 	p_pff_attribute16               in varchar2,
309 	p_pff_attribute17               in varchar2,
310 	p_pff_attribute18               in varchar2,
311 	p_pff_attribute19               in varchar2,
312 	p_pff_attribute20               in varchar2,
313 	p_pff_attribute21               in varchar2,
314 	p_pff_attribute22               in varchar2,
315 	p_pff_attribute23               in varchar2,
316 	p_pff_attribute24               in varchar2,
317 	p_pff_attribute25               in varchar2,
318 	p_pff_attribute26               in varchar2,
319 	p_pff_attribute27               in varchar2,
320 	p_pff_attribute28               in varchar2,
321 	p_pff_attribute29               in varchar2,
322 	p_pff_attribute30               in varchar2,
323 	p_object_version_number         in number
324 	)
325 	Return g_rec_type is
326 --
327   l_rec	  g_rec_type;
328   l_proc  varchar2(72) := g_package||'convert_args';
329 --
330 Begin
331   --
332   hr_utility.set_location('Entering:'||l_proc, 5);
333   --
334   -- Convert arguments into local l_rec structure.
335   --
336   l_rec.pct_fl_tm_fctr_id                := p_pct_fl_tm_fctr_id;
337   l_rec.name                             := p_name;
338   l_rec.business_group_id                := p_business_group_id;
339   l_rec.mx_pct_val                       := p_mx_pct_val;
340   l_rec.mn_pct_val                       := p_mn_pct_val;
341   l_rec.no_mn_pct_val_flag               := p_no_mn_pct_val_flag;
342   l_rec.no_mx_pct_val_flag               := p_no_mx_pct_val_flag;
343   l_rec.use_prmry_asnt_only_flag         := p_use_prmry_asnt_only_flag;
344   l_rec.use_sum_of_all_asnts_flag        := p_use_sum_of_all_asnts_flag;
345   l_rec.rndg_cd                          := p_rndg_cd;
346   l_rec.rndg_rl                          := p_rndg_rl;
347   l_rec.pff_attribute_category           := p_pff_attribute_category;
348   l_rec.pff_attribute1                   := p_pff_attribute1;
349   l_rec.pff_attribute2                   := p_pff_attribute2;
350   l_rec.pff_attribute3                   := p_pff_attribute3;
351   l_rec.pff_attribute4                   := p_pff_attribute4;
352   l_rec.pff_attribute5                   := p_pff_attribute5;
353   l_rec.pff_attribute6                   := p_pff_attribute6;
354   l_rec.pff_attribute7                   := p_pff_attribute7;
355   l_rec.pff_attribute8                   := p_pff_attribute8;
356   l_rec.pff_attribute9                   := p_pff_attribute9;
357   l_rec.pff_attribute10                  := p_pff_attribute10;
358   l_rec.pff_attribute11                  := p_pff_attribute11;
359   l_rec.pff_attribute12                  := p_pff_attribute12;
360   l_rec.pff_attribute13                  := p_pff_attribute13;
361   l_rec.pff_attribute14                  := p_pff_attribute14;
362   l_rec.pff_attribute15                  := p_pff_attribute15;
363   l_rec.pff_attribute16                  := p_pff_attribute16;
364   l_rec.pff_attribute17                  := p_pff_attribute17;
365   l_rec.pff_attribute18                  := p_pff_attribute18;
366   l_rec.pff_attribute19                  := p_pff_attribute19;
367   l_rec.pff_attribute20                  := p_pff_attribute20;
368   l_rec.pff_attribute21                  := p_pff_attribute21;
369   l_rec.pff_attribute22                  := p_pff_attribute22;
370   l_rec.pff_attribute23                  := p_pff_attribute23;
371   l_rec.pff_attribute24                  := p_pff_attribute24;
372   l_rec.pff_attribute25                  := p_pff_attribute25;
373   l_rec.pff_attribute26                  := p_pff_attribute26;
374   l_rec.pff_attribute27                  := p_pff_attribute27;
375   l_rec.pff_attribute28                  := p_pff_attribute28;
376   l_rec.pff_attribute29                  := p_pff_attribute29;
377   l_rec.pff_attribute30                  := p_pff_attribute30;
378   l_rec.object_version_number            := p_object_version_number;
379   --
380   -- Return the plsql record structure.
381   --
382   hr_utility.set_location(' Leaving:'||l_proc, 10);
383   Return(l_rec);
384 --
385 End convert_args;
386 --
387 end ben_pff_shd;