DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_EIV_SHD

Source


1 Package Body ben_eiv_shd as
2 /* $Header: beeivrhi.pkb 115.4 2002/12/22 20:25:28 pabodla noship $ */
3 --
7 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
8 g_package  varchar2(33) := '  ben_eiv_shd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------< return_api_dml_status >-------------------------|
12 -- ----------------------------------------------------------------------------
13 Function return_api_dml_status Return Boolean Is
14 --
15 Begin
16   --
17   Return (nvl(g_api_dml, false));
18   --
19 End return_api_dml_status;
20 --
21 -- ----------------------------------------------------------------------------
22 -- |---------------------------< constraint_error >---------------------------|
23 -- ----------------------------------------------------------------------------
24 Procedure constraint_error
25   (p_constraint_name in all_constraints.constraint_name%TYPE
26   ) Is
27 --
28   l_proc        varchar2(72) := g_package||'constraint_error';
29 --
30 Begin
31   --
32   If (p_constraint_name = 'BEN_EXTRA_INPUT_VALUES_PK') Then
33     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
34     fnd_message.set_token('PROCEDURE', l_proc);
35     fnd_message.set_token('STEP','5');
36     fnd_message.raise_error;
37   Else
38     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
39     fnd_message.set_token('PROCEDURE', l_proc);
40     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
41     fnd_message.raise_error;
42   End If;
43   --
44 End constraint_error;
45 --
46 -- ----------------------------------------------------------------------------
47 -- |-----------------------------< api_updating >-----------------------------|
48 -- ----------------------------------------------------------------------------
49 Function api_updating
50   (p_extra_input_value_id                 in     number
51   ,p_object_version_number                in     number
52   )
53   Return Boolean Is
54   --
55   --
56   -- Cursor selects the 'current' row from the HR Schema
57   --
58   Cursor C_Sel1 is
59     select
60        extra_input_value_id
61       ,acty_base_rt_id
62       ,input_value_id
63       ,input_text
64       ,upd_when_ele_ended_cd
65       ,return_var_name
66       ,business_group_id
67       ,eiv_attribute_category
68       ,eiv_attribute1
69       ,eiv_attribute2
70       ,eiv_attribute3
71       ,eiv_attribute4
72       ,eiv_attribute5
73       ,eiv_attribute6
74       ,eiv_attribute7
75       ,eiv_attribute8
76       ,eiv_attribute9
77       ,eiv_attribute10
78       ,eiv_attribute11
79       ,eiv_attribute12
80       ,eiv_attribute13
81       ,eiv_attribute14
82       ,eiv_attribute15
83       ,eiv_attribute16
84       ,eiv_attribute17
85       ,eiv_attribute18
86       ,eiv_attribute19
87       ,eiv_attribute20
88       ,eiv_attribute21
89       ,eiv_attribute22
90       ,eiv_attribute23
91       ,eiv_attribute24
92       ,eiv_attribute25
93       ,eiv_attribute26
94       ,eiv_attribute27
95       ,eiv_attribute28
96       ,eiv_attribute29
97       ,eiv_attribute30
98       ,object_version_number
99     from        ben_extra_input_values
100     where       extra_input_value_id = p_extra_input_value_id;
101   --
102   l_fct_ret     boolean;
103   --
104 Begin
105   --
106   If (p_extra_input_value_id is null and
107       p_object_version_number is null
108      ) Then
109     --
110     -- One of the primary key arguments is null therefore we must
111     -- set the returning function value to false
112     --
113     l_fct_ret := false;
114   Else
115     If (p_extra_input_value_id
116         = ben_eiv_shd.g_old_rec.extra_input_value_id and
117         p_object_version_number
118         = ben_eiv_shd.g_old_rec.object_version_number
119        ) Then
120       --
121       -- The g_old_rec is current therefore we must
122       -- set the returning function to true
123       --
124       l_fct_ret := true;
125     Else
126       --
127       -- Select the current row into g_old_rec
128       --
129       Open C_Sel1;
130       Fetch C_Sel1 Into ben_eiv_shd.g_old_rec;
131       If C_Sel1%notfound Then
132         Close C_Sel1;
133         --
134         -- The primary key is invalid therefore we must error
135         --
136         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
137         fnd_message.raise_error;
138       End If;
139       Close C_Sel1;
140       If (p_object_version_number
141           <> ben_eiv_shd.g_old_rec.object_version_number) Then
142         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
143         fnd_message.raise_error;
144       End If;
145       l_fct_ret := true;
146     End If;
147   End If;
148   Return (l_fct_ret);
149 --
150 End api_updating;
151 --
152 -- ----------------------------------------------------------------------------
153 -- |---------------------------------< lck >----------------------------------|
154 -- ----------------------------------------------------------------------------
155 Procedure lck
156   (p_extra_input_value_id                 in     number
157   ,p_object_version_number                in     number
158   ) is
159 --
160 -- Cursor selects the 'current' row from the HR Schema
161 --
162   Cursor C_Sel1 is
163     select
164        extra_input_value_id
165       ,acty_base_rt_id
166       ,input_value_id
167       ,input_text
168       ,upd_when_ele_ended_cd
169       ,return_var_name
170       ,business_group_id
171       ,eiv_attribute_category
172       ,eiv_attribute1
173       ,eiv_attribute2
174       ,eiv_attribute3
175       ,eiv_attribute4
176       ,eiv_attribute5
177       ,eiv_attribute6
178       ,eiv_attribute7
179       ,eiv_attribute8
180       ,eiv_attribute9
181       ,eiv_attribute10
182       ,eiv_attribute11
183       ,eiv_attribute12
184       ,eiv_attribute13
185       ,eiv_attribute14
186       ,eiv_attribute15
187       ,eiv_attribute16
188       ,eiv_attribute17
189       ,eiv_attribute18
190       ,eiv_attribute19
191       ,eiv_attribute20
192       ,eiv_attribute21
193       ,eiv_attribute22
194       ,eiv_attribute23
195       ,eiv_attribute24
196       ,eiv_attribute25
197       ,eiv_attribute26
198       ,eiv_attribute27
199       ,eiv_attribute28
200       ,eiv_attribute29
201       ,eiv_attribute30
202       ,object_version_number
203     from        ben_extra_input_values
204     where       extra_input_value_id = p_extra_input_value_id
205     for update nowait;
206 --
207   l_proc        varchar2(72) := g_package||'lck';
208 --
209 Begin
210   hr_utility.set_location('Entering:'||l_proc, 5);
211   --
212   hr_api.mandatory_arg_error
213     (p_api_name           => l_proc
214     ,p_argument           => 'EXTRA_INPUT_VALUE_ID'
215     ,p_argument_value     => p_extra_input_value_id
216     );
217   hr_utility.set_location(l_proc,6);
218   hr_api.mandatory_arg_error
219     (p_api_name           => l_proc
220     ,p_argument           => 'OBJECT_VERSION_NUMBER'
221     ,p_argument_value     => p_object_version_number
222     );
223   --
224   Open  C_Sel1;
225   Fetch C_Sel1 Into ben_eiv_shd.g_old_rec;
226   If C_Sel1%notfound then
227     Close C_Sel1;
228     --
229     -- The primary key is invalid therefore we must error
230     --
231     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
232     fnd_message.raise_error;
233   End If;
234   Close C_Sel1;
235   If (p_object_version_number
236       <> ben_eiv_shd.g_old_rec.object_version_number) Then
237         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
238         fnd_message.raise_error;
239   End If;
240   --
241   hr_utility.set_location(' Leaving:'||l_proc, 10);
242   --
243   -- We need to trap the ORA LOCK exception
244   --
245 Exception
246   When HR_Api.Object_Locked then
247     --
248     -- The object is locked therefore we need to supply a meaningful
249     -- error message.
250     --
251     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
252     fnd_message.set_token('TABLE_NAME', 'ben_extra_input_values');
253     fnd_message.raise_error;
254 End lck;
255 --
256 -- ----------------------------------------------------------------------------
257 -- |-----------------------------< convert_args >-----------------------------|
258 -- ----------------------------------------------------------------------------
259 Function convert_args
260   (p_extra_input_value_id           in number
261   ,p_acty_base_rt_id                in number
262   ,p_input_value_id                 in number
263   ,p_input_text                     in varchar2
264   ,p_upd_when_ele_ended_cd          in varchar2
265   ,p_return_var_name                in varchar2
266   ,p_business_group_id              in number
267   ,p_eiv_attribute_category         in varchar2
268   ,p_eiv_attribute1                 in varchar2
269   ,p_eiv_attribute2                 in varchar2
270   ,p_eiv_attribute3                 in varchar2
271   ,p_eiv_attribute4                 in varchar2
272   ,p_eiv_attribute5                 in varchar2
273   ,p_eiv_attribute6                 in varchar2
274   ,p_eiv_attribute7                 in varchar2
275   ,p_eiv_attribute8                 in varchar2
276   ,p_eiv_attribute9                 in varchar2
277   ,p_eiv_attribute10                in varchar2
278   ,p_eiv_attribute11                in varchar2
279   ,p_eiv_attribute12                in varchar2
280   ,p_eiv_attribute13                in varchar2
281   ,p_eiv_attribute14                in varchar2
282   ,p_eiv_attribute15                in varchar2
283   ,p_eiv_attribute16                in varchar2
284   ,p_eiv_attribute17                in varchar2
285   ,p_eiv_attribute18                in varchar2
286   ,p_eiv_attribute19                in varchar2
287   ,p_eiv_attribute20                in varchar2
288   ,p_eiv_attribute21                in varchar2
289   ,p_eiv_attribute22                in varchar2
290   ,p_eiv_attribute23                in varchar2
291   ,p_eiv_attribute24                in varchar2
292   ,p_eiv_attribute25                in varchar2
293   ,p_eiv_attribute26                in varchar2
294   ,p_eiv_attribute27                in varchar2
295   ,p_eiv_attribute28                in varchar2
296   ,p_eiv_attribute29                in varchar2
297   ,p_eiv_attribute30                in varchar2
298   ,p_object_version_number          in number
299   )
300   Return g_rec_type is
301 --
302   l_rec   g_rec_type;
303 --
304 Begin
305   --
306   -- Convert arguments into local l_rec structure.
307   --
308   l_rec.extra_input_value_id             := p_extra_input_value_id;
309   l_rec.acty_base_rt_id                  := p_acty_base_rt_id;
310   l_rec.input_value_id                   := p_input_value_id;
311   l_rec.input_text                       := p_input_text;
312   l_rec.upd_when_ele_ended_cd            := p_upd_when_ele_ended_cd;
313   l_rec.return_var_name                  := p_return_var_name;
314   l_rec.business_group_id                := p_business_group_id;
315   l_rec.eiv_attribute_category           := p_eiv_attribute_category;
316   l_rec.eiv_attribute1                   := p_eiv_attribute1;
317   l_rec.eiv_attribute2                   := p_eiv_attribute2;
318   l_rec.eiv_attribute3                   := p_eiv_attribute3;
319   l_rec.eiv_attribute4                   := p_eiv_attribute4;
320   l_rec.eiv_attribute5                   := p_eiv_attribute5;
321   l_rec.eiv_attribute6                   := p_eiv_attribute6;
322   l_rec.eiv_attribute7                   := p_eiv_attribute7;
323   l_rec.eiv_attribute8                   := p_eiv_attribute8;
324   l_rec.eiv_attribute9                   := p_eiv_attribute9;
325   l_rec.eiv_attribute10                  := p_eiv_attribute10;
326   l_rec.eiv_attribute11                  := p_eiv_attribute11;
327   l_rec.eiv_attribute12                  := p_eiv_attribute12;
328   l_rec.eiv_attribute13                  := p_eiv_attribute13;
329   l_rec.eiv_attribute14                  := p_eiv_attribute14;
330   l_rec.eiv_attribute15                  := p_eiv_attribute15;
331   l_rec.eiv_attribute16                  := p_eiv_attribute16;
332   l_rec.eiv_attribute17                  := p_eiv_attribute17;
333   l_rec.eiv_attribute18                  := p_eiv_attribute18;
334   l_rec.eiv_attribute19                  := p_eiv_attribute19;
335   l_rec.eiv_attribute20                  := p_eiv_attribute20;
336   l_rec.eiv_attribute21                  := p_eiv_attribute21;
337   l_rec.eiv_attribute22                  := p_eiv_attribute22;
338   l_rec.eiv_attribute23                  := p_eiv_attribute23;
339   l_rec.eiv_attribute24                  := p_eiv_attribute24;
340   l_rec.eiv_attribute25                  := p_eiv_attribute25;
341   l_rec.eiv_attribute26                  := p_eiv_attribute26;
342   l_rec.eiv_attribute27                  := p_eiv_attribute27;
343   l_rec.eiv_attribute28                  := p_eiv_attribute28;
344   l_rec.eiv_attribute29                  := p_eiv_attribute29;
345   l_rec.eiv_attribute30                  := p_eiv_attribute30;
346   l_rec.object_version_number            := p_object_version_number;
347   --
348   -- Return the plsql record structure.
349   --
350   Return(l_rec);
351 --
352 End convert_args;
353 --
354 end ben_eiv_shd;