DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_EGD_SHD

Source


6 -- ----------------------------------------------------------------------------
1 Package Body ben_egd_shd as
2 /* $Header: beegdrhi.pkb 120.1 2008/04/24 10:18:32 bachakra noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
7 --
8 g_package  varchar2(33)	:= '  ben_egd_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_ELIG_DPNT_FK2') 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_ELIG_DPNT_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   Else
47     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
48     fnd_message.set_token('PROCEDURE', l_proc);
49     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
50     fnd_message.raise_error;
51   End If;
52   --
53   hr_utility.set_location(' Leaving:'||l_proc, 10);
54 End constraint_error;
55 --
56 -- ----------------------------------------------------------------------------
57 -- |-----------------------------< api_updating >-----------------------------|
58 -- ----------------------------------------------------------------------------
59 Function api_updating
60   (
61   p_elig_dpnt_id                       in number,
62   p_object_version_number              in number
63   )      Return Boolean Is
64 --
65   --
66   -- Cursor selects the 'current' row from the HR Schema
67   --
68   Cursor C_Sel1 is
69     select
70 		elig_dpnt_id,
71 	create_dt,
72 	elig_strt_dt,
73 	elig_thru_dt,
74 	ovrdn_flag,
75 	ovrdn_thru_dt,
76 	inelg_rsn_cd,
77 	dpnt_inelig_flag,
78 	elig_per_elctbl_chc_id,
79 	per_in_ler_id,
80 	elig_per_id,
81 	elig_per_opt_id,
82 	elig_cvrd_dpnt_id,
83 	dpnt_person_id,
84 	business_group_id,
85 	egd_attribute_category,
86 	egd_attribute1,
87 	egd_attribute2,
88 	egd_attribute3,
89 	egd_attribute4,
90 	egd_attribute5,
91 	egd_attribute6,
92 	egd_attribute7,
93 	egd_attribute8,
94 	egd_attribute9,
95 	egd_attribute10,
96 	egd_attribute11,
97 	egd_attribute12,
98 	egd_attribute13,
99 	egd_attribute14,
100 	egd_attribute15,
101 	egd_attribute16,
102 	egd_attribute17,
103 	egd_attribute18,
104 	egd_attribute19,
105 	egd_attribute20,
106 	egd_attribute21,
107 	egd_attribute22,
108 	egd_attribute23,
109 	egd_attribute24,
110 	egd_attribute25,
111 	egd_attribute26,
112 	egd_attribute27,
113 	egd_attribute28,
114 	egd_attribute29,
115 	egd_attribute30,
116 	request_id,
117 	program_application_id,
118 	program_id,
119 	program_update_date,
120 	object_version_number
121     from	ben_elig_dpnt
122     where	elig_dpnt_id = p_elig_dpnt_id;
123 --
124   l_proc	varchar2(72)	:= g_package||'api_updating';
125   l_fct_ret	boolean;
126 --
127 Begin
128   hr_utility.set_location('Entering:'||l_proc, 5);
129   --
130   If (
131 	p_elig_dpnt_id is null and
132 	p_object_version_number is null
133      ) Then
134     --
135     -- One of the primary key arguments is null therefore we must
136     -- set the returning function value to false
137     --
138     l_fct_ret := false;
139   Else
140     If (
141 	p_elig_dpnt_id = g_old_rec.elig_dpnt_id and
142 	p_object_version_number = g_old_rec.object_version_number
143        ) Then
144       hr_utility.set_location(l_proc, 10);
145       --
146       -- The g_old_rec is current therefore we must
147       -- set the returning function to true
148       --
149       l_fct_ret := true;
150     Else
151       --
152       -- Select the current row into g_old_rec
153       --
154       Open C_Sel1;
155       Fetch C_Sel1 Into g_old_rec;
156       If C_Sel1%notfound Then
157         Close C_Sel1;
158         --
159         -- The primary key is invalid therefore we must error
160         --
161         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
162         fnd_message.raise_error;
163       End If;
167         fnd_message.raise_error;
164       Close C_Sel1;
165       If (p_object_version_number <> g_old_rec.object_version_number) Then
166         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
168       End If;
169       hr_utility.set_location(l_proc, 15);
170       l_fct_ret := true;
171     End If;
172   End If;
173   hr_utility.set_location(' Leaving:'||l_proc, 20);
174   Return (l_fct_ret);
175 --
176 End api_updating;
177 --
178 -- ----------------------------------------------------------------------------
179 -- |---------------------------------< lck >----------------------------------|
180 -- ----------------------------------------------------------------------------
181 Procedure lck
182   (
183   p_elig_dpnt_id                       in number,
184   p_object_version_number              in number
185   ) is
186 --
187 -- Cursor selects the 'current' row from the HR Schema
188 --
189   Cursor C_Sel1 is
190     select 	elig_dpnt_id,
191 	create_dt,
192 	elig_strt_dt,
193 	elig_thru_dt,
194 	ovrdn_flag,
195 	ovrdn_thru_dt,
196 	inelg_rsn_cd,
197 	dpnt_inelig_flag,
198 	elig_per_elctbl_chc_id,
199 	per_in_ler_id,
200 	elig_per_id,
201 	elig_per_opt_id,
202 	elig_cvrd_dpnt_id,
203 	dpnt_person_id,
204 	business_group_id,
205 	egd_attribute_category,
206 	egd_attribute1,
207 	egd_attribute2,
208 	egd_attribute3,
209 	egd_attribute4,
210 	egd_attribute5,
211 	egd_attribute6,
212 	egd_attribute7,
213 	egd_attribute8,
214 	egd_attribute9,
215 	egd_attribute10,
216 	egd_attribute11,
217 	egd_attribute12,
218 	egd_attribute13,
219 	egd_attribute14,
220 	egd_attribute15,
221 	egd_attribute16,
222 	egd_attribute17,
223 	egd_attribute18,
224 	egd_attribute19,
225 	egd_attribute20,
226 	egd_attribute21,
227 	egd_attribute22,
228 	egd_attribute23,
229 	egd_attribute24,
230 	egd_attribute25,
231 	egd_attribute26,
232 	egd_attribute27,
233 	egd_attribute28,
234 	egd_attribute29,
235 	egd_attribute30,
236 	request_id,
237 	program_application_id,
238 	program_id,
239 	program_update_date,
240 	object_version_number
241     from	ben_elig_dpnt
242     where	elig_dpnt_id = p_elig_dpnt_id
243     for	update nowait;
244 --
245   l_proc	varchar2(72) := g_package||'lck';
246 --
247 Begin
248   hr_utility.set_location('Entering:'||l_proc, 5);
249   --
250   -- Add any mandatory argument checking here:
251   -- Example:
252   -- hr_api.mandatory_arg_error
253   --   (p_api_name       => l_proc,
254   --    p_argument       => 'object_version_number',
255   --    p_argument_value => p_object_version_number);
256   --
257   Open  C_Sel1;
258   Fetch C_Sel1 Into g_old_rec;
259   If C_Sel1%notfound then
260     Close C_Sel1;
261     --
262     -- The primary key is invalid therefore we must error
263     --
264     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
265     fnd_message.raise_error;
266   End If;
267   Close C_Sel1;
268   If (p_object_version_number <> g_old_rec.object_version_number) Then
269         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
270         fnd_message.raise_error;
271       End If;
272 --
273   hr_utility.set_location(' Leaving:'||l_proc, 10);
274 --
275 -- We need to trap the ORA LOCK exception
276 --
277 Exception
278   When HR_Api.Object_Locked then
279     --
280     -- The object is locked therefore we need to supply a meaningful
281     -- error message.
282     --
283     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
284     fnd_message.set_token('TABLE_NAME', 'ben_elig_dpnt');
285     fnd_message.raise_error;
286 End lck;
287 --
288 -- ----------------------------------------------------------------------------
289 -- |-----------------------------< convert_args >-----------------------------|
290 -- ----------------------------------------------------------------------------
291 Function convert_args
292 	(
293 	p_elig_dpnt_id                  in number,
294 	p_create_dt                     in date,
295 	p_elig_strt_dt                  in date,
296 	p_elig_thru_dt                  in date,
297 	p_ovrdn_flag                    in varchar2,
298 	p_ovrdn_thru_dt                 in date,
299 	p_inelg_rsn_cd                  in varchar2,
300 	p_dpnt_inelig_flag              in varchar2,
301 	p_elig_per_elctbl_chc_id        in number,
302 	p_per_in_ler_id                 in number,
303 	p_elig_per_id                   in number,
304 	p_elig_per_opt_id               in number,
305 	p_elig_cvrd_dpnt_id             in number,
306 	p_dpnt_person_id                in number,
307 	p_business_group_id             in number,
308 	p_egd_attribute_category        in varchar2,
309 	p_egd_attribute1                in varchar2,
310 	p_egd_attribute2                in varchar2,
311 	p_egd_attribute3                in varchar2,
312 	p_egd_attribute4                in varchar2,
313 	p_egd_attribute5                in varchar2,
314 	p_egd_attribute6                in varchar2,
315 	p_egd_attribute7                in varchar2,
316 	p_egd_attribute8                in varchar2,
317 	p_egd_attribute9                in varchar2,
318 	p_egd_attribute10               in varchar2,
319 	p_egd_attribute11               in varchar2,
320 	p_egd_attribute12               in varchar2,
321 	p_egd_attribute13               in varchar2,
322 	p_egd_attribute14               in varchar2,
323 	p_egd_attribute15               in varchar2,
324 	p_egd_attribute16               in varchar2,
325 	p_egd_attribute17               in varchar2,
326 	p_egd_attribute18               in varchar2,
327 	p_egd_attribute19               in varchar2,
328 	p_egd_attribute20               in varchar2,
329 	p_egd_attribute21               in varchar2,
330 	p_egd_attribute22               in varchar2,
331 	p_egd_attribute23               in varchar2,
332 	p_egd_attribute24               in varchar2,
333 	p_egd_attribute25               in varchar2,
334 	p_egd_attribute26               in varchar2,
335 	p_egd_attribute27               in varchar2,
336 	p_egd_attribute28               in varchar2,
337 	p_egd_attribute29               in varchar2,
338 	p_egd_attribute30               in varchar2,
339 	p_request_id                    in number,
340 	p_program_application_id        in number,
341 	p_program_id                    in number,
342 	p_program_update_date           in date,
343 	p_object_version_number         in number
344 	)
345 	Return g_rec_type is
346 --
347   l_rec	  g_rec_type;
348   l_proc  varchar2(72) := g_package||'convert_args';
349 --
350 Begin
351   --
352   hr_utility.set_location('Entering:'||l_proc, 5);
353   --
354   -- Convert arguments into local l_rec structure.
355   --
356   l_rec.elig_dpnt_id                     := p_elig_dpnt_id;
357   l_rec.create_dt                        := p_create_dt;
358   l_rec.elig_strt_dt                     := p_elig_strt_dt;
359   l_rec.elig_thru_dt                     := p_elig_thru_dt;
360   l_rec.ovrdn_flag                       := p_ovrdn_flag;
361   l_rec.ovrdn_thru_dt                    := p_ovrdn_thru_dt;
362   l_rec.inelg_rsn_cd                     := p_inelg_rsn_cd;
363   l_rec.dpnt_inelig_flag                 := p_dpnt_inelig_flag;
364   l_rec.elig_per_elctbl_chc_id           := p_elig_per_elctbl_chc_id;
365   l_rec.per_in_ler_id                    := p_per_in_ler_id;
366   l_rec.elig_per_id                      := p_elig_per_id;
367   l_rec.elig_per_opt_id                  := p_elig_per_opt_id;
368   l_rec.elig_cvrd_dpnt_id                := p_elig_cvrd_dpnt_id;
369   l_rec.dpnt_person_id                   := p_dpnt_person_id;
370   l_rec.business_group_id                := p_business_group_id;
371   l_rec.egd_attribute_category           := p_egd_attribute_category;
372   l_rec.egd_attribute1                   := p_egd_attribute1;
373   l_rec.egd_attribute2                   := p_egd_attribute2;
374   l_rec.egd_attribute3                   := p_egd_attribute3;
375   l_rec.egd_attribute4                   := p_egd_attribute4;
376   l_rec.egd_attribute5                   := p_egd_attribute5;
377   l_rec.egd_attribute6                   := p_egd_attribute6;
378   l_rec.egd_attribute7                   := p_egd_attribute7;
379   l_rec.egd_attribute8                   := p_egd_attribute8;
380   l_rec.egd_attribute9                   := p_egd_attribute9;
381   l_rec.egd_attribute10                  := p_egd_attribute10;
382   l_rec.egd_attribute11                  := p_egd_attribute11;
383   l_rec.egd_attribute12                  := p_egd_attribute12;
384   l_rec.egd_attribute13                  := p_egd_attribute13;
385   l_rec.egd_attribute14                  := p_egd_attribute14;
386   l_rec.egd_attribute15                  := p_egd_attribute15;
387   l_rec.egd_attribute16                  := p_egd_attribute16;
388   l_rec.egd_attribute17                  := p_egd_attribute17;
389   l_rec.egd_attribute18                  := p_egd_attribute18;
390   l_rec.egd_attribute19                  := p_egd_attribute19;
391   l_rec.egd_attribute20                  := p_egd_attribute20;
392   l_rec.egd_attribute21                  := p_egd_attribute21;
393   l_rec.egd_attribute22                  := p_egd_attribute22;
394   l_rec.egd_attribute23                  := p_egd_attribute23;
395   l_rec.egd_attribute24                  := p_egd_attribute24;
396   l_rec.egd_attribute25                  := p_egd_attribute25;
397   l_rec.egd_attribute26                  := p_egd_attribute26;
398   l_rec.egd_attribute27                  := p_egd_attribute27;
399   l_rec.egd_attribute28                  := p_egd_attribute28;
400   l_rec.egd_attribute29                  := p_egd_attribute29;
401   l_rec.egd_attribute30                  := p_egd_attribute30;
402   l_rec.request_id                       := p_request_id;
403   l_rec.program_application_id           := p_program_application_id;
404   l_rec.program_id                       := p_program_id;
405   l_rec.program_update_date              := p_program_update_date;
406   l_rec.object_version_number            := p_object_version_number;
407   --
408   -- Return the plsql record structure.
409   --
410   hr_utility.set_location(' Leaving:'||l_proc, 10);
411   Return(l_rec);
412 --
413 End convert_args;
414 --
415 end ben_egd_shd;