DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_CTC_INS

Source


1 Package Body per_ctc_ins as
2 /* $Header: pectcrhi.pkb 120.1 2010/11/29 06:24:00 ghshanka ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  per_ctc_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 structre.
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 per_ctc_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) is
63 --
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 
70     from   per_contracts_f t
71     where  t.contract_id       = p_rec.contract_id
72     and    t.effective_start_date =
73              per_ctc_shd.g_old_rec.effective_start_date
74     and    t.effective_end_date   = (p_validation_start_date - 1);
75 --
76   l_proc		varchar2(72) := g_package||'dt_insert_dml';
77   l_created_by          per_contracts_f.created_by%TYPE;
78   l_creation_date       per_contracts_f.creation_date%TYPE;
79   l_last_update_date   	per_contracts_f.last_update_date%TYPE;
80   l_last_updated_by     per_contracts_f.last_updated_by%TYPE;
81   l_last_update_login   per_contracts_f.last_update_login%TYPE;
82 --
83 Begin
84   hr_utility.set_location('Entering:'||l_proc, 5);
85   --
86   -- Get the object version number for the insert
87   --
88   p_rec.object_version_number :=
89     dt_api.get_object_version_number
90 	(p_base_table_name => 'per_contracts_f',
91 	 p_base_key_column => 'contract_id',
92 	 p_base_key_value  => p_rec.contract_id);
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 <> '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       hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
117       hr_utility.set_message_token('PROCEDURE', l_proc);
118       hr_utility.set_message_token('STEP','10');
119       hr_utility.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   -- Insert the row into: per_contracts_f
131   --
132   insert into per_contracts_f
133   (	contract_id,
134 	effective_start_date,
135 	effective_end_date,
136 	business_group_id,
137 	object_version_number,
138 	person_id,
139 	reference,
140 	type,
141 	status,
142 	status_reason,
143         doc_status,
144         doc_status_change_date,
145 	description,
146 	duration,
147 	duration_units,
148 	contractual_job_title,
149 	parties,
150 	start_reason,
151 	end_reason,
152 	number_of_extensions,
153 	extension_reason,
154 	extension_period,
155 	extension_period_units,
156 	ctr_information_category,
157 	ctr_information1,
158 	ctr_information2,
159 	ctr_information3,
160 	ctr_information4,
161 	ctr_information5,
162 	ctr_information6,
163 	ctr_information7,
164 	ctr_information8,
165 	ctr_information9,
166 	ctr_information10,
167 	ctr_information11,
168 	ctr_information12,
169 	ctr_information13,
170 	ctr_information14,
171 	ctr_information15,
172 	ctr_information16,
173 	ctr_information17,
174 	ctr_information18,
175 	ctr_information19,
176 	ctr_information20,
177 	attribute_category,
178 	attribute1,
179 	attribute2,
180 	attribute3,
181 	attribute4,
182 	attribute5,
183 	attribute6,
184 	attribute7,
185 	attribute8,
186 	attribute9,
187 	attribute10,
188 	attribute11,
189 	attribute12,
190 	attribute13,
191 	attribute14,
192 	attribute15,
193 	attribute16,
194 	attribute17,
195 	attribute18,
196 	attribute19,
197 	attribute20
198    	, created_by,
199    	creation_date,
200    	last_update_date,
201    	last_updated_by,
202    	last_update_login
203   )
204   Values
205   (	p_rec.contract_id,
206 	p_rec.effective_start_date,
207 	p_rec.effective_end_date,
208 	p_rec.business_group_id,
209 	p_rec.object_version_number,
210 	p_rec.person_id,
211 	p_rec.reference,
212 	p_rec.type,
213 	p_rec.status,
214 	p_rec.status_reason,
215         p_rec.doc_status,
216         p_rec.doc_status_change_date,
217 	p_rec.description,
218 	p_rec.duration,
219 	p_rec.duration_units,
220 	p_rec.contractual_job_title,
221 	p_rec.parties,
222 	p_rec.start_reason,
223 	p_rec.end_reason,
224 	p_rec.number_of_extensions,
225 	p_rec.extension_reason,
226 	p_rec.extension_period,
227 	p_rec.extension_period_units,
228 	p_rec.ctr_information_category,
229 	p_rec.ctr_information1,
230 	p_rec.ctr_information2,
231 	p_rec.ctr_information3,
232 	p_rec.ctr_information4,
233 	p_rec.ctr_information5,
234 	p_rec.ctr_information6,
235 	p_rec.ctr_information7,
236 	p_rec.ctr_information8,
237 	p_rec.ctr_information9,
238 	p_rec.ctr_information10,
239 	p_rec.ctr_information11,
240 	p_rec.ctr_information12,
241 	p_rec.ctr_information13,
242 	p_rec.ctr_information14,
243 	p_rec.ctr_information15,
244 	p_rec.ctr_information16,
245 	p_rec.ctr_information17,
246 	p_rec.ctr_information18,
247 	p_rec.ctr_information19,
248 	p_rec.ctr_information20,
249 	p_rec.attribute_category,
250 	p_rec.attribute1,
251 	p_rec.attribute2,
252 	p_rec.attribute3,
253 	p_rec.attribute4,
254 
255 	p_rec.attribute5,
256 	p_rec.attribute6,
257 	p_rec.attribute7,
258 	p_rec.attribute8,
259 	p_rec.attribute9,
260 	p_rec.attribute10,
261 	p_rec.attribute11,
262 	p_rec.attribute12,
263 	p_rec.attribute13,
264 	p_rec.attribute14,
265 	p_rec.attribute15,
266 	p_rec.attribute16,
267 	p_rec.attribute17,
268 	p_rec.attribute18,
269 	p_rec.attribute19,
270 	p_rec.attribute20
271 	, l_created_by,
272    	l_creation_date,
273    	l_last_update_date,
274    	l_last_updated_by,
275    	l_last_update_login
276   );
277   --
278   hr_utility.set_location(' Leaving:'||l_proc, 15);
279 --
280 Exception
281   When hr_api.check_integrity_violated Then
282     -- A check constraint has been violated
283     per_ctc_shd.constraint_error
284       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
285   When hr_api.unique_integrity_violated Then
286     -- Unique integrity has been violated
287     per_ctc_shd.constraint_error
288       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
289   When Others Then
290     Raise;
291 End dt_insert_dml;
292 --
293 -- ----------------------------------------------------------------------------
294 -- |------------------------------< insert_dml >------------------------------|
295 -- ----------------------------------------------------------------------------
296 Procedure insert_dml
297 	(p_rec 			 in out nocopy per_ctc_shd.g_rec_type,
298 	 p_effective_date	       in	date,
299 	 p_datetrack_mode   	 in	varchar2,
300 	 p_validation_start_date in	date,
301 	 p_validation_end_date	 in	date) is
302 --
303 
304   l_proc	varchar2(72) := g_package||'insert_dml';
305 --
306 Begin
307   hr_utility.set_location('Entering:'||l_proc, 5);
308   --
309   dt_insert_dml(p_rec			=> p_rec,
310 		p_effective_date	=> p_effective_date,
311 		p_datetrack_mode	=> p_datetrack_mode,
312        		p_validation_start_date	=> p_validation_start_date,
313 		p_validation_end_date	=> p_validation_end_date);
314   --
315   hr_utility.set_location(' Leaving:'||l_proc, 10);
316 End insert_dml;
317 --
318 -- ----------------------------------------------------------------------------
319 -- |------------------------------< pre_insert >------------------------------|
320 -- ----------------------------------------------------------------------------
321 -- {Start Of Comments}
322 --
323 -- Description:
324 --   This private procedure contains any processing which is required before
325 --   the insert dml. Presently, if the entity has a corresponding primary
326 --   key which is maintained by an associating sequence, the primary key for
327 --   the entity will be populated with the next sequence value in
328 --   preparation for the insert dml.
329 --   Also, if comments are defined for this entity, the comments insert
330 --   logic will also be called, generating a comment_id if required.
331 --
332 -- Prerequisites:
333 --   This is an internal procedure which is called from the ins procedure.
334 --
335 -- In Parameters:
336 --   A Pl/Sql record structre.
337 --
338 -- Post Success:
339 --   Processing continues.
340 --
341 -- Post Failure:
342 --   If an error has occurred, an error message and exception will be raised
343 --   but not handled.
344 --
345 -- Developer Implementation Notes:
346 --   Any pre-processing required before the insert dml is issued should be
347 --   coded within this procedure. As stated above, a good example is the
348 --   generation of a primary key number via a corresponding sequence.
349 --   It is important to note that any 3rd party maintenance should be reviewed
350 --   before placing in this procedure.
351 --
352 -- Access Status:
353 --   Internal Row Handler Use Only.
354 --
355 -- {End Of Comments}
356 -- ----------------------------------------------------------------------------
357 Procedure pre_insert
358 	(p_rec  			in out nocopy per_ctc_shd.g_rec_type,
359 	 p_effective_date		in date,
360 	 p_datetrack_mode		in varchar2,
361 	 p_validation_start_date	in date,
362 	 p_validation_end_date		in date) is
363 --
364   l_proc	varchar2(72) := g_package||'pre_insert';
365 --
366   Cursor C_Sel1 is select per_contracts_s.nextval from sys.dual;
367 --
368 Begin
369   hr_utility.set_location('Entering:'||l_proc, 5);
370   --
371   --
372   -- Select the next sequence number
373   --
374   Open C_Sel1;
375   Fetch C_Sel1 Into p_rec.contract_id;
376   Close C_Sel1;
377   --
378   --
379   hr_utility.set_location(' Leaving:'||l_proc, 10);
380 End pre_insert;
381 --
382 -- ----------------------------------------------------------------------------
383 -- |-----------------------------< post_insert >------------------------------|
384 -- ----------------------------------------------------------------------------
385 -- {Start Of Comments}
386 --
387 -- Description:
388 --   This private procedure contains any processing which is required after the
389 --   insert dml.
390 --
391 -- Prerequisites:
392 --   This is an internal procedure which is called from the ins procedure.
393 --
394 -- In Parameters:
395 --   A Pl/Sql record structre.
396 --
397 -- Post Success:
398 --   Processing continues.
399 --
400 -- Post Failure:
401 --   If an error has occurred, an error message and exception will be raised
402 --   but not handled.
403 --
404 -- Developer Implementation Notes:
405 --   Any post-processing required after the insert dml is issued should be
406 --   coded within this procedure. It is important to note that any 3rd party
407 --   maintenance should be reviewed before placing in this procedure.
408 --
409 -- Access Status:
410 --   Internal Row Handler Use Only.
411 --
412 -- {End Of Comments}
413 -- ----------------------------------------------------------------------------
414 Procedure post_insert
415 	(p_rec 			 in per_ctc_shd.g_rec_type,
416 	 p_effective_date	 in date,
417 	 p_datetrack_mode	 in varchar2,
418 	 p_validation_start_date in date,
419 	 p_validation_end_date	 in date) is
420 --
421   l_proc	varchar2(72) := g_package||'post_insert';
422 --
423 Begin
424   hr_utility.set_location('Entering:'||l_proc, 5);
425   --
426   -- Start of API User Hook for post_insert.
427   --
428   begin
429     --
430     per_ctc_rki.after_insert
431     (
432      p_contract_id                  => p_rec.contract_id,
433      p_effective_start_date         => p_rec.effective_start_date,
434      p_effective_end_date           => p_rec.effective_end_date,
435      p_business_group_id            => p_rec.business_group_id,
436      p_object_version_number        => p_rec.object_version_number,
437      p_person_id                    => p_rec.person_id,
438      p_reference                    => p_rec.reference,
439      p_type                         => p_rec.type,
440      p_status                       => p_rec.status,
441      p_status_reason                => p_rec.status_reason,
442      p_doc_status                   => p_rec.doc_status,
443      p_doc_status_change_date       => p_rec.doc_status_change_date,
444      p_description                  => p_rec.description,
445      p_duration                     => p_rec.duration,
446      p_duration_units               => p_rec.duration_units,
447      p_contractual_job_title        => p_rec.contractual_job_title,
448      p_parties                      => p_rec.parties,
449      p_start_reason                 => p_rec.start_reason,
450      p_end_reason                   => p_rec.end_reason ,
451      p_number_of_extensions         => p_rec.number_of_extensions,
452      p_extension_reason             => p_rec.extension_reason,
453      p_extension_period             => p_rec.extension_period,
454      p_extension_period_units       => p_rec.extension_period_units,
455      p_ctr_information_category     => p_rec.ctr_information_category,
456      p_ctr_information1             => p_rec.ctr_information1,
457      p_ctr_information2             => p_rec.ctr_information2,
458      p_ctr_information3             => p_rec.ctr_information3,
459      p_ctr_information4             => p_rec.ctr_information4,
460      p_ctr_information5             => p_rec.ctr_information5,
461      p_ctr_information6             => p_rec.ctr_information6,
462      p_ctr_information7             => p_rec.ctr_information7,
463      p_ctr_information8             => p_rec.ctr_information8,
464      p_ctr_information9             => p_rec.ctr_information9,
465      p_ctr_information10            => p_rec.ctr_information10,
466      p_ctr_information11            => p_rec.ctr_information11,
467      p_ctr_information12            => p_rec.ctr_information12,
468      p_ctr_information13            => p_rec.ctr_information13,
469      p_ctr_information14            => p_rec.ctr_information14,
470      p_ctr_information15            => p_rec.ctr_information15,
471      p_ctr_information16            => p_rec.ctr_information16,
472      p_ctr_information17            => p_rec.ctr_information17,
473      p_ctr_information18            => p_rec.ctr_information18,
474      p_ctr_information19            => p_rec.ctr_information19,
475      p_ctr_information20            => p_rec.ctr_information20,
476      p_attribute_category           => p_rec.attribute_category,
477      p_attribute1                   => p_rec.attribute1,
478      p_attribute2                   => p_rec.attribute2,
479      p_attribute3                   => p_rec.attribute3,
480      p_attribute4                   => p_rec.attribute4,
481      p_attribute5                   => p_rec.attribute5,
482      p_attribute6                   => p_rec.attribute6,
483      p_attribute7                   => p_rec.attribute7,
484      p_attribute8                   => p_rec.attribute8,
485      p_attribute9                   => p_rec.attribute9,
486      p_attribute10                  => p_rec.attribute10,
487      p_attribute11                  => p_rec.attribute11,
488      p_attribute12                  => p_rec.attribute12,
489      p_attribute13                  => p_rec.attribute13,
490      p_attribute14                  => p_rec.attribute14,
491      p_attribute15                  => p_rec.attribute15,
492      p_attribute16                  => p_rec.attribute16,
493      p_attribute17                  => p_rec.attribute17,
494      p_attribute18                  => p_rec.attribute18,
495      p_attribute19                  => p_rec.attribute19,
496      p_attribute20                  => p_rec.attribute20,
497      p_effective_date               => p_effective_date,
498      p_validation_start_date        => p_validation_start_date,
499      p_validation_end_date          => p_validation_end_date
500     );
501     --
502   exception
503     --
504     when hr_api.cannot_find_prog_unit then
505       --
506       hr_api.cannot_find_prog_unit_error
507         (p_module_name => 'per_contracts_f'
508         ,p_hook_type   => 'AI');
509       --
510   end;
511   --
512   -- End of API User Hook for post_insert.
513   --
514   hr_utility.set_location(' Leaving:'||l_proc, 10);
515 End post_insert;
516 --
517 -- ----------------------------------------------------------------------------
518 -- |-------------------------------< ins_lck >--------------------------------|
519 -- ----------------------------------------------------------------------------
520 -- {Start Of Comments}
521 --
522 -- Description:
523 --   The ins_lck process has one main function to perform. When inserting
524 --   a datetracked row, we must validate the DT mode.
525 --   be manipulated.
526 --
527 -- Prerequisites:
528 --   This procedure can only be called for the datetrack mode of INSERT.
529 --
530 -- In Parameters:
531 --
532 -- Post Success:
533 --   On successful completion of the ins_lck process the parental
534 --   datetracked rows will be locked providing the p_enforce_foreign_locking
535 --   argument value is TRUE.
536 --   If the p_enforce_foreign_locking argument value is FALSE then the
537 --   parential rows are not locked.
538 --
539 -- Post Failure:
540 --   The Lck process can fail for:
541 --   1) When attempting to lock the row the row could already be locked by
542 --      another user. This will raise the HR_Api.Object_Locked exception.
543 --   2) When attempting to the lock the parent which doesn't exist.
544 --      For the entity to be locked the parent must exist!
545 --
546 -- Developer Implementation Notes:
547 --   None.
548 --
549 -- Access Status:
550 --   Internal Row Handler Use Only.
551 --
552 -- {End Of Comments}
553 -- ----------------------------------------------------------------------------
554 Procedure ins_lck
555 	(p_effective_date	       in  date,
556 	 p_datetrack_mode	       in  varchar2,
557 	 p_rec	 		 in  per_ctc_shd.g_rec_type,
558 	 p_validation_start_date out nocopy date,
559 	 p_validation_end_date	 out nocopy date) is
560 --
561   l_proc		  varchar2(72) := g_package||'ins_lck';
562   l_validation_start_date date;
563   l_validation_end_date	  date;
564 --
565 Begin
566   hr_utility.set_location('Entering:'||l_proc, 5);
567   --
568   -- Validate the datetrack mode mode getting the validation start
569   -- and end dates for the specified datetrack operation.
570   --
571   dt_api.validate_dt_mode
572 	(p_effective_date	   => p_effective_date,
573 	 p_datetrack_mode	   => p_datetrack_mode,
574 	 p_base_table_name	   => 'per_contracts_f',
575 	 p_base_key_column	   => 'contract_id',
576 	 p_base_key_value 	   => p_rec.contract_id,
577          p_parent_table_name1      => 'per_people_f',
578          p_parent_key_column1      => 'person_id',
579          p_parent_key_value1       => p_rec.person_id,
580          p_enforce_foreign_locking => true,
581 	 p_validation_start_date   => l_validation_start_date,
582  	 p_validation_end_date	   => l_validation_end_date);
583   --
584   -- Set the validation start and end date OUT arguments
585   --
586   p_validation_start_date := l_validation_start_date;
587   p_validation_end_date   := l_validation_end_date;
588   --
589   hr_utility.set_location(' Leaving:'||l_proc, 10);
590 
591 --
592 End ins_lck;
593 --
594 -- ----------------------------------------------------------------------------
595 -- |---------------------------------< ins >----------------------------------|
596 -- ----------------------------------------------------------------------------
597 Procedure ins
598   (
599   p_rec            in out nocopy per_ctc_shd.g_rec_type,
600   p_effective_date in     date
601   ) is
602 --
603   l_proc			varchar2(72) := g_package||'ins';
604   l_datetrack_mode		varchar2(30) := 'INSERT';
605   l_validation_start_date	date;
606   l_validation_end_date		date;
607 --
608 Begin
609   hr_utility.set_location('Entering:'||l_proc, 5);
610   --
611   -- Call the lock operation
612   --
613   ins_lck
614 	(p_effective_date	 => p_effective_date,
615 	 p_datetrack_mode	 => l_datetrack_mode,
616 	 p_rec	 		 => p_rec,
617 	 p_validation_start_date => l_validation_start_date,
618 	 p_validation_end_date	 => l_validation_end_date);
619   --
620   -- Call the supporting insert validate operations
621   --
622   per_ctc_bus.insert_validate
623 	(p_rec			 => p_rec,
624 	 p_effective_date	 => p_effective_date,
625 	 p_datetrack_mode	 => l_datetrack_mode,
626 	 p_validation_start_date => l_validation_start_date,
627 	 p_validation_end_date	 => l_validation_end_date);
628   --
629   -- Call the supporting pre-insert operation
630   --
631   pre_insert
632  	(p_rec			 => p_rec,
633 	 p_effective_date	       => p_effective_date,
634 	 p_datetrack_mode   	 => l_datetrack_mode,
635 	 p_validation_start_date => l_validation_start_date,
636 	 p_validation_end_date	 => l_validation_end_date);
637   --
638   -- Insert the row
639   --
640   insert_dml
641  	(p_rec			 => p_rec,
642 	 p_effective_date	 => p_effective_date,
643 	 p_datetrack_mode	 => l_datetrack_mode,
644 	 p_validation_start_date => l_validation_start_date,
645 	 p_validation_end_date	 => l_validation_end_date);
646   --
647   -- Call the supporting post-insert operation
648   --
649   post_insert
650  	(p_rec			 => p_rec,
651 	 p_effective_date	 => p_effective_date,
652 	 p_datetrack_mode	 => l_datetrack_mode,
653 	 p_validation_start_date => l_validation_start_date,
654 	 p_validation_end_date	 => l_validation_end_date);
655 end ins;
656 --
657 -- ----------------------------------------------------------------------------
658 -- |---------------------------------< ins >----------------------------------|
659 -- ----------------------------------------------------------------------------
660 Procedure ins
661   (
662   p_contract_id                  out nocopy number,
663   p_effective_start_date         out nocopy date,
664   p_effective_end_date           out nocopy date,
665   p_business_group_id            in number,
666   p_object_version_number        out nocopy number,
667   p_person_id                    in number,
668   p_reference                    in varchar2,
669   p_type                         in varchar2,
670   p_status                       in varchar2,
671   p_status_reason                in varchar2         default null,
672   p_doc_status                   in varchar2         default null,
673   p_doc_status_change_date       in date             default null,
674   p_description                  in varchar2         default null,
675   p_duration                     in number           default null,
676   p_duration_units               in varchar2         default null,
677   p_contractual_job_title        in varchar2         default null,
678   p_parties                      in varchar2         default null,
679   p_start_reason                 in varchar2         default null,
680   p_end_reason                   in varchar2         default null,
681   p_number_of_extensions         in number           default null,
682   p_extension_reason             in varchar2         default null,
683   p_extension_period             in number           default null,
684   p_extension_period_units       in varchar2         default null,
685   p_ctr_information_category     in varchar2         default null,
686   p_ctr_information1             in varchar2         default null,
687   p_ctr_information2             in varchar2         default null,
688   p_ctr_information3             in varchar2         default null,
689   p_ctr_information4             in varchar2         default null,
690   p_ctr_information5             in varchar2         default null,
691   p_ctr_information6             in varchar2         default null,
692   p_ctr_information7             in varchar2         default null,
693   p_ctr_information8             in varchar2         default null,
694   p_ctr_information9             in varchar2         default null,
695   p_ctr_information10            in varchar2         default null,
696   p_ctr_information11            in varchar2         default null,
697   p_ctr_information12            in varchar2         default null,
698   p_ctr_information13            in varchar2         default null,
699   p_ctr_information14            in varchar2         default null,
700   p_ctr_information15            in varchar2         default null,
701   p_ctr_information16            in varchar2         default null,
702   p_ctr_information17            in varchar2         default null,
703   p_ctr_information18            in varchar2         default null,
704   p_ctr_information19            in varchar2         default null,
705   p_ctr_information20            in varchar2         default null,
706   p_attribute_category           in varchar2         default null,
707   p_attribute1                   in varchar2         default null,
708   p_attribute2                   in varchar2         default null,
709   p_attribute3                   in varchar2         default null,
710   p_attribute4                   in varchar2         default null,
711   p_attribute5                   in varchar2         default null,
712   p_attribute6                   in varchar2         default null,
713   p_attribute7                   in varchar2         default null,
714   p_attribute8                   in varchar2         default null,
715   p_attribute9                   in varchar2         default null,
716   p_attribute10                  in varchar2         default null,
717   p_attribute11                  in varchar2         default null,
718   p_attribute12                  in varchar2         default null,
719   p_attribute13                  in varchar2         default null,
720   p_attribute14                  in varchar2         default null,
721   p_attribute15                  in varchar2         default null,
722   p_attribute16                  in varchar2         default null,
723   p_attribute17                  in varchar2         default null,
724   p_attribute18                  in varchar2         default null,
725   p_attribute19                  in varchar2         default null,
726   p_attribute20                  in varchar2         default null,
727   p_effective_date		 in date
728   ) is
729 --
730   l_rec		per_ctc_shd.g_rec_type;
731   l_proc	varchar2(72) := g_package||'ins';
732 --
733 Begin
734   hr_utility.set_location('Entering:'||l_proc, 5);
735   --
736   -- Call conversion function to turn arguments into the
737   -- p_rec structure.
738   --
739   l_rec :=
740   per_ctc_shd.convert_args
741   (
742   null,
743   null,
744   null,
745   p_business_group_id,
746   null,
747   p_person_id,
748   p_reference,
749   p_type,
750   p_status,
751   p_status_reason,
752   p_doc_status,
753   p_doc_status_change_date,
754   p_description,
755   p_duration,
756   p_duration_units,
757   p_contractual_job_title,
758   p_parties,
759   p_start_reason,
760   p_end_reason,
761   p_number_of_extensions,
762   p_extension_reason,
763   p_extension_period,
764   p_extension_period_units,
765   p_ctr_information_category,
766   p_ctr_information1,
767   p_ctr_information2,
768   p_ctr_information3,
769   p_ctr_information4,
770   p_ctr_information5,
771   p_ctr_information6,
772   p_ctr_information7,
773   p_ctr_information8,
774   p_ctr_information9,
775   p_ctr_information10,
776   p_ctr_information11,
777   p_ctr_information12,
778   p_ctr_information13,
779   p_ctr_information14,
780   p_ctr_information15,
781   p_ctr_information16,
782   p_ctr_information17,
783   p_ctr_information18,
784   p_ctr_information19,
785   p_ctr_information20,
786   p_attribute_category,
787   p_attribute1,
788   p_attribute2,
789   p_attribute3,
790   p_attribute4,
791   p_attribute5,
792   p_attribute6,
793   p_attribute7,
794   p_attribute8,
795   p_attribute9,
796   p_attribute10,
797   p_attribute11,
798   p_attribute12,
799   p_attribute13,
800   p_attribute14,
801   p_attribute15,
802   p_attribute16,
803   p_attribute17,
804   p_attribute18,
805   p_attribute19,
806   p_attribute20
807   );
808   --
809   -- Having converted the arguments into the per_ctc_rec
810   -- plsql record structure we call the corresponding record
811   -- business process.
812   --
813   ins(l_rec, p_effective_date);
814   --
815   -- Set the OUT arguments.
816   --
817   p_contract_id        	:= l_rec.contract_id;
818   p_effective_start_date  	:= l_rec.effective_start_date;
819   p_effective_end_date    	:= l_rec.effective_end_date;
820   p_object_version_number 	:= l_rec.object_version_number;
821   --
822   --
823   hr_utility.set_location(' Leaving:'||l_proc, 10);
824 End ins;
825 --
826 end per_ctc_ins;