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