DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_RVC_SHD

Source


1 Package Body ben_rvc_shd as
2 /* $Header: bervcrhi.pkb 115.2 2002/12/11 11:18:06 hnarayan noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_rvc_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 = 'AVCON_BEN_E_RQD_F_000') 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_prv_ctfn_prvdd_FK2') 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_prv_ctfn_prvdd_FK3') 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_rt_val_ctfn_prvdd_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_rt_val_ctfn_prvdd_id,
76 	enrt_ctfn_typ_cd,
77         enrt_ctfn_rqd_flag ,
78         enrt_ctfn_recd_dt ,
79         enrt_ctfn_dnd_dt ,
80 	prtt_rt_val_id,
81 	business_group_id,
82 	rvc_attribute_category,
83 	rvc_attribute1,
84 	rvc_attribute2,
85 	rvc_attribute3,
86 	rvc_attribute4,
87 	rvc_attribute5,
88 	rvc_attribute6,
89 	rvc_attribute7,
90 	rvc_attribute8,
91 	rvc_attribute9,
92 	rvc_attribute10,
93 	rvc_attribute11,
94 	rvc_attribute12,
95 	rvc_attribute13,
96 	rvc_attribute14,
97 	rvc_attribute15,
98 	rvc_attribute16,
99 	rvc_attribute17,
100 	rvc_attribute18,
101 	rvc_attribute19,
102 	rvc_attribute20,
103 	rvc_attribute21,
104 	rvc_attribute22,
105 	rvc_attribute23,
106 	rvc_attribute24,
107 	rvc_attribute25,
108 	rvc_attribute26,
109 	rvc_attribute27,
110 	rvc_attribute28,
111 	rvc_attribute29,
112 	rvc_attribute30,
113 	request_id,
114 	program_application_id,
115 	program_id,
116 	program_update_date,
117 	object_version_number
118     from	ben_prtt_rt_val_ctfn_prvdd
119     where	prtt_rt_val_ctfn_prvdd_id = p_prtt_rt_val_ctfn_prvdd_id;
120 --
121   l_proc	varchar2(72)	:= g_package||'api_updating';
122   l_fct_ret	boolean;
123 --
124 Begin
125   hr_utility.set_location('Entering:'||l_proc, 5);
126   --
127   If (
128 	p_prtt_rt_val_ctfn_prvdd_id is null and
129 	p_object_version_number is null
130      ) Then
131     --
132     -- One of the primary key arguments is null therefore we must
133     -- set the returning function value to false
134     --
135     l_fct_ret := false;
136   Else
137     If (
138 	p_prtt_rt_val_ctfn_prvdd_id = g_old_rec.prtt_rt_val_ctfn_prvdd_id and
139 	p_object_version_number = g_old_rec.object_version_number
140        ) Then
141       hr_utility.set_location(l_proc, 10);
142       --
143       -- The g_old_rec is current therefore we must
144       -- set the returning function to true
145       --
146       l_fct_ret := true;
147     Else
148       --
149       -- Select the current row into g_old_rec
150       --
151       Open C_Sel1;
152       Fetch C_Sel1 Into g_old_rec;
153       If C_Sel1%notfound Then
154         Close C_Sel1;
155         --
156         -- The primary key is invalid therefore we must error
157         --
158         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
159         fnd_message.raise_error;
160       End If;
161       Close C_Sel1;
162       If (p_object_version_number <> g_old_rec.object_version_number) Then
163         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
164         fnd_message.raise_error;
165       End If;
166       hr_utility.set_location(l_proc, 15);
167       l_fct_ret := true;
168     End If;
169   End If;
170   hr_utility.set_location(' Leaving:'||l_proc, 20);
171   Return (l_fct_ret);
172 --
173 End api_updating;
174 --
175 -- ----------------------------------------------------------------------------
176 -- |---------------------------------< lck >----------------------------------|
177 -- ----------------------------------------------------------------------------
178 Procedure lck
179   (
180   p_prtt_rt_val_ctfn_prvdd_id                 in number,
181   p_object_version_number              in number
182   ) is
183 --
184 -- Cursor selects the 'current' row from the HR Schema
185 --
186   Cursor C_Sel1 is
187     select 	prtt_rt_val_ctfn_prvdd_id,
188 	enrt_ctfn_typ_cd,
189         enrt_ctfn_rqd_flag ,
190         enrt_ctfn_recd_dt ,
191         enrt_ctfn_dnd_dt ,
192 	prtt_rt_val_id,
193 	business_group_id,
194 	rvc_attribute_category,
195 	rvc_attribute1,
196 	rvc_attribute2,
197 	rvc_attribute3,
198 	rvc_attribute4,
199 	rvc_attribute5,
200 	rvc_attribute6,
201 	rvc_attribute7,
202 	rvc_attribute8,
203 	rvc_attribute9,
204 	rvc_attribute10,
205 	rvc_attribute11,
206 	rvc_attribute12,
207 	rvc_attribute13,
208 	rvc_attribute14,
209 	rvc_attribute15,
210 	rvc_attribute16,
211 	rvc_attribute17,
212 	rvc_attribute18,
213 	rvc_attribute19,
214 	rvc_attribute20,
215 	rvc_attribute21,
216 	rvc_attribute22,
217 	rvc_attribute23,
218 	rvc_attribute24,
219 	rvc_attribute25,
220 	rvc_attribute26,
221 	rvc_attribute27,
222 	rvc_attribute28,
223 	rvc_attribute29,
224 	rvc_attribute30,
225 	request_id,
226 	program_application_id,
227 	program_id,
228 	program_update_date,
229 	object_version_number
230     from	ben_prtt_rt_val_ctfn_prvdd
231     where	prtt_rt_val_ctfn_prvdd_id = p_prtt_rt_val_ctfn_prvdd_id
232     for	update nowait;
233 --
234   l_proc	varchar2(72) := g_package||'lck';
235 --
236 Begin
237   hr_utility.set_location('Entering:'||l_proc, 5);
238   --
239   -- Add any mandatory argument checking here:
240   -- Example:
241   -- hr_api.mandatory_arg_error
242   --   (p_api_name       => l_proc,
243   --    p_argument       => 'object_version_number',
244   --    p_argument_value => p_object_version_number);
245   --
246   Open  C_Sel1;
247   Fetch C_Sel1 Into g_old_rec;
248   If C_Sel1%notfound then
249     Close C_Sel1;
250     --
251     -- The primary key is invalid therefore we must error
252     --
253     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
254     fnd_message.raise_error;
255   End If;
256   Close C_Sel1;
257   If (p_object_version_number <> g_old_rec.object_version_number) Then
258         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
259         fnd_message.raise_error;
260       End If;
261 --
262   hr_utility.set_location(' Leaving:'||l_proc, 10);
263 --
264 -- We need to trap the ORA LOCK exception
265 --
266 Exception
267   When HR_Api.Object_Locked then
268     --
269     -- The object is locked therefore we need to supply a meaningful
270     -- error message.
271     --
272     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
273     fnd_message.set_token('TABLE_NAME', 'ben_prtt_rt_val_ctfn_prvdd');
274     fnd_message.raise_error;
275 End lck;
276 --
277 -- ----------------------------------------------------------------------------
278 -- |-----------------------------< convert_args >-----------------------------|
279 -- ----------------------------------------------------------------------------
280 Function convert_args
281 	(
282 	p_prtt_rt_val_ctfn_prvdd_id            in number,
283 	p_enrt_ctfn_typ_cd              in varchar2,
284         p_enrt_ctfn_rqd_flag            in  varchar2,
285         p_enrt_ctfn_recd_dt             in  date,
286         p_enrt_ctfn_dnd_dt              in  date,
287 	p_prtt_rt_val_id        in number,
288 	p_business_group_id             in number,
289 	p_rvc_attribute_category        in varchar2,
290 	p_rvc_attribute1                in varchar2,
291 	p_rvc_attribute2                in varchar2,
292 	p_rvc_attribute3                in varchar2,
293 	p_rvc_attribute4                in varchar2,
294 	p_rvc_attribute5                in varchar2,
295 	p_rvc_attribute6                in varchar2,
296 	p_rvc_attribute7                in varchar2,
297 	p_rvc_attribute8                in varchar2,
298 	p_rvc_attribute9                in varchar2,
299 	p_rvc_attribute10               in varchar2,
300 	p_rvc_attribute11               in varchar2,
301 	p_rvc_attribute12               in varchar2,
302 	p_rvc_attribute13               in varchar2,
303 	p_rvc_attribute14               in varchar2,
304 	p_rvc_attribute15               in varchar2,
305 	p_rvc_attribute16               in varchar2,
306 	p_rvc_attribute17               in varchar2,
307 	p_rvc_attribute18               in varchar2,
308 	p_rvc_attribute19               in varchar2,
309 	p_rvc_attribute20               in varchar2,
310 	p_rvc_attribute21               in varchar2,
311 	p_rvc_attribute22               in varchar2,
312 	p_rvc_attribute23               in varchar2,
313 	p_rvc_attribute24               in varchar2,
314 	p_rvc_attribute25               in varchar2,
315 	p_rvc_attribute26               in varchar2,
316 	p_rvc_attribute27               in varchar2,
317 	p_rvc_attribute28               in varchar2,
318 	p_rvc_attribute29               in varchar2,
319 	p_rvc_attribute30               in varchar2,
320 	p_request_id                    in number,
321 	p_program_application_id        in number,
322 	p_program_id                    in number,
323 	p_program_update_date           in date,
324 	p_object_version_number         in number
325 	)
326 	Return g_rec_type is
327 --
328   l_rec	  g_rec_type;
329   l_proc  varchar2(72) := g_package||'convert_args';
330 --
331 Begin
332   --
333   hr_utility.set_location('Entering:'||l_proc, 5);
334   --
335   -- Convert arguments into local l_rec structure.
336   --
337   l_rec.prtt_rt_val_ctfn_prvdd_id        := p_prtt_rt_val_ctfn_prvdd_id;
338   l_rec.enrt_ctfn_typ_cd                 := p_enrt_ctfn_typ_cd;
339   l_rec.enrt_ctfn_rqd_flag               := p_enrt_ctfn_rqd_flag;
340   l_rec.enrt_ctfn_recd_dt                := p_enrt_ctfn_recd_dt;
341   l_rec.enrt_ctfn_dnd_dt                 := p_enrt_ctfn_dnd_dt;
342   l_rec.prtt_rt_val_id                   := p_prtt_rt_val_id;
343   l_rec.business_group_id                := p_business_group_id;
344   l_rec.rvc_attribute_category           := p_rvc_attribute_category;
345   l_rec.rvc_attribute1                   := p_rvc_attribute1;
346   l_rec.rvc_attribute2                   := p_rvc_attribute2;
347   l_rec.rvc_attribute3                   := p_rvc_attribute3;
348   l_rec.rvc_attribute4                   := p_rvc_attribute4;
349   l_rec.rvc_attribute5                   := p_rvc_attribute5;
350   l_rec.rvc_attribute6                   := p_rvc_attribute6;
351   l_rec.rvc_attribute7                   := p_rvc_attribute7;
352   l_rec.rvc_attribute8                   := p_rvc_attribute8;
353   l_rec.rvc_attribute9                   := p_rvc_attribute9;
354   l_rec.rvc_attribute10                  := p_rvc_attribute10;
355   l_rec.rvc_attribute11                  := p_rvc_attribute11;
356   l_rec.rvc_attribute12                  := p_rvc_attribute12;
357   l_rec.rvc_attribute13                  := p_rvc_attribute13;
358   l_rec.rvc_attribute14                  := p_rvc_attribute14;
359   l_rec.rvc_attribute15                  := p_rvc_attribute15;
360   l_rec.rvc_attribute16                  := p_rvc_attribute16;
361   l_rec.rvc_attribute17                  := p_rvc_attribute17;
362   l_rec.rvc_attribute18                  := p_rvc_attribute18;
363   l_rec.rvc_attribute19                  := p_rvc_attribute19;
364   l_rec.rvc_attribute20                  := p_rvc_attribute20;
365   l_rec.rvc_attribute21                  := p_rvc_attribute21;
366   l_rec.rvc_attribute22                  := p_rvc_attribute22;
367   l_rec.rvc_attribute23                  := p_rvc_attribute23;
368   l_rec.rvc_attribute24                  := p_rvc_attribute24;
369   l_rec.rvc_attribute25                  := p_rvc_attribute25;
370   l_rec.rvc_attribute26                  := p_rvc_attribute26;
371   l_rec.rvc_attribute27                  := p_rvc_attribute27;
372   l_rec.rvc_attribute28                  := p_rvc_attribute28;
373   l_rec.rvc_attribute29                  := p_rvc_attribute29;
374   l_rec.rvc_attribute30                  := p_rvc_attribute30;
375   l_rec.request_id                       := p_request_id;
376   l_rec.program_application_id           := p_program_application_id;
377   l_rec.program_id                       := p_program_id;
378   l_rec.program_update_date              := p_program_update_date;
379   l_rec.object_version_number            := p_object_version_number;
380   --
381   -- Return the plsql record structure.
382   --
383   hr_utility.set_location(' Leaving:'||l_proc, 10);
384   Return(l_rec);
385 --
386 End convert_args;
387 --
388 end ben_rvc_shd;