1 PACKAGE pay_exa_shd AUTHID CURRENT_USER AS
2 /* $Header: pyexarhi.pkh 115.5 2002/12/10 18:44:35 dsaxby ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 type g_rec_type is record
9 (
10 external_account_id number(9),
11 territory_code varchar2(9), -- increased length
12 prenote_date date,
13 id_flex_num number(15),
14 summary_flag varchar2(9), -- increased length
15 enabled_flag varchar2(9), -- increased length
16 start_date_active date,
17 end_date_active date,
18 segment1 varchar2(150),
19 segment2 varchar2(150),
20 segment3 varchar2(150),
21 segment4 varchar2(150),
22 segment5 varchar2(150),
23 segment6 varchar2(150),
24 segment7 varchar2(150),
25 segment8 varchar2(150),
26 segment9 varchar2(150),
27 segment10 varchar2(150),
28 segment11 varchar2(150),
29 segment12 varchar2(150),
30 segment13 varchar2(150),
31 segment14 varchar2(150),
32 segment15 varchar2(150),
33 segment16 varchar2(150),
34 segment17 varchar2(150),
35 segment18 varchar2(150),
36 segment19 varchar2(150),
37 segment20 varchar2(150),
38 segment21 varchar2(150),
39 segment22 varchar2(150),
40 segment23 varchar2(150),
41 segment24 varchar2(150),
42 segment25 varchar2(150),
43 segment26 varchar2(150),
44 segment27 varchar2(150),
45 segment28 varchar2(150),
46 segment29 varchar2(150),
47 segment30 varchar2(150),
48 object_version_number number(9)
49 );
50 --
51 -- ----------------------------------------------------------------------------
52 -- | Global Definitions - Internal Development Use Only |
53 -- ----------------------------------------------------------------------------
54 --
55 g_old_rec g_rec_type; -- global record definition
56 g_api_dml boolean; -- global api dml status
57 --
58 -- ----------------------------------------------------------------------------
59 -- |------------------------< return_api_dml_status >-------------------------|
60 -- ----------------------------------------------------------------------------
61 -- {Start Of Comments}
62 --
63 -- Description:
64 -- This function will return the current g_api_dml private global
65 -- boolean status.
66 -- The g_api_dml status determines if at the time of the function
67 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
68 -- is being issued from within an api.
69 -- If the status is TRUE then a dml statement is being issued from
70 -- within this entity api.
71 -- This function is primarily to support database triggers which
72 -- need to maintain the object_version_number for non-supported
73 -- dml statements (i.e. dml statement issued outside of the api layer).
74 --
75 -- Pre Conditions:
76 -- None.
77 --
78 -- In Arguments:
79 -- None.
80 --
81 -- Post Success:
82 -- Processing continues.
83 -- If the function returns a TRUE value then, dml is being executed from
84 -- within this api.
85 --
86 -- Post Failure:
87 -- None.
88 --
89 -- Access Status:
90 -- Internal Table Handler Use Only.
91 --
92 -- {End Of Comments}
93 -- ----------------------------------------------------------------------------
94 function return_api_dml_status return boolean;
95 --
96 -- ----------------------------------------------------------------------------
97 -- |---------------------------< constraint_error >---------------------------|
98 -- ----------------------------------------------------------------------------
99 -- {Start Of Comments}
100 --
101 -- Description:
102 -- This procedure is called when a constraint has been violated (i.e.
103 -- The exception hr_api.check_integrity_violated,
104 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
105 -- hr_api.unique_integrity_violated has been raised).
106 -- The exceptions can only be raised as follows:
107 -- 1) A check constraint can only be violated during an INSERT or UPDATE
108 -- dml operation.
109 -- 2) A parent integrity constraint can only be violated during an
110 -- INSERT or UPDATE dml operation.
111 -- 3) A child integrity constraint can only be violated during an
112 -- DELETE dml operation.
113 -- 4) A unique integrity constraint can only be violated during INSERT or
114 -- UPDATE dml operation.
115 --
116 -- Pre Conditions:
117 -- 1) Either hr_api.check_integrity_violated,
118 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
119 -- hr_api.unique_integrity_violated has been raised with the subsequent
120 -- stripping of the constraint name from the generated error message
121 -- text.
122 -- 2) Standalone validation test which correspond with a constraint error.
123 --
124 -- In Arguments:
125 -- p_constraint_name is in upper format and is just the constraint name
126 -- (e.g. not prefixed by brackets, schema owner etc).
127 --
128 -- Post Success:
129 -- Development dependant.
130 --
131 -- Post Failure:
132 -- Developement dependant.
133 --
134 -- Developer Implementation Notes:
135 -- For each constraint being checked the hr system package failure message
136 -- has been generated as a template only. These system error messages should
137 -- be modified as required (i.e. change the system failure message to a user
138 -- friendly defined error message).
139 --
140 -- Access Status:
141 -- Internal Development Use Only.
142 --
143 -- {End Of Comments}
144 -- ----------------------------------------------------------------------------
145 procedure constraint_error(
146 p_constraint_name in all_constraints.constraint_name%TYPE
147 );
148 --
149 -- ----------------------------------------------------------------------------
150 -- |-----------------------------< api_updating >-----------------------------|
151 -- ----------------------------------------------------------------------------
152 -- {Start Of Comments}
153 --
154 -- Description:
155 -- This function is used to populate the g_old_rec record with the
156 -- current row from the database for the specified primary key
157 -- provided that the primary key exists and is valid and does not
158 -- already match the current g_old_rec. The function will always return
159 -- a TRUE value if the g_old_rec is populated with the current row.
160 -- A FALSE value will be returned if all of the primary key arguments
161 -- are null.
162 --
163 -- Pre Conditions:
164 -- None.
165 --
166 -- In Arguments:
167 --
168 -- Post Success:
169 -- A value of TRUE will be returned indiciating that the g_old_rec
170 -- is current.
171 -- A value of FALSE will be returned if all of the primary key arguments
172 -- have a null value (this indicates that the row has not be inserted into
173 -- the Schema), and therefore could never have a corresponding row.
174 --
175 -- Post Failure:
176 -- A failure can only occur under two circumstances:
177 -- 1) The primary key is invalid (i.e. a row does not exist for the
178 -- specified primary key values).
179 -- 2) If an object_version_number exists but is NOT the same as the current
180 -- g_old_rec value.
181 --
182 -- Developer Implementation Notes:
183 -- None.
184 --
185 -- Access Status:
186 -- Internal Table Handler Use Only.
187 --
188 -- {End Of Comments}
189 -- ----------------------------------------------------------------------------
190 function api_updating(
191 p_external_account_id in number
192 ,p_object_version_number in number
193 )
194 return boolean;
195 --
196 -- ----------------------------------------------------------------------------
197 -- |---------------------------------< lck >----------------------------------|
198 -- ----------------------------------------------------------------------------
199 -- {Start Of Comments}
200 --
201 -- Description:
202 -- The Lck process has two main functions to perform. Firstly, the row to be
203 -- updated or deleted must be locked. The locking of the row will only be
204 -- successful if the row is not currently locked by another user.
205 -- Secondly, during the locking of the row, the row is selected into
206 -- the g_old_rec data structure which enables the current row values from the
207 -- server to be available to the api.
208 --
209 -- Pre Conditions:
210 -- When attempting to call the lock the object version number (if defined)
211 -- is mandatory.
212 --
213 -- In Arguments:
214 -- The arguments to the Lck process are the primary key(s) which uniquely
215 -- identify the row and the object version number of row.
216 --
217 -- Post Success:
218 -- On successful completion of the Lck process the row to be updated or
219 -- deleted will be locked and selected into the global data structure
220 -- g_old_rec.
221 --
222 -- Post Failure:
223 -- The Lck process can fail for three reasons:
224 -- 1) When attempting to lock the row the row could already be locked by
225 -- another user. This will raise the HR_Api.Object_Locked exception.
226 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
227 -- This error is trapped and reported using the message name
228 -- 'HR_7220_INVALID_PRIMARY_KEY'.
229 -- 3) The row although existing in the HR Schema has a different object
230 -- version number than the object version number specified.
231 -- This error is trapped and reported using the message name
232 -- 'HR_7155_OBJECT_INVALID'.
233 --
234 -- Developer Implementation Notes:
235 -- For each primary key and the object version number arguments add a
236 -- call to hr_api.mandatory_arg_error procedure to ensure that these
237 -- argument values are not null.
238 --
239 -- Access Status:
240 -- Internal Development Use Only.
241 --
242 -- {End Of Comments}
243 -- ----------------------------------------------------------------------------
244 procedure lck(
245 p_external_account_id in number
246 ,p_object_version_number in number
247 );
248 --
249 -- ----------------------------------------------------------------------------
250 -- |-----------------------------< convert_args >-----------------------------|
251 -- ----------------------------------------------------------------------------
252 -- {Start Of Comments}
253 --
254 -- Description:
255 -- This function is used to turn attribute arguments into the record
256 -- structure g_rec_type.
257 --
258 -- Pre Conditions:
259 -- This is a private function and can only be called from the ins or upd
260 -- attribute processes.
261 --
262 -- In Arguments:
263 --
264 -- Post Success:
265 -- A returning record structure will be returned.
266 --
267 -- Post Failure:
268 -- No direct error handling is required within this function. Any possible
269 -- errors within this function will be a PL/SQL value error due to conversion
270 -- of datatypes or data lengths.
271 --
272 -- Developer Implementation Notes:
273 -- None.
274 --
275 -- Access Status:
276 -- Internal Table Handler Use Only.
277 --
278 -- {End Of Comments}
279 -- ----------------------------------------------------------------------------
280 function convert_args(
281 p_external_account_id in number
282 ,p_territory_code in varchar2
283 ,p_prenote_date in date
284 ,p_id_flex_num in number
285 ,p_summary_flag in varchar2
286 ,p_enabled_flag in varchar2
287 ,p_start_date_active in date
288 ,p_end_date_active in date
289 ,p_segment1 in varchar2
290 ,p_segment2 in varchar2
291 ,p_segment3 in varchar2
292 ,p_segment4 in varchar2
293 ,p_segment5 in varchar2
294 ,p_segment6 in varchar2
295 ,p_segment7 in varchar2
296 ,p_segment8 in varchar2
297 ,p_segment9 in varchar2
298 ,p_segment10 in varchar2
299 ,p_segment11 in varchar2
300 ,p_segment12 in varchar2
301 ,p_segment13 in varchar2
302 ,p_segment14 in varchar2
303 ,p_segment15 in varchar2
304 ,p_segment16 in varchar2
305 ,p_segment17 in varchar2
306 ,p_segment18 in varchar2
307 ,p_segment19 in varchar2
308 ,p_segment20 in varchar2
309 ,p_segment21 in varchar2
310 ,p_segment22 in varchar2
311 ,p_segment23 in varchar2
312 ,p_segment24 in varchar2
313 ,p_segment25 in varchar2
314 ,p_segment26 in varchar2
315 ,p_segment27 in varchar2
316 ,p_segment28 in varchar2
317 ,p_segment29 in varchar2
318 ,p_segment30 in varchar2
319 ,p_object_version_number in number
320 )
321 return g_rec_type;
322 --
323 -- ----------------------------------------------------------------------------
324 -- |-----------------------------< keyflex_comb >-----------------------------|
325 -- ----------------------------------------------------------------------------
326 -- {Start Of Comments}
327 --
328 -- Description:
329 -- Wrapper for hr_kflex_utility.ins_or_sel_keyflex_comb() and
330 -- hr_kflex_utility.upd_or_sel_keyflex_comb().
331 -- Only need to maintain 1 set of error messages
332 --
333 -- Pre Conditions:
334 --
335 -- In Arguments:
336 -- Name Reqd Type Description
337 -- p_dml_mode varchar2 Determines which aol api
338 -- is being used.
339 -- p_business_group_id Yes number Business group id.
340 -- p_appl_short_name Yes varchar2 Application short name,
341 -- eg. 'PAY'
342 -- p_flex_code Yes varchar2 Keyflex registration code,
343 -- eg. 'BANK'
344 -- p_segment1 varchar2 External account combination
345 -- key flexfield.
346 -- . . .
347 -- p_segment30 varchar2 External account combination
348 -- key flexfield.
349 -- p_concat_segments_in varchar2 External account combination
350 -- string, if specified takes
351 -- precedence over segment1...30.
352 --
353 -- Post Success:
354 -- Name Type Description
355 -- p_ccid number If p_validate is false,
356 -- this will be a new or
357 -- existing external
358 -- account code combination id,
359 -- If p_validate is true,
360 -- this will be reset back to
361 -- its IN value.
362 -- p_concat_segments_out varchar If p_validate is false,
363 -- this will be the combination
364 -- string that corresponds to
365 -- p_ccid
366 -- If p_validate is true,
367 -- this will be null.
368 -- Post Failure:
369 --
370 -- Developer Implementation Notes:
371 --
372 -- Access Status:
373 --
374 -- {End Of Comments}
375 -- ----------------------------------------------------------------------------
376 procedure keyflex_comb(
377 p_dml_mode in varchar2 default null
378 ,p_business_group_id in number
379 ,p_appl_short_name in fnd_application.application_short_name%TYPE
380 -- --
381 ,p_territory_code in varchar2 default null
382 ,p_flex_code in fnd_id_flex_segments.id_flex_code%TYPE
383 ,p_segment1 in varchar2 default null
384 ,p_segment2 in varchar2 default null
385 ,p_segment3 in varchar2 default null
386 ,p_segment4 in varchar2 default null
387 ,p_segment5 in varchar2 default null
388 ,p_segment6 in varchar2 default null
389 ,p_segment7 in varchar2 default null
390 ,p_segment8 in varchar2 default null
391 ,p_segment9 in varchar2 default null
392 ,p_segment10 in varchar2 default null
393 ,p_segment11 in varchar2 default null
394 ,p_segment12 in varchar2 default null
395 ,p_segment13 in varchar2 default null
396 ,p_segment14 in varchar2 default null
397 ,p_segment15 in varchar2 default null
398 ,p_segment16 in varchar2 default null
399 ,p_segment17 in varchar2 default null
400 ,p_segment18 in varchar2 default null
401 ,p_segment19 in varchar2 default null
402 ,p_segment20 in varchar2 default null
403 ,p_segment21 in varchar2 default null
404 ,p_segment22 in varchar2 default null
405 ,p_segment23 in varchar2 default null
406 ,p_segment24 in varchar2 default null
407 ,p_segment25 in varchar2 default null
408 ,p_segment26 in varchar2 default null
409 ,p_segment27 in varchar2 default null
410 ,p_segment28 in varchar2 default null
411 ,p_segment29 in varchar2 default null
412 ,p_segment30 in varchar2 default null
413 ,p_concat_segments_in in varchar2 default null
414 ,p_ccid in out nocopy number
415 ,p_concat_segments_out out nocopy varchar2
416 );
417 --
418 END pay_exa_shd;