DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PER_SHD

Source


1 Package Body per_per_shd as
2 /* $Header: peperrhi.pkb 120.20.12020000.5 2013/05/16 10:39:02 srannama ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_per_shd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------< return_api_dml_status >-------------------------|
12 -- ----------------------------------------------------------------------------
13 Function return_api_dml_status Return Boolean Is
14 --
15   l_proc    varchar2(72) := g_package||'return_api_dml_status';
16 --
17 Begin
18   hr_utility.set_location('Entering:'||l_proc, 5);
19   --
20   Return (nvl(g_api_dml, false));
21   --
22   hr_utility.set_location(' Leaving:'||l_proc, 10);
23 End return_api_dml_status;
24 --
25 -- ----------------------------------------------------------------------------
26 -- |---------------------------< constraint_error >---------------------------|
27 -- ----------------------------------------------------------------------------
28 Procedure constraint_error
29             (p_constraint_name in all_constraints.constraint_name%TYPE) Is
30 --
31   l_proc    varchar2(72) := g_package||'constraint_error';
32 --
33 Begin
34   hr_utility.set_location('Entering:'||l_proc, 5);
35   --
36   If (p_constraint_name = 'PER_PEOPLE_F_FK1') Then
37     -- Error: The Business Group is not defined.
38     hr_utility.set_message(801, 'HR_6673_PO_EMP_NO_BG');
39     hr_utility.raise_error;
40   ElsIf (p_constraint_name = 'PER_PEOPLE_F_FK2') Then
41     -- Error: Invalid person type
42     hr_utility.set_message(801, 'HR_7513_PER_TYPE_INVALID');
43     hr_utility.raise_error;
44   ElsIf (p_constraint_name = 'PER_PEOPLE_F_PK') Then
45     -- Error: The primary key specified is invalid
46     hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
47     hr_utility.raise_error;
48   ElsIf (p_constraint_name = 'PER_PER_EXPENSE_CHECK_SEND_CHK') Then
49     hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
50     hr_utility.set_message_token('PROCEDURE', l_proc);
51     hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
52     hr_utility.raise_error;
53   ElsIf (p_constraint_name = 'PER_PER_REGISTERED_DISABLE_CHK') Then
54     hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
55     hr_utility.set_message_token('PROCEDURE', l_proc);
56     hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
57     hr_utility.raise_error;
58   ElsIf (p_constraint_name = 'PER_PER_SEX_CHK') Then
59     hr_utility.set_message(801, 'HR_7511_PER_SEX_INVALID');
60     hr_utility.raise_error;
61   ElsIf (p_constraint_name = 'PER_PER_ON_MILITARY_SRV_CHK') Then
62     hr_utility.set_message(800, 'PER_52115_PER_INV_ON_MIL_SERV');
63     hr_utility.raise_error;
64   ElsIf (p_constraint_name = 'PER_PER_RESUME_EXISTS_CHK') Then
65     hr_utility.set_message(800, 'PER_52116_PER_INV_RES_EXIST');
66     hr_utility.raise_error;
67   ElsIf (p_constraint_name = 'PER_PER_SECOND_PASSPORT_CHK') Then
68     hr_utility.set_message(800, 'PER_52117_PER_INV_SEC_PAS_EXT');
69     hr_utility.raise_error;
70   Elsif (p_constraint_name = 'PER_BEN_NO_CVG_F_CHK') Then
71     hr_utility.set_message(800,'PER_52387_BEN_NO_CVG_F');
72     hr_utility.raise_error;
73  Elsif (p_constraint_name = 'PER_DPDNT_VLNTRY_SVCE_CHK') Then
74     hr_utility.set_message(800,'PER_52389_DPDNT_VLNTRY_SVCE_F');
75     hr_utility.raise_error;
76  Else
77     hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
78     hr_utility.set_message_token('PROCEDURE', l_proc);
79     hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
80     hr_utility.raise_error;
81   End If;
82   --
83   hr_utility.set_location(' Leaving:'||l_proc, 10);
84 End constraint_error;
85 --
86 -- ----------------------------------------------------------------------------
87 -- |-----------------------------< api_updating >-----------------------------|
88 -- ----------------------------------------------------------------------------
89 Function api_updating
90   (p_effective_date     in date,
91    p_person_id            in number,
92    p_object_version_number in number
93   ) Return Boolean Is
94 --
95   --
96   -- Cursor selects the 'current' row from the HR Schema
97   --
98   Cursor C_Sel1 is
99     select
100    person_id,
101    effective_start_date,
102    effective_end_date,
103    business_group_id,
104    person_type_id,
105    last_name,
106    start_date,
107    applicant_number,
108    comment_id,
109    null,
110    current_applicant_flag,
111    current_emp_or_apl_flag,
112    current_employee_flag,
113    date_employee_data_verified,
114    date_of_birth,
115    email_address,
116    employee_number,
117    expense_check_send_to_address,
118    first_name,
119    full_name,
120    known_as,
121    marital_status,
122    middle_names,
123    nationality,
124    national_identifier,
125    previous_last_name,
126    registered_disabled_flag,
127    sex,
128    title,
129    vendor_id,
130    work_telephone,
131    request_id,
132    program_application_id,
133    program_id,
134    program_update_date,
135    attribute_category,
136    attribute1,
137    attribute2,
138    attribute3,
139    attribute4,
140    attribute5,
141    attribute6,
142    attribute7,
143    attribute8,
144    attribute9,
145    attribute10,
146    attribute11,
147    attribute12,
148    attribute13,
149    attribute14,
150    attribute15,
151    attribute16,
152    attribute17,
153    attribute18,
154    attribute19,
155    attribute20,
156    attribute21,
157    attribute22,
158    attribute23,
159    attribute24,
160    attribute25,
161    attribute26,
162    attribute27,
163    attribute28,
164    attribute29,
165    attribute30,
166    per_information_category,
167    per_information1,
168    per_information2,
169    per_information3,
170    per_information4,
171    per_information5,
172    per_information6,
173    per_information7,
174    per_information8,
175    per_information9,
176    per_information10,
177    per_information11,
178    per_information12,
179    per_information13,
180    per_information14,
181    per_information15,
182    per_information16,
183    per_information17,
184    per_information18,
185    per_information19,
186    per_information20,
187    object_version_number,
188         suffix,
189         DATE_OF_DEATH                ,
190         BACKGROUND_CHECK_STATUS      ,
191         BACKGROUND_DATE_CHECK        ,
192         BLOOD_TYPE                   ,
193         CORRESPONDENCE_LANGUAGE      ,
194         FAST_PATH_EMPLOYEE           ,
195         FTE_CAPACITY                 ,
196         HOLD_APPLICANT_DATE_UNTIL    ,
197         HONORS                       ,
198         INTERNAL_LOCATION            ,
199         LAST_MEDICAL_TEST_BY         ,
200         LAST_MEDICAL_TEST_DATE       ,
201         MAILSTOP                     ,
202         OFFICE_NUMBER                ,
203         ON_MILITARY_SERVICE          ,
204         ORDER_NAME                   ,
205         PRE_NAME_ADJUNCT             ,
206         PROJECTED_START_DATE         ,
207         REHIRE_AUTHORIZOR            ,
208         REHIRE_RECOMMENDATION        ,
209         RESUME_EXISTS                ,
210         RESUME_LAST_UPDATED          ,
211         SECOND_PASSPORT_EXISTS       ,
212         STUDENT_STATUS               ,
213         WORK_SCHEDULE                ,
214         PER_INFORMATION21            ,
215         PER_INFORMATION22            ,
216         PER_INFORMATION23            ,
217         PER_INFORMATION24            ,
218         PER_INFORMATION25            ,
219         PER_INFORMATION26            ,
220         PER_INFORMATION27            ,
221         PER_INFORMATION28            ,
222         PER_INFORMATION29            ,
223         PER_INFORMATION30            ,
224         REHIRE_REASON                ,
225         BENEFIT_GROUP_ID             ,
226         RECEIPT_OF_DEATH_CERT_DATE   ,
227         COORD_BEN_MED_PLN_NO         ,
228         COORD_BEN_NO_CVG_FLAG        ,
229         COORD_BEN_MED_EXT_ER,
230         COORD_BEN_MED_PL_NAME,
231         COORD_BEN_MED_INSR_CRR_NAME,
232         COORD_BEN_MED_INSR_CRR_IDENT,
233         COORD_BEN_MED_CVG_STRT_DT,
234         COORD_BEN_MED_CVG_END_DT,
235         USES_TOBACCO_FLAG            ,
236         DPDNT_ADOPTION_DATE          ,
237         DPDNT_VLNTRY_SVCE_FLAG       ,
238         ORIGINAL_DATE_OF_HIRE        ,
239       town_of_birth                ,
240         region_of_birth              ,
241       country_of_birth             ,
242         global_person_id,
243         party_id,
244         npw_number,
245         current_npw_flag,
246         global_name,
247         local_name
248     from per_all_people_f
249     where   person_id = p_person_id
250     and     p_effective_date
251     between effective_start_date and effective_end_date;
252 --
253   l_proc varchar2(72)   := g_package||'api_updating';
254   l_fct_ret boolean;
255 --
256 Begin
257   hr_utility.set_location('Entering:'||l_proc, 5);
258   --
259   If (p_effective_date is null or
260       p_person_id is null or
261       p_object_version_number is null) Then
262     --
263     -- One of the primary key arguments is null therefore we must
264     -- set the returning function value to false
265     --
266     l_fct_ret := false;
267   Else
268     If (p_person_id = g_old_rec.person_id and
269         p_object_version_number = g_old_rec.object_version_number) Then
270       hr_utility.set_location(l_proc, 10);
271       --
272       -- The g_old_rec is current therefore we must
273       -- set the returning function to true
274       --
275       l_fct_ret := true;
276     Else
277       --
278       -- Clear out the global variable which holds the previous system
279       -- person type
280       --
281       per_per_bus.g_previous_sys_per_type := null;
282       --
283       -- Select the current row
284       --
285       Open C_Sel1;
286       Fetch C_Sel1 Into g_old_rec;
287       If C_Sel1%notfound Then
288         Close C_Sel1;
289         --
290         -- The primary key is invalid therefore we must error
291         --
292         hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
293         hr_utility.raise_error;
294       End If;
295       Close C_Sel1;
296 	  -- ER FPT
297       If (p_object_version_number <> g_old_rec.object_version_number) AND (g_old_rec.effective_start_date <> p_effective_date) Then
298         hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
299         hr_utility.raise_error;
300       End If;
301       hr_utility.set_location(l_proc, 15);
302       l_fct_ret := true;
303     End If;
304   End If;
305   hr_utility.set_location(' Leaving:'||l_proc, 20);
306   Return (l_fct_ret);
307 --
308 End api_updating;
309 --
310 -- ----------------------------------------------------------------------------
311 -- |--------------------------< find_dt_del_modes >---------------------------|
312 -- ----------------------------------------------------------------------------
313 Procedure find_dt_del_modes
314    (p_effective_date in  date,
315     p_base_key_value in  number,
316     p_zap       out nocopy boolean,
317     p_delete    out nocopy boolean,
318     p_future_change out nocopy boolean,
319     p_delete_next_change out nocopy boolean) is
320 --
321   l_proc       varchar2(72)   := g_package||'find_dt_del_modes';
322 --
323   --
324   --
325 --
326 Begin
327   hr_utility.set_location('Entering:'||l_proc, 5);
328     --
329   --
330   -- Call the corresponding datetrack api
331   --
332   dt_api.find_dt_del_modes
333    (p_effective_date => p_effective_date,
334     p_base_table_name   => 'per_all_people_f',
335     p_base_key_column   => 'person_id',
336     p_base_key_value => p_base_key_value,
337     p_zap         => p_zap,
338     p_delete      => p_delete,
339     p_future_change  => p_future_change,
340     p_delete_next_change   => p_delete_next_change);
341   --
342   hr_utility.set_location(' Leaving:'||l_proc, 10);
343 End find_dt_del_modes;
344 --
345 -- ----------------------------------------------------------------------------
346 -- |--------------------------< find_dt_upd_modes >---------------------------|
347 -- ----------------------------------------------------------------------------
348 Procedure find_dt_upd_modes
349    (p_effective_date in  date,
350     p_base_key_value in  number,
351     p_correction   out nocopy boolean,
352     p_update    out nocopy boolean,
353     p_update_override out nocopy boolean,
354     p_update_change_insert out nocopy boolean) is
355 --
356   l_proc    varchar2(72) := g_package||'find_dt_upd_modes';
357 --
358 Begin
359   hr_utility.set_location('Entering:'||l_proc, 5);
360   --
361   -- Call the corresponding datetrack api
362   --
363   dt_api.find_dt_upd_modes
364    (p_effective_date => p_effective_date,
365     p_base_table_name   => 'per_all_people_f',
366     p_base_key_column   => 'person_id',
367     p_base_key_value => p_base_key_value,
368     p_correction     => p_correction,
369     p_update      => p_update,
370     p_update_override   => p_update_override,
371     p_update_change_insert => p_update_change_insert);
372   --
373   hr_utility.set_location(' Leaving:'||l_proc, 10);
374 End find_dt_upd_modes;
375 --
376 -- ----------------------------------------------------------------------------
377 -- |------------------------< upd_effective_end_date >------------------------|
378 -- ----------------------------------------------------------------------------
379 Procedure upd_effective_end_date
380    (p_effective_date    in date,
381     p_base_key_value    in number,
382     p_new_effective_end_date  in date,
383     p_validation_start_date   in date,
384     p_validation_end_date     in date,
385          p_object_version_number       out nocopy number) is
386 --
387   l_proc         varchar2(72) := g_package||'upd_effective_end_date';
388   l_object_version_number number;
389 --
390 Begin
391   hr_utility.set_location('Entering:'||l_proc, 5);
392   --
393   -- Because we are updating a row we must get the next object
394   -- version number.
395   --
396   l_object_version_number :=
397     dt_api.get_object_version_number
398    (p_base_table_name   => 'per_all_people_f',
399     p_base_key_column   => 'person_id',
400     p_base_key_value => p_base_key_value);
401   --
402   hr_utility.set_location(l_proc, 10);
403   g_api_dml := true;  -- Set the api dml status
404   --
405   -- Update the specified datetrack row setting the effective
406   -- end date to the specified new effective end date.
407   --
408   update  per_all_people_f t
409   set   t.effective_end_date    = p_new_effective_end_date,
410      t.object_version_number = l_object_version_number
411   where    t.person_id    = p_base_key_value
412   and   p_effective_date
413   between t.effective_start_date and t.effective_end_date;
414   --
415   g_api_dml := false;   -- Unset the api dml status
416   p_object_version_number := l_object_version_number;
417   hr_utility.set_location(' Leaving:'||l_proc, 15);
418 --
419 Exception
420   When Others Then
421     g_api_dml := false;   -- Unset the api dml status
422     Raise;
423 End upd_effective_end_date;
424 --
425 -- ----------------------------------------------------------------------------
426 -- |---------------------------------< lck >----------------------------------|
427 -- ----------------------------------------------------------------------------
428 Procedure lck
429    (p_effective_date  in  date,
430     p_datetrack_mode  in  varchar2,
431     p_person_id    in  number,
432     p_object_version_number in  number,
433     p_validation_start_date out nocopy date,
434     p_validation_end_date   out nocopy date) is
435 --
436   l_proc      varchar2(72) := g_package||'lck';
437   l_validation_start_date date;
438   l_validation_end_date   date;
439   l_object_invalid     exception;
440   l_argument        varchar2(30);
441   --
442   -- Cursor C_Sel1 selects the current locked row as of session date
443   -- ensuring that the object version numbers match.
444   --
445   Cursor C_Sel1 is
446     select
447    person_id,
448    effective_start_date,
449    effective_end_date,
450    business_group_id,
451    person_type_id,
452    last_name,
453    start_date,
454    applicant_number,
455    comment_id,
456    null,
457    current_applicant_flag,
458    current_emp_or_apl_flag,
459    current_employee_flag,
460    date_employee_data_verified,
461    date_of_birth,
462    email_address,
463    employee_number,
464    expense_check_send_to_address,
465    first_name,
466    full_name,
467    known_as,
468    marital_status,
469    middle_names,
470    nationality,
471    national_identifier,
472    previous_last_name,
473    registered_disabled_flag,
474    sex,
475    title,
476    vendor_id,
477    work_telephone,
478    request_id,
479    program_application_id,
480    program_id,
481    program_update_date,
482    attribute_category,
483    attribute1,
484    attribute2,
485    attribute3,
486    attribute4,
487    attribute5,
488    attribute6,
489    attribute7,
490    attribute8,
491    attribute9,
492    attribute10,
493    attribute11,
494    attribute12,
495    attribute13,
496    attribute14,
497    attribute15,
498    attribute16,
499    attribute17,
500    attribute18,
501    attribute19,
502    attribute20,
503    attribute21,
504    attribute22,
505    attribute23,
506    attribute24,
507    attribute25,
508    attribute26,
509    attribute27,
510    attribute28,
511    attribute29,
512    attribute30,
513    per_information_category,
514    per_information1,
515    per_information2,
516    per_information3,
517    per_information4,
518    per_information5,
519    per_information6,
520    per_information7,
521    per_information8,
522    per_information9,
523    per_information10,
524    per_information11,
525    per_information12,
526    per_information13,
527    per_information14,
528    per_information15,
529    per_information16,
530    per_information17,
531    per_information18,
532    per_information19,
533    per_information20,
534    object_version_number,
535         suffix,
536         DATE_OF_DEATH                ,
537         BACKGROUND_CHECK_STATUS      ,
538         BACKGROUND_DATE_CHECK        ,
539         BLOOD_TYPE                   ,
540         CORRESPONDENCE_LANGUAGE      ,
541         FAST_PATH_EMPLOYEE           ,
542         FTE_CAPACITY                 ,
543         HOLD_APPLICANT_DATE_UNTIL    ,
544         HONORS                       ,
545         INTERNAL_LOCATION            ,
546         LAST_MEDICAL_TEST_BY         ,
547         LAST_MEDICAL_TEST_DATE       ,
548         MAILSTOP                     ,
549         OFFICE_NUMBER                ,
550         ON_MILITARY_SERVICE          ,
551         ORDER_NAME                   ,
552         PRE_NAME_ADJUNCT             ,
553         PROJECTED_START_DATE         ,
554         REHIRE_AUTHORIZOR            ,
555         REHIRE_RECOMMENDATION        ,
556         RESUME_EXISTS                ,
557         RESUME_LAST_UPDATED          ,
558         SECOND_PASSPORT_EXISTS       ,
559         STUDENT_STATUS               ,
560         WORK_SCHEDULE                ,
561         PER_INFORMATION21            ,
562         PER_INFORMATION22            ,
563         PER_INFORMATION23            ,
564         PER_INFORMATION24            ,
565         PER_INFORMATION25            ,
566         PER_INFORMATION26            ,
567         PER_INFORMATION27            ,
568         PER_INFORMATION28            ,
569         PER_INFORMATION29            ,
570         PER_INFORMATION30            ,
571         REHIRE_REASON                ,
572         BENEFIT_GROUP_ID             ,
573         RECEIPT_OF_DEATH_CERT_DATE   ,
574         COORD_BEN_MED_PLN_NO         ,
575         COORD_BEN_NO_CVG_FLAG        ,
576         COORD_BEN_MED_EXT_ER,
577         COORD_BEN_MED_PL_NAME,
578         COORD_BEN_MED_INSR_CRR_NAME,
579         COORD_BEN_MED_INSR_CRR_IDENT,
580         COORD_BEN_MED_CVG_STRT_DT,
581         COORD_BEN_MED_CVG_END_DT,
582         USES_TOBACCO_FLAG            ,
583         DPDNT_ADOPTION_DATE          ,
584         DPDNT_VLNTRY_SVCE_FLAG       ,
585         ORIGINAL_DATE_OF_HIRE        ,
586       town_of_birth                ,
587         region_of_birth              ,
588       country_of_birth             ,
589         global_person_id             ,
590         party_id,
591         npw_number,
592         current_npw_flag,
593         global_name,
594         local_name
595     from    per_all_people_f -- for bug 7518991
596     where   person_id         = p_person_id
597     and      p_effective_date
598     between effective_start_date and effective_end_date
599     for update nowait;
600   --
601   -- Cursor C_Sel3 select comment text
602   --
603   Cursor C_Sel3 is
604     select hc.comment_text
605     from   hr_comments hc
606     where  hc.comment_id = per_per_shd.g_old_rec.comment_id;
607   --
608 
609 Begin
610   hr_utility.set_location('Entering:'||l_proc, 5);
611   --
612   -- Ensure that all the mandatory arguments are not null
613   --
614   hr_api.mandatory_arg_error(p_api_name       => l_proc,
615                              p_argument       => 'effective_date',
616                              p_argument_value => p_effective_date);
617   --
618   hr_api.mandatory_arg_error(p_api_name       => l_proc,
619                              p_argument       => 'datetrack_mode',
620                              p_argument_value => p_datetrack_mode);
621   --
622   hr_api.mandatory_arg_error(p_api_name       => l_proc,
623                              p_argument       => 'person_id',
624                              p_argument_value => p_person_id);
625   --
626   hr_api.mandatory_arg_error(p_api_name       => l_proc,
627                              p_argument       => 'object_version_number',
628                              p_argument_value => p_object_version_number);
629   --
630   -- Check to ensure the datetrack mode is not INSERT.
631   --
632   If (p_datetrack_mode <> 'INSERT') then
633     --
634     -- We must select and lock the current row.
635     --
636     Open  C_Sel1;
637     Fetch C_Sel1 Into g_old_rec;
638     If C_Sel1%notfound then
639       Close C_Sel1;
640       --
641       -- The primary key is invalid therefore we must error
642       --
643       hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
644       hr_utility.raise_error;
645     End If;
646     Close C_Sel1;
647 	-- ER FPT
648     If (p_object_version_number <> g_old_rec.object_version_number) and (p_datetrack_mode <> 'CORRECTION') Then
649         hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
650         hr_utility.raise_error;
651       End If;
652     hr_utility.set_location(l_proc, 15);
653     --
654     -- Providing we are doing an update and a comment_id exists then
655     -- we select the comment text.
656     --
657     If ((g_old_rec.comment_id is not null)              and
658         (p_datetrack_mode = 'UPDATE'                   or
659          p_datetrack_mode = 'CORRECTION'               or
660          p_datetrack_mode = 'UPDATE_OVERRIDE'          or
661          p_datetrack_mode = 'UPDATE_CHANGE_INSERT')) then
662       Open C_Sel3;
663       Fetch C_Sel3 Into per_per_shd.g_old_rec.comments;
664       If C_Sel3%notfound then
665         --
666         -- The comments for the specified comment_id does not exist.
667         -- We must error due to data integrity problems.
668         --
669         Close C_Sel3;
670         hr_utility.set_message(801, 'HR_7202_COMMENT_TEXT_NOT_EXIST');
671         hr_utility.raise_error;
672       End If;
673       Close C_Sel3;
674     End If;
675     --
676     -- Validate the datetrack mode mode getting the validation start
677     -- and end dates for the specified datetrack operation.
678     --
679 
680     dt_api.validate_dt_mode
681    (p_effective_date          => p_effective_date,
682     p_datetrack_mode          => p_datetrack_mode,
683     p_base_table_name         => 'per_all_people_f', -- for bug 7518991
684     p_base_key_column         => 'person_id',
685     p_base_key_value          => p_person_id,
686     p_child_table_name1       => 'per_contracts_f',
687     p_child_key_column1       => 'contract_id',
688     p_enforce_foreign_locking => true,
689     p_validation_start_date   => l_validation_start_date,
690     p_validation_end_date     => l_validation_end_date);
691   Else
692     --
693     -- We are doing a datetrack 'INSERT' which is illegal within this
694     -- procedure therefore we must error (note: to lck on insert the
695     -- private procedure ins_lck should be called).
696     --
697     hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
698     hr_utility.set_message_token('PROCEDURE', l_proc);
699     hr_utility.set_message_token('STEP','20');
700     hr_utility.raise_error;
701   End If;
702   --
703   -- Set the validation start and end date OUT arguments
704   --
705   p_validation_start_date := l_validation_start_date;
706   p_validation_end_date   := l_validation_end_date;
707   --
708   hr_utility.set_location(' Leaving:'||l_proc, 30);
709 --
710 -- We need to trap the ORA LOCK exception
711 --
712 Exception
713   When HR_Api.Object_Locked then
714     --
715     -- The object is locked therefore we need to supply a meaningful
716     -- error message.
717     --
718     hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
719     hr_utility.set_message_token('TABLE_NAME', 'per_all_people_f');
720     hr_utility.raise_error;
721   When l_object_invalid then
722     --
723     -- The object doesn't exist or is invalid
724     --
725     hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
726     hr_utility.set_message_token('TABLE_NAME', 'per_all_people_f');
727     hr_utility.raise_error;
728 End lck;
729 --
730 -- ----------------------------------------------------------------------------
731 -- |-----------------------------< convert_args >-----------------------------|
732 -- ----------------------------------------------------------------------------
733 Function convert_args
734    (
735    p_person_id                     in number,
736    p_effective_start_date          in date,
737    p_effective_end_date            in date,
738    p_business_group_id             in number,
739    p_person_type_id                in number,
740    p_last_name                     in varchar2,
741    p_start_date                    in date,
742    p_applicant_number              in varchar2,
743    p_comment_id                    in number,
744    p_comments                      in varchar2,
745    p_current_applicant_flag        in varchar2,
746    p_current_emp_or_apl_flag       in varchar2,
747    p_current_employee_flag         in varchar2,
748    p_date_employee_data_verified   in date,
749    p_date_of_birth                 in date,
750    p_email_address                 in varchar2,
751    p_employee_number               in varchar2,
752    p_expense_check_send_to_addres  in varchar2,
753    p_first_name                    in varchar2,
754    p_full_name                     in varchar2,
755    p_known_as                      in varchar2,
756    p_marital_status                in varchar2,
757    p_middle_names                  in varchar2,
758    p_nationality                   in varchar2,
759    p_national_identifier           in varchar2,
760    p_previous_last_name            in varchar2,
761    p_registered_disabled_flag      in varchar2,
762    p_sex                           in varchar2,
763    p_title                         in varchar2,
764    p_vendor_id                     in number,
765    p_work_telephone                in varchar2,
766    p_request_id                    in number,
767    p_program_application_id        in number,
768    p_program_id                    in number,
769    p_program_update_date           in date,
770    p_attribute_category            in varchar2,
771    p_attribute1                    in varchar2,
772    p_attribute2                    in varchar2,
773    p_attribute3                    in varchar2,
774    p_attribute4                    in varchar2,
775    p_attribute5                    in varchar2,
776    p_attribute6                    in varchar2,
777    p_attribute7                    in varchar2,
778    p_attribute8                    in varchar2,
779    p_attribute9                    in varchar2,
780    p_attribute10                   in varchar2,
781    p_attribute11                   in varchar2,
782    p_attribute12                   in varchar2,
783    p_attribute13                   in varchar2,
784    p_attribute14                   in varchar2,
785    p_attribute15                   in varchar2,
786    p_attribute16                   in varchar2,
787    p_attribute17                   in varchar2,
788    p_attribute18                   in varchar2,
789    p_attribute19                   in varchar2,
790    p_attribute20                   in varchar2,
791    p_attribute21                   in varchar2,
792    p_attribute22                   in varchar2,
793    p_attribute23                   in varchar2,
794    p_attribute24                   in varchar2,
795    p_attribute25                   in varchar2,
796    p_attribute26                   in varchar2,
797    p_attribute27                   in varchar2,
798    p_attribute28                   in varchar2,
799    p_attribute29                   in varchar2,
800    p_attribute30                   in varchar2,
801    p_per_information_category      in varchar2,
802    p_per_information1              in varchar2,
803    p_per_information2              in varchar2,
804    p_per_information3              in varchar2,
805    p_per_information4              in varchar2,
806    p_per_information5              in varchar2,
807    p_per_information6              in varchar2,
808    p_per_information7              in varchar2,
809    p_per_information8              in varchar2,
810    p_per_information9              in varchar2,
811    p_per_information10             in varchar2,
812    p_per_information11             in varchar2,
813    p_per_information12             in varchar2,
814    p_per_information13             in varchar2,
815    p_per_information14             in varchar2,
816    p_per_information15             in varchar2,
817    p_per_information16             in varchar2,
818    p_per_information17             in varchar2,
819    p_per_information18             in varchar2,
820    p_per_information19             in varchar2,
821    p_per_information20             in varchar2,
822    p_object_version_number         in number,
823         p_suffix                        in varchar2,
824         p_DATE_OF_DEATH                 in DATE,
825         p_BACKGROUND_CHECK_STATUS       in varchar2,
826         p_BACKGROUND_DATE_CHECK         in DATE,
827         p_BLOOD_TYPE                    in varchar2,
828         p_CORRESPONDENCE_LANGUAGE       in varchar2,
829         p_FAST_PATH_EMPLOYEE            in varchar2,
830         p_FTE_CAPACITY                  in NUMBER,
831         p_HOLD_APPLICANT_DATE_UNTIL     in DATE,
832         p_HONORS                        in varchar2,
833         p_INTERNAL_LOCATION             in varchar2,
834         p_LAST_MEDICAL_TEST_BY          in varchar2,
835         p_LAST_MEDICAL_TEST_DATE        in DATE,
836         p_MAILSTOP                      in varchar2,
837         p_OFFICE_NUMBER                 in varchar2,
838         p_ON_MILITARY_SERVICE           in varchar2,
839         p_ORDER_NAME                    in varchar2,
840         p_PRE_NAME_ADJUNCT              in varchar2,
841         p_PROJECTED_START_DATE          in DATE,
842         p_REHIRE_AUTHORIZOR             in varchar2,
843         p_REHIRE_RECOMMENDATION         in varchar2,
844         p_RESUME_EXISTS                 in varchar2,
845         p_RESUME_LAST_UPDATED           in DATE,
846         p_SECOND_PASSPORT_EXISTS        in varchar2,
847         p_STUDENT_STATUS                in varchar2,
848         p_WORK_SCHEDULE                 in varchar2,
849         p_PER_INFORMATION21             in varchar2,
850         p_PER_INFORMATION22             in varchar2,
851         p_PER_INFORMATION23             in varchar2,
852         p_PER_INFORMATION24             in varchar2,
853         p_PER_INFORMATION25             in varchar2,
854         p_PER_INFORMATION26             in varchar2,
855         p_PER_INFORMATION27             in varchar2,
856         p_PER_INFORMATION28             in varchar2,
857         p_PER_INFORMATION29             in varchar2,
858         p_PER_INFORMATION30             in varchar2,
859         p_REHIRE_REASON                 in varchar2,
860         p_BENEFIT_GROUP_ID              in number,
861         p_RECEIPT_OF_DEATH_CERT_DATE    in DATE,
862         p_COORD_BEN_MED_PLN_NO          in varchar2,
863         p_COORD_BEN_NO_CVG_FLAG         in varchar2,
864         p_coord_ben_med_ext_er          in varchar2,
865         p_coord_ben_med_pl_name         in varchar2,
866         p_coord_ben_med_insr_crr_name   in varchar2,
867         p_coord_ben_med_insr_crr_ident  in varchar2,
868         p_coord_ben_med_cvg_strt_dt     in date,
869         p_coord_ben_med_cvg_end_dt      in date,
870         p_USES_TOBACCO_FLAG             in varchar2,
871         p_DPDNT_ADOPTION_DATE           in DATE,
872         p_DPDNT_VLNTRY_SVCE_FLAG        in varchar2,
873         p_ORIGINAL_DATE_OF_HIRE         in DATE,
874       p_town_of_birth                   in varchar2,
875         p_region_of_birth               in varchar2,
876       p_country_of_birth                in varchar2,
877         p_global_person_id              in varchar2,
878         p_party_id                      in number,
879         p_npw_number                    in varchar2,
880         p_current_npw_flag              in varchar2,
881         p_global_name                   in  varchar2,
882         p_local_name                    in  varchar2
883    )
884    Return g_rec_type is
885 --
886   l_rec    g_rec_type;
887   l_proc  varchar2(72) := g_package||'convert_args';
888 --
889 Begin
890   --
891   hr_utility.set_location('Entering:'||l_proc, 5);
892   --
893   -- Convert arguments into local l_rec structure.
894   --
895   l_rec.person_id                        := p_person_id;
896   l_rec.effective_start_date             := p_effective_start_date;
897   l_rec.effective_end_date               := p_effective_end_date;
898   l_rec.business_group_id                := p_business_group_id;
899   l_rec.person_type_id                   := p_person_type_id;
900   l_rec.last_name                        := p_last_name;
901   l_rec.start_date                       := p_start_date;
902   l_rec.applicant_number                 := p_applicant_number;
903   l_rec.comment_id                       := p_comment_id;
904   l_rec.comments                         := p_comments;
905   l_rec.current_applicant_flag           := p_current_applicant_flag;
906   l_rec.current_emp_or_apl_flag          := p_current_emp_or_apl_flag;
907   l_rec.current_employee_flag            := p_current_employee_flag;
908   l_rec.date_employee_data_verified      := p_date_employee_data_verified;
909   l_rec.date_of_birth                    := p_date_of_birth;
910   l_rec.email_address                    := p_email_address;
911   l_rec.employee_number                  := p_employee_number;
912   l_rec.expense_check_send_to_address    := p_expense_check_send_to_addres;
913   l_rec.first_name                       := p_first_name;
914   l_rec.full_name                        := p_full_name;
915   l_rec.known_as                         := p_known_as;
916   l_rec.marital_status                   := p_marital_status;
917   l_rec.middle_names                     := p_middle_names;
918   l_rec.nationality                      := p_nationality;
919   l_rec.national_identifier              := p_national_identifier;
920   l_rec.previous_last_name               := p_previous_last_name;
921   l_rec.registered_disabled_flag         := p_registered_disabled_flag;
922   l_rec.sex                              := p_sex;
923   l_rec.title                            := p_title;
924   l_rec.vendor_id                        := p_vendor_id;
925   l_rec.work_telephone                   := p_work_telephone;
926   l_rec.request_id                       := p_request_id;
927   l_rec.program_application_id           := p_program_application_id;
928   l_rec.program_id                       := p_program_id;
929   l_rec.program_update_date              := p_program_update_date;
930   l_rec.attribute_category               := p_attribute_category;
931   l_rec.attribute1                       := p_attribute1;
932   l_rec.attribute2                       := p_attribute2;
933   l_rec.attribute3                       := p_attribute3;
934   l_rec.attribute4                       := p_attribute4;
935   l_rec.attribute5                       := p_attribute5;
936   l_rec.attribute6                       := p_attribute6;
937   l_rec.attribute7                       := p_attribute7;
938   l_rec.attribute8                       := p_attribute8;
939   l_rec.attribute9                       := p_attribute9;
940   l_rec.attribute10                      := p_attribute10;
941   l_rec.attribute11                      := p_attribute11;
942   l_rec.attribute12                      := p_attribute12;
943   l_rec.attribute13                      := p_attribute13;
944   l_rec.attribute14                      := p_attribute14;
945   l_rec.attribute15                      := p_attribute15;
946   l_rec.attribute16                      := p_attribute16;
947   l_rec.attribute17                      := p_attribute17;
948   l_rec.attribute18                      := p_attribute18;
949   l_rec.attribute19                      := p_attribute19;
950   l_rec.attribute20                      := p_attribute20;
951   l_rec.attribute21                      := p_attribute21;
952   l_rec.attribute22                      := p_attribute22;
953   l_rec.attribute23                      := p_attribute23;
954   l_rec.attribute24                      := p_attribute24;
955   l_rec.attribute25                      := p_attribute25;
956   l_rec.attribute26                      := p_attribute26;
957   l_rec.attribute27                      := p_attribute27;
958   l_rec.attribute28                      := p_attribute28;
959   l_rec.attribute29                      := p_attribute29;
960   l_rec.attribute30                      := p_attribute30;
961   l_rec.per_information_category         := p_per_information_category;
962   l_rec.per_information1                 := p_per_information1;
963   l_rec.per_information2                 := p_per_information2;
964   l_rec.per_information3                 := p_per_information3;
965   l_rec.per_information4                 := p_per_information4;
966   l_rec.per_information5                 := p_per_information5;
967   l_rec.per_information6                 := p_per_information6;
968   l_rec.per_information7                 := p_per_information7;
969   l_rec.per_information8                 := p_per_information8;
970   l_rec.per_information9                 := p_per_information9;
971   l_rec.per_information10                := p_per_information10;
972   l_rec.per_information11                := p_per_information11;
973   l_rec.per_information12                := p_per_information12;
974   l_rec.per_information13                := p_per_information13;
975   l_rec.per_information14                := p_per_information14;
976   l_rec.per_information15                := p_per_information15;
977   l_rec.per_information16                := p_per_information16;
978   l_rec.per_information17                := p_per_information17;
979   l_rec.per_information18                := p_per_information18;
980   l_rec.per_information19                := p_per_information19;
981   l_rec.per_information20                := p_per_information20;
982   l_rec.object_version_number            := p_object_version_number;
983   l_rec.suffix                           := p_suffix;
984   l_rec.DATE_OF_DEATH                    := p_DATE_OF_DEATH;
985   l_rec.BACKGROUND_CHECK_STATUS          := p_BACKGROUND_CHECK_STATUS;
986   l_rec.BACKGROUND_DATE_CHECK            := p_BACKGROUND_DATE_CHECK;
987   l_rec.BLOOD_TYPE                       := p_BLOOD_TYPE;
988   l_rec.CORRESPONDENCE_LANGUAGE          := p_CORRESPONDENCE_LANGUAGE;
989   l_rec.FAST_PATH_EMPLOYEE               := p_FAST_PATH_EMPLOYEE;
990   l_rec.FTE_CAPACITY                     := p_FTE_CAPACITY;
991   l_rec.HOLD_APPLICANT_DATE_UNTIL        := p_HOLD_APPLICANT_DATE_UNTIL;
992   l_rec.HONORS                           := p_HONORS;
993   l_rec.INTERNAL_LOCATION                := p_INTERNAL_LOCATION;
994   l_rec.LAST_MEDICAL_TEST_BY             := p_LAST_MEDICAL_TEST_BY;
995   l_rec.LAST_MEDICAL_TEST_DATE           := p_LAST_MEDICAL_TEST_DATE;
996   l_rec.MAILSTOP                         := p_MAILSTOP;
997   l_rec.OFFICE_NUMBER                    := p_OFFICE_NUMBER;
998   l_rec.ON_MILITARY_SERVICE              := p_ON_MILITARY_SERVICE;
999 
1000   l_rec.ORDER_NAME                       := p_ORDER_NAME;
1001   l_rec.PRE_NAME_ADJUNCT                 := p_PRE_NAME_ADJUNCT;
1002   l_rec.PROJECTED_START_DATE             := p_PROJECTED_START_DATE;
1003   l_rec.REHIRE_AUTHORIZOR                := p_REHIRE_AUTHORIZOR;
1004   l_rec.REHIRE_RECOMMENDATION            := p_REHIRE_RECOMMENDATION;
1005   l_rec.RESUME_EXISTS                    := p_RESUME_EXISTS;
1006   l_rec.RESUME_LAST_UPDATED              := p_RESUME_LAST_UPDATED;
1007   l_rec.SECOND_PASSPORT_EXISTS           := p_SECOND_PASSPORT_EXISTS;
1008   l_rec.STUDENT_STATUS                   := p_STUDENT_STATUS;
1009   l_rec.WORK_SCHEDULE                    := p_WORK_SCHEDULE;
1010   l_rec.PER_INFORMATION21                := p_PER_INFORMATION21;
1011   l_rec.PER_INFORMATION22                := p_PER_INFORMATION22;
1012   l_rec.PER_INFORMATION23                := p_PER_INFORMATION23;
1013   l_rec.PER_INFORMATION24                := p_PER_INFORMATION24;
1014   l_rec.PER_INFORMATION25                := p_PER_INFORMATION25;
1015   l_rec.PER_INFORMATION26                := p_PER_INFORMATION26;
1016   l_rec.PER_INFORMATION27                := p_PER_INFORMATION27;
1017   l_rec.PER_INFORMATION28                := p_PER_INFORMATION28;
1018   l_rec.PER_INFORMATION29                := p_PER_INFORMATION29;
1019   l_rec.PER_INFORMATION30                := p_PER_INFORMATION30;
1020   l_rec.REHIRE_REASON                    := p_REHIRE_REASON;
1021   l_rec.BENEFIT_GROUP_ID                 := p_BENEFIT_GROUP_ID;
1022   l_rec.RECEIPT_OF_DEATH_CERT_DATE       := p_RECEIPT_OF_DEATH_CERT_DATE;
1023   l_rec.COORD_BEN_MED_PLN_NO             := p_COORD_BEN_MED_PLN_NO;
1024   l_rec.COORD_BEN_NO_CVG_FLAG            := p_COORD_BEN_NO_CVG_FLAG;
1025   l_rec.coord_ben_med_ext_er             := p_coord_ben_med_ext_er;
1026   l_rec.coord_ben_med_pl_name            := p_coord_ben_med_pl_name;
1027   l_rec.coord_ben_med_insr_crr_name      := p_coord_ben_med_insr_crr_name;
1028   l_rec.coord_ben_med_insr_crr_ident     := p_coord_ben_med_insr_crr_ident;
1029   l_rec.coord_ben_med_cvg_strt_dt        := p_coord_ben_med_cvg_strt_dt;
1030   l_rec.coord_ben_med_cvg_end_dt         := p_coord_ben_med_cvg_end_dt;
1031   l_rec.USES_TOBACCO_FLAG                := p_USES_TOBACCO_FLAG;
1032   l_rec.DPDNT_ADOPTION_DATE              := p_DPDNT_ADOPTION_DATE;
1033   l_rec.DPDNT_VLNTRY_SVCE_FLAG           := p_DPDNT_VLNTRY_SVCE_FLAG;
1034   l_rec.ORIGINAL_DATE_OF_HIRE            := p_ORIGINAL_DATE_OF_HIRE;
1035   l_rec.town_of_birth                    := p_town_of_birth;
1036   l_rec.region_of_birth                  := p_region_of_birth;
1037   l_rec.country_of_birth                 := p_country_of_birth;
1038   l_rec.global_person_id                 := p_global_person_id;
1039   l_rec.party_id                         := p_party_id;
1040   l_rec.npw_number                       := p_npw_number;
1041   l_rec.current_npw_flag                 := p_current_npw_flag;
1042   l_rec.global_name                      := p_global_name;  -- #3889584
1043   l_rec.local_name                       := p_local_name;
1044   --
1045   -- Return the plsql record structure.
1046   --
1047   hr_utility.set_location(' Leaving:'||l_proc, 10);
1048   Return(l_rec);
1049 --
1050 End convert_args;
1051 --
1052 end per_per_shd;