1 Package pay_rfm_shd as
2 /* $Header: pyrfmrhi.pkh 120.0 2005/05/29 08:20 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (report_type varchar2(30)
10 ,report_qualifier varchar2(30)
11 ,report_format varchar2(30)
12 ,effective_start_date date
13 ,effective_end_date date
14 ,range_code varchar2(60)
15 ,assignment_action_code varchar2(60)
16 ,initialization_code varchar2(60)
17 ,archive_code varchar2(60)
18 ,magnetic_code varchar2(60)
19 ,report_category varchar2(30)
20 ,report_name varchar2(60)
21 ,sort_code varchar2(60)
22 ,updatable_flag varchar2(9) -- Increased length
23 ,deinitialization_code varchar2(60)
24 ,report_format_mapping_id number(15)
25 ,business_group_id number(15)
26 ,legislation_code varchar2(30)
27 ,temporary_action_flag varchar2(9) -- Increased length
28 ,object_version_number number(9)
29 );
30 --
31 -- ----------------------------------------------------------------------------
32 -- | Global Definitions - Internal Development Use Only |
33 -- ----------------------------------------------------------------------------
34 --
35 g_old_rec g_rec_type; -- Global record definition
36 -- Global table name
37 g_tab_nam constant varchar2(30) := 'PAY_REPORT_FORMAT_MAPPINGS_F';
38 g_api_dml boolean; -- Global api dml status
39 --
40 -- ----------------------------------------------------------------------------
41 -- |------------------------< return_api_dml_status >-------------------------|
42 -- ----------------------------------------------------------------------------
43 -- {Start Of Comments}
44 --
45 -- Description:
46 -- This function will return the current g_api_dml private global
47 -- boolean status.
48 -- The g_api_dml status determines if at the time of the function
49 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
50 -- is being issued from within an api.
51 -- If the status is TRUE then a dml statement is being issued from
52 -- within this entity api.
53 -- This function is primarily to support database triggers which
54 -- need to maintain the object_version_number for non-supported
55 -- dml statements (i.e. dml statement issued outside of the api layer).
56 --
57 -- Prerequisites:
58 -- None.
59 --
60 -- In Parameters:
61 -- None.
62 --
63 -- Post Success:
64 -- Processing continues.
65 -- If the function returns a TRUE value then, dml is being executed from
66 -- within this api.
67 --
68 -- Post Failure:
69 -- None.
70 --
71 -- Access Status:
72 -- Internal Row Handler Use Only.
73 --
74 -- {End Of Comments}
75 -- ----------------------------------------------------------------------------
76 Function return_api_dml_status Return Boolean;
77 --
78 -- ----------------------------------------------------------------------------
79 -- |---------------------------< constraint_error >---------------------------|
80 -- ----------------------------------------------------------------------------
81 -- {Start Of Comments}
82 --
83 -- Description:
84 -- This procedure is called when a constraint has been violated (i.e.
85 -- The exception hr_api.check_integrity_violated,
86 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
87 -- hr_api.unique_integrity_violated has been raised).
88 -- The exceptions can only be raised as follows:
89 -- 1) A check constraint can only be violated during an INSERT or UPDATE
90 -- dml operation.
91 -- 2) A parent integrity constraint can only be violated during an
92 -- INSERT or UPDATE dml operation.
93 -- 3) A child integrity constraint can only be violated during an
94 -- DELETE dml operation.
95 -- 4) A unique integrity constraint can only be violated during INSERT or
96 -- UPDATE dml operation.
97 --
98 -- Prerequisites:
99 -- 1) Either hr_api.check_integrity_violated,
100 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
101 -- hr_api.unique_integrity_violated has been raised with the subsequent
102 -- stripping of the constraint name from the generated error message
103 -- text.
104 -- 2) Standalone validation test which corresponds with a constraint error.
105 --
106 -- In Parameter:
107 -- p_constraint_name is in upper format and is just the constraint name
108 -- (e.g. not prefixed by brackets, schema owner etc).
109 --
110 -- Post Success:
111 -- Development dependant.
112 --
113 -- Post Failure:
114 -- Developement dependant.
115 --
116 -- Developer Implementation Notes:
117 -- For each constraint being checked the hr system package failure message
118 -- has been generated as a template only. These system error messages should
119 -- be modified as required (i.e. change the system failure message to a user
120 -- friendly defined error message).
121 --
122 -- Access Status:
123 -- Internal Development Use Only.
124 --
125 -- {End Of Comments}
126 -- ----------------------------------------------------------------------------
127 Procedure constraint_error
128 (p_constraint_name in all_constraints.constraint_name%TYPE);
129 --
130 -- ----------------------------------------------------------------------------
131 -- |-----------------------------< api_updating >-----------------------------|
132 -- ----------------------------------------------------------------------------
133 -- {Start Of Comments}
134 --
135 -- Description:
136 -- This function is used to populate the g_old_rec record with the
137 -- current row from the database for the specified primary key
138 -- provided that the primary key exists and is valid and does not
139 -- already match the current g_old_rec. The function will always return
140 -- a TRUE value if the g_old_rec is populated with the current row.
141 -- A FALSE value will be returned if all of the primary key arguments
142 -- are null.
143 --
144 -- Prerequisites:
145 -- None.
146 --
147 -- In Parameters:
148 --
149 -- Post Success:
150 -- A value of TRUE will be returned indiciating that the g_old_rec
151 -- is current.
152 -- A value of FALSE will be returned if all of the primary key arguments
153 -- have a null value (this indicates that the row has not be inserted into
154 -- the Schema), and therefore could never have a corresponding row.
155 --
156 -- Post Failure:
157 -- A failure can only occur under two circumstances:
158 -- 1) The primary key is invalid (i.e. a row does not exist for the
159 -- specified primary key values).
160 -- 2) If an object_version_number exists but is NOT the same as the current
161 -- g_old_rec value.
162 --
163 -- Developer Implementation Notes:
164 -- None.
165 --
166 -- Access Status:
167 -- Internal Development Use Only.
168 --
169 -- {End Of Comments}
170 -- ----------------------------------------------------------------------------
171 Function api_updating
172 (p_effective_date in date
173 ,p_report_format_mapping_id in number
174 ,p_object_version_number in number
175 ) Return Boolean;
176 --
177 -- ----------------------------------------------------------------------------
178 -- |---------------------------< find_dt_upd_modes >--------------------------|
179 -- ----------------------------------------------------------------------------
180 -- {Start Of Comments}
181 --
182 -- Description:
183 -- This procedure is used to determine what datetrack update modes are
184 -- allowed as of the effective date for this entity. The procedure will
185 -- return a corresponding Boolean value for each of the update modes
186 -- available where TRUE indicates that the corresponding update mode
187 -- is available.
188 --
189 -- Prerequisites:
190 -- None.
191 --
192 -- In Parameters:
193 -- p_effective_date
194 -- Specifies the date at which the datetrack modes will be operated on.
195 -- p_base_key_value
196 -- Specifies the primary key value for this datetrack entity.
197 -- (E.g. For this entity the assignment of the argument would be:
198 -- p_base_key_value = :report_format_mapping_id).
199 --
200 -- Post Success:
201 -- Processing continues.
202 --
203 -- Post Failure:
204 -- Failure might occur if for the specified effective date and primary key
205 -- value a row doesn't exist.
206 --
207 -- Developer Implementation Notes:
208 -- This procedure could require changes if this entity has any sepcific
209 -- delete restrictions.
210 -- For example, this entity might disallow the datetrack update mode of
211 -- UPDATE. To implement this you would have to set and return a Boolean
212 -- value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
213 --
214 -- Access Status:
215 -- Internal Development Use Only.
216 --
217 -- {End Of Comments}
218 -- ----------------------------------------------------------------------------
219 Procedure find_dt_upd_modes
220 (p_effective_date in date
221 ,p_base_key_value in number
222 ,p_correction out nocopy boolean
223 ,p_update out nocopy boolean
224 ,p_update_override out nocopy boolean
225 ,p_update_change_insert out nocopy boolean
226 );
227 --
228 -- ----------------------------------------------------------------------------
229 -- |---------------------------< find_dt_del_modes >--------------------------|
230 -- ----------------------------------------------------------------------------
231 -- {Start Of Comments}
232 --
233 -- Description:
234 -- This procedure is used to determine what datetrack delete modes are
235 -- allowed as of the effective date for this entity. The procedure will
236 -- return a corresponding Boolean value for each of the delete modes
237 -- available where TRUE indicates that the corresponding delete mode is
238 -- available.
239 --
240 -- Prerequisites:
241 -- None.
242 --
243 -- In Parameters:
244 -- p_effective_date
245 -- Specifies the date at which the datetrack modes will be operated on.
246 -- p_base_key_value
247 -- Specifies the primary key value for this datetrack entity.
248 -- (E.g. For this entity the assignment of the argument would be:
249 -- p_base_key_value = :report_format_mapping_id).
250 --
251 -- Post Success:
252 -- Processing continues.
253 --
254 -- Post Failure:
255 -- Failure might occur if for the specified effective date and primary key
256 -- value a row doesn't exist.
257 --
258 -- Developer Implementation Notes:
259 -- This procedure could require changes if this entity has any sepcific
260 -- delete restrictions.
261 -- For example, this entity might disallow the datetrack delete mode of
262 -- ZAP. To implement this you would have to set and return a Boolean value
263 -- of FALSE after the call to the dt_api.find_dt_del_modes procedure.
264 --
265 -- Access Status:
266 -- Internal Development Use Only.
267 --
268 -- {End Of Comments}
269 -- ----------------------------------------------------------------------------
270 Procedure find_dt_del_modes
271 (p_effective_date in date
272 ,p_base_key_value in number
273 ,p_zap out nocopy boolean
274 ,p_delete out nocopy boolean
275 ,p_future_change out nocopy boolean
276 ,p_delete_next_change out nocopy boolean
277 );
278 --
279 -- ----------------------------------------------------------------------------
280 -- |-----------------------< upd_effective_end_date >-------------------------|
281 -- ----------------------------------------------------------------------------
282 -- {Start Of Comments}
283 --
284 -- Description:
285 -- This procedure will update the specified datetrack row with the
286 -- specified new effective end date. The object version number is also
287 -- set to the next object version number. DateTrack modes which call
288 -- this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
289 -- UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
290 -- This is an internal datetrack maintenance procedure which should
291 -- not be modified in anyway.
292 --
293 -- Prerequisites:
294 -- None.
295 --
296 -- In Parameters:
297 -- p_new_effective_end_date
298 -- Specifies the new effective end date which will be set for the
299 -- row as of the effective date.
300 -- p_base_key_value
301 -- Specifies the primary key value for this datetrack entity.
302 -- (E.g. For this entity the assignment of the argument would be:
303 -- p_base_key_value = :report_format_mapping_id).
304 --
305 -- Post Success:
306 -- The specified row will be updated with the new effective end date and
307 -- object_version_number.
308 --
309 -- Post Failure:
310 -- Failure might occur if for the specified effective date and primary key
311 -- value a row doesn't exist.
312 --
313 -- Developer Implementation Notes:
314 -- This is an internal datetrack maintenance procedure which should
315 -- not be modified in anyway.
316 --
317 -- Access Status:
318 -- Internal Row Handler Use Only.
319 --
320 -- {End Of Comments}
321 -- ----------------------------------------------------------------------------
322 Procedure upd_effective_end_date
323 (p_effective_date in date
324 ,p_base_key_value in number
325 ,p_new_effective_end_date in date
326 ,p_validation_start_date in date
327 ,p_validation_end_date in date
328 ,p_object_version_number out nocopy number
329 );
330 --
331 -- ----------------------------------------------------------------------------
332 -- |---------------------------------< lck >----------------------------------|
333 -- ----------------------------------------------------------------------------
334 -- {Start Of Comments}
335 --
336 -- Description:
337 -- The Lck process for datetrack is complicated and comprises of the
338 -- following processing
339 -- The processing steps are as follows:
340 -- 1) The row to be updated or deleted must be locked.
341 -- By locking this row, the g_old_rec record data type is populated.
342 -- 2) If a comment exists the text is selected from hr_comments.
343 -- 3) The datetrack mode is then validated to ensure the operation is
344 -- valid. If the mode is valid the validation start and end dates for
345 -- the mode will be derived and returned. Any required locking is
346 -- completed when the datetrack mode is validated.
347 --
348 -- Prerequisites:
349 -- When attempting to call the lck procedure the object version number,
350 -- primary key, effective date and datetrack mode must be specified.
351 --
352 -- In Parameters:
353 -- p_effective_date
354 -- Specifies the date of the datetrack update operation.
355 -- p_datetrack_mode
356 -- Determines the datetrack update or delete mode.
357 --
358 -- Post Success:
359 -- On successful completion of the Lck process the row to be updated or
360 -- deleted will be locked and selected into the global data structure
361 -- g_old_rec.
362 --
363 -- Post Failure:
364 -- The Lck process can fail for three reasons:
365 -- 1) When attempting to lock the row the row could already be locked by
366 -- another user. This will raise the HR_Api.Object_Locked exception.
367 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
368 -- This error is trapped and reported using the message name
369 -- 'HR_7220_INVALID_PRIMARY_KEY'.
370 -- 3) The row although existing in the HR Schema has a different object
371 -- version number than the object version number specified.
372 -- This error is trapped and reported using the message name
373 -- 'HR_7155_OBJECT_INVALID'.
374 --
375 -- Developer Implementation Notes:
376 -- None.
377 --
378 -- Access Status:
379 -- Internal Development Use Only.
380 --
381 -- {End Of Comments}
382 -- ----------------------------------------------------------------------------
383 Procedure lck
384 (p_effective_date in date
385 ,p_datetrack_mode in varchar2
386 ,p_report_format_mapping_id in number
387 ,p_object_version_number in number
388 ,p_validation_start_date out nocopy date
389 ,p_validation_end_date out nocopy date
390 );
391 --
392 -- ----------------------------------------------------------------------------
393 -- |-----------------------------< convert_args >-----------------------------|
394 -- ----------------------------------------------------------------------------
395 -- {Start Of Comments}
396 --
397 -- Description:
398 -- This function is used to turn attribute parameters into the record
399 -- structure parameter g_rec_type.
400 --
401 -- Prerequisites:
402 -- This is a private function and can only be called from the ins or upd
403 -- attribute processes.
404 --
405 -- In Parameters:
406 --
407 -- Post Success:
408 -- A returning record structure will be returned.
409 --
410 -- Post Failure:
411 -- No direct error handling is required within this function. Any possible
412 -- errors within this function will be a PL/SQL value error due to
413 -- conversion of datatypes or data lengths.
414 --
415 -- Developer Implementation Notes:
416 -- None.
417 --
418 -- Access Status:
419 -- Internal Row Handler Use Only.
420 --
421 -- {End Of Comments}
422 -- ----------------------------------------------------------------------------
423 Function convert_args
424 (p_report_type in varchar2
425 ,p_report_qualifier in varchar2
426 ,p_report_format in varchar2
427 ,p_effective_start_date in date
428 ,p_effective_end_date in date
429 ,p_range_code in varchar2
430 ,p_assignment_action_code in varchar2
431 ,p_initialization_code in varchar2
432 ,p_archive_code in varchar2
433 ,p_magnetic_code in varchar2
434 ,p_report_category in varchar2
435 ,p_report_name in varchar2
436 ,p_sort_code in varchar2
437 ,p_updatable_flag in varchar2
438 ,p_deinitialization_code in varchar2
439 ,p_report_format_mapping_id in number
440 ,p_business_group_id in number
441 ,p_legislation_code in varchar2
442 ,p_temporary_action_flag in varchar2
443 ,p_object_version_number in number
444 )
445 Return g_rec_type;
446 --
447 -- ----------------------------------------------------------------------------
448 -- |---------------------< get_report_format_mapping_id >---------------------|
449 -- ----------------------------------------------------------------------------
450 -- {Start Of Comments}
451 --
452 -- Description:
453 -- This function is used to return the report_format_mapping_id of a
454 -- particular report format mapping from its true key - report_type,
455 -- report_qualifier and report_category.
456 --
457 -- Prerequisites:
458 -- None
459 --
460 --
461 -- In Parameters:
462 --
463 --
464 -- Post Success:
465 -- Returns the report_format_mapping_id of the corresponding report format
466 -- mapping if it exists. If the report format mapping does not exists then
467 -- the function returns null.
468 --
469 -- Post Failure:
470 -- Failure might occur if the report_format_mapping_id is null
471 -- or there is a non unique report_format_mapping_id for the report format
472 -- mapping that is being referred. The errors are trapped and reported.
473 --
474 -- Developer Implementation Notes:
475 -- None
476 --
477 -- Access Status:
478 -- Internal Development Use Only.
479 --
480 -- {End Of Comments}
481 -- ----------------------------------------------------------------------------
482 Function get_report_format_mapping_id
483 (p_report_type in varchar2
484 ,p_report_qualifier in varchar2
485 ,p_report_category in varchar2
486 )
487 Return number;
488 --
489 end pay_rfm_shd;