DBA Data[Home] [Help]

PACKAGE BODY: APPS.PSP_ERA_SHD

Source


1 Package Body psp_era_shd as
2 /* $Header: PSPEARHB.pls 120.2 2006/03/26 01:08 dpaudel noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  psp_era_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 = 'SYS_C00145528') 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   Else
27     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
28     fnd_message.set_token('PROCEDURE', l_proc);
29     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
30     fnd_message.raise_error;
31   End If;
32   --
33 End constraint_error;
34 --
35 -- ----------------------------------------------------------------------------
36 -- |-----------------------------< api_updating >-----------------------------|
37 -- ----------------------------------------------------------------------------
38 Function api_updating
39   (p_effort_report_approval_id            in     number
40   ,p_object_version_number                in     number
41   )
42   Return Boolean Is
43   --
44   --
45   -- Cursor selects the 'current' row from the HR Schema
46   --
47   Cursor C_Sel1 is
48     select
49        effort_report_approval_id
50       ,effort_report_detail_id
51       ,wf_role_name
52       ,wf_orig_system_id
53       ,wf_orig_system
54       ,approver_order_num
55       ,approval_status
56       ,response_date
57       ,actual_cost_share
58       ,overwritten_effort_percent
59       ,wf_item_key
60       ,comments
61       ,pera_information_category
62       ,pera_information1
63       ,pera_information2
64       ,pera_information3
65       ,pera_information4
66       ,pera_information5
67       ,pera_information6
68       ,pera_information7
69       ,pera_information8
70       ,pera_information9
71       ,pera_information10
72       ,pera_information11
73       ,pera_information12
74       ,pera_information13
75       ,pera_information14
76       ,pera_information15
77       ,pera_information16
78       ,pera_information17
79       ,pera_information18
80       ,pera_information19
81       ,pera_information20
82       ,wf_role_display_name
83       ,object_version_number
84       ,notification_id
85       ,eff_information_category
86       ,eff_information1
87       ,eff_information2
88       ,eff_information3
89       ,eff_information4
90       ,eff_information5
91       ,eff_information6
92       ,eff_information7
93       ,eff_information8
94       ,eff_information9
95       ,eff_information10
96       ,eff_information11
97       ,eff_information12
98       ,eff_information13
99       ,eff_information14
103   --
100       ,eff_information15
101     from        psp_eff_report_approvals
102     where       effort_report_approval_id = p_effort_report_approval_id;
104   l_fct_ret     boolean;
105   --
106 Begin
107   --
108   If (p_effort_report_approval_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_effort_report_approval_id
118         = psp_era_shd.g_old_rec.effort_report_approval_id and
119         p_object_version_number
120         = psp_era_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 psp_era_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           <> psp_era_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;
147       l_fct_ret := true;
148     End If;
149   End If;
150   Return (l_fct_ret);
151 --
152 End api_updating;
153 --
154 -- ----------------------------------------------------------------------------
155 -- |---------------------------------< lck >----------------------------------|
156 -- ----------------------------------------------------------------------------
157 Procedure lck
158   (p_effort_report_approval_id            in     number
159   ,p_object_version_number                in     number
160   ) is
161 --
162 -- Cursor selects the 'current' row from the HR Schema
163 --
164   Cursor C_Sel1 is
165     select
166        effort_report_approval_id
167       ,effort_report_detail_id
168       ,wf_role_name
169       ,wf_orig_system_id
170       ,wf_orig_system
171       ,approver_order_num
172       ,approval_status
173       ,response_date
174       ,actual_cost_share
175       ,overwritten_effort_percent
176       ,wf_item_key
177       ,comments
178       ,pera_information_category
179       ,pera_information1
180       ,pera_information2
181       ,pera_information3
182       ,pera_information4
183       ,pera_information5
184       ,pera_information6
185       ,pera_information7
186       ,pera_information8
187       ,pera_information9
188       ,pera_information10
189       ,pera_information11
190       ,pera_information12
191       ,pera_information13
192       ,pera_information14
193       ,pera_information15
194       ,pera_information16
195       ,pera_information17
196       ,pera_information18
197       ,pera_information19
198       ,pera_information20
199       ,wf_role_display_name
200       ,object_version_number
201       ,notification_id
202       ,eff_information_category
203       ,eff_information1
204       ,eff_information2
205       ,eff_information3
206       ,eff_information4
207       ,eff_information5
208       ,eff_information6
209       ,eff_information7
210       ,eff_information8
211       ,eff_information9
212       ,eff_information10
213       ,eff_information11
214       ,eff_information12
215       ,eff_information13
216       ,eff_information14
217       ,eff_information15
218     from        psp_eff_report_approvals
219     where       effort_report_approval_id = p_effort_report_approval_id
220     for update nowait;
221 --
222   l_proc        varchar2(72) := g_package||'lck';
223 --
224 Begin
225   hr_utility.set_location('Entering:'||l_proc, 5);
226   --
227   hr_api.mandatory_arg_error
228     (p_api_name           => l_proc
229     ,p_argument           => 'EFFORT_REPORT_APPROVAL_ID'
230     ,p_argument_value     => p_effort_report_approval_id
231     );
232   hr_utility.set_location(l_proc,6);
233   hr_api.mandatory_arg_error
234     (p_api_name           => l_proc
235     ,p_argument           => 'OBJECT_VERSION_NUMBER'
236     ,p_argument_value     => p_object_version_number
237     );
238   --
239   Open  C_Sel1;
240   Fetch C_Sel1 Into psp_era_shd.g_old_rec;
241   If C_Sel1%notfound then
242     Close C_Sel1;
243     --
244     -- The primary key is invalid therefore we must error
245     --
246     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
247     fnd_message.raise_error;
248   End If;
249   Close C_Sel1;
250   If (p_object_version_number
251       <> psp_era_shd.g_old_rec.object_version_number) Then
252         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
253         fnd_message.raise_error;
254   End If;
255   --
256   hr_utility.set_location(' Leaving:'||l_proc, 10);
257   --
258   -- We need to trap the ORA LOCK exception
259   --
260 Exception
261   When HR_Api.Object_Locked then
262     --
263     -- The object is locked therefore we need to supply a meaningful
267     fnd_message.set_token('TABLE_NAME', 'psp_eff_report_approvals');
264     -- error message.
265     --
266     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
268     fnd_message.raise_error;
269 End lck;
270 --
271 -- ----------------------------------------------------------------------------
272 -- |-----------------------------< convert_args >-----------------------------|
273 -- ----------------------------------------------------------------------------
274 Function convert_args
275   (p_effort_report_approval_id      in number
276   ,p_effort_report_detail_id        in number
277   ,p_wf_role_name                   in varchar2
278   ,p_wf_orig_system_id              in number
279   ,p_wf_orig_system                 in varchar2
280   ,p_approver_order_num             in number
281   ,p_approval_status                in varchar2
282   ,p_response_date                  in date
283   ,p_actual_cost_share              in number
284   ,p_overwritten_effort_percent     in number
285   ,p_wf_item_key                    in varchar2
286   ,p_comments                       in varchar2
287   ,p_pera_information_category      in varchar2
288   ,p_pera_information1              in varchar2
289   ,p_pera_information2              in varchar2
290   ,p_pera_information3              in varchar2
291   ,p_pera_information4              in varchar2
292   ,p_pera_information5              in varchar2
293   ,p_pera_information6              in varchar2
294   ,p_pera_information7              in varchar2
295   ,p_pera_information8              in varchar2
296   ,p_pera_information9              in varchar2
297   ,p_pera_information10             in varchar2
298   ,p_pera_information11             in varchar2
299   ,p_pera_information12             in varchar2
300   ,p_pera_information13             in varchar2
301   ,p_pera_information14             in varchar2
302   ,p_pera_information15             in varchar2
303   ,p_pera_information16             in varchar2
304   ,p_pera_information17             in varchar2
305   ,p_pera_information18             in varchar2
306   ,p_pera_information19             in varchar2
307   ,p_pera_information20             in varchar2
308   ,p_wf_role_display_name           in varchar2
309   ,p_object_version_number          in number
310   ,p_notification_id                in number
311   ,p_eff_information_category       in varchar2
312   ,p_eff_information1               in varchar2
313   ,p_eff_information2               in varchar2
314   ,p_eff_information3               in varchar2
315   ,p_eff_information4               in varchar2
316   ,p_eff_information5               in varchar2
317   ,p_eff_information6               in varchar2
318   ,p_eff_information7               in varchar2
319   ,p_eff_information8               in varchar2
320   ,p_eff_information9               in varchar2
321   ,p_eff_information10              in varchar2
322   ,p_eff_information11              in varchar2
323   ,p_eff_information12              in varchar2
324   ,p_eff_information13              in varchar2
325   ,p_eff_information14              in varchar2
326   ,p_eff_information15              in varchar2
327   )
328   Return g_rec_type is
329 --
330   l_rec   g_rec_type;
331 --
332 Begin
333   --
334   -- Convert arguments into local l_rec structure.
335   --
336   l_rec.effort_report_approval_id        := p_effort_report_approval_id;
337   l_rec.effort_report_detail_id          := p_effort_report_detail_id;
338   l_rec.wf_role_name                     := p_wf_role_name;
339   l_rec.wf_orig_system_id                := p_wf_orig_system_id;
340   l_rec.wf_orig_system                   := p_wf_orig_system;
341   l_rec.approver_order_num               := p_approver_order_num;
342   l_rec.approval_status                  := p_approval_status;
343   l_rec.response_date                    := p_response_date;
344   l_rec.actual_cost_share                := p_actual_cost_share;
345   l_rec.overwritten_effort_percent       := p_overwritten_effort_percent;
346   l_rec.wf_item_key                      := p_wf_item_key;
347   l_rec.comments                         := p_comments;
348   l_rec.pera_information_category        := p_pera_information_category;
349   l_rec.pera_information1                := p_pera_information1;
350   l_rec.pera_information2                := p_pera_information2;
351   l_rec.pera_information3                := p_pera_information3;
352   l_rec.pera_information4                := p_pera_information4;
353   l_rec.pera_information5                := p_pera_information5;
354   l_rec.pera_information6                := p_pera_information6;
355   l_rec.pera_information7                := p_pera_information7;
356   l_rec.pera_information8                := p_pera_information8;
357   l_rec.pera_information9                := p_pera_information9;
358   l_rec.pera_information10               := p_pera_information10;
359   l_rec.pera_information11               := p_pera_information11;
360   l_rec.pera_information12               := p_pera_information12;
361   l_rec.pera_information13               := p_pera_information13;
362   l_rec.pera_information14               := p_pera_information14;
363   l_rec.pera_information15               := p_pera_information15;
364   l_rec.pera_information16               := p_pera_information16;
365   l_rec.pera_information17               := p_pera_information17;
366   l_rec.pera_information18               := p_pera_information18;
367   l_rec.pera_information19               := p_pera_information19;
368   l_rec.pera_information20               := p_pera_information20;
369   l_rec.wf_role_display_name             := p_wf_role_display_name;
370   l_rec.object_version_number            := p_object_version_number;
371   l_rec.notification_id                  := p_notification_id;
372   l_rec.eff_information_category         := p_eff_information_category;
373   l_rec.eff_information1                 := p_eff_information1;
374   l_rec.eff_information2                 := p_eff_information2;
375   l_rec.eff_information3                 := p_eff_information3;
376   l_rec.eff_information4                 := p_eff_information4;
377   l_rec.eff_information5                 := p_eff_information5;
378   l_rec.eff_information6                 := p_eff_information6;
379   l_rec.eff_information7                 := p_eff_information7;
380   l_rec.eff_information8                 := p_eff_information8;
381   l_rec.eff_information9                 := p_eff_information9;
382   l_rec.eff_information10                := p_eff_information10;
383   l_rec.eff_information11                := p_eff_information11;
384   l_rec.eff_information12                := p_eff_information12;
385   l_rec.eff_information13                := p_eff_information13;
386   l_rec.eff_information14                := p_eff_information14;
387   l_rec.eff_information15                := p_eff_information15;
388   --
389   -- Return the plsql record structure.
390   --
391   Return(l_rec);
392 --
393 End convert_args;
394 --
395 end psp_era_shd;