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