DBA Data[Home] [Help]

PACKAGE: APPS.BEN_LOU_SHD

Source


1 Package ben_lou_shd as
2 /* $Header: belourhi.pkh 120.0 2005/05/28 03:29:32 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (
10   ler_chg_oipl_enrt_rl_id           number(15),
11   effective_start_date              date,
12   effective_end_date                date,
13   business_group_id                 number(15),
14   formula_id               number(15),
15   ler_chg_oipl_enrt_id              number(15),
16   ordr_to_aply_num                  number(15),
17   lou_attribute_category            varchar2(30),
18   lou_attribute1                    varchar2(150),
19   lou_attribute2                    varchar2(150),
20   lou_attribute3                    varchar2(150),
21   lou_attribute4                    varchar2(150),
22   lou_attribute5                    varchar2(150),
23   lou_attribute6                    varchar2(150),
24   lou_attribute7                    varchar2(150),
25   lou_attribute8                    varchar2(150),
26   lou_attribute9                    varchar2(150),
27   lou_attribute10                   varchar2(150),
28   lou_attribute11                   varchar2(150),
29   lou_attribute12                   varchar2(150),
30   lou_attribute13                   varchar2(150),
31   lou_attribute14                   varchar2(150),
32   lou_attribute15                   varchar2(150),
33   lou_attribute16                   varchar2(150),
34   lou_attribute17                   varchar2(150),
35   lou_attribute18                   varchar2(150),
36   lou_attribute19                   varchar2(150),
37   lou_attribute20                   varchar2(150),
38   lou_attribute21                   varchar2(150),
39   lou_attribute22                   varchar2(150),
40   lou_attribute23                   varchar2(150),
41   lou_attribute24                   varchar2(150),
42   lou_attribute25                   varchar2(150),
43   lou_attribute26                   varchar2(150),
44   lou_attribute27                   varchar2(150),
45   lou_attribute28                   varchar2(150),
46   lou_attribute29                   varchar2(150),
47   lou_attribute30                   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 -- Prerequisites:
76 --   None.
77 --
78 -- In Parameters:
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 Row 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 -- Prerequisites:
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 corresponds with a constraint error.
123 --
124 -- In Parameter:
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 -- |-----------------------------< api_updating >-----------------------------|
150 -- ----------------------------------------------------------------------------
151 -- {Start Of Comments}
152 --
153 -- Description:
154 --   This function is used to populate the g_old_rec record with the current
155 --   row from the database for the specified primary key provided that the
156 --   primary key exists, and is valid, and does not already match the current
157 --   g_old_rec.
158 --   The function will always return a TRUE value if the g_old_rec is
159 --   populated with the current row. A FALSE value will be returned if all of
160 --   the primary key arguments are null.
161 --
162 -- Prerequisites:
163 --   None.
164 --
165 -- In Parameters:
166 --
167 -- Post Success:
168 --   A value of TRUE will be returned indiciating that the g_old_rec is
169 --   current.
170 --   A value of FALSE will be returned if all of the primary key arguments
171 --   have a null value (this indicates that the row has not be inserted into
172 --   the Schema), and therefore could never have a corresponding row.
173 --
174 -- Post Failure:
175 --   A failure can only occur under two circumstances:
176 --   1) The primary key is invalid (i.e. a row does not exist for the
177 --      specified primary key values).
178 --   2) If an object_version_number exists but is NOT the same as the current
179 --      g_old_rec value.
180 --
181 -- Developer Implementation Notes:
182 --   None.
183 --
184 -- Access Status:
185 --   Internal Development Use Only.
186 --
187 -- {End Of Comments}
188 -- ----------------------------------------------------------------------------
189 Function api_updating
190   (p_effective_date		in date,
191    p_ler_chg_oipl_enrt_rl_id		in number,
192    p_object_version_number	in number
193   ) Return Boolean;
194 --
195 -- ----------------------------------------------------------------------------
196 -- |--------------------------< find_dt_del_modes >---------------------------|
197 -- ----------------------------------------------------------------------------
198 -- {Start Of Comments}
199 --
200 -- Description:
201 --   This procedure is used to determine what datetrack delete modes are
202 --   allowed as of the effective date for this entity. The procedure will
203 --   return a corresponding Boolean value for each of the delete modes
204 --   available where TRUE indicates that the corresponding delete mode is
205 --   available.
206 --
207 -- Prerequisites:
208 --   None.
209 --
210 -- In Parameters:
211 --   p_effective_date
212 --     Specifies the date at which the datetrack modes will be operated on.
213 --   p_base_key_value
214 --     Specifies the primary key value for this datetrack entity.
215 --     (E.g. For this entity the assignment of the argument would be:
216 --           p_base_key_value = :ler_chg_oipl_enrt_rl_id).
217 --
218 -- Post Success:
219 --   Processing continues.
220 --
221 -- Post Failure:
222 --   Failure might occur if for the specified effective date and primary key
223 --   value a row doesn't exist.
224 --
225 -- Developer Implementation Notes:
226 --   This procedure could require changes if this entity has any sepcific
227 --   delete restrictions.
228 --   For example, this entity might disallow the datetrack delete mode of
229 --   ZAP. To implement this you would have to set and return a Boolean value
230 --   of FALSE after the call to the dt_api.find_dt_del_modes procedure.
231 --
232 -- Access Status:
233 --   Internal Development Use Only.
234 --
235 -- {End Of Comments}
236 -- ----------------------------------------------------------------------------
237 Procedure find_dt_del_modes
238 	(p_effective_date	in  date,
239 	 p_base_key_value	in  number,
240 	 p_zap		 out nocopy boolean,
241 	 p_delete	 out nocopy boolean,
242 	 p_future_change out nocopy boolean,
243 	 p_delete_next_change out nocopy boolean);
244 --
245 -- ----------------------------------------------------------------------------
246 -- |--------------------------< find_dt_upd_modes >---------------------------|
247 -- ----------------------------------------------------------------------------
248 -- {Start Of Comments}
249 --
250 -- Description:
251 --   This procedure is used to determine what datetrack update modes are
252 --   allowed as of the effective date for this entity. The procedure will
253 --   return a corresponding Boolean value for each of the update modes
254 --   available where TRUE indicates that the corresponding update mode
255 --   is available.
256 --
257 -- Prerequisites:
258 --   None.
259 --
260 -- In Parameters:
261 --   p_effective_date
262 --     Specifies the date at which the datetrack modes will be operated on.
263 --   p_base_key_value
264 --     Specifies the primary key value for this datetrack entity.
265 --     (E.g. For this entity the assignment of the argument would be:
266 --           p_base_key_value = :ler_chg_oipl_enrt_rl_id).
267 --
268 -- Post Success:
269 --   Processing continues.
270 --
271 -- Post Failure:
272 --   Failure might occur if for the specified effective date and primary key
273 --   value a row doesn't exist.
274 --
275 -- Developer Implementation Notes:
276 --   This procedure could require changes if this entity has any sepcific
277 --   delete restrictions.
278 --   For example, this entity might disallow the datetrack update mode of
279 --   UPDATE. To implement this you would have to set and return a Boolean
280 --   value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
281 --
282 -- Access Status:
283 --   Internal Development Use Only.
284 --
285 -- {End Of Comments}
286 -- ----------------------------------------------------------------------------
287 Procedure find_dt_upd_modes
288 	(p_effective_date	in  date,
289 	 p_base_key_value	in  number,
290 	 p_correction	 out nocopy boolean,
291 	 p_update	 out nocopy boolean,
292 	 p_update_override out nocopy boolean,
293 	 p_update_change_insert out nocopy boolean);
294 --
295 -- ----------------------------------------------------------------------------
296 -- |------------------------< upd_effective_end_date >------------------------|
297 -- ----------------------------------------------------------------------------
298 -- {Start Of Comments}
299 --
300 -- Description:
301 --   This procedure will update the specified datetrack row with the
302 --   specified new effective end date. The object version number is also
303 --   set to the next object version number. DateTrack modes which call
304 --   this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
305 --   UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
306 --   This is an internal datetrack maintenance procedure which should
307 --   not be modified in anyway.
308 --
309 -- Prerequisites:
310 --   None.
311 --
312 -- In Parameters:
313 --   p_new_effective_end_date
314 --     Specifies the new effective end date which will be set for the
315 --     row as of the effective date.
316 --   p_base_key_value
317 --     Specifies the primary key value for this datetrack entity.
318 --     (E.g. For this entity the assignment of the argument would be:
319 --           p_base_key_value = :ler_chg_oipl_enrt_rl_id).
320 --
321 -- Post Success:
322 --   The specified row will be updated with the new effective end date and
323 --   object_version_number.
324 --
325 -- Post Failure:
326 --   Failure might occur if for the specified effective date and primary key
327 --   value a row doesn't exist.
328 --
329 -- Developer Implementation Notes:
333 -- Access Status:
330 --   This is an internal datetrack maintenance procedure which should
331 --   not be modified in anyway.
332 --
334 --   Internal Row Handler Use Only.
335 --
336 -- {End Of Comments}
337 -- ----------------------------------------------------------------------------
338 Procedure upd_effective_end_date
339 	(p_effective_date		in date,
340 	 p_base_key_value		in number,
341 	 p_new_effective_end_date	in date,
342 	 p_validation_start_date	in date,
343 	 p_validation_end_date		in date,
344          p_object_version_number       out nocopy number);
345 --
346 -- ----------------------------------------------------------------------------
347 -- |---------------------------------< lck >----------------------------------|
348 -- ----------------------------------------------------------------------------
349 -- {Start Of Comments}
350 --
351 -- Description:
352 --   The Lck process for datetrack is complicated and comprises of the
353 --   following processing
354 --   The processing steps are as follows:
355 --   1) The row to be updated or deleted must be locked.
356 --      By locking this row, the g_old_rec record data type is populated.
357 --   2) If a comment exists the text is selected from hr_comments.
358 --   3) The datetrack mode is then validated to ensure the operation is
359 --      valid. If the mode is valid the validation start and end dates for
360 --      the mode will be derived and returned. Any required locking is
361 --      completed when the datetrack mode is validated.
362 --
363 -- Prerequisites:
364 --   When attempting to call the lck procedure the object version number,
365 --   primary key, effective date and datetrack mode must be specified.
366 --
367 -- In Parameters:
368 --   p_effective_date
369 --     Specifies the date of the datetrack update operation.
370 --   p_datetrack_mode
371 --     Determines the datetrack update or delete mode.
372 --
373 -- Post Success:
374 --   On successful completion of the Lck process the row to be updated or
375 --   deleted will be locked and selected into the global data structure
376 --   g_old_rec.
377 --
378 -- Post Failure:
379 --   The Lck process can fail for three reasons:
380 --   1) When attempting to lock the row the row could already be locked by
381 --      another user. This will raise the HR_Api.Object_Locked exception.
382 --   2) The row which is required to be locked doesn't exist in the HR Schema.
383 --      This error is trapped and reported using the message name
384 --      'HR_7220_INVALID_PRIMARY_KEY'.
385 --   3) The row although existing in the HR Schema has a different object
386 --      version number than the object version number specified.
387 --      This error is trapped and reported using the message name
388 --      'HR_7155_OBJECT_INVALID'.
389 --
390 -- Developer Implementation Notes:
391 --   None.
392 --
393 -- Access Status:
394 --   Internal Development Use Only.
395 --
396 -- {End Of Comments}
397 -- ----------------------------------------------------------------------------
398 Procedure lck
399 	(p_effective_date	 in  date,
400 	 p_datetrack_mode	 in  varchar2,
401 	 p_ler_chg_oipl_enrt_rl_id	 in  number,
402 	 p_object_version_number in  number,
403 	 p_validation_start_date out nocopy date,
404 	 p_validation_end_date	 out nocopy date);
405 --
406 -- ----------------------------------------------------------------------------
407 -- |-----------------------------< convert_args >-----------------------------|
408 -- ----------------------------------------------------------------------------
409 -- {Start Of Comments}
410 --
411 -- Description:
412 --   This function is used to turn attribute parameters into the record
413 --   structure parameter g_rec_type.
414 --
415 -- Prerequisites:
416 --   This is a private function and can only be called from the ins or upd
417 --   attribute processes.
418 --
419 -- In Parameters:
420 --
421 -- Post Success:
422 --   A returning record structure will be returned.
423 --
424 -- Post Failure:
425 --   No direct error handling is required within this function. Any possible
426 --   errors within this function will be a PL/SQL value error due to conversion
427 --   of datatypes or data lengths.
428 --
429 -- Developer Implementation Notes:
430 --   None.
431 --
432 -- Access Status:
433 --   Internal Row Handler Use Only.
434 --
435 -- {End Of Comments}
436 -- ----------------------------------------------------------------------------
437 Function convert_args
438 	(
439 	p_ler_chg_oipl_enrt_rl_id       in number,
440 	p_effective_start_date          in date,
441 	p_effective_end_date            in date,
442 	p_business_group_id             in number,
443 	p_formula_id           in number,
444 	p_ler_chg_oipl_enrt_id          in number,
445 	p_ordr_to_aply_num              in number,
446 	p_lou_attribute_category        in varchar2,
447 	p_lou_attribute1                in varchar2,
448 	p_lou_attribute2                in varchar2,
449 	p_lou_attribute3                in varchar2,
450 	p_lou_attribute4                in varchar2,
451 	p_lou_attribute5                in varchar2,
452 	p_lou_attribute6                in varchar2,
453 	p_lou_attribute7                in varchar2,
454 	p_lou_attribute8                in varchar2,
455 	p_lou_attribute9                in varchar2,
456 	p_lou_attribute10               in varchar2,
457 	p_lou_attribute11               in varchar2,
458 	p_lou_attribute12               in varchar2,
459 	p_lou_attribute13               in varchar2,
460 	p_lou_attribute14               in varchar2,
461 	p_lou_attribute15               in varchar2,
462 	p_lou_attribute16               in varchar2,
463 	p_lou_attribute17               in varchar2,
464 	p_lou_attribute18               in varchar2,
465 	p_lou_attribute19               in varchar2,
466 	p_lou_attribute20               in varchar2,
467 	p_lou_attribute21               in varchar2,
468 	p_lou_attribute22               in varchar2,
469 	p_lou_attribute23               in varchar2,
470 	p_lou_attribute24               in varchar2,
471 	p_lou_attribute25               in varchar2,
472 	p_lou_attribute26               in varchar2,
473 	p_lou_attribute27               in varchar2,
474 	p_lou_attribute28               in varchar2,
475 	p_lou_attribute29               in varchar2,
476 	p_lou_attribute30               in varchar2,
477 	p_object_version_number         in number
478 	)
479 	Return g_rec_type;
480 --
481 end ben_lou_shd;