DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_DDR_INS

Source


1 Package Body ben_ddr_ins as
2 /* $Header: beddrrhi.pkb 115.9 2003/03/12 07:36:29 rpgupta ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_ddr_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 ben_ddr_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     from   ben_dsgn_rqmt_f t
70     where  t.dsgn_rqmt_id       = p_rec.dsgn_rqmt_id
71     and    t.effective_start_date =
72              ben_ddr_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          ben_dsgn_rqmt_f.created_by%TYPE;
77   l_creation_date       ben_dsgn_rqmt_f.creation_date%TYPE;
78   l_last_update_date   	ben_dsgn_rqmt_f.last_update_date%TYPE;
79   l_last_updated_by     ben_dsgn_rqmt_f.last_updated_by%TYPE;
80   l_last_update_login   ben_dsgn_rqmt_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 => 'ben_dsgn_rqmt_f',
90 	 p_base_key_column => 'dsgn_rqmt_id',
91 	 p_base_key_value  => p_rec.dsgn_rqmt_id);
92   --
93   -- Set the effective start and end dates to the corresponding
94   -- validation start and end dates
95   --
96   p_rec.effective_start_date := p_validation_start_date;
97   p_rec.effective_end_date   := p_validation_end_date;
98   --
99   -- If the datetrack_mode is not INSERT then we must populate the WHO
100   -- columns with the 'old' creation values and 'new' updated values.
101   --
102   If (p_datetrack_mode <> 'INSERT') then
103     hr_utility.set_location(l_proc, 10);
104     --
105     -- Select the 'old' created values
106     --
107     Open C_Sel1;
108     Fetch C_Sel1 Into l_created_by, l_creation_date;
109     If C_Sel1%notfound Then
110       --
111       -- The previous 'old' created row has not been found. We need
112       -- to error as an internal datetrack problem exists.
113       --
114       Close C_Sel1;
115       hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
116       hr_utility.set_message_token('PROCEDURE', l_proc);
117       hr_utility.set_message_token('STEP','10');
118       hr_utility.raise_error;
119     End If;
120     Close C_Sel1;
121     --
122     -- Set the AOL updated WHO values
123     --
124     l_last_update_date   := sysdate;
125     l_last_updated_by    := fnd_global.user_id;
126     l_last_update_login  := fnd_global.login_id;
127   End If;
128   --
129   ben_ddr_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_dsgn_rqmt_f
132   --
133   insert into ben_dsgn_rqmt_f
134   (	dsgn_rqmt_id,
135 	effective_start_date,
136 	effective_end_date,
137 	mn_dpnts_rqd_num,
138 	mx_dpnts_alwd_num,
139 	no_mn_num_dfnd_flag,
140 	no_mx_num_dfnd_flag,
141 	cvr_all_elig_flag,
142 	oipl_id,
143 	pl_id,
144 	opt_id,
145 	grp_rlshp_cd,
146 	dsgn_typ_cd,
147 	business_group_id,
148 	ddr_attribute_category,
149 	ddr_attribute1,
150 	ddr_attribute2,
151 	ddr_attribute3,
152 	ddr_attribute4,
153 	ddr_attribute5,
154 	ddr_attribute6,
155 	ddr_attribute7,
156 	ddr_attribute8,
157 	ddr_attribute9,
158 	ddr_attribute10,
159 	ddr_attribute11,
160 	ddr_attribute12,
161 	ddr_attribute13,
162 	ddr_attribute14,
163 	ddr_attribute15,
164 	ddr_attribute16,
165 	ddr_attribute17,
166 	ddr_attribute18,
167 	ddr_attribute19,
168 	ddr_attribute20,
169 	ddr_attribute21,
170 	ddr_attribute22,
171 	ddr_attribute23,
172 	ddr_attribute24,
173 	ddr_attribute25,
174 	ddr_attribute26,
175 	ddr_attribute27,
176 	ddr_attribute28,
177 	ddr_attribute29,
178 	ddr_attribute30,
179 	object_version_number
180    	, created_by,
181    	creation_date,
182    	last_update_date,
183    	last_updated_by,
184    	last_update_login
185   )
186   Values
187   (	p_rec.dsgn_rqmt_id,
188 	p_rec.effective_start_date,
189 	p_rec.effective_end_date,
190 	p_rec.mn_dpnts_rqd_num,
191 	p_rec.mx_dpnts_alwd_num,
192 	p_rec.no_mn_num_dfnd_flag,
193 	p_rec.no_mx_num_dfnd_flag,
194 	p_rec.cvr_all_elig_flag,
195 	p_rec.oipl_id,
196 	p_rec.pl_id,
197 	p_rec.opt_id,
198 	p_rec.grp_rlshp_cd,
199 	p_rec.dsgn_typ_cd,
200 	p_rec.business_group_id,
201 	p_rec.ddr_attribute_category,
202 	p_rec.ddr_attribute1,
203 	p_rec.ddr_attribute2,
204 	p_rec.ddr_attribute3,
205 	p_rec.ddr_attribute4,
206 	p_rec.ddr_attribute5,
207 	p_rec.ddr_attribute6,
208 	p_rec.ddr_attribute7,
209 	p_rec.ddr_attribute8,
210 	p_rec.ddr_attribute9,
211 	p_rec.ddr_attribute10,
212 	p_rec.ddr_attribute11,
213 	p_rec.ddr_attribute12,
214 	p_rec.ddr_attribute13,
215 	p_rec.ddr_attribute14,
216 	p_rec.ddr_attribute15,
217 	p_rec.ddr_attribute16,
218 	p_rec.ddr_attribute17,
219 	p_rec.ddr_attribute18,
220 	p_rec.ddr_attribute19,
221 	p_rec.ddr_attribute20,
222 	p_rec.ddr_attribute21,
223 	p_rec.ddr_attribute22,
224 	p_rec.ddr_attribute23,
225 	p_rec.ddr_attribute24,
226 	p_rec.ddr_attribute25,
227 	p_rec.ddr_attribute26,
228 	p_rec.ddr_attribute27,
229 	p_rec.ddr_attribute28,
230 	p_rec.ddr_attribute29,
231 	p_rec.ddr_attribute30,
232 	p_rec.object_version_number
233 	, l_created_by,
234    	l_creation_date,
235    	l_last_update_date,
236    	l_last_updated_by,
237    	l_last_update_login
238   );
239   --
240   ben_ddr_shd.g_api_dml := false;   -- Unset the api dml status
241   hr_utility.set_location(' Leaving:'||l_proc, 15);
242 --
243 Exception
244   When hr_api.check_integrity_violated Then
245     -- A check constraint has been violated
246     ben_ddr_shd.g_api_dml := false;   -- Unset the api dml status
247     ben_ddr_shd.constraint_error
248       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
249   When hr_api.unique_integrity_violated Then
250     -- Unique integrity has been violated
251     ben_ddr_shd.g_api_dml := false;   -- Unset the api dml status
252     ben_ddr_shd.constraint_error
253       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
254   When Others Then
255     ben_ddr_shd.g_api_dml := false;   -- Unset the api dml status
256     Raise;
257 End dt_insert_dml;
258 --
259 -- ----------------------------------------------------------------------------
260 -- |------------------------------< insert_dml >------------------------------|
261 -- ----------------------------------------------------------------------------
262 Procedure insert_dml
263 	(p_rec 			 in out nocopy ben_ddr_shd.g_rec_type,
264 	 p_effective_date	 in	date,
265 	 p_datetrack_mode	 in	varchar2,
266 	 p_validation_start_date in	date,
267 	 p_validation_end_date	 in	date) is
268 --
269   l_proc	varchar2(72) := g_package||'insert_dml';
270 --
271 Begin
272   hr_utility.set_location('Entering:'||l_proc, 5);
273   --
274   dt_insert_dml(p_rec			=> p_rec,
275 		p_effective_date	=> p_effective_date,
276 		p_datetrack_mode	=> p_datetrack_mode,
277        		p_validation_start_date	=> p_validation_start_date,
278 		p_validation_end_date	=> p_validation_end_date);
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 structre.
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 ben_ddr_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) is
328 --
329   l_proc	varchar2(72) := g_package||'pre_insert';
330   cursor c1 is select ben_dsgn_rqmt_f_s.nextval
331                from   sys.dual;
332 --
333 --
334 --
335 Begin
336   hr_utility.set_location('Entering:'||l_proc, 5);
337   --
338   --
339   open c1;
340   fetch c1 into p_rec.dsgn_rqmt_id;
341   close c1;
342   --
343   --
344   hr_utility.set_location(' Leaving:'||l_proc, 10);
345 End pre_insert;
346 --
347 -- ----------------------------------------------------------------------------
348 -- |-----------------------------< post_insert >------------------------------|
349 -- ----------------------------------------------------------------------------
350 -- {Start Of Comments}
351 --
352 -- Description:
353 --   This private procedure contains any processing which is required after the
354 --   insert dml.
355 --
356 -- Prerequisites:
357 --   This is an internal procedure which is called from the ins procedure.
358 --
359 -- In Parameters:
360 --   A Pl/Sql record structre.
361 --
362 -- Post Success:
363 --   Processing continues.
364 --
365 -- Post Failure:
366 --   If an error has occurred, an error message and exception will be raised
367 --   but not handled.
368 --
369 -- Developer Implementation Notes:
370 --   Any post-processing required after the insert dml is issued should be
371 --   coded within this procedure. It is important to note that any 3rd party
372 --   maintenance should be reviewed before placing in this procedure.
373 --
374 -- Access Status:
375 --   Internal Row Handler Use Only.
376 --
377 -- {End Of Comments}
378 -- ----------------------------------------------------------------------------
379 Procedure post_insert
380 	(p_rec 			 in ben_ddr_shd.g_rec_type,
381 	 p_effective_date	 in date,
382 	 p_datetrack_mode	 in varchar2,
383 	 p_validation_start_date in date,
384 	 p_validation_end_date	 in date) is
385 --
386   l_proc	varchar2(72) := g_package||'post_insert';
387 --
388 Begin
389   hr_utility.set_location('Entering:'||l_proc, 5);
390 --
391   --
392   -- Start of API User Hook for post_insert.
393   --
394   begin
395     --
396     ben_ddr_rki.after_insert
397       (
398   p_dsgn_rqmt_id                  =>p_rec.dsgn_rqmt_id
399  ,p_effective_start_date          =>p_rec.effective_start_date
400  ,p_effective_end_date            =>p_rec.effective_end_date
401  ,p_mn_dpnts_rqd_num              =>p_rec.mn_dpnts_rqd_num
402  ,p_mx_dpnts_alwd_num             =>p_rec.mx_dpnts_alwd_num
403  ,p_no_mn_num_dfnd_flag           =>p_rec.no_mn_num_dfnd_flag
404  ,p_no_mx_num_dfnd_flag           =>p_rec.no_mx_num_dfnd_flag
405  ,p_cvr_all_elig_flag             =>p_rec.cvr_all_elig_flag
406  ,p_oipl_id                       =>p_rec.oipl_id
407  ,p_pl_id                         =>p_rec.pl_id
408  ,p_opt_id                        =>p_rec.opt_id
409  ,p_grp_rlshp_cd                  =>p_rec.grp_rlshp_cd
410  ,p_dsgn_typ_cd                   =>p_rec.dsgn_typ_cd
411  ,p_business_group_id             =>p_rec.business_group_id
412  ,p_ddr_attribute_category        =>p_rec.ddr_attribute_category
413  ,p_ddr_attribute1                =>p_rec.ddr_attribute1
414  ,p_ddr_attribute2                =>p_rec.ddr_attribute2
415  ,p_ddr_attribute3                =>p_rec.ddr_attribute3
416  ,p_ddr_attribute4                =>p_rec.ddr_attribute4
417  ,p_ddr_attribute5                =>p_rec.ddr_attribute5
418  ,p_ddr_attribute6                =>p_rec.ddr_attribute6
419  ,p_ddr_attribute7                =>p_rec.ddr_attribute7
420  ,p_ddr_attribute8                =>p_rec.ddr_attribute8
421  ,p_ddr_attribute9                =>p_rec.ddr_attribute9
422  ,p_ddr_attribute10               =>p_rec.ddr_attribute10
423  ,p_ddr_attribute11               =>p_rec.ddr_attribute11
424  ,p_ddr_attribute12               =>p_rec.ddr_attribute12
425  ,p_ddr_attribute13               =>p_rec.ddr_attribute13
426  ,p_ddr_attribute14               =>p_rec.ddr_attribute14
427  ,p_ddr_attribute15               =>p_rec.ddr_attribute15
428  ,p_ddr_attribute16               =>p_rec.ddr_attribute16
429  ,p_ddr_attribute17               =>p_rec.ddr_attribute17
430  ,p_ddr_attribute18               =>p_rec.ddr_attribute18
434  ,p_ddr_attribute22               =>p_rec.ddr_attribute22
431  ,p_ddr_attribute19               =>p_rec.ddr_attribute19
432  ,p_ddr_attribute20               =>p_rec.ddr_attribute20
433  ,p_ddr_attribute21               =>p_rec.ddr_attribute21
435  ,p_ddr_attribute23               =>p_rec.ddr_attribute23
436  ,p_ddr_attribute24               =>p_rec.ddr_attribute24
437  ,p_ddr_attribute25               =>p_rec.ddr_attribute25
438  ,p_ddr_attribute26               =>p_rec.ddr_attribute26
439  ,p_ddr_attribute27               =>p_rec.ddr_attribute27
440  ,p_ddr_attribute28               =>p_rec.ddr_attribute28
441  ,p_ddr_attribute29               =>p_rec.ddr_attribute29
442  ,p_ddr_attribute30               =>p_rec.ddr_attribute30
443  ,p_object_version_number         =>p_rec.object_version_number
444  ,p_effective_date                =>p_effective_date
445  ,p_validation_start_date         =>p_validation_start_date
446  ,p_validation_end_date           =>p_validation_end_date
447       );
448     --
449   exception
450     --
451     when hr_api.cannot_find_prog_unit then
452       --
453       hr_api.cannot_find_prog_unit_error
454         (p_module_name => 'ben_dsgn_rqmt_f'
455         ,p_hook_type   => 'AI');
456       --
457   end;
458   --
459   -- End of API User Hook for post_insert.
460   --
461   --
462   hr_utility.set_location(' Leaving:'||l_proc, 10);
463 End post_insert;
464 --
465 -- ----------------------------------------------------------------------------
466 -- |-------------------------------< ins_lck >--------------------------------|
467 -- ----------------------------------------------------------------------------
468 -- {Start Of Comments}
469 --
470 -- Description:
471 --   The ins_lck process has one main function to perform. When inserting
472 --   a datetracked row, we must validate the DT mode.
473 --   be manipulated.
474 --
475 -- Prerequisites:
476 --   This procedure can only be called for the datetrack mode of INSERT.
477 --
478 -- In Parameters:
479 --
480 -- Post Success:
481 --   On successful completion of the ins_lck process the parental
482 --   datetracked rows will be locked providing the p_enforce_foreign_locking
483 --   argument value is TRUE.
484 --   If the p_enforce_foreign_locking argument value is FALSE then the
485 --   parential rows are not locked.
486 --
487 -- Post Failure:
488 --   The Lck process can fail for:
489 --   1) When attempting to lock the row the row could already be locked by
490 --      another user. This will raise the HR_Api.Object_Locked exception.
491 --   2) When attempting to the lock the parent which doesn't exist.
492 --      For the entity to be locked the parent must exist!
493 --
494 -- Developer Implementation Notes:
495 --   None.
496 --
497 -- Access Status:
498 --   Internal Row Handler Use Only.
499 --
500 -- {End Of Comments}
501 -- ----------------------------------------------------------------------------
502 Procedure ins_lck
503 	(p_effective_date	 in  date,
504 	 p_datetrack_mode	 in  varchar2,
505 	 p_rec	 		 in  ben_ddr_shd.g_rec_type,
506 	 p_validation_start_date out nocopy date,
507 	 p_validation_end_date	 out nocopy date) is
508 --
509   l_proc		  varchar2(72) := g_package||'ins_lck';
510   l_validation_start_date date;
511   l_validation_end_date	  date;
512 --
513 Begin
514   hr_utility.set_location('Entering:'||l_proc, 5);
515   --
516   -- Validate the datetrack mode mode getting the validation start
517   -- and end dates for the specified datetrack operation.
518   --
519   dt_api.validate_dt_mode
520 	(p_effective_date	   => p_effective_date,
521 	 p_datetrack_mode	   => p_datetrack_mode,
522 	 p_base_table_name	   => 'ben_dsgn_rqmt_f',
523 	 p_base_key_column	   => 'dsgn_rqmt_id',
524 	 p_base_key_value 	   => p_rec.dsgn_rqmt_id,
525 	 p_parent_table_name1      => 'ben_oipl_f',
526 	 p_parent_key_column1      => 'oipl_id',
527 	 p_parent_key_value1       => p_rec.oipl_id,
528 	 p_parent_table_name2      => 'ben_opt_f',
529 	 p_parent_key_column2      => 'opt_id',
530 	 p_parent_key_value2       => p_rec.opt_id,
531 	 p_parent_table_name3      => 'ben_pl_f',
532 	 p_parent_key_column3      => 'pl_id',
533 	 p_parent_key_value3       => p_rec.pl_id,
534          p_enforce_foreign_locking => true,
535 	 p_validation_start_date   => l_validation_start_date,
536  	 p_validation_end_date	   => l_validation_end_date);
537   --
538   -- Set the validation start and end date OUT arguments
539   --
540   p_validation_start_date := l_validation_start_date;
541   p_validation_end_date   := l_validation_end_date;
542   --
543   hr_utility.set_location(' Leaving:'||l_proc, 10);
544 --
545 End ins_lck;
546 --
547 -- ----------------------------------------------------------------------------
548 -- |---------------------------------< ins >----------------------------------|
549 -- ----------------------------------------------------------------------------
550 Procedure ins
551   (
552   p_rec		   in out nocopy ben_ddr_shd.g_rec_type,
553   p_effective_date in     date
554   ) is
555 --
556   l_proc			varchar2(72) := g_package||'ins';
557   l_datetrack_mode		varchar2(30) := 'INSERT';
561 Begin
558   l_validation_start_date	date;
559   l_validation_end_date		date;
560 --
562   hr_utility.set_location('Entering:'||l_proc, 5);
563   --
564   -- Call the lock operation
565   --
566   ins_lck
567 	(p_effective_date	 => p_effective_date,
568 	 p_datetrack_mode	 => l_datetrack_mode,
569 	 p_rec	 		 => p_rec,
570 	 p_validation_start_date => l_validation_start_date,
571 	 p_validation_end_date	 => l_validation_end_date);
572   --
573   -- Call the supporting insert validate operations
574   --
575   ben_ddr_bus.insert_validate
576 	(p_rec			 => p_rec,
577 	 p_effective_date	 => p_effective_date,
578 	 p_datetrack_mode	 => l_datetrack_mode,
579 	 p_validation_start_date => l_validation_start_date,
580 	 p_validation_end_date	 => l_validation_end_date);
581   --
582   -- Call the supporting pre-insert operation
583   --
584   pre_insert
585  	(p_rec			 => p_rec,
586 	 p_effective_date	 => p_effective_date,
587 	 p_datetrack_mode	 => l_datetrack_mode,
588 	 p_validation_start_date => l_validation_start_date,
589 	 p_validation_end_date	 => l_validation_end_date);
590   --
591   -- Insert the row
592   --
593   insert_dml
594  	(p_rec			 => p_rec,
595 	 p_effective_date	 => p_effective_date,
596 	 p_datetrack_mode	 => l_datetrack_mode,
597 	 p_validation_start_date => l_validation_start_date,
598 	 p_validation_end_date	 => l_validation_end_date);
599   --
600   -- Call the supporting post-insert operation
601   --
602   post_insert
603  	(p_rec			 => p_rec,
604 	 p_effective_date	 => p_effective_date,
605 	 p_datetrack_mode	 => l_datetrack_mode,
606 	 p_validation_start_date => l_validation_start_date,
607 	 p_validation_end_date	 => l_validation_end_date);
608 end ins;
609 --
610 -- ----------------------------------------------------------------------------
611 -- |---------------------------------< ins >----------------------------------|
612 -- ----------------------------------------------------------------------------
613 Procedure ins
614   (
615   p_dsgn_rqmt_id                 out nocopy number,
616   p_effective_start_date         out nocopy date,
617   p_effective_end_date           out nocopy date,
618   p_mn_dpnts_rqd_num             in number           default null,
619   p_mx_dpnts_alwd_num            in number           default null,
620   p_no_mn_num_dfnd_flag          in varchar2,
621   p_no_mx_num_dfnd_flag          in varchar2,
622   p_cvr_all_elig_flag            in varchar2,
623   p_oipl_id                      in number           default null,
624   p_pl_id                        in number           default null,
625   p_opt_id                       in number           default null,
626   p_grp_rlshp_cd                 in varchar2         default null,
627   p_dsgn_typ_cd                  in varchar2         default null,
628   p_business_group_id            in number,
629   p_ddr_attribute_category       in varchar2         default null,
630   p_ddr_attribute1               in varchar2         default null,
631   p_ddr_attribute2               in varchar2         default null,
632   p_ddr_attribute3               in varchar2         default null,
633   p_ddr_attribute4               in varchar2         default null,
634   p_ddr_attribute5               in varchar2         default null,
635   p_ddr_attribute6               in varchar2         default null,
636   p_ddr_attribute7               in varchar2         default null,
637   p_ddr_attribute8               in varchar2         default null,
638   p_ddr_attribute9               in varchar2         default null,
639   p_ddr_attribute10              in varchar2         default null,
640   p_ddr_attribute11              in varchar2         default null,
641   p_ddr_attribute12              in varchar2         default null,
642   p_ddr_attribute13              in varchar2         default null,
643   p_ddr_attribute14              in varchar2         default null,
644   p_ddr_attribute15              in varchar2         default null,
645   p_ddr_attribute16              in varchar2         default null,
646   p_ddr_attribute17              in varchar2         default null,
647   p_ddr_attribute18              in varchar2         default null,
648   p_ddr_attribute19              in varchar2         default null,
649   p_ddr_attribute20              in varchar2         default null,
650   p_ddr_attribute21              in varchar2         default null,
651   p_ddr_attribute22              in varchar2         default null,
652   p_ddr_attribute23              in varchar2         default null,
653   p_ddr_attribute24              in varchar2         default null,
654   p_ddr_attribute25              in varchar2         default null,
655   p_ddr_attribute26              in varchar2         default null,
656   p_ddr_attribute27              in varchar2         default null,
657   p_ddr_attribute28              in varchar2         default null,
658   p_ddr_attribute29              in varchar2         default null,
659   p_ddr_attribute30              in varchar2         default null,
660   p_object_version_number        out nocopy number,
661   p_effective_date		 in date
662   ) is
663 --
664   l_rec		ben_ddr_shd.g_rec_type;
665   l_proc	varchar2(72) := g_package||'ins';
666 --
667 Begin
668   hr_utility.set_location('Entering:'||l_proc, 5);
669   --
670   -- Call conversion function to turn arguments into the
671   -- p_rec structure.
672   --
673   l_rec :=
674   ben_ddr_shd.convert_args
675   (
676   null,
677   null,
678   null,
679   p_mn_dpnts_rqd_num,
680   p_mx_dpnts_alwd_num,
681   p_no_mn_num_dfnd_flag,
682   p_no_mx_num_dfnd_flag,
683   p_cvr_all_elig_flag,
684   p_oipl_id,
685   p_pl_id,
686   p_opt_id,
687   p_grp_rlshp_cd,
688   p_dsgn_typ_cd,
689   p_business_group_id,
690   p_ddr_attribute_category,
694   p_ddr_attribute4,
691   p_ddr_attribute1,
692   p_ddr_attribute2,
693   p_ddr_attribute3,
695   p_ddr_attribute5,
696   p_ddr_attribute6,
697   p_ddr_attribute7,
698   p_ddr_attribute8,
699   p_ddr_attribute9,
700   p_ddr_attribute10,
701   p_ddr_attribute11,
702   p_ddr_attribute12,
703   p_ddr_attribute13,
704   p_ddr_attribute14,
705   p_ddr_attribute15,
706   p_ddr_attribute16,
707   p_ddr_attribute17,
708   p_ddr_attribute18,
709   p_ddr_attribute19,
710   p_ddr_attribute20,
711   p_ddr_attribute21,
712   p_ddr_attribute22,
713   p_ddr_attribute23,
714   p_ddr_attribute24,
715   p_ddr_attribute25,
716   p_ddr_attribute26,
717   p_ddr_attribute27,
718   p_ddr_attribute28,
719   p_ddr_attribute29,
720   p_ddr_attribute30,
721   null
722   );
723   --
724   -- Having converted the arguments into the ben_ddr_rec
725   -- plsql record structure we call the corresponding record
726   -- business process.
727   --
728   ins(l_rec, p_effective_date);
729   --
730   -- Set the OUT arguments.
731   --
732   p_dsgn_rqmt_id        	:= l_rec.dsgn_rqmt_id;
733   p_effective_start_date  	:= l_rec.effective_start_date;
734   p_effective_end_date    	:= l_rec.effective_end_date;
735   p_object_version_number 	:= l_rec.object_version_number;
736   --
737   --
738   hr_utility.set_location(' Leaving:'||l_proc, 10);
739 End ins;
740 --
741 end ben_ddr_ins;