DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_ELE_INS

Source


1 Package Body pay_ele_ins as
2 /* $Header: pyelerhi.pkb 120.1 2005/05/30 05:19:19 rajeesha noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pay_ele_ins.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |----------------------------< dt_insert_dml >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the actual dml insert logic for datetrack. The
17 --   functions of this procedure are as follows:
18 --   1) Get the object_version_number.
19 --   2) To set the effective start and end dates to the corresponding
20 --      validation start and end dates. Also, the object version number
21 --      record attribute is set.
22 --   3) To set and unset the g_api_dml status as required (as we are about to
23 --      perform dml).
24 --   4) To insert the row into the schema with the derived effective start
25 --      and end dates and the object version number.
26 --   5) To trap any constraint violations that may have occurred.
27 --   6) To raise any other errors.
28 --
29 -- Prerequisites:
30 --   This is an internal private procedure which must be called from the
31 --   insert_dml and pre_update (logic permitting) procedure and must have
32 --   all mandatory arguments set.
33 --
34 -- In Parameters:
35 --   A Pl/Sql record structure.
36 --
37 -- Post Success:
38 --   The specified row will be inserted into the schema.
39 --
40 -- Post Failure:
41 --   On the insert dml failure it is important to note that we always reset the
42 --   g_api_dml status to false.
43 --   If a check or unique integrity constraint violation is raised the
44 --   constraint_error procedure will be called.
45 --   If any other error is reported, the error will be raised after the
46 --   g_api_dml status is reset.
47 --
48 -- Developer Implementation Notes:
49 --   This is an internal datetrack maintenance procedure which should
50 --   not be modified in anyway.
51 --
52 -- Access Status:
53 --   Internal Row Handler Use Only.
54 --
55 -- {End Of Comments}
56 -- ----------------------------------------------------------------------------
57 Procedure dt_insert_dml
58   (p_rec                     in out nocopy pay_ele_shd.g_rec_type
59   ,p_effective_date          in date
60   ,p_datetrack_mode          in varchar2
61   ,p_validation_start_date   in date
62   ,p_validation_end_date     in date
63   ) is
64 -- Cursor to select 'old' created AOL who column values
65 --
66   Cursor C_Sel1 Is
67     select t.created_by,
68            t.creation_date
69     from   pay_element_entries_f t
70     where  t.element_entry_id       = p_rec.element_entry_id
71     and    t.effective_start_date =
72              pay_ele_shd.g_old_rec.effective_start_date
73     and    t.effective_end_date   = (p_validation_start_date - 1);
74 --
75   l_proc                varchar2(72) := g_package||'dt_insert_dml';
76   l_created_by          pay_element_entries_f.created_by%TYPE;
77   l_creation_date       pay_element_entries_f.creation_date%TYPE;
78   l_last_update_date   	pay_element_entries_f.last_update_date%TYPE;
79   l_last_updated_by     pay_element_entries_f.last_updated_by%TYPE;
80   l_last_update_login   pay_element_entries_f.last_update_login%TYPE;
81 --
82 Begin
83   hr_utility.set_location('Entering:'||l_proc, 5);
84   --
85   -- Get the object version number for the insert
86   --
87   p_rec.object_version_number :=
88     dt_api.get_object_version_number
89       (p_base_table_name => 'pay_element_entries_f'
90       ,p_base_key_column => 'element_entry_id'
91       ,p_base_key_value  => p_rec.element_entry_id
92       );
93   --
94   -- Set the effective start and end dates to the corresponding
95   -- validation start and end dates
96   --
97   p_rec.effective_start_date := p_validation_start_date;
98   p_rec.effective_end_date   := p_validation_end_date;
99   --
100   -- If the datetrack_mode is not INSERT then we must populate the WHO
101   -- columns with the 'old' creation values and 'new' updated values.
102   --
103   If (p_datetrack_mode <> hr_api.g_insert) then
104     hr_utility.set_location(l_proc, 10);
105     --
106     -- Select the 'old' created values
107     --
108     Open C_Sel1;
109     Fetch C_Sel1 Into l_created_by, l_creation_date;
110     If C_Sel1%notfound Then
111       --
112       -- The previous 'old' created row has not been found. We need
113       -- to error as an internal datetrack problem exists.
114       --
115       Close C_Sel1;
116       fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
117       fnd_message.set_token('PROCEDURE', l_proc);
118       fnd_message.set_token('STEP','10');
119       fnd_message.raise_error;
120     End If;
121     Close C_Sel1;
122     --
123     -- Set the AOL updated WHO values
124     --
125     l_last_update_date   := sysdate;
126     l_last_updated_by    := fnd_global.user_id;
127     l_last_update_login  := fnd_global.login_id;
128   End If;
129   --
130   pay_ele_shd.g_api_dml := true;  -- Set the api dml status
131   --
132   -- Insert the row into: pay_element_entries_f
133   --
134   insert into pay_element_entries_f
135       (element_entry_id
136       ,effective_start_date
137       ,effective_end_date
138       ,cost_allocation_keyflex_id
139       ,assignment_id
140       ,updating_action_id
141       ,updating_action_type
142       ,element_link_id
143       ,original_entry_id
144       ,creator_type
145       ,entry_type
146       ,comment_id
147       ,creator_id
148       ,reason
149       ,target_entry_id
150       ,attribute_category
151       ,attribute1
152       ,attribute2
153       ,attribute3
154       ,attribute4
155       ,attribute5
156       ,attribute6
157       ,attribute7
158       ,attribute8
159       ,attribute9
160       ,attribute10
161       ,attribute11
162       ,attribute12
163       ,attribute13
164       ,attribute14
165       ,attribute15
166       ,attribute16
167       ,attribute17
168       ,attribute18
169       ,attribute19
170       ,attribute20
171       ,subpriority
172       ,personal_payment_method_id
173       ,date_earned
174       ,object_version_number
175       ,source_id
176       ,balance_adj_cost_flag
177       ,element_type_id
178       ,all_entry_values_null
179       ,created_by
180       ,creation_date
181       ,last_update_date
182       ,last_updated_by
183       ,last_update_login
184       )
185   Values
186     (p_rec.element_entry_id
187     ,p_rec.effective_start_date
188     ,p_rec.effective_end_date
189     ,p_rec.cost_allocation_keyflex_id
190     ,p_rec.assignment_id
191     ,p_rec.updating_action_id
192     ,p_rec.updating_action_type
193     ,p_rec.element_link_id
194     ,p_rec.original_entry_id
195     ,p_rec.creator_type
196     ,p_rec.entry_type
197     ,p_rec.comment_id
198     ,p_rec.creator_id
199     ,p_rec.reason
200     ,p_rec.target_entry_id
201     ,p_rec.attribute_category
202     ,p_rec.attribute1
203     ,p_rec.attribute2
204     ,p_rec.attribute3
205     ,p_rec.attribute4
206     ,p_rec.attribute5
207     ,p_rec.attribute6
208     ,p_rec.attribute7
209     ,p_rec.attribute8
210     ,p_rec.attribute9
211     ,p_rec.attribute10
212     ,p_rec.attribute11
213     ,p_rec.attribute12
214     ,p_rec.attribute13
215     ,p_rec.attribute14
216     ,p_rec.attribute15
217     ,p_rec.attribute16
218     ,p_rec.attribute17
219     ,p_rec.attribute18
220     ,p_rec.attribute19
221     ,p_rec.attribute20
222     ,p_rec.subpriority
223     ,p_rec.personal_payment_method_id
224     ,p_rec.date_earned
225     ,p_rec.object_version_number
226     ,p_rec.source_id
227     ,p_rec.balance_adj_cost_flag
228     ,p_rec.element_type_id
229     ,p_rec.all_entry_values_null
230     ,l_created_by
231     ,l_creation_date
232     ,l_last_update_date
233     ,l_last_updated_by
234     ,l_last_update_login
235     );
236   --
237   pay_ele_shd.g_api_dml := false;   -- Unset the api dml status
238   hr_utility.set_location(' Leaving:'||l_proc, 15);
239 --
240 Exception
241   When hr_api.check_integrity_violated Then
242     -- A check constraint has been violated
243     pay_ele_shd.g_api_dml := false;   -- Unset the api dml status
244     pay_ele_shd.constraint_error
245       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
246   When hr_api.unique_integrity_violated Then
247     -- Unique integrity has been violated
248     pay_ele_shd.g_api_dml := false;   -- Unset the api dml status
249     pay_ele_shd.constraint_error
250       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
251   When Others Then
252     pay_ele_shd.g_api_dml := false;   -- Unset the api dml status
253     Raise;
254 End dt_insert_dml;
255 --
256 -- ----------------------------------------------------------------------------
257 -- |------------------------------< insert_dml >------------------------------|
258 -- ----------------------------------------------------------------------------
259 Procedure insert_dml
260   (p_rec                   in out nocopy pay_ele_shd.g_rec_type
261   ,p_effective_date        in date
262   ,p_datetrack_mode        in varchar2
263   ,p_validation_start_date in date
264   ,p_validation_end_date   in date
265   ) is
266 --
267   l_proc	varchar2(72) := g_package||'insert_dml';
268 --
269 Begin
270   hr_utility.set_location('Entering:'||l_proc, 5);
271   --
272   pay_ele_ins.dt_insert_dml
273     (p_rec                   => p_rec
274     ,p_effective_date        => p_effective_date
275     ,p_datetrack_mode        => p_datetrack_mode
276     ,p_validation_start_date => p_validation_start_date
277     ,p_validation_end_date   => p_validation_end_date
278     );
279   --
280   hr_utility.set_location(' Leaving:'||l_proc, 10);
281 End insert_dml;
282 --
283 -- ----------------------------------------------------------------------------
284 -- |------------------------------< pre_insert >------------------------------|
285 -- ----------------------------------------------------------------------------
286 -- {Start Of Comments}
287 --
288 -- Description:
289 --   This private procedure contains any processing which is required before
290 --   the insert dml. Presently, if the entity has a corresponding primary
291 --   key which is maintained by an associating sequence, the primary key for
292 --   the entity will be populated with the next sequence value in
293 --   preparation for the insert dml.
294 --   Also, if comments are defined for this entity, the comments insert
295 --   logic will also be called, generating a comment_id if required.
296 --
297 -- Prerequisites:
298 --   This is an internal procedure which is called from the ins procedure.
299 --
300 -- In Parameters:
301 --   A Pl/Sql record structure.
302 --
303 -- Post Success:
304 --   Processing continues.
305 --
306 -- Post Failure:
307 --   If an error has occurred, an error message and exception will be raised
308 --   but not handled.
309 --
310 -- Developer Implementation Notes:
311 --   Any pre-processing required before the insert dml is issued should be
312 --   coded within this procedure. As stated above, a good example is the
313 --   generation of a primary key number via a corresponding sequence.
314 --   It is important to note that any 3rd party maintenance should be reviewed
315 --   before placing in this procedure.
316 --
317 -- Access Status:
318 --   Internal Row Handler Use Only.
319 --
320 -- {End Of Comments}
321 -- ----------------------------------------------------------------------------
322 Procedure pre_insert
323   (p_rec                   in out nocopy pay_ele_shd.g_rec_type
324   ,p_effective_date        in date
325   ,p_datetrack_mode        in varchar2
326   ,p_validation_start_date in date
327   ,p_validation_end_date   in date
328   ) is
329 --
330   l_proc	varchar2(72) := g_package||'pre_insert';
331 --
332   Cursor C_Sel1 is select pay_element_entries_s.nextval from sys.dual;
333 --
334 Begin
335   hr_utility.set_location('Entering:'||l_proc, 5);
336   --
337   --
338   -- Select the next sequence number
339   --
340   Open C_Sel1;
341   Fetch C_Sel1 Into p_rec.element_entry_id;
342   Close C_Sel1;
343   --
344   --
345   -- Insert the comment text if comments exist
346   --
347   If (p_rec.comments is not null) then
348     hr_comm_api.ins
349       (p_comment_id        => p_rec.comment_id
350       ,p_source_table_name => 'PAY_ELEMENT_ENTRIES_F'
351       ,p_comment_text      => p_rec.comments
352       );
353   End If;
354   hr_utility.set_location(' Leaving:'||l_proc, 10);
355 End pre_insert;
356 --
357 -- ----------------------------------------------------------------------------
358 -- |----------------------------< post_insert >-------------------------------|
359 -- ----------------------------------------------------------------------------
360 -- {Start Of Comments}
361 --
362 -- Description:
363 --   This private procedure contains any processing which is required after the
364 --   insert dml.
365 --
366 -- Prerequisites:
367 --   This is an internal procedure which is called from the ins procedure.
368 --
369 -- In Parameters:
370 --   A Pl/Sql record structure.
371 --
372 -- Post Success:
373 --   Processing continues.
374 --
375 -- Post Failure:
376 --   If an error has occurred, an error message and exception will be raised
377 --   but not handled.
378 --
379 -- Developer Implementation Notes:
380 --   Any post-processing required after the insert dml is issued should be
381 --   coded within this procedure. It is important to note that any 3rd party
382 --   maintenance should be reviewed before placing in this procedure.
383 --
384 -- Access Status:
385 --   Internal Row Handler Use Only.
386 --
387 -- {End Of Comments}
388 -- ----------------------------------------------------------------------------
389 Procedure post_insert
390   (p_rec                   in pay_ele_shd.g_rec_type
391   ,p_effective_date        in date
392   ,p_datetrack_mode        in varchar2
393   ,p_validation_start_date in date
394   ,p_validation_end_date   in date
395   ) is
396 --
397   l_proc	varchar2(72) := g_package||'post_insert';
398 --
399 
400 Begin
401   hr_utility.set_location('Entering:'||l_proc, 5);
402   begin
403     --
404     pay_ele_rki.after_insert
405       (p_effective_date
406       => p_effective_date
407       ,p_validation_start_date
408       => p_validation_start_date
409       ,p_validation_end_date
410       => p_validation_end_date
411       ,p_element_entry_id
412       => p_rec.element_entry_id
413       ,p_effective_start_date
414       => p_rec.effective_start_date
415       ,p_effective_end_date
416       => p_rec.effective_end_date
417       ,p_cost_allocation_keyflex_id
418       => p_rec.cost_allocation_keyflex_id
419       ,p_assignment_id
420       => p_rec.assignment_id
421       ,p_updating_action_id
422       => p_rec.updating_action_id
423       ,p_updating_action_type
424       => p_rec.updating_action_type
425       ,p_element_link_id
426       => p_rec.element_link_id
427       ,p_original_entry_id
428       => p_rec.original_entry_id
429       ,p_creator_type
430       => p_rec.creator_type
431       ,p_entry_type
432       => p_rec.entry_type
433       ,p_comment_id
434       => p_rec.comment_id
435       ,p_comments
436       => p_rec.comments
437       ,p_creator_id
438       => p_rec.creator_id
439       ,p_reason
440       => p_rec.reason
441       ,p_target_entry_id
442       => p_rec.target_entry_id
443       ,p_attribute_category
444       => p_rec.attribute_category
445       ,p_attribute1
446       => p_rec.attribute1
447       ,p_attribute2
448       => p_rec.attribute2
449       ,p_attribute3
450       => p_rec.attribute3
451       ,p_attribute4
452       => p_rec.attribute4
453       ,p_attribute5
454       => p_rec.attribute5
455       ,p_attribute6
456       => p_rec.attribute6
457       ,p_attribute7
458       => p_rec.attribute7
459       ,p_attribute8
460       => p_rec.attribute8
461       ,p_attribute9
462       => p_rec.attribute9
463       ,p_attribute10
464       => p_rec.attribute10
465       ,p_attribute11
466       => p_rec.attribute11
467       ,p_attribute12
468       => p_rec.attribute12
469       ,p_attribute13
470       => p_rec.attribute13
471       ,p_attribute14
472       => p_rec.attribute14
473       ,p_attribute15
474       => p_rec.attribute15
475       ,p_attribute16
476       => p_rec.attribute16
477       ,p_attribute17
478       => p_rec.attribute17
479       ,p_attribute18
480       => p_rec.attribute18
481       ,p_attribute19
482       => p_rec.attribute19
483       ,p_attribute20
484       => p_rec.attribute20
485 -- --
486   ,
487   p_entry_information_category => p_rec.entry_information_category,
488   p_entry_information1 => p_rec.entry_information1,
489   p_entry_information2 => p_rec.entry_information2,
490   p_entry_information3 => p_rec.entry_information3,
491   p_entry_information4 => p_rec.entry_information4,
492   p_entry_information5 => p_rec.entry_information5,
493   p_entry_information6 => p_rec.entry_information6,
494   p_entry_information7 => p_rec.entry_information7,
495   p_entry_information8 => p_rec.entry_information8,
496   p_entry_information9 => p_rec.entry_information9,
497   p_entry_information10 => p_rec.entry_information10,
498   p_entry_information11 => p_rec.entry_information11,
499   p_entry_information12 => p_rec.entry_information12,
500   p_entry_information13 => p_rec.entry_information13,
501   p_entry_information14 => p_rec.entry_information14,
502   p_entry_information15 => p_rec.entry_information15,
503   p_entry_information16 => p_rec.entry_information16,
504   p_entry_information17 => p_rec.entry_information17,
505   p_entry_information18 => p_rec.entry_information18,
506   p_entry_information19 => p_rec.entry_information19,
507   p_entry_information20 => p_rec.entry_information20,
508   p_entry_information21 => p_rec.entry_information21,
509   p_entry_information22 => p_rec.entry_information22,
510   p_entry_information23 => p_rec.entry_information23,
511   p_entry_information24 => p_rec.entry_information24,
512   p_entry_information25 => p_rec.entry_information25,
513   p_entry_information26 => p_rec.entry_information26,
514   p_entry_information27 => p_rec.entry_information27,
515   p_entry_information28 => p_rec.entry_information28,
516   p_entry_information29 => p_rec.entry_information29,
517   p_entry_information30 => p_rec.entry_information30
518       ,p_subpriority
519       => p_rec.subpriority
520       ,p_personal_payment_method_id
521       => p_rec.personal_payment_method_id
522       ,p_date_earned
523       => p_rec.date_earned
524       ,p_object_version_number
525       => p_rec.object_version_number
526       ,p_source_id
527       => p_rec.source_id
528       ,p_balance_adj_cost_flag => p_rec.balance_adj_cost_flag
529       ,p_element_type_id => p_rec.element_type_id
530       ,p_all_entry_values_null => p_rec.all_entry_values_null
531       );
532     --
533   exception
534     --
535     when hr_api.cannot_find_prog_unit then
536       --
537       hr_api.cannot_find_prog_unit_error
538         (p_module_name => 'PAY_ELEMENT_ENTRIES_F'
539         ,p_hook_type   => 'AI');
540       --
541   end;
542   --
543   -- 11-NOV-03
544   -- Hard calls to DYT_PKG removed, perfomed in pyentapi.pkb
545 
546   hr_utility.set_location('Leaving:'||l_proc, 900);
547   --
548 End post_insert;
549 --
550 -- ----------------------------------------------------------------------------
551 -- |-------------------------------< ins_lck >--------------------------------|
552 -- ----------------------------------------------------------------------------
553 -- {Start Of Comments}
554 --
555 -- Description:
556 --   The ins_lck process has one main function to perform. When inserting
557 --   a datetracked row, we must validate the DT mode.
558 --
559 -- Prerequisites:
560 --   This procedure can only be called for the datetrack mode of INSERT.
561 --
562 -- In Parameters:
563 --
564 -- Post Success:
565 --   On successful completion of the ins_lck process the parental
566 --   datetracked rows will be locked providing the p_enforce_foreign_locking
567 --   argument value is TRUE.
568 --   If the p_enforce_foreign_locking argument value is FALSE then the
569 --   parential rows are not locked.
570 --
571 -- Post Failure:
572 --   The Lck process can fail for:
573 --   1) When attempting to lock the row the row could already be locked by
574 --      another user. This will raise the HR_Api.Object_Locked exception.
575 --   2) When attempting to the lock the parent which doesn't exist.
576 --      For the entity to be locked the parent must exist!
577 --
578 -- Developer Implementation Notes:
579 --   None.
580 --
581 -- Access Status:
582 --   Internal Row Handler Use Only.
583 --
584 -- {End Of Comments}
585 -- ----------------------------------------------------------------------------
586 Procedure ins_lck
587   (p_effective_date        in date
588   ,p_datetrack_mode        in varchar2
589   ,p_rec                   in pay_ele_shd.g_rec_type
590   ,p_validation_start_date out nocopy date
591   ,p_validation_end_date   out nocopy date
592   ) is
593 --
594   l_proc		  varchar2(72) := g_package||'ins_lck';
595   l_validation_start_date date;
596   l_validation_end_date	  date;
597 --
598 Begin
599   hr_utility.set_location('Entering:'||l_proc, 5);
600   --
601   -- Validate the datetrack mode mode getting the validation start
602   -- and end dates for the specified datetrack operation.
603   --
604   dt_api.validate_dt_mode
605     (p_effective_date	       => p_effective_date
606     ,p_datetrack_mode          => p_datetrack_mode
607     ,p_base_table_name         => 'pay_element_entries_f'
608     ,p_base_key_column         => 'element_entry_id'
609     ,p_base_key_value          => p_rec.element_entry_id
610     ,p_parent_table_name1      => 'per_all_assignments_f'
611     ,p_parent_key_column1      => 'assignment_id'
612     ,p_parent_key_value1       => p_rec.assignment_id
613     ,p_parent_table_name2      => 'pay_element_links_f'
614     ,p_parent_key_column2      => 'element_link_id'
615     ,p_parent_key_value2       => p_rec.element_link_id
616     ,p_enforce_foreign_locking => true
617     ,p_validation_start_date   => l_validation_start_date
618     ,p_validation_end_date     => l_validation_end_date
619     );
620   --
621   -- Set the validation start and end date OUT arguments
622   --
623   p_validation_start_date := l_validation_start_date;
624   p_validation_end_date   := l_validation_end_date;
625   --
626   hr_utility.set_location(' Leaving:'||l_proc, 10);
627 --
628 End ins_lck;
629 --
630 -- ----------------------------------------------------------------------------
631 -- |---------------------------------< ins >----------------------------------|
632 -- ----------------------------------------------------------------------------
633 Procedure ins
634   (p_effective_date in     date
635   ,p_rec            in out nocopy pay_ele_shd.g_rec_type
636   ) is
637 --
638   l_proc                        varchar2(72) := g_package||'ins';
639   l_datetrack_mode              varchar2(30) := hr_api.g_insert;
640   l_validation_start_date       date;
641   l_validation_end_date         date;
642 --
643 Begin
644   hr_utility.set_location('Entering:'||l_proc, 5);
645   --
646   -- Call the lock operation
647   --
648   pay_ele_ins.ins_lck
649     (p_effective_date        => p_effective_date
650     ,p_datetrack_mode        => l_datetrack_mode
651     ,p_rec                   => p_rec
652     ,p_validation_start_date => l_validation_start_date
653     ,p_validation_end_date   => l_validation_end_date
654     );
655   --
656   -- Call the supporting insert validate operations
657   --
658   pay_ele_bus.insert_validate
659     (p_rec                   => p_rec
660     ,p_effective_date        => p_effective_date
661     ,p_datetrack_mode        => l_datetrack_mode
662     ,p_validation_start_date => l_validation_start_date
663     ,p_validation_end_date   => l_validation_end_date
664     );
665   --
666   -- Call the supporting pre-insert operation
667   --
668   pay_ele_ins.pre_insert
669     (p_rec                   => p_rec
670     ,p_effective_date        => p_effective_date
671     ,p_datetrack_mode        => l_datetrack_mode
672     ,p_validation_start_date => l_validation_start_date
673     ,p_validation_end_date   => l_validation_end_date
674     );
675   --
676   -- Insert the row
677   --
678   pay_ele_ins.insert_dml
679     (p_rec                   => p_rec
680     ,p_effective_date        => p_effective_date
681     ,p_datetrack_mode        => l_datetrack_mode
682     ,p_validation_start_date => l_validation_start_date
683     ,p_validation_end_date   => l_validation_end_date
684     );
685   --
686   -- Call the supporting post-insert operation
687   --
688   pay_ele_ins.post_insert
689     (p_rec                   => p_rec
690     ,p_effective_date        => p_effective_date
691     ,p_datetrack_mode        => l_datetrack_mode
692     ,p_validation_start_date => l_validation_start_date
693     ,p_validation_end_date   => l_validation_end_date
694     );
695   --
696   hr_utility.set_location('Leaving:'||l_proc,10);
697 end ins;
698 --
699 -- ----------------------------------------------------------------------------
700 -- |---------------------------------< ins >----------------------------------|
701 -- ----------------------------------------------------------------------------
702 Procedure ins
703   (p_effective_date                 in     date
704   ,p_assignment_id                  in     number
705   ,p_element_link_id                in     number
706   ,p_creator_type                   in     varchar2
707   ,p_entry_type                     in     varchar2
708   ,p_cost_allocation_keyflex_id     in     number   default null
709   ,p_updating_action_id             in     number   default null
710   ,p_updating_action_type           in     varchar2 default null
711   ,p_original_entry_id              in     number   default null
712   ,p_comments                       in     varchar2 default null
713   ,p_creator_id                     in     number   default null
714   ,p_reason                         in     varchar2 default null
715   ,p_target_entry_id                in     number   default null
716   ,p_attribute_category             in     varchar2 default null
717   ,p_attribute1                     in     varchar2 default null
718   ,p_attribute2                     in     varchar2 default null
719   ,p_attribute3                     in     varchar2 default null
720   ,p_attribute4                     in     varchar2 default null
721   ,p_attribute5                     in     varchar2 default null
722   ,p_attribute6                     in     varchar2 default null
723   ,p_attribute7                     in     varchar2 default null
724   ,p_attribute8                     in     varchar2 default null
725   ,p_attribute9                     in     varchar2 default null
726   ,p_attribute10                    in     varchar2 default null
727   ,p_attribute11                    in     varchar2 default null
728   ,p_attribute12                    in     varchar2 default null
729   ,p_attribute13                    in     varchar2 default null
730   ,p_attribute14                    in     varchar2 default null
731   ,p_attribute15                    in     varchar2 default null
732   ,p_attribute16                    in     varchar2 default null
733   ,p_attribute17                    in     varchar2 default null
734   ,p_attribute18                    in     varchar2 default null
735   ,p_attribute19                    in     varchar2 default null
736   ,p_attribute20                    in     varchar2 default null
737   ,p_subpriority                    in     number   default null
738   ,p_personal_payment_method_id     in     number   default null
739   ,p_date_earned                    in     date     default null
740   ,p_source_id                      in     number   default null
741   ,p_balance_adj_cost_flag          in     varchar2 default null
742   ,p_element_entry_id                  out nocopy number
743   ,p_object_version_number             out nocopy number
744   ,p_effective_start_date              out nocopy date
745   ,p_effective_end_date                out nocopy date
746   ,p_comment_id                        out nocopy number
747   ) is
748 --
749   l_rec         pay_ele_shd.g_rec_type;
750   l_proc        varchar2(72) := g_package||'ins';
751   l_ele_type_id pay_element_types_f.element_type_id%type;
752 --
753 Begin
754   hr_utility.set_location('Entering:'||l_proc, 5);
755   --
756   -- First derive the element_type_id
757   --
758     l_ele_type_id := pay_ele_bus.derive_element_type_id
759                      (p_element_link_id => p_element_link_id
760                      ,p_effective_date  => p_effective_date);
761   --
762   -- Call conversion function to turn arguments into the
763   -- p_rec structure.
764   --
765   l_rec :=
766   pay_ele_shd.convert_args
767     (null
768     ,null
769     ,null
770     ,p_cost_allocation_keyflex_id
771     ,p_assignment_id
772     ,p_updating_action_id
773     ,p_updating_action_type
774     ,p_element_link_id
775     ,p_original_entry_id
776     ,p_creator_type
777     ,p_entry_type
778     ,null
779     ,p_comments
780     ,p_creator_id
781     ,p_reason
782     ,p_target_entry_id
783     ,p_attribute_category
784     ,p_attribute1
785     ,p_attribute2
786     ,p_attribute3
787     ,p_attribute4
788     ,p_attribute5
789     ,p_attribute6
790     ,p_attribute7
791     ,p_attribute8
792     ,p_attribute9
793     ,p_attribute10
794     ,p_attribute11
795     ,p_attribute12
796     ,p_attribute13
797     ,p_attribute14
798     ,p_attribute15
799     ,p_attribute16
800     ,p_attribute17
801     ,p_attribute18
802     ,p_attribute19
803     ,p_attribute20
804     ,p_subpriority
805     ,p_personal_payment_method_id
806     ,p_date_earned
807     ,null
808     ,p_source_id
809     ,p_balance_adj_cost_flag
810     ,l_ele_type_id
811     ,null -- p_all_entry_values_null
812     );
813   --
814   -- Having converted the arguments into the pay_ele_rec
815   -- plsql record structure we call the corresponding record
816   -- business process.
817   --
818   pay_ele_ins.ins
819     (p_effective_date
820     ,l_rec
821     );
822   --
823   -- Set the OUT arguments.
824   --
825   p_element_entry_id                 := l_rec.element_entry_id;
826   p_effective_start_date             := l_rec.effective_start_date;
827   p_effective_end_date               := l_rec.effective_end_date;
828   p_object_version_number            := l_rec.object_version_number;
829   p_comment_id                       := l_rec.comment_id;
830   --
831   hr_utility.set_location(' Leaving:'||l_proc, 10);
832 End ins;
833 --
834 end pay_ele_ins;