DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_AMP_SHD

Source


1 Package Body pay_amp_shd as
2 /* $Header: pyamprhi.pkb 120.0.12000000.1 2007/01/17 15:29:47 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33);  -- Global package name
9 --
13 Function return_api_dml_status Return Boolean Is
10 -- ----------------------------------------------------------------------------
11 -- |------------------------< return_api_dml_status >-------------------------|
12 -- ----------------------------------------------------------------------------
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);
29 --
30 Begin
31   l_proc := g_package||'constraint_error';
32   --
33   If (p_constraint_name = 'PAY_AU_MODULE_PARAMETERS_CHK1') Then
34     fnd_message.set_name('PER', 'PER_52500_INV_YES_NO_FLAG');
35     fnd_message.raise_error;
36   ElsIf (p_constraint_name = 'PAY_AU_MODULE_PARAMETERS_CHK2') Then
37     fnd_message.set_name('PER', 'PER_52500_INV_YES_NO_FLAG');
38     fnd_message.raise_error;
39   ElsIf (p_constraint_name = 'PAY_AU_MODULE_PARAMETERS_CHK3') Then
40     fnd_message.set_name('PER', 'PER_52500_INV_YES_NO_FLAG');
41     fnd_message.raise_error;
42   ElsIf (p_constraint_name = 'PAY_AU_MODULE_PARAMETERS_CHK4') Then
43     fnd_message.set_name('PER', 'PER_52500_INV_YES_NO_FLAG');
44     fnd_message.raise_error;
45   ElsIf (p_constraint_name = 'PAY_AU_MODULE_PARAMETERS_CHK5') Then
46     fnd_message.set_name('PER', 'PER_52500_INV_YES_NO_FLAG');
47     fnd_message.raise_error;
48   ElsIf (p_constraint_name = 'PAY_AU_MODULE_PARAMETERS_CHK6') Then
49     fnd_message.set_name('PER', 'PER_52500_INV_YES_NO_FLAG');
50     fnd_message.raise_error;
51   ElsIf (p_constraint_name = 'PAY_AU_MODULE_PARAMETERS_CHK7') Then
52     fnd_message.set_name('PAY', 'HR_AU_DATA_TYPE_MISMATCH');
53     fnd_message.raise_error;
54   ElsIf (p_constraint_name = 'PAY_AU_MODULE_PARAMETERS_CHK8') Then
55     fnd_message.set_name('PER', 'PER_52500_INV_YES_NO_FLAG');
56     fnd_message.raise_error;
57   ElsIf (p_constraint_name = 'PAY_AU_MODULE_PARAMETERS_FK1') Then
58     fnd_message.set_name('PAY','HR_NZ_INVALID_MODULE');
59     fnd_message.raise_error;
60   ElsIf (p_constraint_name = 'PAY_AU_MODULE_PARAMETERS_PK') Then
61     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
62     fnd_message.set_token('PROCEDURE', l_proc);
63     fnd_message.set_token('STEP','50');
64     fnd_message.raise_error;
65   ElsIf (p_constraint_name = 'PAY_AU_MODULE_PARAMETERS_UK1') Then
66     fnd_message.set_name('PAY', 'PER_7901_SYS_DUPLICATE_RECORDS');
67     fnd_message.raise_error;
68   Else
69     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
70     fnd_message.set_token('PROCEDURE', l_proc);
71     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
72     fnd_message.raise_error;
73   End If;
74   --
75 End constraint_error;
76 --
77 -- ----------------------------------------------------------------------------
78 -- |-----------------------------< api_updating >-----------------------------|
79 -- ----------------------------------------------------------------------------
80 Function api_updating
81   (p_module_parameter_id                  in     number
82   ,p_object_version_number                in     number
83   )
84   Return Boolean Is
85   --
86   --
87   -- Cursor selects the 'current' row from the HR Schema
88   --
89   Cursor C_Sel1 is
90     select
91        module_parameter_id
92       ,module_id
93       ,internal_name
94       ,data_type
95       ,input_flag
96       ,context_flag
97       ,output_flag
98       ,result_flag
99       ,error_message_flag
100       ,function_return_flag
101       ,enabled_flag
102       ,external_name
103       ,database_item_name
104       ,constant_value
105       ,object_version_number
106     from        pay_au_module_parameters
107     where       module_parameter_id = p_module_parameter_id;
108   --
109   l_fct_ret     boolean;
110   --
111 Begin
112   --
113   If (p_module_parameter_id is null and
114       p_object_version_number is null
115      ) Then
116     --
117     -- One of the primary key arguments is null therefore we must
118     -- set the returning function value to false
119     --
120     l_fct_ret := false;
121   Else
122     If (p_module_parameter_id
123         = pay_amp_shd.g_old_rec.module_parameter_id and
124         p_object_version_number
125         = pay_amp_shd.g_old_rec.object_version_number
126        ) Then
127       --
128       -- The g_old_rec is current therefore we must
129       -- set the returning function to true
130       --
131       l_fct_ret := true;
132     Else
133       --
134       -- Select the current row into g_old_rec
135       --
136       Open C_Sel1;
137       Fetch C_Sel1 Into pay_amp_shd.g_old_rec;
138       If C_Sel1%notfound Then
139         Close C_Sel1;
140         --
141         -- The primary key is invalid therefore we must error
142         --
143         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
144         fnd_message.raise_error;
145       End If;
146       Close C_Sel1;
147       If (p_object_version_number
148           <> pay_amp_shd.g_old_rec.object_version_number) Then
149         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
150         fnd_message.raise_error;
151       End If;
155   Return (l_fct_ret);
152       l_fct_ret := true;
153     End If;
154   End If;
156 --
157 End api_updating;
158 --
159 -- ----------------------------------------------------------------------------
160 -- |---------------------------------< lck >----------------------------------|
161 -- ----------------------------------------------------------------------------
162 Procedure lck
163   (p_module_parameter_id                  in     number
164   ,p_object_version_number                in     number
165   ) is
166 --
167 -- Cursor selects the 'current' row from the HR Schema
168 --
169   Cursor C_Sel1 is
170     select
171        module_parameter_id
172       ,module_id
173       ,internal_name
174       ,data_type
175       ,input_flag
176       ,context_flag
177       ,output_flag
178       ,result_flag
179       ,error_message_flag
180       ,function_return_flag
181       ,enabled_flag
182       ,external_name
183       ,database_item_name
184       ,constant_value
185       ,object_version_number
186     from        pay_au_module_parameters
187     where       module_parameter_id = p_module_parameter_id
188     for update nowait;
189 --
190   l_proc        varchar2(72);
191 --
192 Begin
193   l_proc := g_package||'lck';
194   --
195   hr_utility.set_location('Entering:'||l_proc, 5);
196   --
197   hr_api.mandatory_arg_error
198     (p_api_name           => l_proc
199     ,p_argument           => 'MODULE_PARAMETER_ID'
200     ,p_argument_value     => p_module_parameter_id
201     );
202   hr_utility.set_location(l_proc,6);
203   hr_api.mandatory_arg_error
204     (p_api_name           => l_proc
205     ,p_argument           => 'OBJECT_VERSION_NUMBER'
206     ,p_argument_value     => p_object_version_number
207     );
208   --
209   Open  C_Sel1;
210   Fetch C_Sel1 Into pay_amp_shd.g_old_rec;
211   If C_Sel1%notfound then
212     Close C_Sel1;
213     --
214     -- The primary key is invalid therefore we must error
215     --
216     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
217     fnd_message.raise_error;
218   End If;
219   Close C_Sel1;
220   If (p_object_version_number
221       <> pay_amp_shd.g_old_rec.object_version_number) Then
222         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
223         fnd_message.raise_error;
224   End If;
225   --
226   hr_utility.set_location(' Leaving:'||l_proc, 10);
227   --
228   -- We need to trap the ORA LOCK exception
229   --
230 Exception
231   When HR_Api.Object_Locked then
232     --
233     -- The object is locked therefore we need to supply a meaningful
234     -- error message.
235     --
236     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
237     fnd_message.set_token('TABLE_NAME', 'pay_au_module_parameters');
238     fnd_message.raise_error;
239 End lck;
240 --
241 -- ----------------------------------------------------------------------------
242 -- |-----------------------------< convert_args >-----------------------------|
243 -- ----------------------------------------------------------------------------
244 Function convert_args
245   (p_module_parameter_id            in number
246   ,p_module_id                      in number
247   ,p_internal_name                  in varchar2
248   ,p_data_type                      in varchar2
249   ,p_input_flag                     in varchar2
250   ,p_context_flag                   in varchar2
251   ,p_output_flag                    in varchar2
252   ,p_result_flag                    in varchar2
253   ,p_error_message_flag             in varchar2
254   ,p_function_return_flag           in varchar2
255   ,p_enabled_flag                   in varchar2
256   ,p_external_name                  in varchar2
257   ,p_database_item_name             in varchar2
258   ,p_constant_value                 in varchar2
259   ,p_object_version_number          in number
260   )
261   Return g_rec_type is
262 --
263   l_rec   g_rec_type;
264 --
265 Begin
266   --
267   -- Convert arguments into local l_rec structure.
268   --
269   l_rec.module_parameter_id              := p_module_parameter_id;
270   l_rec.module_id                        := p_module_id;
271   l_rec.internal_name                    := p_internal_name;
272   l_rec.data_type                        := p_data_type;
273   l_rec.input_flag                       := p_input_flag;
274   l_rec.context_flag                     := p_context_flag;
275   l_rec.output_flag                      := p_output_flag;
276   l_rec.result_flag                      := p_result_flag;
277   l_rec.error_message_flag               := p_error_message_flag;
278   l_rec.function_return_flag             := p_function_return_flag;
279   l_rec.enabled_flag                     := p_enabled_flag;
280   l_rec.external_name                    := p_external_name;
281   l_rec.database_item_name               := p_database_item_name;
282   l_rec.constant_value                   := p_constant_value;
283   l_rec.object_version_number            := p_object_version_number;
284   --
285   -- Return the plsql record structure.
286   --
287   Return(l_rec);
288 --
289 End convert_args;
290 --
291 begin
292   g_package := '  pay_amp_shd.';  -- Global package name
293 end pay_amp_shd;