DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_DSQ_SHD

Source


1 Package Body ben_dsq_shd as
2 /* $Header: bedsqrhi.pkb 115.7 2002/12/09 12:49:41 lakrish ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_dsq_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_DED_SCHED_PY_FREQ_PK') 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_ACTY_RT_DED_SCHED_F_FK2') Then
42     ben_utility.child_exists_error(p_table_name => 'BEN_ACTY_RT_DED_SCHED_F');
43   ElsIf (p_constraint_name = 'BEN_PERD_TO_PROC_FK2') Then
44     ben_utility.child_exists_error(p_table_name => 'BEN_PERD_TO_PROC');
45   Else
46     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
47     fnd_message.set_token('PROCEDURE', l_proc);
48     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
49     fnd_message.raise_error;
50   End If;
51   --
52   hr_utility.set_location(' Leaving:'||l_proc, 10);
53 End constraint_error;
54 --
55 -- ----------------------------------------------------------------------------
56 -- |-----------------------------< api_updating >-----------------------------|
57 -- ----------------------------------------------------------------------------
58 Function api_updating
59   (
60   p_ded_sched_py_freq_id               in number,
61   p_object_version_number              in number
62   )      Return Boolean Is
63 --
64   --
65   -- Cursor selects the 'current' row from the HR Schema
66   --
67   Cursor C_Sel1 is
68     select
69 		ded_sched_py_freq_id,
70 	py_freq_cd,
71 	dflt_flag,
72 	acty_rt_ded_sched_id,
73 	business_group_id,
74 	dsq_attribute_category,
75 	dsq_attribute1,
76 	dsq_attribute2,
77 	dsq_attribute3,
78 	dsq_attribute4,
79 	dsq_attribute5,
80 	dsq_attribute6,
81 	dsq_attribute7,
82 	dsq_attribute8,
83 	dsq_attribute9,
84 	dsq_attribute10,
85 	dsq_attribute11,
86 	dsq_attribute12,
87 	dsq_attribute13,
88 	dsq_attribute14,
89 	dsq_attribute15,
90 	dsq_attribute16,
91 	dsq_attribute17,
92 	dsq_attribute18,
93 	dsq_attribute19,
94 	dsq_attribute20,
95 	dsq_attribute21,
96 	dsq_attribute22,
97 	dsq_attribute23,
98 	dsq_attribute24,
99 	dsq_attribute25,
100 	dsq_attribute26,
101 	dsq_attribute27,
102 	dsq_attribute28,
103 	dsq_attribute29,
104 	dsq_attribute30,
105 	object_version_number
106     from	ben_ded_sched_py_freq
107     where	ded_sched_py_freq_id = p_ded_sched_py_freq_id;
108 --
109   l_proc	varchar2(72)	:= g_package||'api_updating';
110   l_fct_ret	boolean;
111 --
112 Begin
113   hr_utility.set_location('Entering:'||l_proc, 5);
114   --
115   If (
116 	p_ded_sched_py_freq_id is null and
117 	p_object_version_number is null
118      ) Then
119     --
120     -- One of the primary key arguments is null therefore we must
121     -- set the returning function value to false
122     --
123     l_fct_ret := false;
124   Else
125     If (
126 	p_ded_sched_py_freq_id = g_old_rec.ded_sched_py_freq_id and
127 	p_object_version_number = g_old_rec.object_version_number
128        ) Then
129       hr_utility.set_location(l_proc, 10);
130       --
131       -- The g_old_rec is current therefore we must
132       -- set the returning function to true
133       --
134       l_fct_ret := true;
135     Else
136       --
137       -- Select the current row into g_old_rec
138       --
139       Open C_Sel1;
140       Fetch C_Sel1 Into g_old_rec;
141       If C_Sel1%notfound Then
142         Close C_Sel1;
143         --
144         -- The primary key is invalid therefore we must error
145         --
146         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
147         fnd_message.raise_error;
148       End If;
149       Close C_Sel1;
150       If (p_object_version_number <> g_old_rec.object_version_number) Then
151         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
152         fnd_message.raise_error;
153       End If;
154       hr_utility.set_location(l_proc, 15);
155       l_fct_ret := true;
156     End If;
157   End If;
158   hr_utility.set_location(' Leaving:'||l_proc, 20);
159   Return (l_fct_ret);
160 --
161 End api_updating;
162 --
163 -- ----------------------------------------------------------------------------
164 -- |---------------------------------< lck >----------------------------------|
165 -- ----------------------------------------------------------------------------
166 Procedure lck
167   (
168   p_ded_sched_py_freq_id               in number,
169   p_object_version_number              in number
170   ) is
171 --
172 -- Cursor selects the 'current' row from the HR Schema
173 --
174   Cursor C_Sel1 is
175     select 	ded_sched_py_freq_id,
176 	py_freq_cd,
177 	dflt_flag,
178 	acty_rt_ded_sched_id,
179 	business_group_id,
180 	dsq_attribute_category,
181 	dsq_attribute1,
182 	dsq_attribute2,
183 	dsq_attribute3,
184 	dsq_attribute4,
185 	dsq_attribute5,
186 	dsq_attribute6,
187 	dsq_attribute7,
188 	dsq_attribute8,
189 	dsq_attribute9,
190 	dsq_attribute10,
191 	dsq_attribute11,
192 	dsq_attribute12,
193 	dsq_attribute13,
194 	dsq_attribute14,
195 	dsq_attribute15,
196 	dsq_attribute16,
197 	dsq_attribute17,
198 	dsq_attribute18,
199 	dsq_attribute19,
200 	dsq_attribute20,
201 	dsq_attribute21,
202 	dsq_attribute22,
203 	dsq_attribute23,
204 	dsq_attribute24,
205 	dsq_attribute25,
206 	dsq_attribute26,
207 	dsq_attribute27,
208 	dsq_attribute28,
209 	dsq_attribute29,
210 	dsq_attribute30,
211 	object_version_number
212     from	ben_ded_sched_py_freq
213     where	ded_sched_py_freq_id = p_ded_sched_py_freq_id
214     for	update nowait;
215 --
216   l_proc	varchar2(72) := g_package||'lck';
217 --
218 Begin
219   hr_utility.set_location('Entering:'||l_proc, 5);
220   --
221   -- Add any mandatory argument checking here:
222   -- Example:
223   -- hr_api.mandatory_arg_error
224   --   (p_api_name       => l_proc,
225   --    p_argument       => 'object_version_number',
226   --    p_argument_value => p_object_version_number);
227   --
228   Open  C_Sel1;
229   Fetch C_Sel1 Into g_old_rec;
230   If C_Sel1%notfound then
231     Close C_Sel1;
232     --
233     -- The primary key is invalid therefore we must error
234     --
235     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
236     fnd_message.raise_error;
237   End If;
238   Close C_Sel1;
239   If (p_object_version_number <> g_old_rec.object_version_number) Then
240         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
241         fnd_message.raise_error;
242       End If;
243 --
244   hr_utility.set_location(' Leaving:'||l_proc, 10);
245 --
246 -- We need to trap the ORA LOCK exception
247 --
248 Exception
249   When HR_Api.Object_Locked then
250     --
251     -- The object is locked therefore we need to supply a meaningful
252     -- error message.
253     --
254     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
255     fnd_message.set_token('TABLE_NAME', 'ben_ded_sched_py_freq');
256     fnd_message.raise_error;
257 End lck;
258 --
259 -- ----------------------------------------------------------------------------
260 -- |-----------------------------< convert_args >-----------------------------|
261 -- ----------------------------------------------------------------------------
262 Function convert_args
263 	(
264 	p_ded_sched_py_freq_id          in number,
265 	p_py_freq_cd                    in varchar2,
266 	p_dflt_flag                     in varchar2,
267 	p_acty_rt_ded_sched_id          in number,
268 	p_business_group_id             in number,
269 	p_dsq_attribute_category        in varchar2,
270 	p_dsq_attribute1                in varchar2,
271 	p_dsq_attribute2                in varchar2,
272 	p_dsq_attribute3                in varchar2,
273 	p_dsq_attribute4                in varchar2,
274 	p_dsq_attribute5                in varchar2,
275 	p_dsq_attribute6                in varchar2,
276 	p_dsq_attribute7                in varchar2,
277 	p_dsq_attribute8                in varchar2,
278 	p_dsq_attribute9                in varchar2,
279 	p_dsq_attribute10               in varchar2,
280 	p_dsq_attribute11               in varchar2,
281 	p_dsq_attribute12               in varchar2,
282 	p_dsq_attribute13               in varchar2,
283 	p_dsq_attribute14               in varchar2,
284 	p_dsq_attribute15               in varchar2,
285 	p_dsq_attribute16               in varchar2,
286 	p_dsq_attribute17               in varchar2,
287 	p_dsq_attribute18               in varchar2,
288 	p_dsq_attribute19               in varchar2,
289 	p_dsq_attribute20               in varchar2,
290 	p_dsq_attribute21               in varchar2,
291 	p_dsq_attribute22               in varchar2,
292 	p_dsq_attribute23               in varchar2,
293 	p_dsq_attribute24               in varchar2,
294 	p_dsq_attribute25               in varchar2,
295 	p_dsq_attribute26               in varchar2,
296 	p_dsq_attribute27               in varchar2,
297 	p_dsq_attribute28               in varchar2,
298 	p_dsq_attribute29               in varchar2,
299 	p_dsq_attribute30               in varchar2,
300 	p_object_version_number         in number
301 	)
302 	Return g_rec_type is
303 --
304   l_rec	  g_rec_type;
305   l_proc  varchar2(72) := g_package||'convert_args';
306 --
307 Begin
308   --
309   hr_utility.set_location('Entering:'||l_proc, 5);
310   --
311   -- Convert arguments into local l_rec structure.
312   --
313   l_rec.ded_sched_py_freq_id             := p_ded_sched_py_freq_id;
314   l_rec.py_freq_cd                       := p_py_freq_cd;
315   l_rec.dflt_flag                        := p_dflt_flag;
316   l_rec.acty_rt_ded_sched_id             := p_acty_rt_ded_sched_id;
317   l_rec.business_group_id                := p_business_group_id;
318   l_rec.dsq_attribute_category           := p_dsq_attribute_category;
319   l_rec.dsq_attribute1                   := p_dsq_attribute1;
320   l_rec.dsq_attribute2                   := p_dsq_attribute2;
321   l_rec.dsq_attribute3                   := p_dsq_attribute3;
322   l_rec.dsq_attribute4                   := p_dsq_attribute4;
323   l_rec.dsq_attribute5                   := p_dsq_attribute5;
324   l_rec.dsq_attribute6                   := p_dsq_attribute6;
325   l_rec.dsq_attribute7                   := p_dsq_attribute7;
326   l_rec.dsq_attribute8                   := p_dsq_attribute8;
327   l_rec.dsq_attribute9                   := p_dsq_attribute9;
328   l_rec.dsq_attribute10                  := p_dsq_attribute10;
329   l_rec.dsq_attribute11                  := p_dsq_attribute11;
330   l_rec.dsq_attribute12                  := p_dsq_attribute12;
331   l_rec.dsq_attribute13                  := p_dsq_attribute13;
332   l_rec.dsq_attribute14                  := p_dsq_attribute14;
333   l_rec.dsq_attribute15                  := p_dsq_attribute15;
334   l_rec.dsq_attribute16                  := p_dsq_attribute16;
335   l_rec.dsq_attribute17                  := p_dsq_attribute17;
336   l_rec.dsq_attribute18                  := p_dsq_attribute18;
337   l_rec.dsq_attribute19                  := p_dsq_attribute19;
338   l_rec.dsq_attribute20                  := p_dsq_attribute20;
339   l_rec.dsq_attribute21                  := p_dsq_attribute21;
340   l_rec.dsq_attribute22                  := p_dsq_attribute22;
341   l_rec.dsq_attribute23                  := p_dsq_attribute23;
342   l_rec.dsq_attribute24                  := p_dsq_attribute24;
343   l_rec.dsq_attribute25                  := p_dsq_attribute25;
344   l_rec.dsq_attribute26                  := p_dsq_attribute26;
345   l_rec.dsq_attribute27                  := p_dsq_attribute27;
346   l_rec.dsq_attribute28                  := p_dsq_attribute28;
347   l_rec.dsq_attribute29                  := p_dsq_attribute29;
348   l_rec.dsq_attribute30                  := p_dsq_attribute30;
349   l_rec.object_version_number            := p_object_version_number;
350   --
351   -- Return the plsql record structure.
352   --
353   hr_utility.set_location(' Leaving:'||l_proc, 10);
354   Return(l_rec);
355 --
356 End convert_args;
357 --
358 end ben_dsq_shd;