[Home] [Help]
PACKAGE BODY: APPS.PAY_PBA_SHD
Source
4 -- ----------------------------------------------------------------------------
1 Package Body pay_pba_shd as
2 /* $Header: pypbarhi.pkb 120.1 2005/09/05 06:39:03 adkumar noship $ */
3 --
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pay_pba_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 = 'PAY_BALANCE_ATTRIBUTES_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 = 'PAY_BALANCE_ATTRIBUTES_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 = 'PAY_BALANCE_ATTRIBUTES_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 = 'PAY_BALANCE_ATTRIBUTES_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_balance_attribute_id in number
55 )
56 Return Boolean Is
57 --
58 --
59 -- Cursor selects the 'current' row from the HR Schema
60 --
61 Cursor C_Sel1 is
62 select
63 balance_attribute_id
64 ,attribute_id
65 ,defined_balance_id
66 ,legislation_code
67 ,business_group_id
68 from pay_balance_attributes
69 where balance_attribute_id = p_balance_attribute_id;
70 --
71 l_fct_ret boolean;
72 --
73 Begin
74 --
75 If (p_balance_attribute_id is null
76 ) Then
77 --
78 -- One of the primary key arguments is null therefore we must
79 -- set the returning function value to false
80 --
81 l_fct_ret := false;
82 Else
83 If (p_balance_attribute_id
84 = pay_pba_shd.g_old_rec.balance_attribute_id
85 ) Then
86 --
87 -- The g_old_rec is current therefore we must
88 -- set the returning function to true
89 --
90 l_fct_ret := true;
91 Else
92 --
93 -- Select the current row into g_old_rec
94 --
95 Open C_Sel1;
96 Fetch C_Sel1 Into pay_pba_shd.g_old_rec;
97 If C_Sel1%notfound Then
98 Close C_Sel1;
99 --
100 -- The primary key is invalid therefore we must error
101 --
102 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
103 fnd_message.raise_error;
104 End If;
105 Close C_Sel1;
106 --
110 Return (l_fct_ret);
107 l_fct_ret := true;
108 End If;
109 End If;
111 --
112 End api_updating;
113 --
114 -- ----------------------------------------------------------------------------
115 -- |---------------------------------< lck >----------------------------------|
116 -- ----------------------------------------------------------------------------
117 Procedure lck
118 (p_balance_attribute_id in number
119 ) is
120 --
121 -- Cursor selects the 'current' row from the HR Schema
122 --
123 Cursor C_Sel1 is
124 select
125 balance_attribute_id
126 ,attribute_id
127 ,defined_balance_id
128 ,legislation_code
129 ,business_group_id
130 from pay_balance_attributes
131 where balance_attribute_id = p_balance_attribute_id
132 for update nowait;
133 --
134 l_proc varchar2(72) := g_package||'lck';
135 --
136 Begin
137 hr_utility.set_location('Entering:'||l_proc, 5);
138 --
139 hr_api.mandatory_arg_error
140 (p_api_name => l_proc
141 ,p_argument => 'BALANCE_ATTRIBUTE_ID'
142 ,p_argument_value => p_balance_attribute_id
143 );
144 hr_utility.set_location(l_proc,6);
145 --
146 Open C_Sel1;
147 Fetch C_Sel1 Into pay_pba_shd.g_old_rec;
148 If C_Sel1%notfound then
149 Close C_Sel1;
150 --
151 -- The primary key is invalid therefore we must error
152 --
153 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
154 fnd_message.raise_error;
155 End If;
156 Close C_Sel1;
157 --
158 hr_utility.set_location(' Leaving:'||l_proc, 10);
159 --
160 -- We need to trap the ORA LOCK exception
161 --
162 Exception
163 When HR_Api.Object_Locked then
164 --
165 -- The object is locked therefore we need to supply a meaningful
166 -- error message.
167 --
168 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
169 fnd_message.set_token('TABLE_NAME', 'pay_balance_attributes');
170 fnd_message.raise_error;
171 End lck;
172 --
173 -- ----------------------------------------------------------------------------
174 -- |-----------------------------< convert_args >-----------------------------|
175 -- ----------------------------------------------------------------------------
176 Function convert_args
177 (p_balance_attribute_id in number
181 ,p_business_group_id in number
178 ,p_attribute_id in number
179 ,p_defined_balance_id in number
180 ,p_legislation_code in varchar2
182 )
183 Return g_rec_type is
184 --
185 l_rec g_rec_type;
186 --
187 Begin
188 --
189 -- Convert arguments into local l_rec structure.
190 --
191 l_rec.balance_attribute_id := p_balance_attribute_id;
192 l_rec.attribute_id := p_attribute_id;
193 l_rec.defined_balance_id := p_defined_balance_id;
194 l_rec.legislation_code := p_legislation_code;
195 l_rec.business_group_id := p_business_group_id;
196 --
197 -- Return the plsql record structure.
198 --
199 Return(l_rec);
200 --
201 End convert_args;
202 --
203 end pay_pba_shd;