DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CLF_SHD

Source


4 -- ----------------------------------------------------------------------------
1 Package Body ben_clf_shd as
2 /* $Header: beclfrhi.pkb 120.0 2005/05/28 01:04:10 appldev noship $ */
3 --
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_clf_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_COMP_LVL_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_COMP_LVL_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_COMP_LVL_RT_F_FK1') Then
47     ben_utility.child_exists_error(p_table_name => 'BEN_COMP_LVL_RT_F');
48   ElsIf (p_constraint_name = 'BEN_ELIG_COMP_LVL_PRTE_F_FK2') Then
49     ben_utility.child_exists_error(p_table_name => 'BEN_ELIG_COMP_LVL_PRTE_F');
50   ElsIf (p_constraint_name = 'BEN_CVG_AMT_CALC_MTHD_F_FK2') Then
51     ben_utility.child_exists_error(p_table_name => 'BEN_CVG_AMT_CALC_MTHD_F');
52   ElsIf (p_constraint_name = 'BEN_ACTL_PREM_F_FK2') Then
53     ben_utility.child_exists_error (p_table_name => 'BEN_ACTL_PREM_F');
54   ElsIf (p_constraint_name = 'BEN_ACTY_BASE_RT_F_FK2') Then
55     ben_utility.child_exists_error(p_table_name => 'BEN_ACTY_BASE_RT_F');
56   ElsIf (p_constraint_name = 'BEN_COMP_LVL_ACTY_RT_F_FK2') Then
57     ben_utility.child_exists_error(p_table_name => 'BEN_COMP_LVL_ACTY_RT_F');
61     ben_utility.child_exists_error(p_table_name => 'BEN_MTCHG_RT_F');
58   ElsIf (p_constraint_name = 'BEN_ENRT_BNFT_FK3') Then
59     ben_utility.child_exists_error(p_table_name => 'BEN_ENRT_BNFT');
60   ElsIf (p_constraint_name = 'BEN_MTCHG_RT_F_FK2') Then
62   ElsIf (p_constraint_name = 'BEN_PTD_BAL_TYP_F_FK2') Then
63     ben_utility.child_exists_error(p_table_name => 'BEN_PTD_BAL_TYP_F_FK2');
64   ElsIf (p_constraint_name = 'BEN_PTD_LMT_F_FK2') Then
65    ben_utility.child_exists_error(p_table_name => 'BEN_PTD_LMT_F');
66   ElsIf (p_constraint_name = 'BEN_VRBL_RT_PRFL_F_FK5') Then
67     ben_utility.child_exists_error(p_table_name => 'BEN_VRBL_RT_PRFL_F');
68   Else
69     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
70     fnd_message.set_token('PROCEDURE', l_proc);
71     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
72     fnd_message.raise_error;
73   End If;
74   --
75   hr_utility.set_location(' Leaving:'||l_proc, 10);
76 End constraint_error;
77 --
78 -- ----------------------------------------------------------------------------
79 -- |-----------------------------< api_updating >-----------------------------|
80 -- ----------------------------------------------------------------------------
81 Function api_updating
82   (
83   p_comp_lvl_fctr_id                   in number,
84   p_object_version_number              in number
85   )      Return Boolean Is
86 --
87   --
88   -- Cursor selects the 'current' row from the HR Schema
89   --
90   Cursor C_Sel1 is
91     select
92 	comp_lvl_fctr_id,
93 	business_group_id,
94 	name,
95 	comp_lvl_det_cd,
96         comp_lvl_det_rl,
97 	comp_lvl_uom,
98 	comp_src_cd,
99 	defined_balance_id,
100 	no_mn_comp_flag,
101 	no_mx_comp_flag,
102 	mx_comp_val,
103 	mn_comp_val,
104 	rndg_cd,
105 	rndg_rl,
106         bnfts_bal_id,
107         comp_alt_val_to_use_cd,
108         comp_calc_rl,
109         proration_flag,
110         start_day_mo,
111         end_day_mo,
112         start_year,
113         end_year,
114 	clf_attribute_category,
115 	clf_attribute1,
116 	clf_attribute2,
117 	clf_attribute3,
118 	clf_attribute4,
119 	clf_attribute5,
120 	clf_attribute6,
121 	clf_attribute7,
122 	clf_attribute8,
123 	clf_attribute9,
124 	clf_attribute10,
125 	clf_attribute11,
126 	clf_attribute12,
127 	clf_attribute13,
128 	clf_attribute14,
129 	clf_attribute15,
130 	clf_attribute16,
131 	clf_attribute17,
132 	clf_attribute18,
133 	clf_attribute19,
134 	clf_attribute20,
135 	clf_attribute21,
136 	clf_attribute22,
137 	clf_attribute23,
138 	clf_attribute24,
139 	clf_attribute25,
140 	clf_attribute26,
141 	clf_attribute27,
142 	clf_attribute28,
143 	clf_attribute29,
144 	clf_attribute30,
145 	object_version_number,
146     sttd_sal_prdcty_cd
147     from	ben_comp_lvl_fctr
148     where	comp_lvl_fctr_id = p_comp_lvl_fctr_id;
149 --
150   l_proc	varchar2(72)	:= g_package||'api_updating';
151   l_fct_ret	boolean;
152 --
153 Begin
154   hr_utility.set_location('Entering:'||l_proc, 5);
155   --
156   If (
157 	p_comp_lvl_fctr_id is null and
158 	p_object_version_number is null
159      ) Then
160     --
161     -- One of the primary key arguments is null therefore we must
162     -- set the returning function value to false
163     --
164     l_fct_ret := false;
165   Else
166     If (
167 	p_comp_lvl_fctr_id = g_old_rec.comp_lvl_fctr_id and
168 	p_object_version_number = g_old_rec.object_version_number
169        ) Then
170       hr_utility.set_location(l_proc, 10);
171       --
172       -- The g_old_rec is current therefore we must
173       -- set the returning function to true
174       --
175       l_fct_ret := true;
176     Else
180       Open C_Sel1;
177       --
178       -- Select the current row into g_old_rec
179       --
181       Fetch C_Sel1 Into g_old_rec;
182       If C_Sel1%notfound Then
183         Close C_Sel1;
184         --
185         -- The primary key is invalid therefore we must error
186         --
187         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
188         fnd_message.raise_error;
189       End If;
190       Close C_Sel1;
191       If (p_object_version_number <> g_old_rec.object_version_number) Then
192         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
193         fnd_message.raise_error;
194       End If;
195       hr_utility.set_location(l_proc, 15);
196       l_fct_ret := true;
197     End If;
198   End If;
199   hr_utility.set_location(' Leaving:'||l_proc, 20);
200   Return (l_fct_ret);
201 --
202 End api_updating;
203 --
204 -- ----------------------------------------------------------------------------
205 -- |---------------------------------< lck >----------------------------------|
206 -- ----------------------------------------------------------------------------
207 Procedure lck
208   (
212 --
209   p_comp_lvl_fctr_id                   in number,
210   p_object_version_number              in number
211   ) is
213 -- Cursor selects the 'current' row from the HR Schema
214 --
215   Cursor C_Sel1 is
216     select 	comp_lvl_fctr_id,
217 	business_group_id,
218 	name,
219 	comp_lvl_det_cd,
220         comp_lvl_det_rl,
221 	comp_lvl_uom,
222 	comp_src_cd,
223 	defined_balance_id,
224 	no_mn_comp_flag,
225 	no_mx_comp_flag,
226 	mx_comp_val,
227 	mn_comp_val,
228 	rndg_cd,
229 	rndg_rl,
230         bnfts_bal_id,
231         comp_alt_val_to_use_cd,
232         comp_calc_rl,
233         proration_flag,
234         start_day_mo,
235         end_day_mo,
236         start_year,
237         end_year,
238 	clf_attribute_category,
239 	clf_attribute1,
240 	clf_attribute2,
241 	clf_attribute3,
242 	clf_attribute4,
243 	clf_attribute5,
244 	clf_attribute6,
245 	clf_attribute7,
246 	clf_attribute8,
247 	clf_attribute9,
248 	clf_attribute10,
249 	clf_attribute11,
250 	clf_attribute12,
251 	clf_attribute13,
252 	clf_attribute14,
253 	clf_attribute15,
254 	clf_attribute16,
255 	clf_attribute17,
256 	clf_attribute18,
257 	clf_attribute19,
258 	clf_attribute20,
259 	clf_attribute21,
260 	clf_attribute22,
261 	clf_attribute23,
262 	clf_attribute24,
263 	clf_attribute25,
264 	clf_attribute26,
265 	clf_attribute27,
266 	clf_attribute28,
267 	clf_attribute29,
268 	clf_attribute30,
269 	object_version_number,
270     sttd_sal_prdcty_cd
271     from	ben_comp_lvl_fctr
272     where	comp_lvl_fctr_id = p_comp_lvl_fctr_id
273     for	update nowait;
274 --
275   l_proc	varchar2(72) := g_package||'lck';
276 --
277 Begin
278   hr_utility.set_location('Entering:'||l_proc, 5);
279   --
280   -- Add any mandatory argument checking here:
281   -- Example:
282   -- hr_api.mandatory_arg_error
283   --   (p_api_name       => l_proc,
284   --    p_argument       => 'object_version_number',
285   --    p_argument_value => p_object_version_number);
286   --
287   Open  C_Sel1;
288   Fetch C_Sel1 Into g_old_rec;
289   If C_Sel1%notfound then
290     Close C_Sel1;
291     --
292     -- The primary key is invalid therefore we must error
293     --
294     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
295     fnd_message.raise_error;
296   End If;
297   Close C_Sel1;
298   If (p_object_version_number <> g_old_rec.object_version_number) Then
299         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
300         fnd_message.raise_error;
301       End If;
302 --
303   hr_utility.set_location(' Leaving:'||l_proc, 10);
304 --
305 -- We need to trap the ORA LOCK exception
306 --
307 Exception
308   When HR_Api.Object_Locked then
309     --
310     -- The object is locked therefore we need to supply a meaningful
311     -- error message.
312     --
313     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
314     fnd_message.set_token('TABLE_NAME', 'ben_comp_lvl_fctr');
315     fnd_message.raise_error;
316 End lck;
317 --
318 -- ----------------------------------------------------------------------------
319 -- |-----------------------------< convert_args >-----------------------------|
320 -- ----------------------------------------------------------------------------
321 Function convert_args
322 	(
323 	p_comp_lvl_fctr_id              in number,
324 	p_business_group_id             in number,
325 	p_name                          in varchar2,
326 	p_comp_lvl_det_cd               in varchar2,
327         p_comp_lvl_det_rl               in number,
328 	p_comp_lvl_uom                  in varchar2,
329 	p_comp_src_cd                   in varchar2,
330 	p_defined_balance_id            in number,
331 	p_no_mn_comp_flag               in varchar2,
332 	p_no_mx_comp_flag               in varchar2,
333 	p_mx_comp_val                   in number,
334 	p_mn_comp_val                   in number,
335 	p_rndg_cd                       in varchar2,
336 	p_rndg_rl                       in number,
337         p_bnfts_bal_id                  in number,
338         p_comp_alt_val_to_use_cd        in varchar2,
339         p_comp_calc_rl                  in number,
340         p_proration_flag                in varchar2,
341         p_start_day_mo                  in varchar2,
342         p_end_day_mo                    in varchar2,
343         p_start_year                    in varchar2,
344         p_end_year                      in varchar2,
345 	p_clf_attribute_category        in varchar2,
346 	p_clf_attribute1                in varchar2,
347 	p_clf_attribute2                in varchar2,
348 	p_clf_attribute3                in varchar2,
349 	p_clf_attribute4                in varchar2,
350 	p_clf_attribute5                in varchar2,
351 	p_clf_attribute6                in varchar2,
352 	p_clf_attribute7                in varchar2,
353 	p_clf_attribute8                in varchar2,
354 	p_clf_attribute9                in varchar2,
355 	p_clf_attribute10               in varchar2,
356 	p_clf_attribute11               in varchar2,
357 	p_clf_attribute12               in varchar2,
358 	p_clf_attribute13               in varchar2,
359 	p_clf_attribute14               in varchar2,
360 	p_clf_attribute15               in varchar2,
361 	p_clf_attribute16               in varchar2,
362 	p_clf_attribute17               in varchar2,
366 	p_clf_attribute21               in varchar2,
363 	p_clf_attribute18               in varchar2,
364 	p_clf_attribute19               in varchar2,
365 	p_clf_attribute20               in varchar2,
367 	p_clf_attribute22               in varchar2,
368 	p_clf_attribute23               in varchar2,
369 	p_clf_attribute24               in varchar2,
370 	p_clf_attribute25               in varchar2,
371 	p_clf_attribute26               in varchar2,
372 	p_clf_attribute27               in varchar2,
373 	p_clf_attribute28               in varchar2,
374 	p_clf_attribute29               in varchar2,
375 	p_clf_attribute30               in varchar2,
376 	p_object_version_number         in number,
377     p_sttd_sal_prdcty_cd            in  varchar2
378 	)
379 	Return g_rec_type is
380 --
381   l_rec	  g_rec_type;
382   l_proc  varchar2(72) := g_package||'convert_args';
383 --
384 Begin
385   --
386   hr_utility.set_location('Entering:'||l_proc, 5);
387   --
388   -- Convert arguments into local l_rec structure.
389   --
390   l_rec.comp_lvl_fctr_id                 := p_comp_lvl_fctr_id;
391   l_rec.business_group_id                := p_business_group_id;
392   l_rec.name                             := p_name;
393   l_rec.comp_lvl_det_cd                  := p_comp_lvl_det_cd;
394   l_rec.comp_lvl_det_rl                  := p_comp_lvl_det_rl;
395   l_rec.comp_lvl_uom                     := p_comp_lvl_uom;
396   l_rec.comp_src_cd                      := p_comp_src_cd;
397   l_rec.defined_balance_id               := p_defined_balance_id;
398   l_rec.no_mn_comp_flag                  := p_no_mn_comp_flag;
399   l_rec.no_mx_comp_flag                  := p_no_mx_comp_flag;
400   l_rec.mx_comp_val                      := p_mx_comp_val;
401   l_rec.mn_comp_val                      := p_mn_comp_val;
402   l_rec.rndg_cd                          := p_rndg_cd;
403   l_rec.rndg_rl                          := p_rndg_rl;
404   l_rec.bnfts_bal_id                     := p_bnfts_bal_id;
405   l_rec.comp_alt_val_to_use_cd           := p_comp_alt_val_to_use_cd;
406   l_rec.comp_calc_rl                     := p_comp_calc_rl;
407   l_rec.proration_flag                   := p_proration_flag ;
408   l_rec.start_day_mo                     := p_start_day_mo ;
409   l_rec.end_day_mo                       := p_end_day_mo ;
410   l_rec.start_year                       := p_start_year ;
411   l_rec.end_year                         := p_end_year ;
412   l_rec.clf_attribute_category           := p_clf_attribute_category;
413   l_rec.clf_attribute1                   := p_clf_attribute1;
414   l_rec.clf_attribute2                   := p_clf_attribute2;
415   l_rec.clf_attribute3                   := p_clf_attribute3;
416   l_rec.clf_attribute4                   := p_clf_attribute4;
417   l_rec.clf_attribute5                   := p_clf_attribute5;
418   l_rec.clf_attribute6                   := p_clf_attribute6;
419   l_rec.clf_attribute7                   := p_clf_attribute7;
420   l_rec.clf_attribute8                   := p_clf_attribute8;
421   l_rec.clf_attribute9                   := p_clf_attribute9;
422   l_rec.clf_attribute10                  := p_clf_attribute10;
423   l_rec.clf_attribute11                  := p_clf_attribute11;
424   l_rec.clf_attribute12                  := p_clf_attribute12;
425   l_rec.clf_attribute13                  := p_clf_attribute13;
426   l_rec.clf_attribute14                  := p_clf_attribute14;
427   l_rec.clf_attribute15                  := p_clf_attribute15;
428   l_rec.clf_attribute16                  := p_clf_attribute16;
429   l_rec.clf_attribute17                  := p_clf_attribute17;
430   l_rec.clf_attribute18                  := p_clf_attribute18;
431   l_rec.clf_attribute19                  := p_clf_attribute19;
432   l_rec.clf_attribute20                  := p_clf_attribute20;
433   l_rec.clf_attribute21                  := p_clf_attribute21;
434   l_rec.clf_attribute22                  := p_clf_attribute22;
435   l_rec.clf_attribute23                  := p_clf_attribute23;
436   l_rec.clf_attribute24                  := p_clf_attribute24;
437   l_rec.clf_attribute25                  := p_clf_attribute25;
438   l_rec.clf_attribute26                  := p_clf_attribute26;
439   l_rec.clf_attribute27                  := p_clf_attribute27;
440   l_rec.clf_attribute28                  := p_clf_attribute28;
441   l_rec.clf_attribute29                  := p_clf_attribute29;
442   l_rec.clf_attribute30                  := p_clf_attribute30;
443   l_rec.object_version_number            := p_object_version_number;
444   l_rec.sttd_sal_prdcty_cd               := p_sttd_sal_prdcty_cd;
445   --
446   -- Return the plsql record structure.
447   --
448   hr_utility.set_location(' Leaving:'||l_proc, 10);
449   Return(l_rec);
450 --
451 End convert_args;
452 --
453 end ben_clf_shd;