DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PRV_SHD

Source


1 Package Body ben_prv_shd as
2 /* $Header: beprvrhi.pkb 120.0.12000000.3 2007/07/01 19:16:05 mmudigon noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_prv_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_RT_VAL_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_PRTT_RT_VAL_FK3') Then
42            ben_utility.child_exists_error(p_table_name =>
43 'BEN_PER_IN_LER');
44     fnd_message.raise_error;
45   ElsIf (p_constraint_name = 'BEN_PRTT_RT_VAL_FK4') Then
46            ben_utility.child_exists_error(p_table_name =>
47 'BEN_PER_IN_LER');
48     fnd_message.raise_error;
49   ElsIf (p_constraint_name = 'BEN_PRTT_RT_VAL_PK') Then
50     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
51     fnd_message.set_token('PROCEDURE', l_proc);
52     fnd_message.set_token('STEP','20');
53     fnd_message.raise_error;
54   Else
55     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
56     fnd_message.set_token('PROCEDURE', l_proc);
57     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
58     fnd_message.raise_error;
59   End If;
60   --
61 --  hr_utility.set_location(' Leaving:'||l_proc, 10);
62 End constraint_error;
63 --
64 -- ----------------------------------------------------------------------------
65 -- |-----------------------------< api_updating >-----------------------------|
66 -- ----------------------------------------------------------------------------
67 Function api_updating
68   (
69   p_prtt_rt_val_id                     in number,
70   p_object_version_number              in number
71   )      Return Boolean Is
72 --
73   --
74   -- Cursor selects the 'current' row from the HR Schema
75   --
76   Cursor C_Sel1 is
77     select
78 	prtt_rt_val_id,
79       null,
80 	rt_strt_dt,
81 	rt_end_dt,
82 	rt_typ_cd,
83 	tx_typ_cd,
84 	ordr_num,
85 	acty_typ_cd,
86 	mlt_cd,
87 	acty_ref_perd_cd,
88 	rt_val,
89 	ann_rt_val,
90 	cmcd_rt_val,
91 	cmcd_ref_perd_cd,
92 	bnft_rt_typ_cd,
93 	dsply_on_enrt_flag,
94 	rt_ovridn_flag,
95 	rt_ovridn_thru_dt,
96 	elctns_made_dt,
97 	prtt_rt_val_stat_cd,
98 	prtt_enrt_rslt_id,
99 	cvg_amt_calc_mthd_id,
100 	actl_prem_id,
101 	comp_lvl_fctr_id,
102 	element_entry_value_id,
103 	per_in_ler_id,
104 	ended_per_in_ler_id,
105 	acty_base_rt_id,
106 	prtt_reimbmt_rqst_id,
107         prtt_rmt_aprvd_fr_pymt_id,
108         pp_in_yr_used_num,
109 	business_group_id,
110 	prv_attribute_category,
111 	prv_attribute1,
112 	prv_attribute2,
113 	prv_attribute3,
114 	prv_attribute4,
115 	prv_attribute5,
116 	prv_attribute6,
117 	prv_attribute7,
118 	prv_attribute8,
119 	prv_attribute9,
120 	prv_attribute10,
121 	prv_attribute11,
122 	prv_attribute12,
123 	prv_attribute13,
124 	prv_attribute14,
125 	prv_attribute15,
126 	prv_attribute16,
127 	prv_attribute17,
128 	prv_attribute18,
129 	prv_attribute19,
130 	prv_attribute20,
131 	prv_attribute21,
132 	prv_attribute22,
133 	prv_attribute23,
134 	prv_attribute24,
135 	prv_attribute25,
136 	prv_attribute26,
137 	prv_attribute27,
138 	prv_attribute28,
139 	prv_attribute29,
140 	prv_attribute30,
141         pk_id_table_name,
142         pk_id,
143 	object_version_number
144     from	ben_prtt_rt_val
145     where	prtt_rt_val_id = p_prtt_rt_val_id;
146 --
147   l_proc	varchar2(72)	:= g_package||'api_updating';
148   l_fct_ret	boolean;
149 --
150 Begin
151   hr_utility.set_location('Entering:'||l_proc, 5);
152   --
153   If (
154 	p_prtt_rt_val_id is null and
155 	p_object_version_number is null
156      ) Then
157     --
158     -- One of the primary key arguments is null therefore we must
159     -- set the returning function value to false
160     --
161     l_fct_ret := false;
162   Else
163     If (
164 	p_prtt_rt_val_id = g_old_rec.prtt_rt_val_id and
165 	p_object_version_number = g_old_rec.object_version_number
166        ) Then
167       hr_utility.set_location(l_proc, 10);
168       --
169       -- The g_old_rec is current therefore we must
170       -- set the returning function to true
171       --
172       l_fct_ret := true;
173     Else
174       --
175       -- Select the current row into g_old_rec
176       --
177       Open C_Sel1;
178       Fetch C_Sel1 Into g_old_rec;
179       If C_Sel1%notfound Then
180         Close C_Sel1;
181         --
182         -- The primary key is invalid therefore we must error
183         --
184         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
185         fnd_message.raise_error;
186       End If;
187       Close C_Sel1;
188       If (p_object_version_number <> g_old_rec.object_version_number) Then
189         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
190         fnd_message.raise_error;
191       End If;
192       hr_utility.set_location(l_proc, 15);
193       l_fct_ret := true;
194     End If;
195   End If;
196   hr_utility.set_location(' Leaving:'||l_proc, 20);
197   Return (l_fct_ret);
198 --
199 End api_updating;
200 --
201 -- ----------------------------------------------------------------------------
202 -- |---------------------------------< lck >----------------------------------|
203 -- ----------------------------------------------------------------------------
204 Procedure lck
205   (
206   p_prtt_rt_val_id                     in number,
207   p_object_version_number              in number
208   ) is
209 --
210 -- Cursor selects the 'current' row from the HR Schema
211 --
212   Cursor C_Sel1 is
213     select 	prtt_rt_val_id,
214       null,
215 	rt_strt_dt,
216 	rt_end_dt,
217 	rt_typ_cd,
218 	tx_typ_cd,
219 	ordr_num,
220 	acty_typ_cd,
221 	mlt_cd,
222 	acty_ref_perd_cd,
223 	rt_val,
224 	ann_rt_val,
225 	cmcd_rt_val,
226 	cmcd_ref_perd_cd,
227 	bnft_rt_typ_cd,
228 	dsply_on_enrt_flag,
229 	rt_ovridn_flag,
230 	rt_ovridn_thru_dt,
231 	elctns_made_dt,
232 	prtt_rt_val_stat_cd,
233 	prtt_enrt_rslt_id,
234 	cvg_amt_calc_mthd_id,
235 	actl_prem_id,
236 	comp_lvl_fctr_id,
237 	element_entry_value_id,
238 	per_in_ler_id,
239 	ended_per_in_ler_id,
240         acty_base_rt_id,
241         prtt_reimbmt_rqst_id,
242         prtt_rmt_aprvd_fr_pymt_id,
243         pp_in_yr_used_num,
244 	business_group_id,
245 	prv_attribute_category,
246 	prv_attribute1,
247 	prv_attribute2,
248 	prv_attribute3,
249 	prv_attribute4,
250 	prv_attribute5,
251 	prv_attribute6,
252 	prv_attribute7,
253 	prv_attribute8,
254 	prv_attribute9,
255 	prv_attribute10,
256 	prv_attribute11,
257 	prv_attribute12,
258 	prv_attribute13,
259 	prv_attribute14,
260 	prv_attribute15,
261 	prv_attribute16,
262 	prv_attribute17,
263 	prv_attribute18,
264 	prv_attribute19,
265 	prv_attribute20,
266 	prv_attribute21,
267 	prv_attribute22,
268 	prv_attribute23,
269 	prv_attribute24,
270 	prv_attribute25,
271 	prv_attribute26,
272 	prv_attribute27,
273 	prv_attribute28,
274 	prv_attribute29,
275 	prv_attribute30,
276         pk_id_table_name,
277         pk_id,
278 	object_version_number
279     from	ben_prtt_rt_val
280     where	prtt_rt_val_id = p_prtt_rt_val_id
281     for	update nowait;
282 --
283   l_proc	varchar2(72) := g_package||'lck';
284 --
285 Begin
286   hr_utility.set_location('Entering:'||l_proc, 5);
287   --
288   --
289   -- Ensure that all the mandatory arguments are not null
290   --
291   hr_api.mandatory_arg_error(p_api_name       => l_proc,
292                              p_argument       => 'prtt_rt_val_id',
293                              p_argument_value => p_prtt_rt_val_id);
294   --
295   hr_api.mandatory_arg_error(p_api_name       => l_proc,
296                              p_argument       => 'object_version_number',
297                              p_argument_value => p_object_version_number);
298   Open  C_Sel1;
299   Fetch C_Sel1 Into g_old_rec;
300   If C_Sel1%notfound then
301     Close C_Sel1;
302     --
303     -- The primary key is invalid therefore we must error
304     --
305     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
306     fnd_message.raise_error;
307   End If;
308   Close C_Sel1;
309   If (p_object_version_number <> g_old_rec.object_version_number) Then
310         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
311         fnd_message.raise_error;
312       End If;
313 --
314   hr_utility.set_location(' Leaving:'||l_proc, 10);
315 --
316 -- We need to trap the ORA LOCK exception
317 --
318 Exception
319   When HR_Api.Object_Locked then
320     --
321     -- The object is locked therefore we need to supply a meaningful
322     -- error message.
323     --
324     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
325     fnd_message.set_token('TABLE_NAME', 'ben_prtt_rt_val');
326     fnd_message.raise_error;
327 End lck;
328 --
329 -- ----------------------------------------------------------------------------
330 -- |-----------------------------< convert_args >-----------------------------|
331 -- ----------------------------------------------------------------------------
332 Function convert_args
333 	(
334 	p_prtt_rt_val_id                in number,
335 	p_enrt_rt_id			in number,
336 	p_rt_strt_dt                    in date,
337 	p_rt_end_dt                     in date,
338 	p_rt_typ_cd                     in varchar2,
339 	p_tx_typ_cd                     in varchar2,
340 	p_ordr_num			in number,
341 	p_acty_typ_cd                   in varchar2,
342 	p_mlt_cd                        in varchar2,
343 	p_acty_ref_perd_cd              in varchar2,
344 	p_rt_val                        in number,
345 	p_ann_rt_val                    in number,
346 	p_cmcd_rt_val                   in number,
347 	p_cmcd_ref_perd_cd              in varchar2,
348 	p_bnft_rt_typ_cd                in varchar2,
349 	p_dsply_on_enrt_flag            in varchar2,
350 	p_rt_ovridn_flag                in varchar2,
351 	p_rt_ovridn_thru_dt             in date,
352 	p_elctns_made_dt                in date,
353 	p_prtt_rt_val_stat_cd           in varchar2,
354 	p_prtt_enrt_rslt_id             in number,
355 	p_cvg_amt_calc_mthd_id          in number,
356 	p_actl_prem_id                  in number,
357 	p_comp_lvl_fctr_id              in number,
358 	p_element_entry_value_id        in number,
359 	p_per_in_ler_id                 in number,
360 	p_ended_per_in_ler_id           in number,
361 	p_acty_base_rt_id               in number,
362 	p_prtt_reimbmt_rqst_id          in number,
363         p_prtt_rmt_aprvd_fr_pymt_id     in number,
364         p_pp_in_yr_used_num             in  number,
365 	p_business_group_id             in number,
366 	p_prv_attribute_category        in varchar2,
367 	p_prv_attribute1                in varchar2,
368 	p_prv_attribute2                in varchar2,
369 	p_prv_attribute3                in varchar2,
370 	p_prv_attribute4                in varchar2,
371 	p_prv_attribute5                in varchar2,
372 	p_prv_attribute6                in varchar2,
373 	p_prv_attribute7                in varchar2,
374 	p_prv_attribute8                in varchar2,
375 	p_prv_attribute9                in varchar2,
376 	p_prv_attribute10               in varchar2,
377 	p_prv_attribute11               in varchar2,
378 	p_prv_attribute12               in varchar2,
379 	p_prv_attribute13               in varchar2,
380 	p_prv_attribute14               in varchar2,
381 	p_prv_attribute15               in varchar2,
382 	p_prv_attribute16               in varchar2,
383 	p_prv_attribute17               in varchar2,
384 	p_prv_attribute18               in varchar2,
385 	p_prv_attribute19               in varchar2,
386 	p_prv_attribute20               in varchar2,
387 	p_prv_attribute21               in varchar2,
388 	p_prv_attribute22               in varchar2,
389 	p_prv_attribute23               in varchar2,
393 	p_prv_attribute27               in varchar2,
390 	p_prv_attribute24               in varchar2,
391 	p_prv_attribute25               in varchar2,
392 	p_prv_attribute26               in varchar2,
394 	p_prv_attribute28               in varchar2,
395 	p_prv_attribute29               in varchar2,
396 	p_prv_attribute30               in varchar2,
397 	p_pk_id_table_name              in varchar2,
398 	p_pk_id                         in number ,
399 	p_object_version_number         in number
400 	)
401 	Return g_rec_type is
402 --
403   l_rec	  g_rec_type;
404   l_proc  varchar2(72) := g_package||'convert_args';
405 --
406 Begin
407   --
408   hr_utility.set_location('Entering:'||l_proc, 5);
409   --
410   -- Convert arguments into local l_rec structure.
411   --
412   l_rec.prtt_rt_val_id                   := p_prtt_rt_val_id;
413   l_rec.enrt_rt_id			 := p_enrt_rt_id;
414   l_rec.rt_strt_dt                       := p_rt_strt_dt;
415   l_rec.rt_end_dt                        := p_rt_end_dt;
416   l_rec.rt_typ_cd                        := p_rt_typ_cd;
417   l_rec.tx_typ_cd                        := p_tx_typ_cd;
418   l_rec.ordr_num			 := p_ordr_num;
419   l_rec.acty_typ_cd                      := p_acty_typ_cd;
420   l_rec.mlt_cd                           := p_mlt_cd;
421   l_rec.acty_ref_perd_cd                 := p_acty_ref_perd_cd;
422   l_rec.rt_val                           := p_rt_val;
423   l_rec.ann_rt_val                       := p_ann_rt_val;
424   l_rec.cmcd_rt_val                      := p_cmcd_rt_val;
425   l_rec.cmcd_ref_perd_cd                 := p_cmcd_ref_perd_cd;
426   l_rec.bnft_rt_typ_cd                   := p_bnft_rt_typ_cd;
427   l_rec.dsply_on_enrt_flag               := p_dsply_on_enrt_flag;
428   l_rec.rt_ovridn_flag                   := p_rt_ovridn_flag;
429   l_rec.rt_ovridn_thru_dt                := p_rt_ovridn_thru_dt;
430   l_rec.elctns_made_dt                   := p_elctns_made_dt;
431   l_rec.prtt_rt_val_stat_cd              := p_prtt_rt_val_stat_cd;
432   l_rec.prtt_enrt_rslt_id                := p_prtt_enrt_rslt_id;
433   l_rec.cvg_amt_calc_mthd_id             := p_cvg_amt_calc_mthd_id;
434   l_rec.actl_prem_id                     := p_actl_prem_id;
435   l_rec.comp_lvl_fctr_id                 := p_comp_lvl_fctr_id;
436   l_rec.element_entry_value_id           := p_element_entry_value_id;
437   l_rec.per_in_ler_id                    := p_per_in_ler_id;
438   l_rec.ended_per_in_ler_id              := p_ended_per_in_ler_id;
439   l_rec.acty_base_rt_id                  := p_acty_base_rt_id;
440   l_rec.prtt_reimbmt_rqst_id             := p_prtt_reimbmt_rqst_id;
441   l_rec.prtt_rmt_aprvd_fr_pymt_id        := p_prtt_rmt_aprvd_fr_pymt_id;
442   l_rec.pp_in_yr_used_num                := p_pp_in_yr_used_num;
443   l_rec.business_group_id                := p_business_group_id;
444   l_rec.prv_attribute_category           := p_prv_attribute_category;
445   l_rec.prv_attribute1                   := p_prv_attribute1;
446   l_rec.prv_attribute2                   := p_prv_attribute2;
447   l_rec.prv_attribute3                   := p_prv_attribute3;
448   l_rec.prv_attribute4                   := p_prv_attribute4;
449   l_rec.prv_attribute5                   := p_prv_attribute5;
450   l_rec.prv_attribute6                   := p_prv_attribute6;
451   l_rec.prv_attribute7                   := p_prv_attribute7;
452   l_rec.prv_attribute8                   := p_prv_attribute8;
453   l_rec.prv_attribute9                   := p_prv_attribute9;
454   l_rec.prv_attribute10                  := p_prv_attribute10;
455   l_rec.prv_attribute11                  := p_prv_attribute11;
456   l_rec.prv_attribute12                  := p_prv_attribute12;
457   l_rec.prv_attribute13                  := p_prv_attribute13;
458   l_rec.prv_attribute14                  := p_prv_attribute14;
459   l_rec.prv_attribute15                  := p_prv_attribute15;
460   l_rec.prv_attribute16                  := p_prv_attribute16;
461   l_rec.prv_attribute17                  := p_prv_attribute17;
462   l_rec.prv_attribute18                  := p_prv_attribute18;
463   l_rec.prv_attribute19                  := p_prv_attribute19;
464   l_rec.prv_attribute20                  := p_prv_attribute20;
465   l_rec.prv_attribute21                  := p_prv_attribute21;
466   l_rec.prv_attribute22                  := p_prv_attribute22;
467   l_rec.prv_attribute23                  := p_prv_attribute23;
468   l_rec.prv_attribute24                  := p_prv_attribute24;
469   l_rec.prv_attribute25                  := p_prv_attribute25;
470   l_rec.prv_attribute26                  := p_prv_attribute26;
471   l_rec.prv_attribute27                  := p_prv_attribute27;
472   l_rec.prv_attribute28                  := p_prv_attribute28;
473   l_rec.prv_attribute29                  := p_prv_attribute29;
474   l_rec.prv_attribute30                  := p_prv_attribute30;
475   l_rec.pk_id_table_name                 := p_pk_id_table_name ;
476   l_rec.pk_id                            := p_pk_id;
477   l_rec.object_version_number            := p_object_version_number;
478   --
479   -- Return the plsql record structure.
480   --
481   hr_utility.set_location(' Leaving:'||l_proc, 10);
482   Return(l_rec);
483 --
484 End convert_args;
485 --
486 end ben_prv_shd;