DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_ENP_INS

Source


4 -- ----------------------------------------------------------------------------
1 Package Body ben_enp_ins as
2 /* $Header: beenprhi.pkb 120.4.12020000.2 2012/07/03 12:09:48 amnaraya ship $ */
3 --
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_enp_ins.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< insert_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the actual dml insert logic. The processing of
17 --   this procedure are as follows:
18 --   1) Initialise the object_version_number to 1 if the object_version_number
19 --      is defined as an attribute for this entity.
20 --   2) To set and unset the g_api_dml status as required (as we are about to
21 --      perform dml).
22 --   3) To insert the row into the schema.
23 --   4) To trap any constraint violations that may have occurred.
24 --   5) To raise any other errors.
25 --
26 -- Prerequisites:
27 --   This is an internal private procedure which must be called from the ins
28 --   procedure and must have all mandatory attributes set (except the
29 --   object_version_number which is initialised within this procedure).
30 --
31 -- In Parameters:
32 --   A Pl/Sql record structre.
33 --
34 -- Post Success:
35 --   The specified row will be inserted into the schema.
36 --
37 -- Post Failure:
38 --   On the insert dml failure it is important to note that we always reset the
39 --   g_api_dml status to false.
40 --   If a check, unique or parent integrity constraint violation is raised the
41 --   constraint_error procedure will be called.
42 --   If any other error is reported, the error will be raised after the
43 --   g_api_dml status is reset.
44 --
45 -- Developer Implementation Notes:
46 --   None.
47 --
48 -- Access Status:
49 --   Internal Row Handler Use Only.
50 --
51 -- {End Of Comments}
52 -- ----------------------------------------------------------------------------
53 Procedure insert_dml(p_rec in out nocopy ben_enp_shd.g_rec_type) is
54 --
55   l_proc  varchar2(72) := g_package||'insert_dml';
56 --
57 Begin
58   hr_utility.set_location('Entering:'||l_proc, 5);
59   p_rec.object_version_number := 1;  -- Initialise the object version
60   --
61   ben_enp_shd.g_api_dml := true;  -- Set the api dml status
62   --
63   -- Insert the row into: ben_enrt_perd
64   --
65   insert into ben_enrt_perd
66   (	enrt_perd_id,
67 	business_group_id,
68 	yr_perd_id,
69 	popl_enrt_typ_cycl_id,
70 	end_dt,
71 	strt_dt,
72         asnd_lf_evt_dt ,
73 	cls_enrt_dt_to_use_cd,
74 	dflt_enrt_dt,
75 	enrt_cvg_strt_dt_cd,
76 	rt_strt_dt_rl,
77 	enrt_cvg_end_dt_cd,
78 	enrt_cvg_strt_dt_rl,
79 	enrt_cvg_end_dt_rl,
80 	procg_end_dt,
81 	rt_strt_dt_cd,
82 	rt_end_dt_cd,
83 	rt_end_dt_rl,
84         bdgt_upd_strt_dt,
85         bdgt_upd_end_dt,
86         ws_upd_strt_dt,
87         ws_upd_end_dt,
88         dflt_ws_acc_cd,
89         prsvr_bdgt_cd,
90         uses_bdgt_flag,
91         auto_distr_flag,
92         hrchy_to_use_cd,
93         pos_structure_version_id,
94         emp_interview_type_cd,
95         wthn_yr_perd_id,
96         ler_id,
97         perf_revw_strt_dt,
98         asg_updt_eff_date,
99 	enp_attribute_category,
100 	enp_attribute1,
101 	enp_attribute2,
102 	enp_attribute3,
103 	enp_attribute4,
104 	enp_attribute5,
105 	enp_attribute6,
106 	enp_attribute7,
107 	enp_attribute8,
108 	enp_attribute9,
109 	enp_attribute10,
110 	enp_attribute11,
111 	enp_attribute12,
112 	enp_attribute13,
113 	enp_attribute14,
114 	enp_attribute15,
115 	enp_attribute16,
116 	enp_attribute17,
117 	enp_attribute18,
118 	enp_attribute19,
119 	enp_attribute20,
120 	enp_attribute21,
121 	enp_attribute22,
122 	enp_attribute23,
123 	enp_attribute24,
124 	enp_attribute25,
125 	enp_attribute26,
126 	enp_attribute27,
127 	enp_attribute28,
131         --cwb
128 	enp_attribute29,
129 	enp_attribute30,
130 	enrt_perd_det_ovrlp_bckdt_cd,
132         data_freeze_date   ,
133         Sal_chg_reason_cd ,
134         Approval_mode_cd ,
135         hrchy_ame_trn_cd,
136         hrchy_rl     ,
137         hrchy_ame_app_id ,
138 	object_version_number,
139 	reinstate_cd,
140 	reinstate_ovrdn_cd,
141 	reopen_le_on_reprocess,
142 	defer_deenrol_flag
143   )
144   Values
145   (	p_rec.enrt_perd_id,
146 	p_rec.business_group_id,
147 	p_rec.yr_perd_id,
148 	p_rec.popl_enrt_typ_cycl_id,
149 	p_rec.end_dt,
150 	p_rec.strt_dt,
151         p_rec.asnd_lf_evt_dt,
152 	p_rec.cls_enrt_dt_to_use_cd,
153 	p_rec.dflt_enrt_dt,
154 	p_rec.enrt_cvg_strt_dt_cd,
155 	p_rec.rt_strt_dt_rl,
156 	p_rec.enrt_cvg_end_dt_cd,
157 	p_rec.enrt_cvg_strt_dt_rl,
158 	p_rec.enrt_cvg_end_dt_rl,
159 	p_rec.procg_end_dt,
160 	p_rec.rt_strt_dt_cd,
161 	p_rec.rt_end_dt_cd,
162 	p_rec.rt_end_dt_rl,
163         p_rec.bdgt_upd_strt_dt,
164         p_rec.bdgt_upd_end_dt,
165         p_rec.ws_upd_strt_dt,
166         p_rec.ws_upd_end_dt,
167         p_rec.dflt_ws_acc_cd,
168         p_rec.prsvr_bdgt_cd,
169         p_rec.uses_bdgt_flag,
170         p_rec.auto_distr_flag,
171         p_rec.hrchy_to_use_cd,
172         p_rec.pos_structure_version_id,
173         p_rec.emp_interview_type_cd,
174         p_rec.wthn_yr_perd_id,
175         p_rec.ler_id,
176         p_rec.perf_revw_strt_dt,
177         p_rec.asg_updt_eff_date,
178 	p_rec.enp_attribute_category,
179 	p_rec.enp_attribute1,
180 	p_rec.enp_attribute2,
181 	p_rec.enp_attribute3,
182 	p_rec.enp_attribute4,
183 	p_rec.enp_attribute5,
184 	p_rec.enp_attribute6,
185 	p_rec.enp_attribute7,
186 	p_rec.enp_attribute8,
187 	p_rec.enp_attribute9,
188 	p_rec.enp_attribute10,
189 	p_rec.enp_attribute11,
190 	p_rec.enp_attribute12,
191 	p_rec.enp_attribute13,
192 	p_rec.enp_attribute14,
193 	p_rec.enp_attribute15,
194 	p_rec.enp_attribute16,
195 	p_rec.enp_attribute17,
196 	p_rec.enp_attribute18,
197 	p_rec.enp_attribute19,
198 	p_rec.enp_attribute20,
199 	p_rec.enp_attribute21,
200 	p_rec.enp_attribute22,
201 	p_rec.enp_attribute23,
202 	p_rec.enp_attribute24,
206 	p_rec.enp_attribute28,
203 	p_rec.enp_attribute25,
204 	p_rec.enp_attribute26,
205 	p_rec.enp_attribute27,
207 	p_rec.enp_attribute29,
208 	p_rec.enp_attribute30,
209 	p_rec.enrt_perd_det_ovrlp_bckdt_cd,
210          --cwb
211         p_rec.data_freeze_date   ,
212         p_rec.Sal_chg_reason_cd ,
213         p_rec.Approval_mode_cd ,
214         p_rec.hrchy_ame_trn_cd,
215         p_rec.hrchy_rl     ,
216         p_rec.hrchy_ame_app_id ,
217 	p_rec.object_version_number ,
218 	p_rec.reinstate_cd,
219 	p_rec.reinstate_ovrdn_cd,
220 	p_rec.reopen_le_on_reprocess,
221 	p_rec.defer_deenrol_flag
222   );
223   --
224   ben_enp_shd.g_api_dml := false;   -- Unset the api dml status
225   --
226   hr_utility.set_location(' Leaving:'||l_proc, 10);
227 Exception
228   When hr_api.check_integrity_violated Then
229     -- A check constraint has been violated
230     ben_enp_shd.g_api_dml := false;   -- Unset the api dml status
231     ben_enp_shd.constraint_error
232       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
233   When hr_api.parent_integrity_violated Then
234     -- Parent integrity has been violated
235     ben_enp_shd.g_api_dml := false;   -- Unset the api dml status
236     ben_enp_shd.constraint_error
237       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
238   When hr_api.unique_integrity_violated Then
239     -- Unique integrity has been violated
240     ben_enp_shd.g_api_dml := false;   -- Unset the api dml status
241     ben_enp_shd.constraint_error
242       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
243   When Others Then
244     ben_enp_shd.g_api_dml := false;   -- Unset the api dml status
245     Raise;
246 End insert_dml;
247 --
248 -- ----------------------------------------------------------------------------
249 -- |------------------------------< pre_insert >------------------------------|
250 -- ----------------------------------------------------------------------------
251 -- {Start Of Comments}
252 --
253 -- Description:
254 --   This private procedure contains any processing which is required before
255 --   the insert dml. Presently, if the entity has a corresponding primary
259 --
256 --   key which is maintained by an associating sequence, the primary key for
257 --   the entity will be populated with the next sequence value in
258 --   preparation for the insert dml.
260 -- Prerequisites:
261 --   This is an internal procedure which is called from the ins procedure.
262 --
263 -- In Parameters:
264 --   A Pl/Sql record structre.
265 --
266 -- Post Success:
267 --   Processing continues.
268 --
269 -- Post Failure:
270 --   If an error has occurred, an error message and exception will be raised
271 --   but not handled.
272 --
273 -- Developer Implementation Notes:
274 --   Any pre-processing required before the insert dml is issued should be
275 --   coded within this procedure. As stated above, a good example is the
276 --   generation of a primary key number via a corresponding sequence.
277 --   It is important to note that any 3rd party maintenance should be reviewed
278 --   before placing in this procedure.
279 --
280 -- Access Status:
281 --   Internal Row Handler Use Only.
282 --
283 -- {End Of Comments}
284 -- ----------------------------------------------------------------------------
285 Procedure pre_insert(p_rec  in out nocopy ben_enp_shd.g_rec_type) is
286 --
287   l_proc  varchar2(72) := g_package||'pre_insert';
288 --
289   Cursor C_Sel1 is select ben_enrt_perd_s.nextval from sys.dual;
290 --
291 Begin
292   hr_utility.set_location('Entering:'||l_proc, 5);
293   --
294   --
295   -- Select the next sequence number
296   --
297   Open C_Sel1;
298   Fetch C_Sel1 Into p_rec.enrt_perd_id;
299   Close C_Sel1;
300   --
301   hr_utility.set_location(' Leaving:'||l_proc, 10);
302 End pre_insert;
303 --
304 -- ----------------------------------------------------------------------------
305 -- |-----------------------------< post_insert >------------------------------|
306 -- ----------------------------------------------------------------------------
307 -- {Start Of Comments}
308 --
309 -- Description:
310 --   This private procedure contains any processing which is required after the
311 --   insert dml.
312 --
313 -- Prerequisites:
314 --   This is an internal procedure which is called from the ins procedure.
315 --
316 -- In Parameters:
317 --   A Pl/Sql record structre.
318 --
319 -- Post Success:
320 --   Processing continues.
321 --
322 -- Post Failure:
323 --   If an error has occurred, an error message and exception will be raised
324 --   but not handled.
325 --
326 -- Developer Implementation Notes:
327 --   Any post-processing required after the insert dml is issued should be
328 --   coded within this procedure. It is important to note that any 3rd party
329 --   maintenance should be reviewed before placing in this procedure.
330 --
331 -- Access Status:
332 --   Internal Row Handler Use Only.
333 --
334 -- {End Of Comments}
335 -- ----------------------------------------------------------------------------
336 Procedure post_insert(
337 p_effective_date in date,p_rec in ben_enp_shd.g_rec_type) is
338 --
339   l_proc  varchar2(72) := g_package||'post_insert';
340 --
341 Begin
342   hr_utility.set_location('Entering:'||l_proc, 5);
343 --
344   --
345   -- Start of API User Hook for post_insert.
346   --
347   begin
348     --
349     ben_enp_rki.after_insert
350       (
351   p_enrt_perd_id                  =>p_rec.enrt_perd_id
352  ,p_business_group_id             =>p_rec.business_group_id
353  ,p_yr_perd_id                    =>p_rec.yr_perd_id
354  ,p_popl_enrt_typ_cycl_id         =>p_rec.popl_enrt_typ_cycl_id
355  ,p_end_dt                        =>p_rec.end_dt
356  ,p_strt_dt                       =>p_rec.strt_dt
357  ,p_asnd_lf_evt_dt                =>p_rec.asnd_lf_evt_dt
358  ,p_cls_enrt_dt_to_use_cd         =>p_rec.cls_enrt_dt_to_use_cd
359  ,p_dflt_enrt_dt                  =>p_rec.dflt_enrt_dt
360  ,p_enrt_cvg_strt_dt_cd           =>p_rec.enrt_cvg_strt_dt_cd
361  ,p_rt_strt_dt_rl                 =>p_rec.rt_strt_dt_rl
362  ,p_enrt_cvg_end_dt_cd            =>p_rec.enrt_cvg_end_dt_cd
363  ,p_enrt_cvg_strt_dt_rl           =>p_rec.enrt_cvg_strt_dt_rl
364  ,p_enrt_cvg_end_dt_rl            =>p_rec.enrt_cvg_end_dt_rl
365  ,p_procg_end_dt                  =>p_rec.procg_end_dt
366  ,p_rt_strt_dt_cd                 =>p_rec.rt_strt_dt_cd
367  ,p_rt_end_dt_cd                  =>p_rec.rt_end_dt_cd
368  ,p_rt_end_dt_rl                  =>p_rec.rt_end_dt_rl
369  ,p_bdgt_upd_strt_dt              =>p_rec.bdgt_upd_strt_dt
373  ,p_dflt_ws_acc_cd                =>p_rec.dflt_ws_acc_cd
370  ,p_bdgt_upd_end_dt               =>p_rec.bdgt_upd_end_dt
371  ,p_ws_upd_strt_dt                =>p_rec.ws_upd_strt_dt
372  ,p_ws_upd_end_dt                 =>p_rec.ws_upd_end_dt
374  ,p_prsvr_bdgt_cd                 =>p_rec.prsvr_bdgt_cd
375  ,p_uses_bdgt_flag                =>p_rec.uses_bdgt_flag
376  ,p_auto_distr_flag               =>p_rec.auto_distr_flag
377  ,p_hrchy_to_use_cd               =>p_rec.hrchy_to_use_cd
378  ,p_pos_structure_version_id         =>p_rec.pos_structure_version_id
379  ,p_emp_interview_type_cd         =>p_rec.emp_interview_type_cd
380  ,p_wthn_yr_perd_id               =>p_rec.wthn_yr_perd_id
381  ,p_ler_id                        =>p_rec.ler_id
382  ,p_perf_revw_strt_dt             =>p_rec.perf_revw_strt_dt
383  ,p_asg_updt_eff_date             =>p_rec.asg_updt_eff_date
384  ,p_enp_attribute_category        =>p_rec.enp_attribute_category
385  ,p_enp_attribute1                =>p_rec.enp_attribute1
386  ,p_enp_attribute2                =>p_rec.enp_attribute2
387  ,p_enp_attribute3                =>p_rec.enp_attribute3
388  ,p_enp_attribute4                =>p_rec.enp_attribute4
389  ,p_enp_attribute5                =>p_rec.enp_attribute5
390  ,p_enp_attribute6                =>p_rec.enp_attribute6
391  ,p_enp_attribute7                =>p_rec.enp_attribute7
392  ,p_enp_attribute8                =>p_rec.enp_attribute8
393  ,p_enp_attribute9                =>p_rec.enp_attribute9
394  ,p_enp_attribute10               =>p_rec.enp_attribute10
395  ,p_enp_attribute11               =>p_rec.enp_attribute11
396  ,p_enp_attribute12               =>p_rec.enp_attribute12
397  ,p_enp_attribute13               =>p_rec.enp_attribute13
398  ,p_enp_attribute14               =>p_rec.enp_attribute14
399  ,p_enp_attribute15               =>p_rec.enp_attribute15
400  ,p_enp_attribute16               =>p_rec.enp_attribute16
401  ,p_enp_attribute17               =>p_rec.enp_attribute17
402  ,p_enp_attribute18               =>p_rec.enp_attribute18
403  ,p_enp_attribute19               =>p_rec.enp_attribute19
404  ,p_enp_attribute20               =>p_rec.enp_attribute20
405  ,p_enp_attribute21               =>p_rec.enp_attribute21
406  ,p_enp_attribute22               =>p_rec.enp_attribute22
407  ,p_enp_attribute23               =>p_rec.enp_attribute23
408  ,p_enp_attribute24               =>p_rec.enp_attribute24
409  ,p_enp_attribute25               =>p_rec.enp_attribute25
410  ,p_enp_attribute26               =>p_rec.enp_attribute26
411  ,p_enp_attribute27               =>p_rec.enp_attribute27
412  ,p_enp_attribute28               =>p_rec.enp_attribute28
413  ,p_enp_attribute29               =>p_rec.enp_attribute29
414  ,p_enp_attribute30               =>p_rec.enp_attribute30
415  ,p_enrt_perd_det_ovrlp_bckdt_cd  =>p_rec.enrt_perd_det_ovrlp_bckdt_cd
416     --cwb
417  ,p_data_freeze_date              =>p_rec.data_freeze_date
418  ,p_Sal_chg_reason_cd             =>p_rec.Sal_chg_reason_cd
419  ,p_Approval_mode_cd              =>p_rec.Approval_mode_cd
420  ,p_hrchy_ame_trn_cd              =>p_rec.hrchy_ame_trn_cd
421  ,p_hrchy_rl                      =>p_rec.hrchy_rl
422  ,p_hrchy_ame_app_id              =>p_rec.hrchy_ame_app_id
423   --
424  ,p_object_version_number         =>p_rec.object_version_number
425  ,p_effective_date                =>p_effective_date
426  ,p_reinstate_cd		  =>p_rec.reinstate_cd
427  ,p_reinstate_ovrdn_cd		  =>p_rec.reinstate_ovrdn_cd
428  ,p_reopen_le_on_reprocess        =>p_rec.reopen_le_on_reprocess
429  ,p_defer_deenrol_flag            =>p_rec.defer_deenrol_flag
430       );
431     --
432   exception
433     --
434     when hr_api.cannot_find_prog_unit then
435       --
436       hr_api.cannot_find_prog_unit_error
437         (p_module_name => 'ben_enrt_perd'
438         ,p_hook_type   => 'AI');
439       --
440   end;
441   --
442   -- End of API User Hook for post_insert.
443   --
444   --
445   --
446   hr_utility.set_location(' Leaving:'||l_proc, 10);
447 End post_insert;
448 --
449 -- ----------------------------------------------------------------------------
450 -- |---------------------------------< ins >----------------------------------|
451 -- ----------------------------------------------------------------------------
452 Procedure ins
453   (
454   p_effective_date in date,
455   p_rec        in out nocopy ben_enp_shd.g_rec_type
456   ) is
457 --
458   l_proc  varchar2(72) := g_package||'ins';
459 --
460 Begin
461   hr_utility.set_location('Entering:'||l_proc, 5);
462   --
463   -- Call the supporting insert validate operations
464   --
465   ben_enp_bus.insert_validate(p_rec
466                              ,p_effective_date);
467   --
468   -- Call the supporting pre-insert operation
469   --
470   pre_insert(p_rec);
471   --
472   -- Insert the row
473   --
474   insert_dml(p_rec);
475   --
476   -- Call the supporting post-insert operation
477   --
478   post_insert(
479 p_effective_date,p_rec);
480 end ins;
481 --
482 -- ----------------------------------------------------------------------------
483 -- |---------------------------------< ins >----------------------------------|
484 -- ----------------------------------------------------------------------------
485 Procedure ins
486   (
487   p_effective_date in date,
488   p_enrt_perd_id                 out nocopy number,
489   p_business_group_id            in number,
490   p_yr_perd_id                   in number,
491   p_popl_enrt_typ_cycl_id        in number,
492   p_end_dt                       in date,
493   p_strt_dt                      in date,
494   p_asnd_lf_evt_dt               in date,
495   p_cls_enrt_dt_to_use_cd        in varchar2         ,
496   p_dflt_enrt_dt                 in date             ,
500   p_enrt_cvg_strt_dt_rl          in number           ,
497   p_enrt_cvg_strt_dt_cd          in varchar2         ,
498   p_rt_strt_dt_rl                in number           ,
499   p_enrt_cvg_end_dt_cd           in varchar2         ,
501   p_enrt_cvg_end_dt_rl           in number           ,
502   p_procg_end_dt                 in date,
503   p_rt_strt_dt_cd                in varchar2         ,
504   p_rt_end_dt_cd                 in varchar2         ,
505   p_rt_end_dt_rl                 in number           ,
506   p_bdgt_upd_strt_dt             in  date            ,
507   p_bdgt_upd_end_dt              in  date            ,
508   p_ws_upd_strt_dt               in  date            ,
509   p_ws_upd_end_dt                in  date            ,
510   p_dflt_ws_acc_cd               in  varchar2        ,
511   p_prsvr_bdgt_cd                in  varchar2        ,
512   p_uses_bdgt_flag               in  varchar2        ,
513   p_auto_distr_flag              in  varchar2        ,
514   p_hrchy_to_use_cd              in  varchar2        ,
518   p_ler_id                       in  number          ,
515   p_pos_structure_version_id        in  number       ,
516   p_emp_interview_type_cd        in  varchar2        ,
517   p_wthn_yr_perd_id              in  number          ,
519   p_perf_revw_strt_dt            in date             ,
520   p_asg_updt_eff_date            in date             ,
521   p_enp_attribute_category       in varchar2         ,
522   p_enp_attribute1               in varchar2         ,
523   p_enp_attribute2               in varchar2         ,
524   p_enp_attribute3               in varchar2         ,
525   p_enp_attribute4               in varchar2         ,
526   p_enp_attribute5               in varchar2         ,
527   p_enp_attribute6               in varchar2         ,
528   p_enp_attribute7               in varchar2         ,
529   p_enp_attribute8               in varchar2         ,
530   p_enp_attribute9               in varchar2         ,
531   p_enp_attribute10              in varchar2         ,
532   p_enp_attribute11              in varchar2         ,
533   p_enp_attribute12              in varchar2         ,
534   p_enp_attribute13              in varchar2         ,
535   p_enp_attribute14              in varchar2         ,
536   p_enp_attribute15              in varchar2         ,
537   p_enp_attribute16              in varchar2         ,
538   p_enp_attribute17              in varchar2         ,
539   p_enp_attribute18              in varchar2         ,
540   p_enp_attribute19              in varchar2         ,
541   p_enp_attribute20              in varchar2         ,
542   p_enp_attribute21              in varchar2         ,
543   p_enp_attribute22              in varchar2         ,
544   p_enp_attribute23              in varchar2         ,
545   p_enp_attribute24              in varchar2         ,
546   p_enp_attribute25              in varchar2         ,
547   p_enp_attribute26              in varchar2         ,
548   p_enp_attribute27              in varchar2         ,
549   p_enp_attribute28              in varchar2         ,
550   p_enp_attribute29              in varchar2         ,
551   p_enp_attribute30              in varchar2         ,
552   p_enrt_perd_det_ovrlp_bckdt_cd in varchar2         ,
553   --cwb
554   p_data_freeze_date               in  date    ,
555   p_Sal_chg_reason_cd              in  varchar2,
556   p_Approval_mode_cd               in  varchar2,
557   p_hrchy_ame_trn_cd               in  varchar2,
558   p_hrchy_rl                       in  number,
559   p_hrchy_ame_app_id               in  number,
560   --
561   p_object_version_number        out nocopy number
562   ,p_reinstate_cd		in varchar2
563   ,p_reinstate_ovrdn_cd	in varchar2
564   ,p_reopen_le_on_reprocess in varchar2
565   ,p_defer_deenrol_flag in varchar2
566   ) is
567 --
568   l_rec	  ben_enp_shd.g_rec_type;
569   l_proc  varchar2(72) := g_package||'ins';
570 --
571 Begin
572   hr_utility.set_location('Entering:'||l_proc, 5);
573   --
574   -- Call conversion function to turn arguments into the
575   -- p_rec structure.
576   --
577   l_rec :=
578   ben_enp_shd.convert_args
579   (
580   null,
581   p_business_group_id,
582   p_yr_perd_id,
583   p_popl_enrt_typ_cycl_id,
584   p_end_dt,
585   p_strt_dt,
586   p_asnd_lf_evt_dt,
587   p_cls_enrt_dt_to_use_cd,
588   p_dflt_enrt_dt,
589   p_enrt_cvg_strt_dt_cd,
590   p_rt_strt_dt_rl,
591   p_enrt_cvg_end_dt_cd,
592   p_enrt_cvg_strt_dt_rl,
593   p_enrt_cvg_end_dt_rl,
594   p_procg_end_dt,
595   p_rt_strt_dt_cd,
596   p_rt_end_dt_cd,
597   p_rt_end_dt_rl,
598   p_bdgt_upd_strt_dt,
599   p_bdgt_upd_end_dt,
600   p_ws_upd_strt_dt,
601   p_ws_upd_end_dt,
602   p_dflt_ws_acc_cd,
603   p_prsvr_bdgt_cd,
604   p_uses_bdgt_flag,
605   p_auto_distr_flag,
606   p_hrchy_to_use_cd,
607   p_pos_structure_version_id,
608   p_emp_interview_type_cd,
609   p_wthn_yr_perd_id,
610   p_ler_id,
611   p_perf_revw_strt_dt,
612   p_asg_updt_eff_date,
613   p_enp_attribute_category,
614   p_enp_attribute1,
615   p_enp_attribute2,
616   p_enp_attribute3,
617   p_enp_attribute4,
618   p_enp_attribute5,
619   p_enp_attribute6,
620   p_enp_attribute7,
621   p_enp_attribute8,
622   p_enp_attribute9,
623   p_enp_attribute10,
624   p_enp_attribute11,
625   p_enp_attribute12,
626   p_enp_attribute13,
627   p_enp_attribute14,
628   p_enp_attribute15,
629   p_enp_attribute16,
630   p_enp_attribute17,
631   p_enp_attribute18,
632   p_enp_attribute19,
633   p_enp_attribute20,
634   p_enp_attribute21,
635   p_enp_attribute22,
636   p_enp_attribute23,
637   p_enp_attribute24,
638   p_enp_attribute25,
639   p_enp_attribute26,
640   p_enp_attribute27,
641   p_enp_attribute28,
642   p_enp_attribute29,
643   p_enp_attribute30,
644   p_enrt_perd_det_ovrlp_bckdt_cd,
645   --cwb
646   p_data_freeze_date    ,
647   p_Sal_chg_reason_cd   ,
648   p_Approval_mode_cd    ,
649   p_hrchy_ame_trn_cd    ,
650   p_hrchy_rl            ,
651   p_hrchy_ame_app_id
652   , null              -- bug 4341773 :p_reinstate_cd was passed to object_version_number.
653   ,p_reinstate_cd
654   ,p_reinstate_ovrdn_cd
655   ,p_reopen_le_on_reprocess
656   --
657   ,p_defer_deenrol_flag
658   );
659   --
660   -- Having converted the arguments into the ben_enp_rec
661   -- plsql record structure we call the corresponding record business process.
662   --
663   ins(
664     p_effective_date,l_rec);
665   --
666   -- As the primary key argument(s)
667   -- are specified as an OUT's we must set these values.
668   --
669   p_enrt_perd_id := l_rec.enrt_perd_id;
670   p_object_version_number := l_rec.object_version_number;
671   --
672   hr_utility.set_location(' Leaving:'||l_proc, 10);
673 End ins;
674 --
675 end ben_enp_ins;