[Home] [Help]
PACKAGE BODY: APPS.HR_FMP_SHD
Source
1 Package Body hr_fmp_shd as
2 /* $Header: hrfmprhi.pkb 115.5 2003/10/30 07:11:27 bsubrama noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' hr_fmp_shd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |---------------------------< constraint_error >---------------------------|
12 -- ----------------------------------------------------------------------------
13 Procedure constraint_error
14 (p_constraint_name in all_constraints.constraint_name%TYPE
15 ) Is
16 --
17 l_proc varchar2(72) := g_package||'constraint_error';
18 --
19 Begin
20 --
21 If (p_constraint_name = 'HR_FORM_PROPERTIES_FK2') Then
22 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
23 fnd_message.set_token('PROCEDURE', l_proc);
24 fnd_message.set_token('STEP','5');
25 fnd_message.raise_error;
26 ElsIf (p_constraint_name = 'HR_FORM_PROPERTIES_PK') Then
27 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
28 fnd_message.set_token('PROCEDURE', l_proc);
29 fnd_message.set_token('STEP','10');
30 fnd_message.raise_error;
31 ElsIf (p_constraint_name = 'HR_FORM_PROPERTIES_UK') Then
32 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
33 fnd_message.set_token('PROCEDURE', l_proc);
34 fnd_message.set_token('STEP','15');
35 fnd_message.raise_error;
36 Else
37 fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
38 fnd_message.set_token('PROCEDURE', l_proc);
39 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
40 fnd_message.raise_error;
41 End If;
42 --
43 End constraint_error;
44 --
45 -- ----------------------------------------------------------------------------
46 -- |-----------------------------< api_updating >-----------------------------|
47 -- ----------------------------------------------------------------------------
48 Function api_updating
49 (p_form_property_id in number
50 ,p_object_version_number in number
51 )
52 Return Boolean Is
53 --
54 --
55 -- Cursor selects the 'current' row from the HR Schema
56 --
57 Cursor C_Sel1 is
58 select
59 form_property_id
60 ,object_version_number
61 ,application_id
62 ,form_id
63 ,form_template_id
64 ,help_target
65 ,information_category
66 ,information1
67 ,information2
68 ,information3
69 ,information4
70 ,information5
71 ,information6
72 ,information7
73 ,information8
74 ,information9
75 ,information10
76 ,information11
77 ,information12
78 ,information13
79 ,information14
80 ,information15
81 ,information16
82 ,information17
83 ,information18
84 ,information19
85 ,information20
86 ,information21
87 ,information22
88 ,information23
89 ,information24
90 ,information25
91 ,information26
92 ,information27
93 ,information28
94 ,information29
95 ,information30
96 from hr_form_properties
97 where form_property_id = p_form_property_id;
98 --
99 l_fct_ret boolean;
100 --
101 Begin
102 --
103 If (p_form_property_id is null and
104 p_object_version_number is null
105 ) Then
106 --
107 -- One of the primary key arguments is null therefore we must
108 -- set the returning function value to false
109 --
110 l_fct_ret := false;
111 Else
112 If (p_form_property_id
113 = hr_fmp_shd.g_old_rec.form_property_id and
114 p_object_version_number
115 = hr_fmp_shd.g_old_rec.object_version_number
116 ) Then
117 --
118 -- The g_old_rec is current therefore we must
119 -- set the returning function to true
120 --
121 l_fct_ret := true;
122 Else
123 --
124 -- Select the current row into g_old_rec
125 --
126 Open C_Sel1;
127 Fetch C_Sel1 Into hr_fmp_shd.g_old_rec;
128 If C_Sel1%notfound Then
129 Close C_Sel1;
130
131 --
132 -- The primary key is invalid therefore we must error
133 --
134 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
135 fnd_message.raise_error;
136 End If;
137 Close C_Sel1;
138 --
139 If (p_object_version_number
140 <> hr_tdg_shd.g_old_rec.object_version_number) Then
141 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
142 fnd_message.raise_error;
143 end if;
144 l_fct_ret := true;
145 End If;
146 End If;
147 Return (l_fct_ret);
148 --
149 End api_updating;
150 --
151 -- ----------------------------------------------------------------------------
152 -- |---------------------------------< lck >----------------------------------|
153 -- ----------------------------------------------------------------------------
154 Procedure lck
155 (p_form_property_id in number
156 ,p_object_version_number in number
157 ) is
158 --
159 -- Cursor selects the 'current' row from the HR Schema
160 --
161 Cursor C_Sel1 is
162 select
163 form_property_id
164 ,object_version_number
165 ,application_id
166 ,form_id
167 ,form_template_id
168 ,help_target
169 ,information_category
170 ,information1
171 ,information2
172 ,information3
173 ,information4
174 ,information5
175 ,information6
176 ,information7
177 ,information8
178 ,information9
179 ,information10
180 ,information11
181 ,information12
182 ,information13
183 ,information14
184 ,information15
185 ,information16
186 ,information17
187 ,information18
188 ,information19
189 ,information20
190 ,information21
191 ,information22
192 ,information23
193 ,information24
194 ,information25
195 ,information26
196 ,information27
197 ,information28
198 ,information29
199 ,information30
200 from hr_form_properties
201 where form_property_id = p_form_property_id
202 for update nowait;
203 --
204 l_proc varchar2(72) := g_package||'lck';
205 --
206 Begin
207 hr_utility.set_location('Entering:'||l_proc, 5);
208 --
209 hr_api.mandatory_arg_error
210 (p_api_name => l_proc
211 ,p_argument => 'FORM_PROPERTY_ID'
212 ,p_argument_value => p_form_property_id
213 );
214 --
215 hr_api.mandatory_arg_error
216 (p_api_name => l_proc
217 ,p_argument => 'object_version_number'
218 ,p_argument_value => p_object_version_number
219 );
220 Open C_Sel1;
221 Fetch C_Sel1 Into hr_fmp_shd.g_old_rec;
222 If C_Sel1%notfound then
223 Close C_Sel1;
224 --
225 -- The primary key is invalid therefore we must error
226 --
227 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
228 fnd_message.raise_error;
229 End If;
230 Close C_Sel1;
231 --
232 If (p_object_version_number
233 <> hr_tdg_shd.g_old_rec.object_version_number) Then
234 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
235 fnd_message.raise_error;
236 End If;
237 hr_utility.set_location(' Leaving:'||l_proc, 10);
238 --
239 -- We need to trap the ORA LOCK exception
240 --
241 Exception
242 When HR_Api.Object_Locked then
243 --
244 -- The object is locked therefore we need to supply a meaningful
245 -- error message.
246 --
247 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
248 fnd_message.set_token('TABLE_NAME', 'hr_form_properties');
249 fnd_message.raise_error;
250 End lck;
251 --
252 -- ----------------------------------------------------------------------------
253 -- |-----------------------------< convert_args >-----------------------------|
254 -- ----------------------------------------------------------------------------
255 Function convert_args
256 (p_form_property_id in number
257 ,p_object_version_number in number
258 ,p_application_id in number
259 ,p_form_id in number
260 ,p_form_template_id in number
261 ,p_help_target in varchar2
262 ,p_information_category in varchar2
263 ,p_information1 in varchar2
264 ,p_information2 in varchar2
265 ,p_information3 in varchar2
266 ,p_information4 in varchar2
267 ,p_information5 in varchar2
268 ,p_information6 in varchar2
269 ,p_information7 in varchar2
270 ,p_information8 in varchar2
271 ,p_information9 in varchar2
272 ,p_information10 in varchar2
273 ,p_information11 in varchar2
274 ,p_information12 in varchar2
275 ,p_information13 in varchar2
276 ,p_information14 in varchar2
277 ,p_information15 in varchar2
278 ,p_information16 in varchar2
279 ,p_information17 in varchar2
280 ,p_information18 in varchar2
281 ,p_information19 in varchar2
282 ,p_information20 in varchar2
283 ,p_information21 in varchar2
284 ,p_information22 in varchar2
285 ,p_information23 in varchar2
286 ,p_information24 in varchar2
287 ,p_information25 in varchar2
288 ,p_information26 in varchar2
289 ,p_information27 in varchar2
290 ,p_information28 in varchar2
291 ,p_information29 in varchar2
292 ,p_information30 in varchar2
293 )
294 Return g_rec_type is
295 --
296 l_rec g_rec_type;
297 --
298 Begin
299 --
300 -- Convert arguments into local l_rec structure.
301 --
302 l_rec.form_property_id := p_form_property_id;
303 l_rec.object_version_number := p_object_version_number;
304 l_rec.application_id := p_application_id;
305 l_rec.form_id := p_form_id;
306 l_rec.form_template_id := p_form_template_id;
307 l_rec.help_target := p_help_target;
308 l_rec.information_category := p_information_category;
309 l_rec.information1 := p_information1;
310 l_rec.information2 := p_information2;
311 l_rec.information3 := p_information3;
312 l_rec.information4 := p_information4;
313 l_rec.information5 := p_information5;
314 l_rec.information6 := p_information6;
315 l_rec.information7 := p_information7;
316 l_rec.information8 := p_information8;
317 l_rec.information9 := p_information9;
318 l_rec.information10 := p_information10;
319 l_rec.information11 := p_information11;
320 l_rec.information12 := p_information12;
321 l_rec.information13 := p_information13;
322 l_rec.information14 := p_information14;
323 l_rec.information15 := p_information15;
324 l_rec.information16 := p_information16;
325 l_rec.information17 := p_information17;
326 l_rec.information18 := p_information18;
327 l_rec.information19 := p_information19;
328 l_rec.information20 := p_information20;
329 l_rec.information21 := p_information21;
330 l_rec.information22 := p_information22;
331 l_rec.information23 := p_information23;
332 l_rec.information24 := p_information24;
333 l_rec.information25 := p_information25;
334 l_rec.information26 := p_information26;
335 l_rec.information27 := p_information27;
336 l_rec.information28 := p_information28;
337 l_rec.information29 := p_information29;
338 l_rec.information30 := p_information30;
339 --
340 -- Return the plsql record structure.
341 --
342 Return(l_rec);
343 --
344 End convert_args;
345 --
346 end hr_fmp_shd;