DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQP_FFA_SHD

Source


1 Package Body pqp_ffa_shd as
2 /* $Header: pqffarhi.pkb 120.0 2006/04/26 23:47 pbhure noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pqp_ffa_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 
22   If (p_constraint_name = 'PQP_FLXDU_FUNC_ATTRIBUTES_PK') Then
23     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
24     fnd_message.set_token('PROCEDURE', l_proc);
25     fnd_message.set_token('STEP','5');
26     fnd_message.raise_error;
27   Else
28     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
29     fnd_message.set_token('PROCEDURE', l_proc);
30     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
31     fnd_message.raise_error;
32   End If;
33 
34   --
35 End constraint_error;
36 --
37 -- ----------------------------------------------------------------------------
38 -- |-----------------------------< api_updating >-----------------------------|
39 -- ----------------------------------------------------------------------------
40 Function api_updating
41   (p_flxdu_func_attribute_id              in     number
42   ,p_object_version_number                in     number
43   )
44   Return Boolean Is
45   --
46   --
47   -- Cursor selects the 'current' row from the HR Schema
48   --
49   Cursor C_Sel1 is
50     select
51        flxdu_func_attribute_id
52       ,flxdu_func_name
53       ,flxdu_func_source_type
54       ,flxdu_func_integrator_code
55       ,flxdu_func_xml_data
56       ,legislation_code
57       ,description
58       ,object_version_number
59     from        pqp_flxdu_func_attributes
60     where       flxdu_func_attribute_id = p_flxdu_func_attribute_id;
61   --
62   l_fct_ret     boolean;
63   --
64 Begin
65   --
66   If (p_flxdu_func_attribute_id is null and
67       p_object_version_number is null
68      ) Then
69     --
70     -- One of the primary key arguments is null therefore we must
71     -- set the returning function value to false
72     --
73     l_fct_ret := false;
74   Else
75     If (p_flxdu_func_attribute_id
76         = pqp_ffa_shd.g_old_rec.flxdu_func_attribute_id and
77         p_object_version_number
78         = pqp_ffa_shd.g_old_rec.object_version_number
79        ) Then
80       --
81       -- The g_old_rec is current therefore we must
82       -- set the returning function to true
83       --
84       l_fct_ret := true;
85     Else
86       --
87       -- Select the current row into g_old_rec
88       --
89       Open C_Sel1;
90       Fetch C_Sel1 Into pqp_ffa_shd.g_old_rec;
91       If C_Sel1%notfound Then
92         Close C_Sel1;
93         --
94         -- The primary key is invalid therefore we must error
95         --
96         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
97         fnd_message.raise_error;
98       End If;
99       Close C_Sel1;
100       If (p_object_version_number
101           <> pqp_ffa_shd.g_old_rec.object_version_number) Then
102         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
103         fnd_message.raise_error;
104       End If;
105       l_fct_ret := true;
106     End If;
107   End If;
108   Return (l_fct_ret);
109 --
110 End api_updating;
111 --
112 -- ----------------------------------------------------------------------------
113 -- |---------------------------------< lck >----------------------------------|
114 -- ----------------------------------------------------------------------------
115 Procedure lck
116   (p_flxdu_func_attribute_id              in     number
117   ,p_object_version_number                in     number
118   ) is
119 --
120 -- Cursor selects the 'current' row from the HR Schema
121 --
122   Cursor C_Sel1 is
123     select
124        flxdu_func_attribute_id
125       ,flxdu_func_name
126       ,flxdu_func_source_type
127       ,flxdu_func_integrator_code
128       ,flxdu_func_xml_data
129       ,legislation_code
130       ,description
131       ,object_version_number
132     from        pqp_flxdu_func_attributes
133     where       flxdu_func_attribute_id = p_flxdu_func_attribute_id
134     for update nowait;
135 --
136   l_proc        varchar2(72) := g_package||'lck';
137 --
138 Begin
139   hr_utility.set_location('Entering:'||l_proc, 5);
140   --
141   hr_api.mandatory_arg_error
142     (p_api_name           => l_proc
143     ,p_argument           => 'FLXDU_FUNC_ATTRIBUTE_ID'
144     ,p_argument_value     => p_flxdu_func_attribute_id
145     );
146   hr_utility.set_location(l_proc,6);
147   hr_api.mandatory_arg_error
148     (p_api_name           => l_proc
149     ,p_argument           => 'OBJECT_VERSION_NUMBER'
150     ,p_argument_value     => p_object_version_number
151     );
152   --
153   Open  C_Sel1;
154   Fetch C_Sel1 Into pqp_ffa_shd.g_old_rec;
155   If C_Sel1%notfound then
156     Close C_Sel1;
157     --
158     -- The primary key is invalid therefore we must error
159     --
160     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
161     fnd_message.raise_error;
162   End If;
163   Close C_Sel1;
164   If (p_object_version_number
165       <> pqp_ffa_shd.g_old_rec.object_version_number) Then
166         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
167         fnd_message.raise_error;
168   End If;
169   --
170   hr_utility.set_location(' Leaving:'||l_proc, 10);
171   --
172   -- We need to trap the ORA LOCK exception
173   --
174 Exception
175   When HR_Api.Object_Locked then
176     --
177     -- The object is locked therefore we need to supply a meaningful
178     -- error message.
179     --
180     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
181     fnd_message.set_token('TABLE_NAME', 'pqp_flxdu_func_attributes');
182     fnd_message.raise_error;
183 End lck;
184 --
185 -- ----------------------------------------------------------------------------
186 -- |-----------------------------< convert_args >-----------------------------|
187 -- ----------------------------------------------------------------------------
188 Function convert_args
189   (p_flxdu_func_attribute_id        in number
190   ,p_flxdu_func_name                in varchar2
191   ,p_flxdu_func_source_type         in varchar2
192   ,p_flxdu_func_integrator_code     in varchar2
193   ,p_flxdu_func_xml_data            in varchar2
194   ,p_legislation_code               in varchar2
195   ,p_description                    in varchar2
196   ,p_object_version_number          in number
197   )
198   Return g_rec_type is
199 --
200   l_rec   g_rec_type;
201 --
202 Begin
203   --
204   -- Convert arguments into local l_rec structure.
205   --
206   l_rec.flxdu_func_attribute_id          := p_flxdu_func_attribute_id;
207   l_rec.flxdu_func_name                  := p_flxdu_func_name;
208   l_rec.flxdu_func_source_type           := p_flxdu_func_source_type;
209   l_rec.flxdu_func_integrator_code       := p_flxdu_func_integrator_code;
210   l_rec.flxdu_func_xml_data              := p_flxdu_func_xml_data;
211   l_rec.legislation_code                 := p_legislation_code;
212   l_rec.description                      := p_description;
213   l_rec.object_version_number            := p_object_version_number;
214   --
215   -- Return the plsql record structure.
216   --
217   Return(l_rec);
218 --
219 End convert_args;
220 --
221 end pqp_ffa_shd;