DBA Data[Home] [Help]

PACKAGE BODY: APPS.GHR_SF52_PRE_UPDATE

Source


1 PACKAGE BODY GHR_SF52_PRE_UPDATE AS
2 /* $Header: gh52prup.pkb 120.53.12020000.15 2012/12/21 11:52:46 vmididho ship $ */
3 g_effective_date      date;
4 --
5 
6 PROCEDURE get_auth_codes
7 (p_pa_req_rec		IN		ghr_pa_requests%rowtype,
8  p_pei_auth_code1	IN		per_people_extra_info.pei_information1%type DEFAULT hr_api.g_varchar2,
9  p_pei_auth_code2	IN		per_people_extra_info.pei_information1%type DEFAULT hr_api.g_varchar2,
10  p_auth_code1		IN OUT	nocopy per_people_extra_info.pei_information1%type,
11  p_auth_code2		IN OUT nocopy	per_people_extra_info.pei_information1%type)
12 IS
13 l_proc                  varchar2(70) := 'get_auth_codes';
14 l_pei_extra_info		per_people_extra_info%rowtype;
15 
16 BEGIN
17 
18 	hr_utility.set_location('Entering: ' || l_proc, 10);
19 	if (p_pa_req_rec.noa_family_code not in ('CONV_APP','APP','APPT_TRANS') ) then
20 		if (p_pei_auth_code1 = hr_api.g_varchar2) then
21     			ghr_history_fetch.fetch_peopleei(p_person_id      	=> p_pa_req_rec.person_id
22      		                                 	   ,p_information_type 	=> 'GHR_US_PER_GROUP1'
23      		                                 	   ,p_date_effective    => p_pa_req_rec.effective_date
24            		                           	   ,p_per_ei_data       => l_pei_extra_info);
25 			p_auth_code1	:= 	l_pei_extra_info.pei_information8;
26 			p_auth_code2	:= 	l_pei_extra_info.pei_information9;
27 		else
28 			p_auth_code1	:= 	p_pei_auth_code1;
29 			p_auth_code2	:= 	p_pei_auth_code2;
30 		end if;
31 	else
32 		p_auth_code1	:= 	p_pa_req_rec.first_action_la_code1;
33 		p_auth_code2	:= 	p_pa_req_rec.first_action_la_code2;
34 	end if;
35 	hr_utility.set_location('Leaving: ' || l_proc, 20);
36 END;
37 
38 
39 -- *************************
40 --
41 --	This procedure retrieve data from HR extra information tables and all other data required for CPDF Validations
42 --
43 Procedure populate_record_groups
44 (p_pa_request_rec             in out nocopy ghr_pa_requests%rowtype,
45  p_generic_ei_rec             in     ghr_pa_request_extra_info%rowtype,
46  p_imm_asg_sf52                  out nocopy ghr_api.asg_sf52_type,
47  p_imm_asg_non_sf52              out nocopy ghr_api.asg_non_sf52_type,
48  p_imm_asg_nte_dates             out nocopy ghr_api.asg_nte_dates_type,
49  p_imm_asg_detail_info           out nocopy ghr_api.asg_detail_info_type, --Bug# 8653508
50  p_imm_per_sf52                  out nocopy ghr_api.per_sf52_type,
51  p_imm_per_group1                out nocopy ghr_api.per_group1_type,
52  p_imm_per_group2                out nocopy ghr_api.per_group2_type,
53  p_imm_per_scd_info              out nocopy ghr_api.per_scd_info_type,
54  p_imm_per_retained_grade        out nocopy ghr_api.per_retained_grade_type,
55  p_imm_per_probations            out nocopy ghr_api.per_probations_type,
56  p_imm_per_sep_retire            out nocopy ghr_api.per_sep_retire_type,
57  p_imm_per_security		 out nocopy ghr_api.per_security_type,
58  -- Bug#4486823 RRR Changes Added p_imm_per_service_oblig
59  p_imm_per_service_oblig         out nocopy ghr_api.per_service_oblig_type,
60  p_imm_per_conversions		 out nocopy ghr_api.per_conversions_type,
61  -- 4352589 BEN_EIT Changes
62  p_imm_per_benefit_info	         out nocopy ghr_api.per_benefit_info_type,
63  p_imm_per_uniformed_services    out nocopy ghr_api.per_uniformed_services_type,
64  p_imm_pos_oblig                 out nocopy ghr_api.pos_oblig_type,
65  p_imm_pos_grp2                  out nocopy ghr_api.pos_grp2_type,
66  p_imm_pos_grp1                  out nocopy ghr_api.pos_grp1_type,
67  p_imm_pos_valid_grade           out nocopy ghr_api.pos_valid_grade_type,
68  p_imm_pos_car_prog              out nocopy ghr_api.pos_car_prog_type,
69  p_imm_loc_info                  out nocopy ghr_api.loc_info_type,
70  p_imm_wgi     	                 out nocopy ghr_api.within_grade_increase_type,
71  p_imm_gov_awards                out nocopy ghr_api.government_awards_type,
72  p_imm_recruitment_bonus         out nocopy ghr_api.recruitment_bonus_type,
73  p_imm_relocation_bonus		 out nocopy ghr_api.relocation_bonus_type,
74  p_imm_student_loan_repay        out nocopy ghr_api.student_loan_repay_type,
75  -- Bug 4724337 Race or National Origin changes
76  p_imm_per_race_ethnic_info      out nocopy ghr_api.per_race_ethnic_type,
77  -- End race and National Origin changes
78  --Pradeep
79  p_imm_mddds_special_pay         out nocopy ghr_api.mddds_special_pay_type,
80  p_imm_premium_pay_ind           out nocopy ghr_api.premium_pay_ind_type,
81 
82  p_imm_payroll_type              out nocopy ghr_api.government_payroll_type,
83  p_imm_perf_appraisal            out nocopy ghr_api.performance_appraisal_type,
84  p_imm_conduct_performance       out nocopy ghr_api.conduct_performance_type,
85  p_imm_extra_info_rec	 	 out nocopy ghr_api.extra_info_rec_type,
86  p_imm_sf52_from_data            out nocopy ghr_api.prior_sf52_data_type,
87  p_imm_personal_info		 out nocopy ghr_api.personal_info_type,
88  p_imm_generic_extra_info_rec    out nocopy ghr_api.generic_extra_info_rec_type,
89  p_imm_agency_sf52		 out nocopy ghr_api.agency_sf52_type,
90  p_imm_par_term_retained_grade   out nocopy ghr_api.par_term_retained_grade_type,
91  p_imm_entitlement               out nocopy ghr_api.entitlement_type,
92  -- Bug#2759379 Added Fegli record
93  p_imm_fegli                     out nocopy ghr_api.fegli_type,
94  p_imm_foreign_lang_prof_pay     out nocopy ghr_api.foreign_lang_prof_pay_type,
95   -- Bug#3385386 Added FTA record
96  p_imm_fta                       out nocopy ghr_api.fta_type,
97  p_imm_edp_pay                   out nocopy ghr_api.edp_pay_type,
98  p_imm_hazard_pay                out nocopy ghr_api.hazard_pay_type,
99  p_imm_health_benefits           out nocopy ghr_api.health_benefits_type,
100  p_imm_danger_pay                out nocopy ghr_api.danger_pay_type,
101  p_imm_imminent_danger_pay       out nocopy ghr_api.imminent_danger_pay_type,
102  p_imm_living_quarters_allow     out nocopy ghr_api.living_quarters_allow_type,
103  p_imm_post_diff_amt             out nocopy ghr_api.post_diff_amt_type,
104  p_imm_post_diff_percent         out nocopy ghr_api.post_diff_percent_type,
105  p_imm_sep_maintenance_allow     out nocopy ghr_api.sep_maintenance_allow_type,
106  p_imm_supplemental_post_allow   out nocopy ghr_api.supplemental_post_allow_type,
107  p_imm_temp_lodge_allow          out nocopy ghr_api.temp_lodge_allow_type,
108  p_imm_premium_pay               out nocopy ghr_api.premium_pay_type,
109  p_imm_retirement_annuity        out nocopy ghr_api.retirement_annuity_type,
110  p_imm_severance_pay             out nocopy ghr_api.severance_pay_type,
111  p_imm_thrift_saving_plan        out nocopy ghr_api.thrift_saving_plan,
112  p_imm_retention_allow_review    out nocopy ghr_api.retention_allow_review_type,
113  p_imm_health_ben_pre_tax        out nocopy ghr_api.health_ben_pre_tax_type,
114  p_agency_code			 out nocopy varchar2,
115  -- Bug#6312144 Added new RPA Benefit EIT
116  p_imm_ipa_benefits_cont         out nocopy ghr_api.per_ipa_ben_cont_info_type,
117  p_imm_retirement_info           out nocopy ghr_api.per_retirement_info_type,
118   --BUG # 13571004 added TSP Roth
119  p_imm_tsp_roth                  out nocopy ghr_api.tsp_roth_type
120  )
121 is
122 
123 -- Cursor to select the person's sex which is required for CPDF Edits
124 
125  cursor      c_person_sex is
126    select    per.sex
127    from      per_all_people_f per
128    where     per.person_id = P_pa_request_rec.person_id
129    and       g_effective_date
130    between   per.effective_start_date
131    and       per.effective_end_date;
132 
133 -- Cursor to select the Payrollname ,as entered by the user from the SF52 Extra Information.
134 
135  Cursor c_payroll_name is
136    select rei_information3 payroll_name
137    from   ghr_pa_request_extra_info
138    where  pa_request_id       =   p_pa_request_rec.pa_request_id
139    and    information_type    =   'GHR_US_PAR_PAYROLL_TYPE';
140 
141 -- Cursor to select the Rating Details of the person, required for CPDFs and for update to HR
142 
143  Cursor c_performance_appraisal is
144    select rei_information3 rat_rec,
145           rei_information4 rec_pattern,
146           rei_information5 rec_level,
147           rei_information6 app_ends,
148           rei_information7 app_type,
149           rei_information8 date_init_appr_due,
150           rei_information9  date_effective,
151           rei_information10 unit,
152           rei_information11 org_str_id,
153           rei_information12 off_symbol,
154           rei_information13 pay_plan,
155           rei_information14 grade,
156           rei_information15 date_due,
157           rei_information16 appr_sys_ident,
158           rei_information17 optional_info,
159 	  rei_information18 performance_rating_points,
160 	  rei_information19 app_starts
161    from   ghr_pa_request_extra_info
162    where  pa_request_id       =   p_pa_request_rec.pa_request_id
163    and    information_type    =   'GHR_US_PAR_PERF_APPRAISAL';
164 
165 -- cursor to select the Conduct Performace of the person. (is it required for CPDFs??, sureis required for the reqd_Check)
166 -- is not reqd. as it is not a generic extra info, rather the extra info associated with a
167 -- specific NOA and hence should be available already in the passed parameter.
168 
169  cursor   c_person_type is
170    select  ppt.system_person_type
171    from    per_person_types  ppt,
172            per_all_people_f      ppf
173    where   ppf.person_id       =  p_pa_request_rec.person_id
174    and     ppt.person_type_id  =  ppf.person_type_id
175    and     p_pa_request_rec.effective_date
176    between ppf.effective_start_date
177    and     ppf.effective_end_date;
178 
179  cursor cur_asg_prior_date is
180    Select asg.effective_start_date
181    from   per_all_assignments_f asg
182    Where  asg.assignment_id = p_pa_request_rec.employee_assignment_id
183    order by 1 desc;
184 
185  l_imm_asg_sf52                    		ghr_api.asg_sf52_type;
186  l_imm_asg_non_sf52                		ghr_api.asg_non_sf52_type;
187  l_imm_asg_nte_dates               		ghr_api.asg_nte_dates_type;
188  l_imm_asg_detail_info            		ghr_api.asg_detail_info_type; --Bug# 8653508
189  l_imm_per_sf52                   		ghr_api.per_sf52_type;
190  l_imm_per_group1                		ghr_api.per_group1_type;
191  l_imm_per_group2                		ghr_api.per_group2_type;
192  l_imm_per_scd_info                		ghr_api.per_scd_info_type;
193  l_imm_per_retained_grade               ghr_api.per_retained_grade_type;
194  l_imm_per_probations             		ghr_api.per_probations_type;
195  l_imm_per_sep_retire              		ghr_api.per_sep_retire_type;
196  l_imm_per_security		         	    ghr_api.per_security_type;
197  -- Bug#4486823 RRR changes
198  l_imm_per_service_oblig                ghr_api.per_service_oblig_type;
199  l_imm_per_conversions		 	        ghr_api.per_conversions_type;
200  -- 4352589 BEN_EIT Changes
201  l_imm_per_benefit_info	                ghr_api.per_benefit_info_type;
202  l_imm_per_uniformed_services   		ghr_api.per_uniformed_services_type;
203  l_imm_pos_oblig                   		ghr_api.pos_oblig_type;
204  l_imm_pos_grp2                   		ghr_api.pos_grp2_type;
205  l_imm_pos_grp1                    		ghr_api.pos_grp1_type;
206  l_imm_pos_valid_grade                  ghr_api.pos_valid_grade_type;
207  l_imm_pos_car_prog                     ghr_api.pos_car_prog_type;
208  l_imm_loc_info                         ghr_api.loc_info_type;
209  l_imm_wgi     	                        ghr_api.within_grade_increase_type ;
210  l_imm_gov_awards                       ghr_api.government_awards_type;
211  l_imm_recruitment_bonus		        ghr_api.recruitment_bonus_type ;
212  l_imm_relocation_bonus		            ghr_api.relocation_bonus_type;
213   l_imm_student_loan_repay              ghr_api.student_loan_repay_type;
214 
215  l_imm_extra_info_rec	 	            ghr_api.extra_info_rec_type;
216  l_asg_extra_info_rec                   per_assignment_extra_info%rowtype;
217  l_pos_extra_info_rec                   per_position_extra_info%rowtype;
218  l_imm_sf52_from_data                   ghr_api.prior_sf52_data_type;
219  l_imm_personal_info		            ghr_api.personal_info_type;
220  l_imm_generic_extra_info_rec	        ghr_api.generic_extra_info_rec_type;
221  l_imm_agency_sf52		                ghr_api.agency_sf52_type;
222  l_imm_payroll_type                     ghr_api.government_payroll_type;
223  l_imm_perf_appraisal                   ghr_api.performance_appraisal_type;
224  l_imm_conduct_performance              ghr_api.conduct_performance_type;
225  l_imm_entitlement                      ghr_api.entitlement_type;
226  --Bug#2759379 Added Fegli record
227  l_imm_fegli                            ghr_api.fegli_type;
228  l_imm_foreign_lang_prof_pay            ghr_api.foreign_lang_prof_pay_type;
229  -- Bug#3385386 declared FTA record type variable
230  l_imm_fta				                ghr_api.fta_type;
231  l_imm_edp_pay                          ghr_api.edp_pay_type;
232  l_imm_hazard_pay                       ghr_api.hazard_pay_type;
233  l_imm_health_benefits                  ghr_api.health_benefits_type;
234  l_imm_danger_pay                       ghr_api.danger_pay_type;
235  l_imm_imminent_danger_pay              ghr_api.imminent_danger_pay_type;
236  l_imm_living_quarters_allow            ghr_api.living_quarters_allow_type;
237  l_imm_post_diff_amt                    ghr_api.post_diff_amt_type;
238  l_imm_post_diff_percent                ghr_api.post_diff_percent_type;
239  l_imm_sep_maintenance_allow            ghr_api.sep_maintenance_allow_type;
240  l_imm_supplemental_post_allow          ghr_api.supplemental_post_allow_type;
241  l_imm_temp_lodge_allow                 ghr_api.temp_lodge_allow_type;
242  l_imm_premium_pay                      ghr_api.premium_pay_type;
243  l_imm_retirement_annuity               ghr_api.retirement_annuity_type;
244  l_imm_severance_pay                    ghr_api.severance_pay_type;
245  l_imm_thrift_saving_plan               ghr_api.thrift_saving_plan;
246  l_imm_retention_allow_review           ghr_api.retention_allow_review_type;
247  l_imm_health_ben_pre_tax               ghr_api.health_ben_pre_tax_type;
248  l_agency_code			                varchar2(50);
249  l_special_info_type                    ghr_api.special_information_type;
250  l_imm_par_term_retained_grade            ghr_api.par_term_retained_grade_type;
251  l_session                                ghr_history_api.g_session_var_type;
252  l_asg_ei_data                            per_assignment_extra_info%rowtype;
253  l_assignment_data                        per_all_assignments_f%rowtype;
254  l_result_code                            varchar2(50);
255  l_person_type                            per_person_types.system_person_type%type;
256  l_effective_date                         date;
257  -- Bug#4054110
258  l_temp_rec_level                        varchar2(30);
259  --Pradeep
260  l_imm_mddds_special_pay			  		ghr_api.mddds_special_pay_type;
261  l_imm_premium_pay_ind  			  		ghr_api.premium_pay_ind_type;
262  l_imm_per_race_ethnic_info 				ghr_api.per_race_ethnic_type; -- Bug 4724337 Race or National Origin changes
263  l_imm_ipa_benefits_cont                  ghr_api.per_ipa_ben_cont_info_type;
264  l_imm_retirement_info                    ghr_api.per_retirement_info_type;
265  --BUG # 13571004
266  l_imm_tsp_roth   ghr_api.tsp_roth_type;
267 
268 
269 
270 Begin
271 
272   hr_utility.set_location('PERSON ID  : ' ||to_char(p_pa_request_rec.person_id) ,1);
273   hr_utility.set_location('EMP    ID  : ' ||to_char(p_pa_request_rec.employee_assignment_id) ,2);
274   hr_utility.set_location('POS    ID  : ' ||to_char(p_pa_request_rec.to_position_id) ,3);
275 
276 
277   --  Retrieve all the extra information (required for CPDFs and for update to HR)
278   --  from the Core Tables and store them in the respective Record Groups
279 
280 
281   -- NOTE :
282   -- Should include the foll. 2 statements after changing these 2 parameters as in rather than out
283   -- l_imm_extra_info_rec                  :=  p_imm_extra_info_rec;
284   -- l_imm_generic_extra_info_rec          :=  p_imm_generic_extra_info_rec;
285 
286  Retrieve_all_extra_info
287  (
288   p_pa_request_rec                     => p_pa_request_rec,
289   p_asg_sf52                           => l_imm_asg_sf52,
290   p_per_sf52                           => l_imm_per_sf52,
291   p_per_group1                         => l_imm_per_group1,
292   p_per_scd_info                       => l_imm_per_scd_info,
293   p_pos_grp1                           => l_imm_pos_grp1,
294   p_pos_grp2                           => l_imm_pos_grp2,
295   p_loc_info                           => l_imm_loc_info,
296   p_per_uniformed_services             => l_imm_per_uniformed_services,
297   p_per_conversions                    => l_imm_per_conversions,
298   p_per_benefit_info                   => l_imm_per_benefit_info,
299   p_asg_non_sf52		       => l_imm_asg_non_sf52,
300   p_asg_detail_info		       => l_imm_asg_detail_info, --Bug# 8653508
301   p_per_separate_Retire 	       => l_imm_per_sep_retire,
302   p_asg_nte_dates		       => l_imm_asg_nte_dates,
303   p_per_probations		       => l_imm_per_probations,
304   p_per_retained_grade		       => l_imm_per_retained_grade,
305   --Bug#4486823 RRR Changes
306   p_per_service_oblig                  => l_imm_per_service_oblig,
307   p_within_grade_increase	       => l_imm_wgi,
308   p_valid_grade                        => l_imm_pos_valid_grade,
309   p_pos_oblig                          => l_imm_pos_oblig,
310   p_race_ethnic_info		       => l_imm_per_race_ethnic_info, -- Bug 4724337 Race or National Origin changes
311   p_ipa_benefits_cont                  => l_imm_ipa_benefits_cont,  -- Bug #6312144 retreiving benefits information
312   p_retirement_info                    => l_imm_retirement_info,
313   p_per_group2                         => l_imm_per_group2 --BUG # 14276354
314   );
315 
316  -- Over write the Record Groups populated by the Retrieve_all_extra_info,
317  -- with the non-null Data on the SF52 form
318 
319  process_sf52_extra_info
320  (
321  p_pa_request_rec                      => p_pa_request_rec,
322  p_asg_sf52                    	   => l_imm_asg_sf52,
323  p_per_sf52                            => l_imm_per_sf52,
324  p_per_group1                 	   => l_imm_per_group1,
325  p_per_scd_info                        => l_imm_per_scd_info,
326  p_pos_grp2                            => l_imm_pos_grp2,
327  p_pos_grp1                            => l_imm_pos_grp1,
328  p_loc_info                            => l_imm_loc_info,
329  p_recruitment_bonus	               => l_imm_recruitment_bonus,
330  p_relocation_bonus	               => l_imm_relocation_bonus ,
331   p_student_loan_repay                  => l_imm_student_loan_repay,
332  p_extra_info_rec		               => l_imm_extra_info_rec,
333  p_valid_grade                        => l_imm_pos_valid_grade
334  );
335 
336  -- Over write the Record Groups populated by the Retrieve_all_extra_info,
337  -- with the non-null Data on the SF52 Extra Information form
338  Process_Non_Sf52_Extra_Info
339 (
340  p_pa_request_rec	          => p_pa_request_rec,
341  p_generic_ei_rec             => p_generic_ei_rec,
342  p_per_group1	       		  => l_imm_per_group1,
343  p_per_scd_info               => l_imm_per_scd_info,
344  p_pos_grp2                   => l_imm_pos_grp2,
345  p_pos_grp1                   => l_imm_pos_grp1,
346  p_per_uniformed_services     => l_imm_per_uniformed_services,
347  p_per_conversions            => l_imm_per_conversions,
348  -- 4352589 BEN_EIT Changes
349  p_per_benefit_info           => l_imm_per_benefit_info,
350  p_asg_non_sf52		      	  => l_imm_asg_non_sf52,
351  p_per_separate_Retire 	      => l_imm_per_sep_retire,
352  p_asg_nte_dates	          => l_imm_asg_nte_dates,
353  p_asg_detail_info		=> l_imm_asg_detail_info, --Bug# 8653508
354  p_per_probations      	      => l_imm_per_probations,
355  p_per_retained_grade 	      => l_imm_per_retained_grade,
356  --Bug#4486823 RRR Changes
357  p_per_service_oblig          => l_imm_per_service_oblig,
358  p_within_grade_increase      => l_imm_wgi,
359  p_gov_awards                 => l_imm_gov_awards,
360  p_conduct_performance        => l_imm_conduct_performance,
361  p_agency_sf52		      	  => l_imm_agency_sf52,
362  p_recruitment_bonus	      => l_imm_recruitment_bonus,
363  p_relocation_bonus	          => l_imm_relocation_bonus,
364  p_student_loan_repay         => l_imm_student_loan_repay,
365  --Pradeep
366  p_mddds_special_pay      => l_imm_mddds_special_pay,
367  p_premium_pay_ind        => l_imm_premium_pay_ind,
368 
369  p_par_term_retained_grade    => l_imm_par_term_retained_grade,
370  p_entitlement                => l_imm_entitlement,
371  -- Bug#2759379 Added Fegli record
372  p_fegli                      => l_imm_fegli,
373  p_foreign_lang_prof_pay      => l_imm_foreign_lang_prof_pay,
374   -- Bug#3385386 Added FTA parameter
375  p_imm_fta                    => l_imm_fta,
376  p_edp_pay                    => l_imm_edp_pay,
377  p_hazard_pay                 => l_imm_hazard_pay,
378  p_health_benefits            => l_imm_health_benefits,
379  p_danger_pay                 => l_imm_danger_pay,
380  p_imminent_danger_pay        => l_imm_imminent_danger_pay,
381  p_living_quarters_allow      => l_imm_living_quarters_allow,
382  p_post_diff_amt              => l_imm_post_diff_amt,
383  p_post_diff_percent          => l_imm_post_diff_percent,
384  p_sep_maintenance_allow      => l_imm_sep_maintenance_allow,
385  p_supplemental_post_allow    => l_imm_supplemental_post_allow,
386  p_temp_lodge_allow           => l_imm_temp_lodge_allow,
387  p_premium_pay                => l_imm_premium_pay,
388  p_retirement_annuity         => l_imm_retirement_annuity,
389  p_severance_pay              => l_imm_severance_pay,
390  p_thrift_saving_plan         => l_imm_thrift_saving_plan,
391  p_retention_allow_review     => l_imm_retention_allow_review,
392  p_health_ben_pre_tax         => l_imm_health_ben_pre_tax,
393  p_race_ethnic_info	      => l_imm_per_race_ethnic_info, -- Bug 4724337 Race or National Origin changes
394  p_ipa_benefits_cont          => l_imm_ipa_benefits_cont,  -- Bug #6312144 retreiving benefits information
395  p_retirement_info            => l_imm_retirement_info,
396  p_tsp_roth                   => l_imm_tsp_roth,  --BUG # 13571004
397  p_per_group2                 => l_imm_per_group2  --BUG # 14276354
398  );
399 
400  hr_utility.set_location('Relocation Bonus ' || l_imm_relocation_bonus.p_relocation_bonus,1);
401  hr_utility.set_location('Relocation EXP ' || l_imm_relocation_bonus.p_date_reloc_exp,2);
402  hr_utility.set_location('Recruitment EXP ' || l_imm_recruitment_bonus.p_date_recruit_exp,3);
403 
404 
405  -- With the new ghr_pa_requests table, we just need to fetch the agency_code.
406  -- And this info. is required by CPDF edits and later by the SF50 Report
407 
408  SF52_br_extra_info
409  (P_PA_REQUEST_REC  		=> p_pa_request_rec,
410   p_agency_code			=> l_agency_code
411  );
412 
413   -- Get the from_pay_rate_determinant(aei for the given assignment_id and
414   -- information_type = 'GHR_US_ASG_SF52' and the work schedule (poei for
415   -- the given assignment_id and information_type = 'GHR_US_ASG_SF52'
416 
417  If p_pa_request_rec.from_position_id is not null then
418 
419    ghr_history_api.get_g_session_var(l_session);
420    Ghr_History_Fetch.Fetch_ASGEI_prior_root_sf50
421    (
422     p_assignment_id         => p_pa_request_rec.employee_assignment_id,
423     p_information_type      => 'GHR_US_ASG_SF52',
424     p_date_effective        => p_pa_request_rec.effective_date,
425     p_altered_pa_request_id => l_session.altered_pa_request_id,
426     p_noa_id_corrected      => l_session.noa_id_correct,
427     p_get_ovn_flag          => 'Y',
428     p_asgei_data            => l_asg_ei_data
429    );
430 
431     l_imm_sf52_from_data.work_schedule          :=   l_asg_ei_data.aei_information7;
432     l_imm_sf52_from_data.pay_rate_determinant   :=   l_asg_ei_data.aei_information6;
433 
434 
435    ghr_history_api.get_g_session_var(l_session);
436    for person_type_rec in c_person_type loop
437       l_person_type :=   person_type_rec.system_person_type;
438       exit;
439    end loop;
440 
441 -- Bug# 1223662 --
442    If p_pa_request_rec.noa_family_code = 'CONV_APP' and  l_person_type = 'EX_EMP'
443       then
444       for  asg_prior_date in cur_asg_prior_date loop
445          l_effective_date := asg_prior_date.effective_start_date;
446          exit;
447       end loop;
448    Else
449      l_effective_date := p_pa_request_rec.effective_date;
450    End if;
451    hr_utility.set_location('l_effective_date passed to fetch_assignment '||l_effective_date,3 );
452 
453    Ghr_History_Fetch.Fetch_assignment
454    (
455     p_assignment_id         => p_pa_request_rec.employee_assignment_id,
456     p_date_effective        => l_effective_date,
457     p_altered_pa_request_id => l_session.altered_pa_request_id,
458     p_noa_id_corrected      => l_session.noa_id_correct,
459     p_assignment_data       => l_assignment_data,
460     p_result_code           => l_result_code
461    );
462     l_imm_sf52_from_data.duty_station_location_id   :=   l_assignment_data.location_id;
463 
464  End if;
465 
466  hr_utility.set_location('from_duty_station '||l_imm_sf52_from_data.duty_station_location_id,4 );
467 
468 
469 -- Should retrieve Employee_sex(per_people_f for the person_id , for a specific date),
470 --  as it is not stored in the ghr_pa_requests table
471 
472  For per_sex in c_person_sex loop
473    l_imm_personal_info.p_sex  :=  per_sex.sex;
474  End loop;
475 
476 -- Other person details and from side data required for the CPDFs
477 
478 l_imm_personal_info.p_national_identifier    := p_pa_request_rec.employee_national_identifier ;
479 l_imm_personal_info.p_date_of_birth          := p_pa_request_rec.employee_date_of_birth;
480 --
481 l_imm_sf52_from_data.position_title          :=  p_pa_request_rec.from_position_title;
482 l_imm_sf52_from_data.position_number         :=  p_pa_request_rec.from_position_number;
483 l_imm_sf52_from_data.position_seq_no         :=  p_pa_request_rec.from_position_seq_no;
484 l_imm_sf52_from_data.pay_plan                :=  p_pa_request_rec.from_pay_plan;
485 l_imm_sf52_from_data.occ_code                :=  p_pa_request_rec.from_occ_code;
486 l_imm_sf52_from_data.grade_or_level          :=  p_pa_request_rec.from_grade_or_level;
487 l_imm_sf52_from_data.step_or_rate            :=  p_pa_request_rec.from_step_or_rate;
488 l_imm_sf52_from_data.total_salary            :=  p_pa_request_rec.from_total_salary;
489 l_imm_sf52_from_data.pay_basis               :=  p_pa_request_rec.from_pay_basis;
490 l_imm_sf52_from_data.basic_pay               :=  p_pa_request_rec.from_basic_pay;
491 l_imm_sf52_from_data.locality_adj            :=  p_pa_request_rec.from_locality_adj;
492 l_imm_sf52_from_data.adj_basic_pay           :=  p_pa_request_rec.from_adj_basic_pay;
493 l_imm_sf52_from_data.other_pay               :=  p_pa_request_rec.from_other_pay_amount;
494 l_imm_sf52_from_data.position_org_line1      :=  p_pa_request_rec.from_position_org_line1;
495 l_imm_sf52_from_data.position_org_line2      :=  p_pa_request_rec.from_position_org_line2;
496 l_imm_sf52_from_data.position_org_line3      :=  p_pa_request_rec.from_position_org_line3;
497 l_imm_sf52_from_data.position_org_line4      :=  p_pa_request_rec.from_position_org_line4;
498 l_imm_sf52_from_data.position_org_line5      :=  p_pa_request_rec.from_position_org_line5;
499 l_imm_sf52_from_data.position_org_line6      :=  p_pa_request_rec.from_position_org_line6;
500 l_imm_sf52_from_data.position_id             :=  p_pa_request_rec.from_position_id;
501 --
502 
503 --location_info
504 l_imm_loc_info.duty_station_id               :=  p_pa_request_rec.duty_station_id;
505 
506 -- Populate payroll_type
507 
508  for payroll_name in c_payroll_name loop
509    l_imm_payroll_type.payroll_type   :=   payroll_name.payroll_name;
510  End loop;
511 
512 
513  --
514  -- Take care of performance appraisal special info. (l_imm_perf_appraisal )
515  --
516  -- get the session variable
517  ghr_history_api.get_g_session_var(l_session);
518 
519  If l_session.noa_id_correct is null then
520     hr_utility.set_location('populate_record_groups ', 30);
521 
522     ghr_api.return_special_information
523     (p_person_id         =>  p_pa_request_rec.person_id,
524      p_structure_name    =>  'US Fed Perf Appraisal',
525      p_effective_date    =>  p_pa_request_rec.effective_date,
526      p_special_info      =>  l_special_info_type
527      );
528 
529  Else -- for update get from history
530     hr_utility.set_location('populate_record_groups ', 35);
531     ghr_history_fetch.return_special_information
532      (p_person_id         =>  p_pa_request_rec.person_id,
533       p_structure_name    =>  'US Fed Perf Appraisal',
534       p_effective_date    =>  p_pa_request_rec.effective_date,
535       p_special_info      =>  l_special_info_type
536       );
537 
538   --Added the below call for the Bug 3187894
539 
540     GHR_NON_SF52_EXTRA_INFO.fetch_generic_extra_info(
541      p_pa_request_id       =>  p_pa_request_rec.pa_request_id,
542      p_person_id           =>  p_pa_request_rec.person_id,
543      p_assignment_id       =>  p_pa_request_rec.employee_assignment_id,
544      p_effective_date      =>  p_pa_request_rec.effective_date
545      ) ;
546 
547  End if;
548 
549  l_imm_perf_appraisal.person_analysis_id             := l_special_info_type.person_analysis_id;
550  l_imm_perf_appraisal.object_version_number          := l_special_info_type.object_version_number;
551  l_imm_perf_appraisal.appraisal_type                 := l_special_info_type.segment1;
552  l_imm_perf_appraisal.rating_rec                     := l_special_info_type.segment2;
553  l_imm_perf_appraisal.date_effective                 := l_special_info_type.segment3;
554  l_imm_perf_appraisal.rating_rec_pattern             := l_special_info_type.segment4;
555  l_imm_perf_appraisal.rating_rec_level               := l_special_info_type.segment5;
556  l_imm_perf_appraisal.date_appr_ends                 := l_special_info_type.segment6;
557  l_imm_perf_appraisal.unit                           := l_special_info_type.segment7;
558  l_imm_perf_appraisal.org_structure_id               := l_special_info_type.segment8;
559  l_imm_perf_appraisal.office_symbol                  := l_special_info_type.segment9;
560  l_imm_perf_appraisal.pay_plan                       := l_special_info_type.segment10;
561  l_imm_perf_appraisal.grade                          := l_special_info_type.segment11;
562  l_imm_perf_appraisal.date_due                       := l_special_info_type.segment12;
563  l_imm_perf_appraisal.appraisal_system_identifier    := l_special_info_type.segment13;
564  l_imm_perf_appraisal.date_init_appr_due             := l_special_info_type.segment14;
565  l_imm_perf_appraisal.optional_information           := l_special_info_type.segment15;
566  l_imm_perf_appraisal.performance_rating_points      := l_special_info_type.segment16;
567  --Bug# 4753117 28-Feb-07	Veeramani  assigning appraisal start date
568  l_imm_perf_appraisal.date_appr_starts               := l_special_info_type.segment17;
569 
570  hr_utility.set_location('performance_rating_points'||l_special_info_type.segment16, 39);
571  -- Get user entered details
572  hr_utility.set_location('populate_record_groups ', 40);
573 
574  for perf_appraisal in c_performance_appraisal loop
575 
576   --No need for the IF condition since 'US Fed Perf Appraisal' is a mandatory SIT
577   --Bug 3187894 Commented by Ashley
578 
579     /* if perf_appraisal.rat_rec is not null            or
580         perf_appraisal.rec_pattern is not null        or
581         perf_appraisal.rec_level is not null          or
582         perf_appraisal.app_ends is not null           or
583         perf_appraisal.app_type is not null           or
584         perf_appraisal.date_init_appr_due is not null or
585         perf_appraisal.date_effective is not null or
586         perf_appraisal.unit is not null or
587         perf_appraisal.org_str_id is not null or
588         perf_appraisal.off_symbol is not null or
589         perf_appraisal.pay_plan is not null or
590         perf_appraisal.grade is not null or
591         perf_appraisal.date_due is not null or
592         perf_appraisal.appr_sys_ident is not null or
593         perf_appraisal.optional_info is not null  or
594 	perf_appraisal.performance_rating_points is not null then*/
595 
596 	  if nvl(perf_appraisal.rat_rec,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.rating_rec,hr_api.g_varchar2) then
597         l_imm_perf_appraisal.rating_rec         := perf_appraisal.rat_rec;
598         l_imm_perf_appraisal.perf_appr_flag     := 'Y';
599      end if;
600      if nvl(perf_appraisal.rec_pattern,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.rating_rec_pattern,hr_api.g_varchar2) then
601         l_imm_perf_appraisal.rating_rec_pattern := perf_appraisal.rec_pattern;
602         l_imm_perf_appraisal.perf_appr_flag := 'Y';
603      end if;
604 
605      -- Reverted the changes done by Pradeep for bug#4054110.
606      if nvl(perf_appraisal.rec_level,hr_api.g_varchar2)       <> nvl(l_imm_perf_appraisal.rating_rec_level,hr_api.g_varchar2) then
607 	l_imm_perf_appraisal.rating_rec_level   := perf_appraisal.rec_level;
608         l_imm_perf_appraisal.perf_appr_flag := 'Y';
609      end if;
610 
611      if nvl(perf_appraisal.app_ends,hr_api.g_varchar2)        <> nvl(l_imm_perf_appraisal.date_appr_ends,hr_api.g_varchar2) then
612         l_imm_perf_appraisal.date_appr_ends     :=  perf_appraisal.app_ends;
613         l_imm_perf_appraisal.perf_appr_flag := 'Y';
614      end if;
615        --Bug# 4753117 28-Feb-07	Veeramani  assigning appraisal start date
616      if nvl(perf_appraisal.app_starts,hr_api.g_varchar2)        <> nvl(l_imm_perf_appraisal.date_appr_starts,hr_api.g_varchar2) then
617         l_imm_perf_appraisal.date_appr_starts   :=  perf_appraisal.app_starts;
618         l_imm_perf_appraisal.perf_appr_flag     := 'Y';
619      end if;
620 
621    if nvl(perf_appraisal.app_type,hr_api.g_varchar2)        <> nvl(l_imm_perf_appraisal.appraisal_type,hr_api.g_varchar2) then
622         l_imm_perf_appraisal.appraisal_type     :=  perf_appraisal.app_type;
623         l_imm_perf_appraisal.perf_appr_flag := 'Y';
624      end if;
625    if nvl(perf_appraisal.date_init_appr_due,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.date_init_appr_due,hr_api.g_varchar2) then
626         l_imm_perf_appraisal.date_init_appr_due :=  perf_appraisal.date_init_appr_due;
627         l_imm_perf_appraisal.perf_appr_flag     := 'Y';
628      end if;
629     if nvl(perf_appraisal.date_effective,hr_api.g_varchar2)        <> nvl(l_imm_perf_appraisal.date_effective,hr_api.g_varchar2) then
630         l_imm_perf_appraisal.date_effective     :=  perf_appraisal.date_effective;
631         l_imm_perf_appraisal.perf_appr_flag := 'Y';
632      end if;
633      if nvl(perf_appraisal.unit,hr_api.g_varchar2)        <> nvl(l_imm_perf_appraisal.unit,hr_api.g_varchar2) then
634         l_imm_perf_appraisal.unit     :=  perf_appraisal.unit;
635         l_imm_perf_appraisal.perf_appr_flag := 'Y';
636      end if;
637      if nvl(perf_appraisal.org_str_id,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.org_structure_id,hr_api.g_varchar2) then
638         l_imm_perf_appraisal.org_structure_id :=  perf_appraisal.org_str_id;
639         l_imm_perf_appraisal.perf_appr_flag   := 'Y';
640      end if;
641      if nvl(perf_appraisal.off_symbol,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.office_symbol,hr_api.g_varchar2) then
642         l_imm_perf_appraisal.office_symbol :=  perf_appraisal.off_symbol;
643         l_imm_perf_appraisal.perf_appr_flag   := 'Y';
644      end if;
645      if nvl(perf_appraisal.pay_plan,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.pay_plan,hr_api.g_varchar2) then
646         l_imm_perf_appraisal.pay_plan :=  perf_appraisal.pay_plan;
647         l_imm_perf_appraisal.perf_appr_flag   := 'Y';
648      end if;
649      if nvl(perf_appraisal.grade,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.grade,hr_api.g_varchar2) then
650         l_imm_perf_appraisal.grade :=  perf_appraisal.grade;
651         l_imm_perf_appraisal.perf_appr_flag   := 'Y';
652      end if;
653      if nvl(perf_appraisal.date_due,hr_api.g_varchar2)  <>nvl(l_imm_perf_appraisal.date_due,hr_api.g_varchar2) then
654         l_imm_perf_appraisal.date_due :=  perf_appraisal.date_due;
655         l_imm_perf_appraisal.perf_appr_flag   := 'Y';
656      end if;
657      if nvl(perf_appraisal.appr_sys_ident,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.appraisal_system_identifier,hr_api.g_varchar2) then
658         l_imm_perf_appraisal.appraisal_system_identifier :=  perf_appraisal.appr_sys_ident;
659         l_imm_perf_appraisal.perf_appr_flag   := 'Y';
660      end if;
661      if nvl(perf_appraisal.optional_info,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.optional_information,hr_api.g_varchar2) then
662         l_imm_perf_appraisal.optional_information :=  perf_appraisal.optional_info;
663         l_imm_perf_appraisal.perf_appr_flag   := 'Y';
664      end if;
665 
666      hr_utility.set_location('performance_rating_points'||perf_appraisal.performance_rating_points, 41);
667 
668      if nvl(perf_appraisal.performance_rating_points,hr_api.g_varchar2) <> nvl(l_imm_perf_appraisal.performance_rating_points,hr_api.g_varchar2) then
669         l_imm_perf_appraisal.performance_rating_points :=  perf_appraisal.performance_rating_points;
670         l_imm_perf_appraisal.perf_appr_flag   := 'Y';
671      end if;
672      l_temp_rec_level   := perf_appraisal.rec_level;
673 --   end if;
674  end loop;
675  If l_session.noa_id_correct is null and nvl(l_imm_perf_appraisal.perf_appr_flag ,hr_api.g_varchar2) = 'Y' then
676     l_imm_perf_appraisal.person_analysis_id :=  Null;
677  end if;
678     -- Bug#4054110,4069798
679     --Bug# 12618741 the following statements are commented out, since this code is causing
680     --unnecessary update to SIT table.
681     --l_imm_perf_appraisal.rating_rec_level   := l_temp_rec_level;
682     --l_imm_perf_appraisal.perf_appr_flag := 'Y';
683 
684 -- bug#2468297
685 if (p_pa_request_rec.work_schedule in ('B','F','G','I','J')) then
686 l_imm_asg_non_sf52.parttime_indicator:=NULL;
687 end if;
688 
689 --
690 -- Return values into all out variables
691 --
692  p_imm_asg_sf52                     :=	l_imm_asg_sf52;
693  p_imm_asg_non_sf52                 :=	l_imm_asg_non_sf52;
694  p_imm_asg_nte_dates                :=	l_imm_asg_nte_dates;
695  p_imm_asg_detail_info		    := l_imm_asg_detail_info; --Bug# 8653508
696  p_imm_per_sf52                     :=	l_imm_per_sf52;
697  p_imm_per_group1                   :=	l_imm_per_group1;
698  p_imm_per_group2                   :=	l_imm_per_group2;
699  p_imm_per_scd_info                 :=	l_imm_per_scd_info;
700  p_imm_per_retained_grade           := 	l_imm_per_retained_grade;
701  p_imm_per_probations               :=	l_imm_per_probations;
702  p_imm_per_sep_retire               :=	l_imm_per_sep_retire;
703  p_imm_per_security                 :=	l_imm_per_security;
704  -- Bug#4486823 RRR Changes
705  p_imm_per_service_oblig            :=  l_imm_per_service_oblig;
706  p_imm_per_conversions              :=    l_imm_per_conversions;
707  -- 4352589 BEN_EIT Changes
708  p_imm_per_benefit_info             :=  l_imm_per_benefit_info;
709  p_imm_per_uniformed_services       :=	l_imm_per_uniformed_services;
710  p_imm_pos_oblig                    :=	l_imm_pos_oblig;
711  p_imm_pos_grp2                     :=	l_imm_pos_grp2;
712  p_imm_pos_grp1                     :=	l_imm_pos_grp1;
713  p_imm_pos_valid_grade              :=	l_imm_pos_valid_grade;
714  p_imm_pos_car_prog                 :=    l_imm_pos_car_prog;
715  p_imm_loc_info                     :=    l_imm_loc_info;
716  p_imm_wgi     	                  :=    l_imm_wgi;
717  p_imm_gov_awards                   :=    l_imm_gov_awards;
718  p_imm_recruitment_bonus            :=    l_imm_recruitment_bonus ;
719  p_imm_relocation_bonus		      :=	l_imm_relocation_bonus;
720  p_imm_student_loan_repay             := l_imm_student_loan_repay;
721  --Pradeep
722  p_imm_mddds_special_pay	    :=  l_imm_mddds_special_pay;
723  p_imm_premium_pay_ind  	    :=  l_imm_premium_pay_ind;
724 
725  p_imm_extra_info_rec	 	      :=	l_imm_extra_info_rec ;
726  p_imm_sf52_from_data               :=    l_imm_sf52_from_data;
727  p_imm_personal_info		      :=    l_imm_personal_info;
728  p_imm_generic_extra_info_rec	      := 	l_imm_generic_extra_info_rec ;
729  p_imm_agency_sf52		      :=	l_imm_agency_sf52;
730  p_imm_payroll_type                 :=    l_imm_payroll_type;
731  p_imm_perf_appraisal               :=    l_imm_perf_appraisal;
732  p_imm_conduct_performance          :=    l_imm_conduct_performance;
733  p_agency_code			      :=    l_agency_code;
734  p_imm_par_term_retained_grade      :=    l_imm_par_term_retained_grade;
735  p_imm_entitlement                  :=    l_imm_entitlement;
736  -- Bug#2759379
737  p_imm_fegli                        :=    l_imm_fegli;
738  p_imm_foreign_lang_prof_pay        :=    l_imm_foreign_lang_prof_pay;
739   -- Bug#3385386 Added FTA record
740  p_imm_fta                          :=    l_imm_fta;
741  p_imm_edp_pay                      :=    l_imm_edp_pay;
742  p_imm_hazard_pay                   :=    l_imm_hazard_pay;
743  p_imm_health_benefits              :=    l_imm_health_benefits;
744  p_imm_danger_pay                   :=    l_imm_danger_pay;
745  p_imm_imminent_danger_pay          :=    l_imm_imminent_danger_pay;
746  p_imm_living_quarters_allow        :=    l_imm_living_quarters_allow;
747  p_imm_post_diff_amt                :=    l_imm_post_diff_amt;
748  p_imm_post_diff_percent            :=    l_imm_post_diff_percent;
749  p_imm_sep_maintenance_allow        :=    l_imm_sep_maintenance_allow;
750  p_imm_supplemental_post_allow      :=    l_imm_supplemental_post_allow;
751  p_imm_temp_lodge_allow             :=    l_imm_temp_lodge_allow;
752  p_imm_premium_pay                  :=    l_imm_premium_pay;
753  p_imm_retirement_annuity           :=    l_imm_retirement_annuity;
754  p_imm_severance_pay                :=    l_imm_severance_pay;
755  p_imm_thrift_saving_plan           :=    l_imm_thrift_saving_plan;
756  p_imm_retention_allow_review       :=    l_imm_retention_allow_review;
757  p_imm_health_ben_pre_tax           :=    l_imm_health_ben_pre_tax;
758  p_imm_per_race_ethnic_info			:= 	  l_imm_per_race_ethnic_info; -- Race or National Origin changes
759 
760  --start of bug 6312144
761  p_imm_ipa_benefits_cont   :=    l_imm_ipa_benefits_cont;
762  p_imm_retirement_info  	  := 	l_imm_retirement_info;
763  --end of bug 6312144
764 
765  --BUG # 13571004
766  p_imm_tsp_roth            :=  l_imm_tsp_roth;
767 
768 End populate_record_groups;
769 
770 
771 -- *******************************
772 -- procedure Retrieve_all_extra_info
773 -- *******************************
774 --
775 
776 Procedure retrieve_all_extra_info
777  (p_pa_request_rec                  in      ghr_pa_requests%rowtype,
778   p_asg_sf52                        in out nocopy  ghr_api.asg_sf52_type,
779   p_per_sf52                        in out nocopy  ghr_api.per_sf52_type,
780   p_per_group1                      in out nocopy  ghr_api.per_group1_type,
781   p_per_scd_info                    in out nocopy  ghr_api.per_scd_info_type,
782   p_pos_grp1                        in out nocopy  ghr_api.pos_grp1_type,
783   p_pos_grp2                        in out nocopy  ghr_api.pos_grp2_type,
784   p_loc_info                        in out nocopy  ghr_api.loc_info_type,
785   p_per_uniformed_services          in out nocopy  ghr_api.per_uniformed_services_type,
786   p_per_conversions                 in out nocopy  ghr_api.per_conversions_type,
787   -- 4352589 BEN_EIT Changes
788   p_per_benefit_info                in out nocopy  ghr_api.per_benefit_info_type,
789   p_asg_non_sf52	            in out nocopy  ghr_api.asg_non_sf52_type,
790   p_asg_detail_info		    in out nocopy ghr_api.asg_detail_info_type, --Bug# 8653508
791   p_per_separate_Retire             in out nocopy  ghr_api.per_sep_retire_type,
792   p_asg_nte_dates                   in out nocopy  ghr_api.asg_nte_dates_type,
793   p_per_probations	            	in out nocopy  ghr_api.per_probations_type,
794   p_per_retained_grade	            in out nocopy  ghr_api.per_retained_grade_type,
795   --Bug#4486823 RRR Changes
796   p_per_service_oblig               in out nocopy ghr_api.per_service_oblig_type,
797   p_within_grade_increase           in out nocopy  ghr_api.within_grade_increase_type,
798   p_valid_grade                     in out nocopy  ghr_api.pos_valid_grade_type ,
799   p_pos_oblig                       in out nocopy  ghr_api.pos_oblig_type,
800   p_race_ethnic_info		    in out nocopy  ghr_api.per_race_ethnic_type, -- Bug 4724337 Race or National Origin changes
801   --Bug #6312144 RPA EIT Benefits
802   p_ipa_benefits_cont               in out nocopy  ghr_api.per_ipa_ben_cont_info_type,
803   p_retirement_info                 in out nocopy  ghr_api.per_retirement_info_type,
804   --BUG # 14276354 added new Person group2 segments
805   p_per_group2                      in out nocopy  ghr_api.per_group2_type
806   )
807   is
808   l_per_extra_info_rec              per_people_extra_info%rowtype;
809   l_asg_extra_info_rec              per_assignment_extra_info%rowtype;
810   l_pos_extra_info_rec              per_position_extra_info%rowtype;
811   l_proc                            varchar2(70) := 'Retrieve_all_extra_info';
812   l_person_type                     per_person_types.system_person_type%type := hr_api.g_varchar2;
813   l_position_id                     per_positions.position_id%type;
814   l_retained_grade_rec              ghr_pay_calc.retained_grade_rec_type;
815   l_session                         ghr_history_api.g_session_var_type;
816   l_person_status					per_assignment_status_types.user_status%type;
817 
818 	-- Bug 3021003
819 	l_ret_flag BOOLEAN := FALSE;
820  -- Cursor to retrieve the Person Type of the Person , as of the effective_date of the Request
821 
822   cursor   c_person_type is
823    select  ppt.system_person_type
824    from    per_person_types  ppt,
825            per_all_people_f      ppf
826    where   ppf.person_id       =  p_pa_request_rec.person_id
827    and     ppt.person_type_id  =  ppf.person_type_id
828    and     g_effective_date
829    between ppf.effective_start_date
830    and     ppf.effective_end_date;
831 
832 
833    cursor  c_per_ret_grade is
834      select pei_information1 date_from,
835             pei_information2 date_to,
836             pei_information3 grade_or_level,
837             pei_information4 step_or_rate,
838             pei_information5 pay_plan,
839             pei_information6 pay_table_id,
840             pei_information7 locality_percent,
841             pei_information8 pay_basis
842       from  per_people_Extra_info pei
843       where pei.person_Extra_info_id =  p_per_retained_grade.person_extra_info_id;
844 
845 	-- Bug 3390876 Get User Status
846    CURSOR c_user_status(c_assignment_id per_all_assignments_f.assignment_id%type,
847                         c_effective_date ghr_pa_requests.effective_date%type) IS
848     SELECT
849 	  ast.user_status,
850 	  ast.per_system_status,
851 	  asg.effective_start_date
852 	FROM
853 	  per_assignment_status_types ast,
854 	  per_all_assignments_f asg
855 	WHERE
856 	  asg.assignment_id = c_assignment_id AND
857 	  ast.assignment_status_type_id = asg.assignment_status_type_id  		and
858 	  c_effective_date between asg.effective_start_date and asg.effective_end_date;
859 	-- End Bug 3390876
860 
861    Procedure get_ret_grade
862    (p_pa_request_id in           number,
863     p_person_extra_info_id  out nocopy  number
864    )
865    is
866    l_proc           varchar2(72)  :=  'get_ret_grade';
867    l_extra_info_id  per_people_extra_info.person_extra_info_id%type;
868    l_request_id     ghr_pa_requests.pa_request_id%type;
869 
870      CURSOR c1(c_request_id in  number) is
871        SELECT  par.altered_pa_request_id
872        FROM    ghr_pa_requests  par
873        WHERE   par.pa_request_id = c_request_id;
874 
875      CURSOR c2 (c_request_id number) is
876             SELECT  par.pa_request_id, par.altered_pa_request_id, pei.rei_information3
877             FROM    ghr_pa_requests par, ghr_pa_request_extra_info pei
878             WHERE   par.pa_request_id     = pei.pa_request_id
879               AND   pei.pa_request_id     = c_request_id
880               AND   pei.information_type  = 'GHR_US_PAR_TERM_RET_GRADE';
881 
882   begin
883 
884      l_request_id := p_pa_request_id;
885      l_extra_info_id := null;
886      for c1_rec in c1(c_request_id => l_request_id) loop
887         --dbms_output.put_line('inside fetch extra info id loop1');
888         hr_utility.set_location(l_proc,1);
889         l_request_id := c1_rec.altered_pa_request_id;
890         If l_request_id is not null then
891          for c2_rec in c2(l_request_id) loop
892            hr_utility.set_location(l_proc,1);
893            l_extra_info_id := c2_rec.rei_information3;
894          end loop;
895            hr_utility.set_location(l_proc ||'Extra info id  is '|| to_char(l_extra_info_id),3);
896        End if;
897        If l_extra_info_id is not null then
898           exit;
899        End if;
900         hr_utility.set_location(l_proc,4);
901      end loop;
902      p_person_extra_info_id   := l_extra_info_id;
903   end  get_ret_grade;
904 
905 
906 --   begin
907 
908 
909 -- Probabally should not retrieve extra info for an  'APPOINTMENT' family, except in case of a 'CORRECTION'.
910 
911   Begin
912    g_effective_date                :=  nvl(p_pa_request_rec.effective_date,sysdate);
913    ghr_history_api.get_g_session_var(l_session); -- Bug 3021003
914 --  l_extra_info_rec.l_extra_info_id := null;
915 -- Bug # 1234846 --
916 	  If p_pa_request_rec.noa_family_code in ('APP','CONV_APP') then
917 		 hr_utility.set_location(l_proc,12);
918 		 l_person_type    := null;
919 		 for per_type in c_person_type loop
920 		   l_person_type :=  per_type.system_person_type;
921 		 end loop;
922 		 if l_person_type is null then
923 		   hr_utility.set_message(8301,'GHR_38133_INVALID_PERSON');
924 		   hr_utility.raise_error;
925 		 end if;
926 	  End if;
927 
928       hr_utility.set_location(' Noa Family Code is ' || p_pa_request_rec.noa_family_code ,13);
929       hr_utility.set_location(' Person Type is ' || l_person_type,14);
930   -- Bug 3390876 Need to populate record groups even for Conversion of Appointment NTE actions if Suspended
931 	 IF p_pa_request_rec.employee_assignment_id IS NOT NULL THEN
932 		FOR l_user_status IN c_user_status(p_pa_request_rec.employee_assignment_id,g_effective_date) LOOP
933 			l_person_status := l_user_status.per_system_status;
934 		END LOOP;
935 	 END IF;
936 
937 
938 --Bug # 12833233
939 --     As in the Below IF condition, fetching of GHR_US_ASG_NON_SF52 is not happening
940 --     due to filtering of Conversion to Appointment. Modified to fetch
941 --     existing pay user status ra value for Conversion Actions as it is a mandatory field
942 
943    IF p_pa_request_rec.noa_family_code in ('CONV_APP')  and p_pa_request_rec.employee_assignment_id is not NULL THEN
944 
945         ghr_history_fetch.fetch_asgei
946                (p_assignment_id              =>  p_pa_request_rec.employee_assignment_id,
947                 p_information_type           => 'GHR_US_ASG_NON_SF52',
948                 p_date_effective             =>  p_pa_request_rec.effective_date,
949                 p_asg_ei_data                =>  l_asg_extra_info_rec
950                );
951 	p_asg_non_sf52.pay_status_userra_status    :=  l_asg_extra_info_rec.aei_information14;
952    END IF;
953 --Bug # 12833233
954 
955 
956   -- Adding OR condition in the code below.
957   -- Need to add all Conv. to app actions NTE. Bug 3390876
958   IF (p_pa_request_rec.noa_family_code not in ( 'APP','CONV_APP') and
959         l_person_type <> 'EX_EMP') OR
960 		(p_pa_request_rec.first_noa_code IN ('508','515','517','522','548','549','553','554','571','590')) THEN
961 --		AND l_person_status = 'SUSP_ASSIGN') THEN
962    IF p_pa_request_rec.employee_assignment_id is not null then
963       hr_utility.set_location(' asg id ' || to_char(p_pa_request_rec.employee_assignment_id) ,2);
964       hr_utility.set_location(' Date ' || to_Char(p_pa_request_rec.effective_date),2);
965 
966   -- Retrieve asg_sf52
967 
968      ghr_history_fetch.fetch_asgei
969     (p_assignment_id              =>  p_pa_request_rec.employee_assignment_id,
970      p_information_type           => 'GHR_US_ASG_SF52',
971      p_date_effective             =>  p_pa_request_rec.effective_date,
972      p_asg_ei_data                =>  l_asg_extra_info_rec
973      );
974 
975     hr_utility.set_location('retrieved asg extra info 1 ',1);
976 
977     p_asg_sf52.assignment_extra_info_id :=  l_asg_extra_info_rec.assignment_extra_info_id;
978     p_asg_sf52.object_version_number    :=  l_asg_extra_info_rec.object_version_number;
979     p_asg_sf52.step_or_rate             :=  l_asg_extra_info_rec.aei_information3;
980     p_asg_sf52.tenure                   :=  l_asg_extra_info_rec.aei_information4;
981     p_asg_sf52.annuitant_indicator      :=  l_asg_extra_info_rec.aei_information5;
982     p_asg_sf52.pay_rate_determinant     :=  l_asg_extra_info_rec.aei_information6;
983     p_asg_sf52.work_schedule            :=  l_asg_extra_info_rec.aei_information7;
984     p_asg_sf52.part_time_hours          :=  l_asg_extra_info_rec.aei_information8;
985     p_asg_sf52.calc_pay_table           :=  l_asg_extra_info_rec.aei_information9;
986 
987     hr_utility.set_location('After Fetch from local var - tenure ' || l_asg_extra_info_rec.aei_information3,2);
988     hr_utility.set_location('After Fetch from local var - asextrinfoid ' || to_char(l_asg_extra_info_rec.assignment_extra_info_id) ,2);
989     l_asg_extra_info_rec   :=  null;
990     hr_utility.set_location('After Fetch - tenure ' || p_asg_sf52.tenure,2);
991     hr_utility.set_location('After Fetch - annu indic'  || p_asg_sf52.annuitant_indicator,2);
992     hr_utility.set_location('After Fetch- asextrinfoid ' || to_char(p_asg_sf52.assignment_extra_info_id) ,2);
993 
994 
995  -- Retrieve asg_non_sf52
996 
997   ghr_history_fetch.fetch_asgei
998   (p_assignment_id              =>  p_pa_request_rec.employee_assignment_id,
999    p_information_type           => 'GHR_US_ASG_NON_SF52',
1000    p_date_effective             =>  p_pa_request_rec.effective_date,
1001    p_asg_ei_data                =>  l_asg_extra_info_rec
1002   );
1003 
1004 
1005   hr_utility.set_location('retrieved asg extra info 2 ',2);
1006 
1007   p_asg_non_sf52.assignment_extra_info_id       :=  l_asg_extra_info_rec.assignment_extra_info_id;
1008   p_asg_non_sf52.object_version_number          :=  l_asg_extra_info_rec.object_version_number;
1009   p_asg_non_sf52.date_arr_personnel_office      :=  l_asg_extra_info_rec.aei_information3;
1010   p_asg_non_sf52.duty_status                    :=  l_asg_extra_info_rec.aei_information4;
1011   p_asg_non_sf52.key_emer_essential_empl        :=  l_asg_extra_info_rec.aei_information5;
1012   p_asg_non_sf52.non_disc_agmt_status           :=  l_asg_extra_info_rec.aei_information6;
1013   p_asg_non_sf52.date_wtop_exemp_expires        :=  l_asg_extra_info_rec.aei_information7;
1014   p_asg_non_sf52.parttime_indicator             :=  l_asg_extra_info_rec.aei_information8;
1015   p_asg_non_sf52.qualification_standard_waiver  :=  l_asg_extra_info_rec.aei_information9;
1016   p_asg_non_sf52.trainee_promotion_id           :=  l_asg_extra_info_rec.aei_information10;
1017   p_asg_non_sf52.date_trainee_promotion_expt    :=  l_asg_extra_info_rec.aei_information11;
1018   --Bug # 12652438
1019   p_asg_non_sf52.pay_status_userra_status    :=  l_asg_extra_info_rec.aei_information14;
1020   l_asg_extra_info_rec   :=  null;
1021 
1022  -- Retrieve asg_nte_dates
1023 
1024   ghr_history_fetch.fetch_asgei
1025   (p_assignment_id              =>  p_pa_request_rec.employee_assignment_id,
1026    p_information_type           => 'GHR_US_ASG_NTE_DATES',
1027    p_date_effective             =>  p_pa_request_rec.effective_date,
1028    p_asg_ei_data                =>  l_asg_extra_info_rec
1029   );
1030 
1031   hr_utility.set_location('retrieved asg extra info 3 ',3);
1032 
1033 
1034   p_asg_nte_dates.assignment_extra_info_id       :=  l_asg_extra_info_rec.assignment_extra_info_id;
1035   p_asg_nte_dates.object_version_number          :=  l_asg_extra_info_rec.object_version_number;
1036   p_asg_nte_dates.asg_nte_start_date             :=  l_asg_extra_info_rec.aei_information3;
1037   p_asg_nte_dates.assignment_nte                 :=  l_asg_extra_info_rec.aei_information4;
1038   p_asg_nte_dates.lwop_nte_start_date            :=  l_asg_extra_info_rec.aei_information5;
1039   p_asg_nte_dates.lwop_nte                       :=  l_asg_extra_info_rec.aei_information6;
1040   p_asg_nte_dates.suspension_nte_start_date      :=  l_asg_extra_info_rec.aei_information7;
1041   p_asg_nte_dates.suspension_nte                 :=  l_asg_extra_info_rec.aei_information8;
1042   p_asg_nte_dates.furlough_nte_start_date        :=  l_asg_extra_info_rec.aei_information9;
1043   p_asg_nte_dates.furlough_nte                   :=  l_asg_extra_info_rec.aei_information10;
1044   p_asg_nte_dates.lwp_nte_start_date             :=  l_asg_extra_info_rec.aei_information11;
1045   p_asg_nte_dates.lwp_nte                        :=  l_asg_extra_info_rec.aei_information12;
1046   p_asg_nte_dates.sabatical_nte_start_date       :=  l_asg_extra_info_rec.aei_information13;
1047   p_asg_nte_dates.sabatical_nte                  :=  l_asg_extra_info_rec.aei_information14;
1048   p_asg_nte_dates.assignment_number              :=  l_asg_extra_info_rec.aei_information15;
1049 --  p_asg_nte_dates.position_change_nte            :=  l_asg_extra_info_rec.aei_information16;  -- ??
1050   l_asg_extra_info_rec   :=  null;
1051 
1052    --Begin Bug# 8653508
1053   hr_utility.set_location('Before retrieving Detail IPA Benefits Continuation',191);
1054   ghr_history_fetch.fetch_asgei
1055   (p_assignment_id              =>  p_pa_request_rec.employee_assignment_id,
1056    p_information_type           => 'GHR_US_ASG_DET_INFO',
1057    p_date_effective             =>  p_pa_request_rec.effective_date,
1058    p_asg_ei_data                =>  l_asg_extra_info_rec
1059   );
1060    p_asg_detail_info.assignment_extra_info_id           :=  l_asg_extra_info_rec.assignment_extra_info_id;
1061    p_asg_detail_info.object_version_number          :=  l_asg_extra_info_rec.object_version_number;
1062    p_asg_detail_info.detail_begin_date 		    :=  l_asg_extra_info_rec.aei_information1;
1063    p_asg_detail_info.detail_end_date            :=  l_asg_extra_info_rec.aei_information2;
1064    p_asg_detail_info.detail_type    	    :=  l_asg_extra_info_rec.aei_information3;
1065    p_asg_detail_info.unclss_duty_ind 	            :=  l_asg_extra_info_rec.aei_information4;
1066    p_asg_detail_info.position_name  	    :=  l_asg_extra_info_rec.aei_information5;
1067    p_asg_detail_info.valid_grade	    :=  l_asg_extra_info_rec.aei_information6;
1068    p_asg_detail_info.occ_series           :=  l_asg_extra_info_rec.aei_information7;
1069    p_asg_detail_info.appropriation_code           :=  l_asg_extra_info_rec.aei_information8;
1070    p_asg_detail_info.flsa_category      :=  l_asg_extra_info_rec.aei_information9;
1071    p_asg_detail_info.bargaining_unit_status :=  l_asg_extra_info_rec.aei_information10;
1072    p_asg_detail_info.work_schedule :=  l_asg_extra_info_rec.aei_information11;
1073    p_asg_detail_info.duty_location :=  l_asg_extra_info_rec.aei_information12;
1074    p_asg_detail_info.organization :=  l_asg_extra_info_rec.aei_information13;
1075    l_asg_extra_info_rec   :=  null;
1076 --End Bug# 8653508
1077 
1078   END IF;
1079 END IF;
1080 
1081   -- Retrieve PER SF52
1082 
1083   ghr_history_fetch.fetch_peopleei
1084   (p_person_id                  =>  p_pa_request_rec.person_id,
1085    p_information_type           => 'GHR_US_PER_SF52',
1086    p_date_effective             =>  p_pa_request_rec.effective_date,
1087    p_per_ei_data                =>  l_per_extra_info_rec
1088   );
1089 
1090    hr_utility.set_location('retrieved per sf52 ',5);
1091 
1092    p_per_sf52.person_extra_info_id        :=  l_per_extra_info_rec.person_extra_info_id;
1093    p_per_sf52.object_version_number       :=  l_per_extra_info_rec.object_version_number;
1094    p_per_sf52.citizenship                 :=  l_per_extra_info_rec.pei_information3;
1095    p_per_sf52.veterans_preference         :=  l_per_extra_info_rec.pei_information4;
1096    p_per_sf52.veterans_preference_for_rif :=  l_per_extra_info_rec.pei_information5;
1097    p_per_sf52.veterans_status             :=  l_per_extra_info_rec.pei_information6;
1098 
1099   l_per_extra_info_rec   :=  null;
1100 
1101 -- Retrieve Per_Group1
1102 
1103    ghr_history_fetch.fetch_peopleei
1104   (p_person_id                  =>  p_pa_request_rec.person_id,
1105    p_information_type           => 'GHR_US_PER_GROUP1',
1106    p_date_effective             =>  p_pa_request_rec.effective_date,
1107    p_per_ei_data                =>  l_per_extra_info_rec
1108   );
1109 
1110   hr_utility.set_location('After fetch RINO     ' || l_per_extra_info_rec.pei_information5,1);
1111   hr_utility.set_location('After Fetch HANDICAP ' || l_per_extra_info_rec.pei_information11,2);
1112 
1113   hr_utility.set_location('retrieved per group1 ',6);
1114 
1115    p_per_group1.person_extra_info_id         :=  l_per_extra_info_rec.person_extra_info_id;
1116    p_per_group1.object_version_number        :=  l_per_extra_info_rec.object_version_number;
1117    p_per_group1.appointment_type             :=  l_per_extra_info_rec.pei_information3;
1118    p_per_group1.type_of_employment           :=  l_per_extra_info_rec.pei_information4;
1119    p_per_group1.race_national_origin         :=  l_per_extra_info_rec.pei_information5;
1120    p_per_group1.date_last_promotion          :=  l_per_extra_info_rec.pei_information6;
1121    p_per_group1.promotion_eligibility_date   :=  l_per_extra_info_rec.pei_information29; --Bug# 13942237,16023085
1122    p_per_group1.agency_code_transfer_from    :=  l_per_extra_info_rec.pei_information7;
1123    p_per_group1.org_appointment_auth_code1   :=  l_per_extra_info_rec.pei_information8;
1124    p_per_group1.org_appointment_desc1        :=  l_per_extra_info_rec.pei_information22;--Bug# 4941984(AFHR2)
1125    p_per_group1.org_appointment_auth_code2   :=  l_per_extra_info_rec.pei_information9;
1126    p_per_group1.org_appointment_desc2        :=  l_per_extra_info_rec.pei_information23;--Bug# 4941984(AFHR2)
1127    p_per_group1.country_world_citizenship    :=  l_per_extra_info_rec.pei_information10;
1128    p_per_group1.handicap_code                :=  l_per_extra_info_rec.pei_information11;
1129    p_per_group1.consent_id                   :=  l_per_extra_info_rec.pei_information12;
1130    p_per_group1.date_fehb_eligibility_expires :=  l_per_extra_info_rec.pei_information13;
1131    p_per_group1.date_temp_eligibility_fehb   :=  l_per_extra_info_rec.pei_information14;
1132    p_per_group1.date_febh_dependent_cert_exp :=  l_per_extra_info_rec.pei_information15;
1133    p_per_group1.family_member_emp_pref       :=  l_per_extra_info_rec.pei_information16;
1134    p_per_group1.family_member_status         :=  l_per_extra_info_rec.pei_information17;
1135    --Bug#4486823 RRR Changes
1136    p_per_group1.retention_inc_review_date    :=  l_per_extra_info_rec.pei_information21;
1137 
1138    l_per_extra_info_rec   :=  null;
1139 
1140 
1141    --bug # 14276354
1142 
1143     ghr_history_fetch.fetch_peopleei
1144   (p_person_id                  =>  p_pa_request_rec.person_id,
1145    p_information_type           => 'GHR_US_PER_GROUP2',
1146    p_date_effective             =>  p_pa_request_rec.effective_date,
1147    p_per_ei_data                =>  l_per_extra_info_rec
1148   );
1149 
1150    p_per_group2.person_extra_info_id         :=  l_per_extra_info_rec.person_extra_info_id;
1151    p_per_group2.object_version_number        :=  l_per_extra_info_rec.object_version_number;
1152    p_per_group2.obligated_position_number    :=  l_per_extra_info_rec.pei_information3;
1153    p_per_group2.obligated_position_type      :=  l_per_extra_info_rec.pei_information4;
1154    p_per_group2.date_overseas_tour_expires   :=  l_per_extra_info_rec.pei_information5;
1155    p_per_group2.date_return_rights_expires   :=  l_per_extra_info_rec.pei_information6;
1156    p_per_group2.date_stat_return_rights_expir :=  l_per_extra_info_rec.pei_information7;
1157    p_per_group2.civilian_duty_stat_contigency :=  l_per_extra_info_rec.pei_information8;
1158    p_per_group2.date_travel_agmt_pcs_expires  :=  l_per_extra_info_rec.pei_information9;
1159    p_per_group2.draw_down_action_id           :=  l_per_extra_info_rec.pei_information10;
1160    p_per_group2.pathways_program_start_date   :=  l_per_extra_info_rec.pei_information11;
1161    p_per_group2.pathways_program_extn_date    :=  l_per_extra_info_rec.pei_information12;
1162    p_per_group2.pathways_program_end_date     :=  l_per_extra_info_rec.pei_information13;
1163 
1164 
1165    l_per_extra_info_rec   :=  null;
1166 --
1167 
1168 -- Retrieve  Per_scd `
1169 
1170   ghr_history_fetch.fetch_peopleei
1171   (p_person_id              =>  p_pa_request_rec.person_id,
1172   p_information_type           => 'GHR_US_PER_SCD_INFORMATION',
1173   p_date_effective             =>  p_pa_request_rec.effective_date,
1174   p_per_ei_data                =>  l_per_extra_info_rec
1175   );
1176 
1177     hr_utility.set_location('After fetch SCD     ' || l_per_extra_info_rec.pei_information3,1);
1178 
1179    hr_utility.set_location('retrieved per scd ',8);
1180 
1181 
1182    p_per_scd_info.person_extra_info_id         :=  l_per_extra_info_rec.person_extra_info_id;
1183    p_per_scd_info.object_version_number        :=  l_per_extra_info_rec.object_version_number;
1184    p_per_scd_info.scd_leave                    :=  l_per_extra_info_rec.pei_information3;
1185    p_per_scd_info.scd_civilian                 :=  l_per_extra_info_rec.pei_information4;
1186    p_per_scd_info.scd_rif                      :=  l_per_extra_info_rec.pei_information5;
1187    p_per_scd_info.scd_tsp                      :=  l_per_extra_info_rec.pei_information6;
1188    -- Begin Bug# 4864508
1189    p_per_scd_info.scd_retirement	       :=  l_per_extra_info_rec.pei_information7;
1190    -- End Bug# 4864508
1191    --bug#4443968
1192    p_per_scd_info.scd_creditable_svc_annl_leave := l_per_extra_info_rec.pei_information12;
1193    p_per_scd_info.scd_Length_of_Service		:= l_per_extra_info_rec.pei_information13; --Bug# 14514445
1194 
1195    l_per_extra_info_rec   :=  null;
1196 
1197 
1198 -- Retrieve per_probations
1199 
1200    ghr_history_fetch.fetch_peopleei
1201   (p_person_id                 =>  p_pa_request_rec.person_id,
1202   p_information_type           => 'GHR_US_PER_PROBATIONS',
1203    p_date_effective            =>  p_pa_request_rec.effective_date,
1204   p_per_ei_data                =>  l_per_extra_info_rec
1205   );
1206 
1207 
1208   hr_utility.set_location('retrieved per probations  ',9);
1209 
1210    p_per_probations.person_extra_info_id         :=  l_per_extra_info_rec.person_extra_info_id;
1211    p_per_probations.object_version_number        :=  l_per_extra_info_rec.object_version_number;
1212    p_per_probations.date_prob_trial_period_begin :=  l_per_extra_info_rec.pei_information3;
1213    p_per_probations.date_prob_trial_period_ends  :=  l_per_extra_info_rec.pei_information4;
1214   -- p_per_probations.date_spvr_mgr_prob_Begins    :=  l_per_extra_info_rec.pei_information8; --Bug# 4588575
1215    p_per_probations.date_spvr_mgr_prob_ends      :=  l_per_extra_info_rec.pei_information5;
1216    p_per_probations.spvr_mgr_prob_completion     :=  l_per_extra_info_rec.pei_information6;
1217    p_per_probations.date_ses_prob_expires        :=  l_per_extra_info_rec.pei_information7;
1218 
1219    l_per_extra_info_rec   :=  null;
1220 
1221 --  Retrieve per_retained_grade
1222 
1223 -- Retained Grade has to retrieved with a special logic, as it can have multiple occurences
1224 -- and on the same dates. The procedure below, returns the retained grade details that fetches the max. profit for
1225 -- the person for the specific date.
1226 
1227 -- Note : It is assumed that the retain_pay_table_id is not used by the CPDFs.
1228 --        Actually the user_table_id is stored into the retain_pay_table_id , which is just the primary key id and not
1229 --        the actual pay table name, like the quad 0s. Since the only pay table used by the CPDF is the Quad 0 and
1230 --        has been hard coded for validations, it is OK to pass the id against the actual name of the pay table.
1231 --
1232 
1233 
1234  begin
1235 
1236   If p_pa_request_rec.first_noa_code = '866' then
1237     l_retained_grade_rec :=  ghr_pc_basic_pay.get_retained_grade_details
1238                              (p_person_id       =>   p_pa_request_rec.person_id,
1239                               p_effective_date  =>   p_pa_request_rec.effective_date + 1,
1240                               p_pa_request_id   =>   p_pa_request_rec.pa_request_id
1241                              );
1242   Else
1243      l_retained_grade_rec :=  ghr_pc_basic_pay.get_retained_grade_details
1244                             (p_person_id       =>   p_pa_request_rec.person_id,
1245                              p_effective_date  =>   p_pa_request_rec.effective_date,
1246                              p_pa_request_id   =>   p_pa_request_rec.pa_request_id
1247                             );
1248    END IF;
1249 
1250      -- Bug#4423679 Added date_from, date_to
1251      p_per_retained_grade.date_from              :=  l_retained_grade_rec.date_from;
1252      p_per_retained_grade.date_to                :=  l_retained_grade_rec.date_to;
1253      -- Bug#4423679
1254      p_per_retained_grade.retain_grade            :=  l_retained_grade_rec.grade_or_level;
1255      p_per_retained_grade.retain_step_or_rate     :=  l_retained_grade_rec.step_or_rate;
1256      p_per_retained_grade.retain_pay_plan         :=  l_retained_grade_rec.pay_plan;
1257      p_per_retained_grade.retain_pay_table_id     :=  to_char(l_retained_grade_rec.user_table_id);
1258      p_per_retained_grade.retain_locality_percent :=  to_char(l_retained_grade_rec.locality_percent);
1259      p_per_retained_grade.retain_pay_basis        :=  l_retained_grade_rec.pay_basis;
1260      p_per_retained_grade.temp_step               :=  l_retained_grade_rec.temp_step;
1261    --End if;
1262     -- Bug 3021003 If Intervening actions are present in WGI, QSI corrections, get the corrected step.
1263 	-- Bug 4658890 Removed 894 from first_noa_code
1264    IF   p_pa_request_rec.first_noa_code IN ('867','892','893') AND  l_session.noa_id_correct IS NOT NULL THEN
1265      hr_utility.set_location('Inside PRUP Sun if condn',10);
1266 		ghr_pay_calc.is_retained_ia(p_pa_request_rec.person_id,
1267 									   p_pa_request_rec.effective_date,
1268 									   l_retained_grade_rec.pay_plan,
1269 									   l_retained_grade_rec.grade_or_level,
1270 									   l_retained_grade_rec.step_or_rate,
1271 									   l_retained_grade_rec.temp_step,
1272 									   l_ret_flag);
1273 		 IF l_ret_flag = TRUE THEN
1274 			IF l_retained_grade_rec.temp_step IS NOT NULL THEN
1275 				hr_utility.set_location('Inside PRUP Sun if temp_step condn' || l_retained_grade_rec.temp_step,10);
1276 				p_per_retained_grade.temp_step := ghr_pc_basic_pay.get_next_WGI_step (l_retained_grade_rec.pay_plan,l_retained_grade_rec.temp_step);
1277 			ELSE
1278 				hr_utility.set_location('Inside PRUP Sun ELSE temp_step condn' || l_retained_grade_rec.step_or_rate,10);
1279 				p_per_retained_grade.retain_step_or_rate := ghr_pc_basic_pay.get_next_WGI_step (l_retained_grade_rec.pay_plan,l_retained_grade_rec.step_or_rate);
1280 			END IF;
1281 			p_per_sf52.per_sf52_flag := 'Y';
1282 		 END IF;
1283    END IF;
1284 
1285   hr_utility.set_location('Retrieved Per_retained_grade',10);
1286 
1287 -- Need to handle this Exception here because it is just a warning to indicate that the pay cannot be calculated
1288 -- which is only apt for the Front End and does not matter in this context.
1289 
1290 exception
1291   when ghr_pay_calc.pay_calc_message then
1292      null;
1293  end;
1294 
1295 -- Retrieve per_separate_retire
1296 
1297    hr_utility.set_location('retrieved per unif ',13);
1298    hr_utility.set_location('p_per_separate_retire.agency_code_transfer_to = ' ||
1299                             p_per_separate_retire.agency_code_transfer_to ,13);
1300    hr_utility.set_location('l_per_extra_info_rec.pei_information8 = ' ||
1301                             l_per_extra_info_rec.pei_information8 ,13);
1302    ghr_history_fetch.fetch_peopleei
1303   (p_person_id                 =>  p_pa_request_rec.person_id,
1304    p_information_type          => 'GHR_US_PER_SEPARATE_RETIRE',
1305    p_date_effective            =>  p_pa_request_rec.effective_date,
1306    p_per_ei_data               =>  l_per_extra_info_rec
1307   );
1308   p_per_separate_retire.person_extra_info_id          := l_per_extra_info_rec.person_extra_info_id;
1309   p_per_separate_retire.object_version_number         := l_per_extra_info_rec.object_version_number;
1310   p_per_separate_retire.fers_coverage                 := l_per_extra_info_rec.pei_information3;
1311   p_per_separate_retire.prev_retirement_coverage      := l_per_extra_info_rec.pei_information4;
1312   p_per_separate_retire.frozen_service                := l_per_extra_info_rec.pei_information5;
1313   p_per_separate_retire.naf_retirement_indicator      := l_per_extra_info_rec.pei_information6;
1314   p_per_separate_retire.reason_for_separation         := l_per_extra_info_rec.pei_information7;
1315   p_per_separate_retire.agency_code_transfer_to       := l_per_extra_info_rec.pei_information8;
1316   p_per_separate_retire.date_projected_retirement     := l_per_extra_info_rec.pei_information9;
1317   p_per_separate_retire.mandatory_retirement_date     := l_per_extra_info_rec.pei_information10;
1318   --Start Bug 1359482
1319   If  nvl(p_pa_request_rec.first_noa_code,hr_api.g_varchar2) in ('300','301','302','303','304') then
1320     hr_utility.set_location('separate_pkg_status_indicator defaults to 1',14);
1321     p_per_separate_retire.separate_pkg_status_indicator := '1';
1322     p_per_separate_retire.per_sep_retire_flag := 'Y';
1323   else
1324     p_per_separate_retire.separate_pkg_status_indicator := l_per_extra_info_rec.pei_information11;
1325   end if;
1326   --End Bug 1359482
1327 
1328   p_per_separate_retire.separate_pkg_register_number  := l_per_extra_info_rec.pei_information12;
1329   p_per_separate_retire.separate_pkg_pay_office_id    := l_per_extra_info_rec.pei_information13;
1330   p_per_separate_retire.date_ret_appl_received        := l_per_extra_info_rec.pei_information14;
1331   p_per_separate_retire.date_ret_pkg_sent_to_payroll  := l_per_extra_info_rec.pei_information15;
1332   p_per_separate_retire.date_ret_pkg_recv_payroll     := l_per_extra_info_rec.pei_information16;
1333   p_per_separate_retire.date_ret_pkg_to_opm           := l_per_extra_info_rec.pei_information17;
1334 
1335   l_per_extra_info_rec   :=  null;
1336 
1337    hr_utility.set_location('p_per_separate_retire.agency_code_transfer_to = ' ||
1338                             p_per_separate_retire.agency_code_transfer_to ,14);
1339    hr_utility.set_location('l_per_extra_info_rec.pei_information8 = ' ||
1340                             l_per_extra_info_rec.pei_information8 ,14);
1341    hr_utility.set_location('retrieved per unif ',14);
1342 
1343 -- Bug#4486823 RRR Changes
1344 -- Retrieve per_service_obligation
1345 
1346   /*  ghr_history_fetch.fetch_peopleei
1347   (p_person_id                 =>  p_pa_request_rec.person_id,
1348    p_information_type          => 'GHR_US_PER_SERVICE_OBLIGATION',
1349    p_date_effective            =>  p_pa_request_rec.effective_date,
1350    p_per_ei_data               =>  l_per_extra_info_rec
1351   );
1352   p_per_service_oblig.person_extra_info_id          := l_per_extra_info_rec.person_extra_info_id;
1353   p_per_service_oblig.object_version_number         := l_per_extra_info_rec.object_version_number;
1354   p_per_service_oblig.service_oblig_type_code       := l_per_extra_info_rec.pei_information3;
1355   p_per_service_oblig.service_oblig_start_date      := l_per_extra_info_rec.pei_information4;
1356   p_per_service_oblig.service_oblig_end_date        := l_per_extra_info_rec.pei_information5;
1357   l_per_extra_info_rec   :=  null;
1358 
1359    hr_utility.set_location('p_per_service_oblig.service_oblig_type_code = ' ||
1360                             p_per_service_oblig.service_oblig_type_code ,15);
1361    hr_utility.set_location('p_per_service_oblig.service_oblig_start_date = ' ||
1362                             p_per_service_oblig.service_oblig_start_date ,15);
1363    hr_utility.set_location('retrieved per serv oblg ',15); */
1364 
1365  -- Retrieve per_uniformed_services
1366 
1367    ghr_history_fetch.fetch_peopleei
1368   (p_person_id                 =>  p_pa_request_rec.person_id,
1369    p_information_type          => 'GHR_US_PER_UNIFORMED_SERVICES',
1370    p_date_effective            =>  p_pa_request_rec.effective_date,
1371    p_per_ei_data               =>  l_per_extra_info_rec
1372   );
1373 
1374    p_per_uniformed_services.person_extra_info_id         :=  l_per_extra_info_rec.person_extra_info_id;
1375    p_per_uniformed_services.object_version_number        :=  l_per_extra_info_rec.object_version_number;
1376    p_per_uniformed_services.reserve_category             :=  l_per_extra_info_rec.pei_information3;
1377    p_per_uniformed_services.military_recall_status       :=  l_per_extra_info_rec.pei_information4;
1378    p_per_uniformed_services.creditable_military_service  :=  l_per_extra_info_rec.pei_information5;
1379    p_per_uniformed_services.date_retired_uniform_service :=  l_per_extra_info_rec.pei_information6;
1380    p_per_uniformed_services.uniform_service_component    :=  l_per_extra_info_rec.pei_information7;
1381    p_per_uniformed_services.uniform_service_designation  :=  l_per_extra_info_rec.pei_information8;
1382    p_per_uniformed_services.retirement_grade             :=  l_per_extra_info_rec.pei_information9;
1383    p_per_uniformed_services.military_retire_waiver_ind   :=  l_per_extra_info_rec.pei_information10;
1384    p_per_uniformed_services.exception_retire_pay_ind     :=  l_per_extra_info_rec.pei_information11;
1385 
1386    l_per_extra_info_rec   :=  null;
1387 
1388 
1389 -- Retrieve per_conversions
1390 
1391    ghr_history_fetch.fetch_peopleei
1392   (p_person_id                 =>  p_pa_request_rec.person_id,
1393    p_information_type          => 'GHR_US_PER_CONVERSIONS',
1394    p_date_effective            =>  p_pa_request_rec.effective_date,
1395    p_per_ei_data               =>  l_per_extra_info_rec
1396   );
1397 
1398    p_per_conversions.person_extra_info_id         :=  l_per_extra_info_rec.person_extra_info_id;
1399    p_per_conversions.object_version_number        :=  l_per_extra_info_rec.object_version_number;
1400    p_per_conversions.date_conv_career_begins      :=  l_per_extra_info_rec.pei_information3;
1401    p_per_conversions.date_conv_career_due         :=  l_per_extra_info_rec.pei_information4;
1402    p_per_conversions.date_recmd_conv_begins       :=  l_per_extra_info_rec.pei_information5;
1403    p_per_conversions.date_recmd_conv_due          :=  l_per_extra_info_rec.pei_information7;
1404    p_per_conversions.date_vra_conv_due            :=  l_per_extra_info_rec.pei_information6;
1405 
1406    l_per_extra_info_rec   :=  null;
1407 
1408    -- 4352589 BEN_EIT Changes
1409    -- Retrieve per_benefit_info
1410    ghr_history_fetch.fetch_peopleei
1411   (p_person_id                 =>  p_pa_request_rec.person_id,
1412    p_information_type          => 'GHR_US_PER_BENEFIT_INFO',
1413    p_date_effective            =>  p_pa_request_rec.effective_date,
1414    p_per_ei_data               =>  l_per_extra_info_rec
1415   );
1416 
1417    p_per_benefit_info.person_extra_info_id           :=  l_per_extra_info_rec.person_extra_info_id;
1418    p_per_benefit_info.object_version_number          :=  l_per_extra_info_rec.object_version_number;
1419    p_per_benefit_info.FEGLI_Date_Eligibility_Expires :=  l_per_extra_info_rec.pei_information3;
1420    p_per_benefit_info.FEHB_Date_Eligibility_expires  :=  l_per_extra_info_rec.pei_information4;
1421    p_per_benefit_info.FEHB_Date_temp_eligibility     :=  l_per_extra_info_rec.pei_information5;
1422    p_per_benefit_info.FEHB_Date_dependent_cert_expir :=  l_per_extra_info_rec.pei_information6;
1423    p_per_benefit_info.FEHB_LWOP_contingency_st_date  :=  l_per_extra_info_rec.pei_information7;
1424    p_per_benefit_info.FEHB_LWOP_contingency_end_date :=  l_per_extra_info_rec.pei_information8;
1425    p_per_benefit_info.FEHB_Child_equiry_court_date   :=  l_per_extra_info_rec.pei_information10;
1426    p_per_benefit_info.FERS_Date_eligibility_expires  :=  l_per_extra_info_rec.pei_information11;
1427    p_per_benefit_info.FERS_Election_Date             :=  l_per_extra_info_rec.pei_information12;
1428    p_per_benefit_info.FERS_Election_Indicator        :=  l_per_extra_info_rec.pei_information13;
1429    p_per_benefit_info.TSP_Agncy_Contrib_Elig_date    :=  l_per_extra_info_rec.pei_information14;
1430    p_per_benefit_info.TSP_Emp_Contrib_Elig_date      :=  l_per_extra_info_rec.pei_information15;
1431 
1432    -- Changes related to 6312144 -- Addition of new segments introduced in benefit info record type
1433    p_per_benefit_info.FEGLI_Assignment_Ind:=  l_per_extra_info_rec.pei_information16;
1434    p_per_benefit_info.FEGLI_Post_Elec_Basic_Ins_Amt:=  l_per_extra_info_rec.pei_information17;
1435    p_per_benefit_info.FEGLI_Court_Order_Ind:=  l_per_extra_info_rec.pei_information18;
1436    p_per_benefit_info.Desg_FEGLI_Benf_Ind:=  l_per_extra_info_rec.pei_information19;
1437    p_per_benefit_info.FEHB_Event_Code:=  l_per_extra_info_rec.pei_information20;
1438 
1439 
1440     -- Bug 4724337 Race or National Origin changes
1441    	l_per_extra_info_rec   :=  null;
1442      ghr_history_fetch.fetch_peopleei
1443 	  (p_person_id                 =>  p_pa_request_rec.person_id,
1444 	   p_information_type          => 'GHR_US_PER_ETHNICITY_RACE',
1445 	   p_date_effective            =>  p_pa_request_rec.effective_date,
1446 	   p_per_ei_data               =>  l_per_extra_info_rec
1447 	  );
1448    p_race_ethnic_info.person_extra_info_id           :=  l_per_extra_info_rec.person_extra_info_id;
1449    p_race_ethnic_info.object_version_number          :=  l_per_extra_info_rec.object_version_number;
1450    p_race_ethnic_info.p_hispanic 					 :=  l_per_extra_info_rec.pei_information3;
1451    p_race_ethnic_info.p_american_indian  			 :=  l_per_extra_info_rec.pei_information4;
1452    p_race_ethnic_info.p_asian     					 :=  l_per_extra_info_rec.pei_information5;
1453    p_race_ethnic_info.p_black_afr_american 			 :=  l_per_extra_info_rec.pei_information6;
1454    p_race_ethnic_info.p_hawaiian_pacific  			 :=  l_per_extra_info_rec.pei_information7;
1455    p_race_ethnic_info.p_white  						 :=  l_per_extra_info_rec.pei_information8;
1456 
1457 
1458 -- Retrieve pos_valid_grade
1459 
1460    If p_pa_request_rec.to_position_id is null then
1461      l_position_id := p_pa_request_rec.from_position_id;
1462    Else
1463      l_position_id := p_pa_request_rec.to_position_id;
1464    End if;
1465 
1466   ghr_history_fetch.fetch_positionei
1467   (p_position_id                =>  l_position_id,
1468    p_information_type           => 'GHR_US_POS_VALID_GRADE',
1469    p_date_effective             =>  p_pa_request_rec.effective_date,
1470    p_pos_ei_data                =>  l_pos_extra_info_rec
1471    );
1472 
1473    hr_utility.set_location('retrieved pos valid grade ',15);
1474 
1475    p_valid_grade.position_extra_info_id            :=  l_pos_extra_info_rec.position_extra_info_id;
1476    p_valid_grade.object_version_number             :=  l_pos_extra_info_rec.object_version_number;
1477    p_valid_grade.valid_grade                       :=  l_pos_extra_info_rec.poei_information3;
1478    p_valid_grade.target_grade                      :=  l_pos_extra_info_rec.poei_information4;
1479    p_valid_grade.pay_table_id                      :=  l_pos_extra_info_rec.poei_information5;
1480    p_valid_grade.pay_basis                         :=  l_pos_extra_info_rec.poei_information6;
1481    p_valid_grade.employment_category_group         :=  l_pos_extra_info_rec.poei_information7;
1482    hr_utility.set_location('POS_VAL_GRADE - POS ID ' || to_char(l_position_id),1);
1483    hr_utility.set_location('POS_VAL_GRADE - OVN ' || to_char(l_pos_extra_info_rec.object_version_number),2);
1484    hr_utility.set_location('POS_VAL_GRADE - POEI ID' || to_char(l_pos_extra_info_rec.position_extra_info_id),3);
1485 
1486    l_pos_extra_info_rec   :=  null;
1487 
1488   -- Retrieve Position group1
1489 
1490 
1491   ghr_history_fetch.fetch_positionei
1492   (p_position_id                =>  l_position_id,
1493    p_information_type           => 'GHR_US_POS_GRP1',
1494    p_date_effective             =>  p_pa_request_rec.effective_date,
1495    p_pos_ei_data                =>  l_pos_extra_info_rec
1496   );
1497 
1498 
1499    hr_utility.set_location('retrieved pos grp 1 ',16);
1500 
1501    p_pos_grp1.position_extra_info_id            :=  l_pos_extra_info_rec.position_extra_info_id;
1502    p_pos_grp1.object_version_number             :=  l_pos_extra_info_rec.object_version_number;
1503    p_pos_grp1.personnel_office_id               :=  l_pos_extra_info_rec.poei_information3;
1504    p_pos_grp1.office_symbol                     :=  l_pos_extra_info_rec.poei_information4;
1505    p_pos_grp1.organization_structure_id         :=  l_pos_extra_info_rec.poei_information5;
1506    p_pos_grp1.occupation_category_code          :=  l_pos_extra_info_rec.poei_information6;
1507    p_pos_grp1.flsa_category                     :=  l_pos_extra_info_rec.poei_information7;
1508    p_pos_grp1.bargaining_unit_status            :=  l_pos_extra_info_rec.poei_information8;
1509    p_pos_grp1.competitive_level                 :=  l_pos_extra_info_rec.poei_information9;
1510    p_pos_grp1.work_schedule                     :=  l_pos_extra_info_rec.poei_information10;
1511    p_pos_grp1.functional_class                  :=  l_pos_extra_info_rec.poei_information11;
1512    p_pos_grp1.position_working_title            :=  l_pos_extra_info_rec.poei_information12;
1513    p_pos_grp1.position_sensitivity              :=  l_pos_extra_info_rec.poei_information13;
1514    p_pos_grp1.security_access                   :=  l_pos_extra_info_rec.poei_information14;
1515    p_pos_grp1.prp_sci                           :=  l_pos_extra_info_rec.poei_information15;
1516    p_pos_grp1.supervisory_status                :=  l_pos_extra_info_rec.poei_information16;
1517    p_pos_grp1.type_employee_supervised          :=  l_pos_extra_info_rec.poei_information17;
1518    p_pos_grp1.payroll_office_id                 :=  l_pos_extra_info_rec.poei_information18;
1519    p_pos_grp1.timekeeper                        :=  l_pos_extra_info_rec.poei_information19;
1520    p_pos_grp1.competitive_area                  :=  l_pos_extra_info_rec.poei_information20;
1521    p_pos_grp1.positions_organization            :=  l_pos_extra_info_rec.poei_information21;
1522    p_pos_grp1.oct_report_flag                   :=  l_pos_extra_info_rec.poei_information22;
1523    p_pos_grp1.part_time_hours                   :=  l_pos_extra_info_rec.poei_information23;
1524 
1525 
1526 
1527     hr_utility.set_location('POS_gRP1 - POS ID ' || to_char(l_position_id),1);
1528     hr_utility.set_location('POS_GRP1 - OVN ' || to_char(p_pos_grp1.object_version_number),2);
1529     hr_utility.set_location('POS_GRP1 - POEI ID' || to_char(p_pos_grp1.position_extra_info_id),3);
1530 
1531 l_pos_extra_info_rec   :=  null;
1532 
1533  -- Retrieve Position Group2
1534 
1535  ghr_history_fetch.fetch_positionei
1536   (p_position_id                =>  l_position_id,
1537    p_information_type           => 'GHR_US_POS_GRP2',
1538    p_date_effective             =>  p_pa_request_rec.effective_date,
1539    p_pos_ei_data                =>  l_pos_extra_info_rec
1540   );
1541 
1542 
1543   hr_utility.set_location('retrieved pos grp 2 ',17);
1544 
1545 
1546    p_pos_grp2.position_extra_info_id            :=  l_pos_extra_info_rec.position_extra_info_id;
1547    p_pos_grp2.object_version_number             :=  l_pos_extra_info_rec.object_version_number;
1548    p_pos_grp2.position_occupied                 :=  l_pos_extra_info_rec.poei_information3;
1549    p_pos_grp2.organization_function_code        :=  l_pos_extra_info_rec.poei_information4;
1550    p_pos_grp2.date_position_classified          :=  l_pos_extra_info_rec.poei_information5;
1551    p_pos_grp2.date_last_position_audit          :=  l_pos_extra_info_rec.poei_information6;
1552    p_pos_grp2.classification_official           :=  l_pos_extra_info_rec.poei_information7;
1553    p_pos_grp2.language_required                 :=  l_pos_extra_info_rec.poei_information8;
1554    p_pos_grp2.drug_test                         :=  l_pos_extra_info_rec.poei_information9;
1555    p_pos_grp2.financial_statement               :=  l_pos_extra_info_rec.poei_information10;
1556    p_pos_grp2.training_program_id               :=  l_pos_extra_info_rec.poei_information11;
1557    p_pos_grp2.key_emergency_essential           :=  l_pos_extra_info_rec.poei_information12;
1558    p_pos_grp2.appropriation_code1               :=  l_pos_extra_info_rec.poei_information13;
1559    p_pos_grp2.appropriation_code2               :=  l_pos_extra_info_rec.poei_information14;
1560    p_pos_grp2.intelligence_position_ind         :=  l_pos_extra_info_rec.poei_information15;
1561    p_pos_grp2.leo_position_indicator            :=  l_pos_extra_info_rec.poei_information16;
1562     hr_utility.set_location('POS_2 - POS ID ' || to_char(l_position_id),1);
1563     hr_utility.set_location('POS_2 - OVN ' || to_char(l_pos_extra_info_rec.object_version_number),2);
1564     hr_utility.set_location('POS_2 - POEI ID' || to_char(l_pos_extra_info_rec.position_extra_info_id),3);
1565 
1566    l_pos_extra_info_rec   :=  null;
1567 
1568  -- Retrieve  Position Obligation
1569 
1570   ghr_history_fetch.fetch_positionei
1571   (p_position_id                =>  l_position_id,
1572    p_information_type           => 'GHR_US_POS_OBLIG',
1573    p_date_effective             =>  p_pa_request_rec.effective_date,
1574    p_pos_ei_data                =>  l_pos_extra_info_rec
1575   );
1576   p_pos_oblig.position_extra_info_id            := l_pos_extra_info_rec.position_extra_info_id;
1577   p_pos_oblig.object_version_number             := l_pos_extra_info_rec.object_version_number;
1578   p_pos_oblig.expiration_date 			:= l_pos_extra_info_rec.poei_information3;
1579   p_pos_oblig.obligation_type 			:= l_pos_extra_info_rec.poei_information4;
1580   p_pos_oblig.employee_ssn    		      := l_pos_extra_info_rec.poei_information5;
1581   l_pos_extra_info_rec           			:= null;
1582 
1583   hr_utility.set_location('retrieved pos oblig ',18);
1584 
1585 /* Retrieve GHR_US_POS_CAR_PROG */
1586 
1587 /* Retrieve GHR_US_PER_BENEFITS_CONT */
1588   -- Bug 6312144 IPA Benefits Continuation EIT changes
1589 
1590   hr_utility.set_location('Before retrieving IPA Benefits Continuation',19);
1591   l_per_extra_info_rec   :=  null;
1592   ghr_history_fetch.fetch_peopleei
1593   	  (p_person_id                 =>  p_pa_request_rec.person_id,
1594 	   p_information_type          => 'GHR_US_PER_BENEFITS_CONT',
1595 	   p_date_effective            =>  p_pa_request_rec.effective_date,
1596 	   p_per_ei_data               =>  l_per_extra_info_rec
1597 	  );
1598    p_ipa_benefits_cont.person_extra_info_id           :=  l_per_extra_info_rec.person_extra_info_id;
1599    p_ipa_benefits_cont.object_version_number          :=  l_per_extra_info_rec.object_version_number;
1600    p_ipa_benefits_cont.FEGLI_Indicator 		      :=  l_per_extra_info_rec.pei_information1;
1601    p_ipa_benefits_cont.FEGLI_Election_Date            :=  l_per_extra_info_rec.pei_information2;
1602    p_ipa_benefits_cont.FEGLI_Elec_Not_Date    	      :=  l_per_extra_info_rec.pei_information3;
1603    p_ipa_benefits_cont.FEHB_Indicator 	              :=  l_per_extra_info_rec.pei_information4;
1604    p_ipa_benefits_cont.FEHB_Election_Date  	      :=  l_per_extra_info_rec.pei_information5;
1605    p_ipa_benefits_cont.FEHB_Elec_Notf_Date	      :=  l_per_extra_info_rec.pei_information6;
1606    p_ipa_benefits_cont.retirement_Indicator           :=  l_per_extra_info_rec.pei_information7;
1607    p_ipa_benefits_cont.retirement_Elec_Date           :=  l_per_extra_info_rec.pei_information12;
1608    p_ipa_benefits_cont.retirement_Elec_Notf_Date      :=  l_per_extra_info_rec.pei_information8;
1609    p_ipa_benefits_cont.Cont_Term_Insuff_Pay_Elec_Date :=  l_per_extra_info_rec.pei_information9;
1610    p_ipa_benefits_cont.Cont_Term_Insuff_Pay_Notf_Date :=  l_per_extra_info_rec.pei_information10;
1611    p_ipa_benefits_cont.Cont_Term_Insuff_Pmt_Type_Code :=  l_per_extra_info_rec.pei_information11;
1612 
1613 /* Retrieve GHR_US_PER_BENEFITS_CONT */
1614  hr_utility.set_location('Retrieving IPA Benefits Continuation',20);
1615 
1616 /* Retrieve GHR_US_PER_RETIRMENT_SYS_INFO*/
1617 
1618  hr_utility.set_location('Before retrieving Retirement System Information',21);
1619  -- Bug 6312144 Retirement System Information EIT changes
1620  l_per_extra_info_rec   :=  null;
1621  ghr_history_fetch.fetch_peopleei
1622 	   (p_person_id                 =>  p_pa_request_rec.person_id,
1623 	    p_information_type          => 'GHR_US_PER_RETIRMENT_SYS_INFO',
1624 	    p_date_effective            =>  p_pa_request_rec.effective_date,
1625 	    p_per_ei_data               =>  l_per_extra_info_rec
1626 	   );
1627    p_retirement_info.person_extra_info_id           :=  l_per_extra_info_rec.person_extra_info_id;
1628    p_retirement_info.object_version_number          :=  l_per_extra_info_rec.object_version_number;
1629    p_retirement_info.special_population_code        :=  l_per_extra_info_rec.pei_information1;
1630    p_retirement_info.App_Exc_CSRS_Ind               :=  l_per_extra_info_rec.pei_information2;
1631    p_retirement_info.App_Exc_FERS_Ind               :=  l_per_extra_info_rec.pei_information3;
1632    p_retirement_info.FICA_Coverage_Ind1             :=  l_per_extra_info_rec.pei_information4;
1633    p_retirement_info.FICA_Coverage_Ind2             :=  l_per_extra_info_rec.pei_information5;
1634 
1635    hr_utility.set_location('After Retirement System Information',22);
1636 /* Retrieve GHR_US_PER_RETIRMENT_SYS_INFO*/
1637 
1638 End retrieve_all_extra_info;
1639 
1640 
1641 
1642 -- **********************  *********
1643 -- procedure SF52_br_extra_info
1644 -- *******************************
1645 --
1646 --
1647 /*
1648 	This procedure gets other Sf52 data that has not been retrieved by
1649       the process_sf52_extra_info and process_non_sf52_extra_info procedure
1650 */
1651 --
1652 
1653 procedure SF52_br_extra_info
1654 (
1655   P_PA_REQUEST_REC  		IN       GHR_PA_REQUESTS%ROWTYPE
1656  ,p_agency_code			out nocopy      varchar2
1657  ) is
1658 --
1659 l_bus_gp 	            number;
1660 l_agency_code 	      varchar2(50);
1661 l_proc                  varchar2(70) := 'SF52_br_extra_info';
1662 l_position_id           per_positions.position_id%type;
1663 
1664 --
1665 --Bug# 957677  -- Parameter Name Change
1666 cursor   c_bus_gp(p_position_id number) is
1667   select pos.business_group_id
1668   from   hr_all_positions_f pos  -- Venkat - Position DT
1669   where  pos.position_id = p_position_id
1670      and p_pa_request_rec.effective_date between
1671          pos.effective_start_date and pos.effective_end_date;
1672 
1673 Cursor c_pa_request_extra_info (l_information_type varchar2) is
1674   Select *
1675   from   ghr_pa_request_extra_info
1676   where  pa_request_id    =  p_pa_request_rec.pa_request_id
1677   and    information_type =  l_information_type;
1678 
1679 --
1680 Begin
1681   --
1682   g_effective_date              :=  nvl(p_pa_request_rec.effective_date,sysdate);
1683   hr_utility.set_location('Entering  ' || l_proc,10);
1684   --
1685   If p_pa_request_rec.to_position_id is null then
1686     l_position_id :=  p_pa_request_rec.from_position_id;
1687   Else
1688     l_position_id :=  p_pa_request_rec.to_position_id;
1689   End if;
1690   for bus_gp in c_bus_gp(l_position_id) loop
1691     l_bus_gp := bus_gp.business_group_id;
1692   End loop;
1693   --
1694   -- Agency Code
1695   -- if this is a change in data element and the pa_req ei agency code is not null,
1696   -- then take the agency code from the extra info for the action. If this is a realignment,
1697   -- and the pa_req_ei agency code is not null, then take the agency code from the extra info for the action.
1698   -- Otherwise, use the agency code associated with l_position_id.
1699   --
1700   if  p_pa_request_rec.noa_family_code = 'CHG_DATA_ELEMENT'  then
1701       for c_ei_rec in c_pa_request_extra_info('GHR_US_PAR_CHG_DATA_ELEMENT') loop
1702          l_agency_code   :=  c_ei_rec.rei_information4;
1703       end loop;
1704   elsif p_pa_request_rec.noa_family_code = 'REALIGNMENT' then
1705       for c_ei_rec in c_pa_request_extra_info('GHR_US_PAR_REALIGNMENT') loop
1706          l_agency_code   :=  c_ei_rec.rei_information10;
1707       end loop;
1708   end if;
1709   if  p_pa_request_rec.noa_family_code = 'CHG_DATA_ELEMENT'  and
1710 	l_agency_code is not null  then
1711       p_agency_code := l_agency_code;
1712   elsif
1713 	p_pa_request_rec.noa_family_code = 'REALIGNMENT' and
1714 	l_agency_code is not null then
1715 	p_agency_code := l_agency_code;
1716   else
1717   	p_agency_code  :=  ghr_api.get_position_agency_code_pos
1718                            (p_position_id       =>   l_position_id
1719                            ,p_business_group_id =>   l_bus_gp
1720                            ,p_effective_date    => p_pa_request_rec.effective_date
1721                            );
1722   end if;
1723   hr_utility.set_location('Leaving ' ||l_proc,40);
1724 end SF52_br_extra_info;
1725 
1726 --
1727 -- *****************************
1728 -- procedure Process_Sf52_Extra_Info
1729 -- *****************************
1730 --
1731 
1732 -- This procedure Updates the various Record Groups with Data from the SF52 Form.
1733 
1734 procedure Process_Sf52_Extra_Info
1735 (p_pa_request_rec             in     ghr_pa_requests%rowtype,
1736  p_asg_sf52                   in out nocopy ghr_api.asg_sf52_type,
1737  p_per_sf52                   in out nocopy ghr_api.per_sf52_type,
1738  p_per_group1                 in out nocopy ghr_api.per_group1_type,
1739  p_per_scd_info               in out nocopy ghr_api.per_scd_info_type,
1740  p_pos_grp2                   in out nocopy ghr_api.pos_grp2_type,
1741  p_pos_grp1                   in out nocopy ghr_api.pos_grp1_type,
1742  p_loc_info                   in out nocopy ghr_api.loc_info_type,
1743  p_recruitment_bonus	      in out nocopy ghr_api.recruitment_bonus_type ,
1744  p_relocation_bonus           in out nocopy ghr_api.relocation_bonus_type,
1745  p_student_loan_repay         in out nocopy ghr_api.student_loan_repay_type,
1746  p_extra_info_rec	            in out nocopy ghr_api.extra_info_rec_type,
1747  p_valid_grade  in out  nocopy ghr_api.pos_valid_grade_type)
1748  is
1749 --
1750 l_noa_code		      ghr_nature_of_actions.code%type;
1751 l_proc                  varchar2(70) := 'Process_Sf52_Extra_Info';
1752 l_person_type           per_person_types.system_person_type%type;
1753 
1754 --
1755 
1756 
1757  cursor    c_person_type is
1758    select  ppt.system_person_type
1759    from    per_person_types  ppt,
1760            per_all_people_f      ppf
1761    where   ppf.person_id       =  p_pa_request_rec.person_id
1762    and     ppt.person_type_id  =  ppf.person_type_id
1763    and     g_effective_date
1764    between ppf.effective_start_date
1765    and     ppf.effective_end_date;
1766 
1767 /*Cursor c_pa_request_extra_info (l_information_type varchar2) is
1768   Select rei_information4,rei_information8
1769   from   ghr_pa_request_extra_info
1770   where  pa_request_id    =  p_pa_request_rec.pa_request_id
1771   and    information_type =  l_information_type; */
1772 --
1773 /*l_payroll_office_id       ghr_pa_request_extra_info.rei_information4%type;
1774 l_pos_org                 ghr_pa_request_extra_info.rei_information8%type;*/
1775 l_student_loan_repay       ghr_api.student_loan_repay_type;
1776 
1777 --Bug  6881863
1778 l_calc_table_id        pay_user_tables.user_table_id%type;
1779 --
1780 
1781 Begin
1782 
1783   g_effective_date           :=  nvl(p_pa_request_rec.effective_date,sysdate);
1784 
1785 /*l_payroll_office_id          := p_pos_grp1.payroll_office_id;
1786 l_pos_org                    := p_pos_grp1.positions_organization;*/
1787 l_student_loan_repay := p_student_loan_repay;
1788 
1789   hr_utility.set_location('Entering ' ||l_proc,5);
1790 
1791 --    **********************
1792 --    Assignment SF52  Extra Info
1793 --     **********************
1794 --
1795   -- FWFA Changes.
1796   If P_pa_request_rec.To_Step_Or_Rate      is not null  or
1797      P_pa_request_rec.Tenure                is not null or
1798      P_pa_request_rec.Annuitant_Indicator   is not null or
1799      P_pa_request_rec.Pay_Rate_Determinant  is not null or
1800      p_pa_request_rec.to_pay_table_identifier is not null
1801    then
1802 --
1803 --
1804     hr_utility.set_location(l_proc,10);
1805 
1806 --
1807     hr_utility.set_location('ASG FLAG ' || p_asg_sf52.asg_sf52_flag,1);
1808     If p_pa_request_rec.to_step_or_rate is not null then
1809       If P_pa_request_rec.to_step_or_rate <>
1810         nvl(p_asg_sf52.step_or_rate,hr_api.g_varchar2) then
1811         hr_utility.set_location(l_proc,20);
1812         p_Asg_sf52.Asg_sf52_flag       := 'Y';
1813         p_Asg_Sf52.Step_Or_Rate        :=  P_pa_request_rec.to_Step_Or_Rate;
1814       End if;
1815     End if;
1816 --
1817     hr_utility.set_location('ASG FLAG ' || p_asg_sf52.asg_sf52_flag,2);
1818     hr_utility.set_location('old tenure  ' || p_asg_sf52.tenure,2);
1819     hr_utility.set_location('new tenure  ' || p_pa_request_rec.tenure,2);
1820     hr_utility.set_location('old ann ind  ' || p_asg_sf52.annuitant_indicator,2);
1821 
1822 
1823     If p_pa_request_rec.tenure is not null then
1824        If P_pa_request_rec.Tenure        <>
1825          nvl(p_asg_sf52.tenure,hr_api.g_varchar2) then
1826          hr_utility.set_location(l_proc,25);
1827          p_asg_sf52.asg_sf52_flag        := 'Y';
1828          P_Asg_Sf52.Tenure               :=  P_pa_request_rec.Tenure ;
1829        End if;
1830     End if;
1831 --
1832     hr_utility.set_location('ASG FLAG ' || p_asg_sf52.asg_sf52_flag,3);
1833 
1834     If p_pa_request_rec.annuitant_indicator is not null then
1835       If P_pa_request_rec.Annuitant_Indicator <>
1836         nvl(p_asg_sf52.annuitant_indicator,hr_api.g_varchar2)then
1837         hr_utility.set_location(l_proc,30);
1838         p_asg_sf52.asg_sf52_flag        := 'Y';
1839         P_Asg_Sf52.Annuitant_Indicator  := P_pa_request_rec.Annuitant_Indicator;
1840       End if;
1841     End if;
1842 --
1843     hr_utility.set_location('ASG FLAG ' || p_asg_sf52.asg_sf52_flag,4);
1844 
1845     If p_pa_request_rec.pay_rate_determinant is not null then
1846       If P_pa_request_rec.Pay_Rate_Determinant<>
1847         nvl(p_asg_sf52.pay_rate_determinant,hr_api.g_varchar2) then
1848         hr_utility.set_location(l_proc,35);
1849         p_asg_sf52.asg_sf52_flag         := 'Y';
1850         p_Asg_Sf52.Pay_Rate_Determinant  := P_pa_request_rec.Pay_Rate_Determinant;
1851       End if;
1852     End if;
1853    hr_utility.set_location('ASG FLAG ' || p_asg_sf52.asg_sf52_flag,5);
1854   End if;
1855 
1856   If nvl(P_pa_request_rec.work_schedule,hr_api.g_varchar2) <>
1857         nvl(p_asg_sf52.work_schedule,hr_api.g_varchar2) then
1858         hr_utility.set_location(l_proc,35);
1859         p_asg_sf52.asg_sf52_flag         := 'Y';
1860         p_Asg_Sf52.work_schedule  := P_pa_request_rec.work_schedule;
1861   End if;
1862 
1863     hr_utility.set_location('ASG FLAG ' || p_asg_sf52.asg_sf52_flag,6);
1864 
1865   If nvl(P_pa_request_rec.part_time_hours,hr_api.g_number) <>
1866         nvl(p_asg_sf52.part_time_hours,hr_api.g_number) then
1867         hr_utility.set_location(l_proc,35);
1868         p_asg_sf52.asg_sf52_flag         := 'Y';
1869         p_Asg_Sf52.part_time_hours   := P_pa_request_rec.part_time_hours;
1870   End if;
1871  -- 809503
1872   for person_type_rec in c_person_type loop
1873      IF person_type_rec.system_person_type  = 'EX_EMP' and
1874        p_pa_request_rec.noa_family_code in ('CONV_APP','APP','APPT_TRANS') THEN
1875        p_asg_sf52.asg_sf52_flag := 'Y';
1876      END IF;
1877   end loop;
1878 
1879    hr_utility.set_location('ASG FLAG ' || p_asg_sf52.asg_sf52_flag,6);
1880     If p_pa_request_rec.to_pay_table_identifier is not null then
1881       If P_pa_request_rec.to_pay_table_identifier <>
1882         nvl(p_asg_sf52.calc_pay_table,hr_api.g_number)then
1883         hr_utility.set_location(l_proc,30);
1884         p_asg_sf52.asg_sf52_flag        := 'Y';
1885         P_Asg_Sf52.calc_pay_table  := P_pa_request_rec.to_pay_table_identifier;
1886       End if;
1887     End if;
1888 
1889     -- Added for the bug # 6881863
1890     -- to fetch the pay table identifier from position if it getting as NULL if PRD is K or J
1891     IF p_pa_request_rec.to_pay_table_identifier is null and NVL(p_pa_request_rec.pay_rate_determinant,'X') in ('K','J') then
1892        l_calc_table_id := ghr_pay_calc.get_user_table_id(p_position_id => p_pa_request_rec.to_position_id,
1893 	                                                p_effective_date => p_pa_request_rec.effective_date);
1894        --Bug# 13587903, added below if condition not to update calc pay table every time
1895        IF nvl(p_asg_sf52.calc_pay_table,hr_api.g_number) <> l_calc_table_id THEN
1896 		hr_utility.set_location(l_proc,40);
1897 		p_asg_sf52.asg_sf52_flag   := 'Y';
1898 		P_Asg_Sf52.calc_pay_table  := l_calc_table_id;
1899        END IF; --Bug# 13587903
1900     END IF;
1901     -- 6881863
1902     hr_utility.set_location('ASG FLAG ' || p_asg_sf52.asg_sf52_flag,7);
1903 
1904 
1905 
1906 --
1907 --  ********************
1908 -- Additional Location DDF
1909 --  ********************
1910   p_Loc_Info.duty_station_id             := to_char(p_pa_request_rec.duty_station_id);
1911 
1912 
1913 --
1914 --    **********************
1915 --    Person  SF52  Extra Info
1916 --     **********************
1917 --
1918   If P_pa_request_rec.Citizenship           is not null or
1919      P_pa_request_rec.Veterans_Preference   is not null or
1920      P_pa_request_rec.Veterans_Pref_for_rif is not null or
1921      P_pa_request_rec.Veterans_Status       is not null then
1922     hr_utility.set_location(l_proc,55);
1923 --
1924 --
1925     If p_pa_request_rec.citizenship is not null then
1926       If p_pa_request_rec.Citizenship  <> nvl(p_per_sf52.citizenship,hr_api.g_varchar2) then
1927         hr_utility.set_location(l_proc,65);
1928         P_Per_sf52.Per_Sf52_Flag      := 'Y';
1929         P_Per_sf52.Citizenship        := P_pa_request_rec.Citizenship;
1930       End if;
1931     End if;
1932 --
1933   If p_pa_request_rec.veterans_preference is not null then
1934     If P_pa_request_rec.Veterans_Preference <>
1935       nvl(p_per_sf52.veterans_preference,hr_api.g_varchar2) then
1936       hr_utility.set_location(l_proc,70);
1937       P_Per_sf52.Per_Sf52_Flag       := 'Y';
1938       P_Per_sf52.Veterans_Preference := P_pa_request_rec.Veterans_Preference;
1939     End if;
1940   End if;
1941 
1942   If p_pa_request_rec.veterans_pref_for_rif is not null then
1943     If P_pa_request_rec.Veterans_Pref_for_rif <>
1944       nvl(p_per_sf52.veterans_preference_for_rif,hr_api.g_varchar2) then
1945       hr_utility.set_location(l_proc,75);
1946       P_Per_sf52.Per_Sf52_Flag               := 'Y';
1947       P_Per_sf52.Veterans_Preference_For_Rif := P_pa_request_rec.Veterans_Pref_for_rif;
1948     End if;
1949   End if;
1950 
1951   If p_pa_request_rec.veterans_status is not null then
1952     If P_pa_request_rec.Veterans_Status <>
1953       nvl(p_per_sf52.veterans_status,hr_api.g_varchar2)then
1954       hr_utility.set_location(l_proc,80);
1955       P_Per_sf52.Per_Sf52_Flag      := 'Y';
1956       P_Per_sf52.Veterans_Status    := P_pa_request_rec.Veterans_Status;
1957     End if;
1958   End if;
1959 --
1960 End if;
1961 
1962 --
1963 --    **********************
1964 --    per_scd extra info
1965 --     **********************
1966 
1967 If p_pa_request_rec.service_comp_date is not null then
1968   hr_utility.set_location(l_proc,85);
1969 
1970   hr_utility.set_location(l_proc,90);
1971   If fnd_date.date_to_canonical(p_pa_request_rec.service_comp_date)
1972      <> nvl(p_per_scd_info.scd_leave,fnd_date.date_to_canonical(hr_api.g_date)) then
1973     hr_utility.set_location(l_proc,95);
1974     p_per_scd_info.scd_leave          := fnd_date.date_to_canonical(p_pa_request_rec.service_comp_date);
1975     p_per_scd_info.per_scd_info_flag  := 'Y';
1976   End if;
1977  End if;
1978 
1979 --
1980 --
1981 --    **********************
1982 --    Position Group1 Extra Info
1983 --     **********************
1984 --
1985 -- JH Add part time Hours
1986   /*if p_pa_request_rec.noa_family_code = 'REALIGNMENT' then
1987   hr_utility.set_location('Inside PRUP realign check'||p_pa_request_rec.noa_family_code,12345);
1988       for c_ei_rec in c_pa_request_extra_info('GHR_US_PAR_REALIGNMENT') loop
1989          If c_ei_rec.rei_information4 is not null then
1990 	 l_payroll_office_id   :=  c_ei_rec.rei_information4;
1991 	 end if;
1992 	 If c_ei_rec.rei_information8 is not null then
1993 	 l_pos_org             :=  c_ei_rec.rei_information8;
1994 	 end if;
1995       end loop;
1996     hr_utility.set_location('Inside PRUP payroll check'||l_payroll_office_id,12345);
1997     p_pos_grp1.payroll_office_id := l_payroll_office_id;
1998 
1999     hr_utility.set_location('Inside PRUP pos org check'||l_pos_org,12345);
2000     p_pos_grp1.positions_organization := l_pos_org;
2001   end if;*/
2002 
2003   If 	P_pa_request_rec.to_Occ_Code		      	is not null or
2004 	P_pa_request_rec.Bargaining_Unit_Status	 	is not null or
2005 	P_pa_request_rec.Work_Schedule		 	is not null or
2006 	P_pa_request_rec.Functional_Class	 	      is not null or
2007 	P_pa_request_rec.FLSA_Category		 	is not null or
2008 	P_pa_request_rec.Supervisory_Status		      is not null or
2009       P_pa_request_rec.part_time_hours			is not null  then
2010     hr_utility.set_location(l_proc,95);
2011 --
2012 --
2013 	-- Bug 3226555 Commented below code as they can never be equal. It was unnecessarily inserting a
2014 	-- row into the history for the table PER_POSITIONS_EXTRA_INFO and thereby making the Position
2015 	-- status as invalid when cancellation to any action was done.
2016  /*   If p_pa_request_rec.to_occ_code is not null then
2017       If P_pa_request_rec.to_Occ_Code <>
2018         nvl(p_pos_grp1.occupation_category_code,hr_api.g_varchar2) then
2019         hr_utility.set_location(l_proc,105);
2020         P_Pos_grp1.Pos_Grp1_Flag     := 'Y';
2021         P_Pos_grp1.Occupation_Category_Code := P_pa_request_rec.to_Occ_Code;
2022       End if;
2023     End if; */
2024 
2025     If p_pa_request_rec.bargaining_unit_status is not null then
2026       If P_pa_request_rec.Bargaining_Unit_Status <>
2027         nvl(p_pos_grp1.bargaining_unit_status,hr_api.g_varchar2) then
2028         hr_utility.set_location(l_proc,110);
2029         P_Pos_grp1.Pos_Grp1_Flag     := 'Y';
2030         P_Pos_grp1.Bargaining_Unit_Status := P_pa_request_rec.Bargaining_Unit_Status;
2031       End if;
2032     End if;
2033 
2034 -- JH removing comments so position is updated for WS and adding PTH update
2035 -- Bugs 773851, 773795
2036       If p_pa_request_rec.work_schedule is not null then
2037       If P_pa_request_rec.Work_Schedule <>
2038         nvl(p_pos_grp1.work_schedule,hr_api.g_varchar2) then
2039         hr_utility.set_location(l_proc,115);
2040         hr_utility.set_location('JH Rec WS = ' || P_pa_request_rec.work_schedule,115);
2041         hr_utility.set_location('JH Posn Grp1 WS = ' || p_pos_grp1.work_schedule,115);
2042         P_Pos_grp1.Pos_Grp1_Flag     := 'Y';
2043         P_Pos_grp1.Work_Schedule := P_pa_request_rec.Work_Schedule;
2044         hr_utility.set_location('JH Update WS = ' || p_pos_grp1.work_schedule,115);
2045       End if;
2046     End if;
2047 
2048 -- JH Hard coded to pass null if WS is F, G, B, I, J.
2049      If p_pa_request_rec.part_time_hours is not null then
2050       If P_pa_request_rec.part_time_hours <>
2051         nvl(p_pos_grp1.part_time_hours,hr_api.g_number) then
2052         hr_utility.set_location(l_proc,117);
2053         hr_utility.set_location('JH Rec PTH = ' || P_pa_request_rec.part_time_hours,117);
2054         hr_utility.set_location('JH Posn Grp1 PTH = ' || p_pos_grp1.part_time_hours,117);
2055         P_Pos_grp1.Pos_Grp1_Flag     := 'Y';
2056         P_Pos_grp1.part_time_hours := P_pa_request_rec.part_time_hours;
2057         hr_utility.set_location('JH Update PTH = ' || p_pos_grp1.part_time_hours,117);
2058       End if;
2059     Elsif P_Pos_grp1.Work_Schedule in ('F', 'G', 'B', 'I', 'J') Then
2060         P_Pos_grp1.part_time_hours := null;
2061     End if;
2062 -- JH End changes
2063 
2064     If p_pa_request_rec.functional_class is not null then
2065       If P_pa_request_rec.Functional_Class  <>
2066         nvl(p_pos_grp1.functional_class,hr_api.g_varchar2) then
2067         hr_utility.set_location(l_proc,120);
2068         P_Pos_grp1.Pos_Grp1_Flag     := 'Y';
2069         P_Pos_grp1.Functional_Class := P_pa_request_rec.Functional_Class;
2070       End if;
2071     End if;
2072 
2073     If p_pa_request_rec.flsa_category is not null then
2074       If P_pa_request_rec.FLSA_Category <>
2075         nvl(p_pos_grp1.flsa_category,hr_api.g_varchar2) then
2076         hr_utility.set_location(l_proc,125);
2077         P_Pos_grp1.Pos_Grp1_Flag     := 'Y';
2078         P_Pos_grp1.FLSA_Category := P_pa_request_rec.FLSA_Category;
2079       End if;
2080     End if;
2081 
2082     If p_pa_request_rec.supervisory_status is not null then
2083       If P_pa_request_rec.Supervisory_Status <>
2084         nvl(p_pos_grp1.supervisory_status,hr_api.g_varchar2) then
2085         hr_utility.set_location(l_proc,130);
2086         P_Pos_grp1.Pos_Grp1_Flag     := 'Y';
2087         P_Pos_grp1.Supervisory_Status := P_pa_request_rec.Supervisory_Status;
2088       End if;
2089     End if;
2090 
2091   End If;
2092 
2093 --
2094 --    **********************
2095 --    Position Group2 Extra Info
2096 --     **********************
2097 --
2098   If  P_pa_request_rec.Appropriation_Code1	 	is not null or
2099 	P_pa_request_rec.Appropriation_Code2	 	is not null or
2100       p_pa_request_rec.position_occupied              is not null then  --*
2101 --
2102      hr_utility.set_location(l_proc,135);
2103 --
2104     If p_pa_request_rec.position_occupied is not null then
2105       If p_pa_request_rec.position_occupied <> nvl(p_pos_grp2.position_occupied,hr_api.g_varchar2) then
2106         hr_utility.set_location(l_proc,145);
2107         P_Pos_grp2.Pos_grp2_flag          :=  'Y';
2108         p_pos_grp2.position_occupied      :=  p_pa_request_rec.position_occupied;
2109       End if;
2110     End if;
2111 
2112     If p_pa_request_rec.appropriation_code1 is not null then
2113       If P_pa_request_rec.Appropriation_Code1 <>  nvl(p_pos_grp2.appropriation_code1,hr_api.g_varchar2) then
2114         hr_utility.set_location(l_proc,150);
2115         P_Pos_grp2.Pos_grp2_flag    :=  'Y';
2116         P_Pos_grp2.Appropriation_Code1 := P_pa_request_rec.Appropriation_Code1;
2117       End if;
2118     End if;
2119 
2120 --
2121     If p_pa_request_rec.appropriation_code2 is not null then
2122       If p_pa_request_rec.Appropriation_Code2 <> nvl(p_pos_grp2.appropriation_code2,hr_api.g_varchar2) then
2123         hr_utility.set_location(l_proc,155);
2124         P_Pos_grp2.Pos_grp2_flag    :=  'Y';
2125         P_Pos_grp2.Appropriation_Code2:= P_pa_request_rec.Appropriation_Code2;
2126       End if;
2127     End if;
2128 --
2129   End if;
2130 
2131 --    ************************
2132 --    Position Valid Grade EIT
2133 --    ************************
2134 -- If Grade is changed, then need to update it to Position Bug 2414903
2135 	IF p_pa_request_rec.to_grade_id IS NOT NULL THEN
2136 		IF p_pa_request_rec.to_grade_id <> NVL(to_number(p_valid_grade.valid_grade),hr_api.g_number) THEN
2137 			p_valid_grade.pos_valid_grade_flag := 'Y';
2138 			p_valid_grade.valid_grade := p_pa_request_rec.to_grade_id;
2139 		END IF;
2140 	END IF;
2141 
2142 
2143 --    *****************
2144 --    Recruitment Bonus
2145 --    *****************
2146 --
2147 	If  nvl(p_pa_request_rec.first_noa_code,hr_api.g_varchar2) = '815' then
2148          hr_utility.set_location(l_proc,165);
2149         p_recruitment_bonus.p_recruitment_bonus := p_pa_request_rec.award_amount;
2150 		  p_recruitment_bonus.p_percentage        := p_pa_request_rec.award_percentage;
2151 	END IF;
2152 --
2153 --
2154 --
2155 --    ***************
2156 --    Relocation Bonus
2157 --    ***************
2158 --
2159 	If nvl(p_pa_request_rec.first_noa_code,hr_api.g_varchar2) = '816' then
2160         hr_utility.set_location(l_proc,170);
2161         p_relocation_bonus.p_relocation_bonus := p_pa_request_rec.award_amount;
2162 		  p_relocation_bonus.p_percentage        := p_pa_request_rec.award_percentage;
2163 	End if;
2164 --
2165 --
2166 --    ***************
2167 --    Student Loan Repayment
2168 --    ***************
2169 --
2170 	If nvl(p_pa_request_rec.first_noa_code,hr_api.g_varchar2) = '817' then
2171         hr_utility.set_location(l_proc,170);
2172         l_student_loan_repay.p_amount := p_pa_request_rec.award_amount;
2173 	p_student_loan_repay          := l_student_loan_repay;
2174 	End if;
2175 --
2176 --
2177 --
2178 EXCEPTION
2179 WHEN OTHERS THEN
2180 p_student_loan_repay := l_student_loan_repay;
2181 raise;
2182 
2183 End Process_Sf52_Extra_Info;
2184 
2185 --
2186 --  **********************************************************
2187 --  Process_non_SF-52_Extra_Info
2188 --  **********************************************************
2189 --
2190 PROCEDURE  Process_Non_Sf52_Extra_Info
2191 --
2192 (p_pa_request_rec			in out nocopy ghr_pa_requests%rowtype,
2193  p_generic_ei_rec             in     ghr_pa_request_extra_info%rowtype,
2194  p_per_group1		     	in out nocopy ghr_api.per_group1_type,
2195  p_per_scd_info               in out nocopy  ghr_api.per_scd_info_type,
2196  p_pos_grp2                   in out nocopy ghr_api.pos_grp2_type,
2197  p_pos_grp1                   in out nocopy ghr_api.pos_grp1_type,
2198  p_per_uniformed_services	in out nocopy ghr_api.per_uniformed_services_type,
2199  p_per_conversions            in out nocopy ghr_api.per_conversions_type,
2200  -- 4352589 BEN_EIT Changes
2201  p_per_benefit_info	      in out nocopy ghr_api.per_benefit_info_type,
2202  p_asg_non_sf52			in out nocopy ghr_api.asg_non_sf52_type,
2203  p_per_separate_Retire 		in out nocopy ghr_api.per_sep_retire_type,
2204  p_asg_nte_dates			in out nocopy ghr_api.asg_nte_dates_type,
2205   p_asg_detail_info		IN OUT nocopy ghr_api.asg_detail_info_type, --Bug# 8653508
2206  p_per_probations		      in out nocopy ghr_api.per_probations_type,
2207  p_per_retained_grade		in out nocopy ghr_api.per_retained_grade_type,
2208  --Bug#4486823 RRR Changes
2209  p_per_service_oblig        in out nocopy ghr_api.per_service_oblig_type,
2210  p_within_grade_increase	in out nocopy ghr_api.within_grade_increase_type,
2211  p_gov_awards                 in out nocopy ghr_api.government_awards_type,
2212  p_conduct_performance        in out nocopy ghr_api.conduct_performance_type,
2213  p_agency_sf52			in out nocopy ghr_api.agency_sf52_type,
2214  p_recruitment_bonus          in out nocopy ghr_apI.recruitment_bonus_type,
2215  p_relocation_bonus           in out nocopy ghr_apI.relocation_bonus_type,
2216  p_student_loan_repay         in out nocopy ghr_api.student_loan_repay_type,
2217  --Pradeep
2218  p_mddds_special_pay      in out nocopy ghr_api.mddds_special_pay_type,
2219   p_premium_pay_ind      in out nocopy ghr_api.premium_pay_ind_type,
2220 
2221  p_par_term_retained_grade    in out nocopy ghr_api.par_term_retained_grade_type,
2222  p_entitlement                in out nocopy ghr_api.entitlement_type,
2223  -- Bug#2759379 Added Fegli record
2224  p_fegli                      in out nocopy ghr_api.fegli_type,
2225  p_foreign_lang_prof_pay      in out nocopy ghr_api.foreign_lang_prof_pay_type,
2226 -- Bug#3385386 Added FTA record
2227  p_imm_fta                    in out nocopy ghr_api.fta_type,
2228  p_edp_pay                    in out nocopy ghr_api.edp_pay_type,
2229  p_hazard_pay                 in out nocopy ghr_api.hazard_pay_type,
2230  p_health_benefits            in out nocopy ghr_api.health_benefits_type,
2231  p_danger_pay                 in out nocopy ghr_api.danger_pay_type,
2232  p_imminent_danger_pay        in out nocopy ghr_api.imminent_danger_pay_type,
2233  p_living_quarters_allow      in out nocopy ghr_api.living_quarters_allow_type,
2234  p_post_diff_amt              in out nocopy ghr_api.post_diff_amt_type,
2235  p_post_diff_percent          in out nocopy ghr_api.post_diff_percent_type,
2236  p_sep_maintenance_allow      in out nocopy ghr_api.sep_maintenance_allow_type,
2237  p_supplemental_post_allow    in out nocopy ghr_api.supplemental_post_allow_type,
2238  p_temp_lodge_allow           in out nocopy ghr_api.temp_lodge_allow_type,
2239  p_premium_pay                in out nocopy ghr_api.premium_pay_type,
2240  p_retirement_annuity         in out nocopy ghr_api.retirement_annuity_type,
2241  p_severance_pay              in out nocopy ghr_api.severance_pay_type,
2242  p_thrift_saving_plan         in out nocopy ghr_api.thrift_saving_plan,
2243  p_retention_allow_review     in out nocopy ghr_api.retention_allow_review_type,
2244  p_health_ben_pre_tax         in out nocopy ghr_api.health_ben_pre_tax_type,
2245  p_race_ethnic_info	      in out nocopy ghr_api.per_race_ethnic_type, -- Bug 4724337 Race or National Origin changes
2246  p_ipa_benefits_cont          in out nocopy ghr_api.per_ipa_ben_cont_info_type,
2247  p_retirement_info            in out nocopy ghr_api.per_retirement_info_type,
2248    --BUG # 13571004 added TSP Roth
2249  p_tsp_roth                   in out nocopy ghr_api.tsp_roth_type,
2250  --BUG # 14276354 added new Segments to Per Group2
2251  p_per_group2		      in out nocopy ghr_api.per_group2_type --BUG # 14276354
2252 )
2253 --
2254 IS
2255   --
2256   -- Declare local variables
2257 
2258   l_proc                      varchar2(70) := 'Process_non_sf52_extra_info';
2259   l_noa_code                  ghr_nature_of_actions.code%type;
2260   l_noa_id                    ghr_nature_of_actions.nature_of_action_id%type;
2261   l_information_type          ghr_pa_request_info_types.information_type%type;
2262   l_pa_request_ei_rec         ghr_pa_request_extra_info%rowtype;
2263   p_extra_info_agency_rec     ghr_api.extra_info_rec_type;
2264   l_session                   ghr_history_api.g_session_var_type;
2265   l_multiple_error_flag       boolean;
2266   -- Bug#5668878
2267   l_psi                       VARCHAR2(10);
2268   --
2269   -- Declare cursors
2270   --
2271   -- Bug#3941541 Added the effective date condition.
2272    Cursor c_info_types is
2273      Select  pit.information_type
2274      from    ghr_pa_request_info_types  pit,
2275              ghr_noa_families           nfa,
2276              ghr_families               fam
2277      where   nfa.nature_of_action_id  = p_pa_request_rec.first_noa_id
2278      and     nfa.noa_family_code      = fam.noa_family_code
2279      and     fam.pa_info_type_flag    = 'Y'
2280      and     pit.noa_family_code      = fam.noa_family_code
2281      and     pit.information_type     like 'GHR_US%'
2282      and     p_pa_request_rec.effective_date BETWEEN NVL(nfa.start_date_active,p_pa_request_rec.effective_date)
2283 	                                             AND NVL(nfa.end_date_active,p_pa_request_rec.effective_date);
2284   --
2285     Cursor c_pa_request_extra_info is
2286        Select *
2287        from   ghr_pa_request_extra_info
2288        where  pa_request_id    =  p_pa_request_rec.pa_request_id
2289        and    information_type =  l_information_type;
2290 
2291        --Bug # 5584845
2292      Cursor c_pa_term_rg_extra_info is
2293         Select *
2294 	from   ghr_pa_request_extra_info
2295         where  pa_request_id    =  p_pa_request_rec.pa_request_id
2296         and    information_type =  l_information_type
2297 	and    fnd_date.canonical_to_date(rei_information6) = (select MIN (NVL(fnd_date.canonical_to_date(rei_information6),p_pa_request_rec.effective_date) )
2298                                                                FROM   ghr_pa_request_extra_info
2299                                                                WHERE  pa_request_id = p_pa_request_rec.pa_request_id
2300                                                                AND    information_type = l_information_type);
2301 
2302 
2303 -- Bug 3260890
2304   l_office_symbol per_position_extra_info.poei_information4%type := p_pos_grp1.office_symbol;
2305   l_organization_structure_id per_position_extra_info.poei_information5%type := p_pos_grp1.organization_structure_id;
2306   l_positions_organization 	per_position_extra_info.poei_information21%type := p_pos_grp1.positions_organization;
2307   l_organization_function_code per_position_extra_info.poei_information4%type := p_pos_grp2.organization_function_code;
2308   l_personnel_office_id per_position_extra_info.poei_information3%type := p_pos_grp1.personnel_office_id;
2309   l_payroll_office_id ghr_pa_request_extra_info.rei_information4%type := p_pos_grp1.payroll_office_id;
2310   -- End Bug 3260890
2311 
2312 -- Bug# 4672772 Begin
2313 
2314 	l_old_user_status			per_assignment_status_types.user_status%type;
2315 	l_old_system_status			per_assignment_status_types.per_system_status%type;
2316 	l_old_effective_start_date  date;
2317 	l_asg_extra_info_rec		per_assignment_extra_info%rowtype;
2318 	l_user_apnt_status			per_assignment_status_types.user_status%type;
2319 	l_user_apnt_eff_date		date;
2320 
2321 	Cursor c_user_status is
2322 	select ast.user_status,
2323          ast.per_system_status,
2324          asg.effective_start_date
2325 	from
2326 		per_assignment_status_types ast,
2327 		per_all_assignments_f asg
2328     where	asg.assignment_id = p_pa_request_rec.employee_assignment_id
2329     and		ast.assignment_status_type_id = asg.assignment_status_type_id
2330     and     p_pa_request_rec.effective_date
2331     between asg.effective_start_date
2332     and     asg.effective_end_date;
2333 
2334 	CURSOR	c_user_apnt_status IS
2335 	select 	ast.user_status,asg.effective_start_date
2336 	from	per_assignment_status_types ast,
2337 			per_all_assignments_f asg
2338 	where	ast.assignment_status_type_id = asg.assignment_status_type_id
2339 	and		asg.assignment_id = p_pa_request_rec.employee_assignment_id
2340 	and 	asg.primary_flag = 'Y'
2341 	order by asg.effective_start_date;
2342 
2343 -- Bug# 4672772 End
2344 --Begin Bug# 6083404
2345     l_user_actv_apnt_status			per_assignment_status_types.user_status%type;
2346     CURSOR c_user_actv_appt IS
2347     select 	ast.user_status
2348     from	per_assignment_status_types ast,
2349             per_all_assignments_f asg
2350     where	ast.assignment_status_type_id = asg.assignment_status_type_id
2351     and		asg.assignment_id = p_pa_request_rec.employee_assignment_id
2352     and 	asg.primary_flag = 'Y'
2353     and user_status='Active Appointment';
2354 --end Bug# 6083404
2355 
2356 --Begin Bug# 10182526
2357 l_detail_nte_date	ghr_pa_requests.first_noa_information1%type;
2358       CURSOR c_detail_first_nte_date is
2359         SELECT first_noa_information1
2360         FROM ghr_pa_requests
2361         WHERE  pa_request_id = p_pa_request_rec.pa_request_id;
2362 
2363 	CURSOR c_detail_second_nte_date is
2364         SELECT second_noa_information1
2365         FROM ghr_pa_requests
2366         WHERE  pa_request_id = p_pa_request_rec.pa_request_id;
2367 --end Bug# 10182526
2368 --Begin Bug# 13942237
2369 /*l_pos_extra_info_rec     per_position_extra_info%rowtype;
2370 l_valid_grade_name   VARCHAR2(150);
2371 l_target_grade_name   VARCHAR2(150);
2372 
2373 cursor grade_id(p_grade_id in varchar2) is
2374 select NAME from PER_GRADES
2375 where GRADE_ID = to_number(p_grade_id);*/
2376 --End Bug# 13942237
2377 --
2378   --
2379   -- Declare local procedures and local functions
2380   --
2381   -- Procedure  Set_extra_info
2382   --
2383   -- This overwrites the value of the core extra information segment with
2384   -- the value from the SF52 Extra Information entered by the User, along with the Current Request
2385   --
2386   Procedure set_extra_info
2387   (p_hr_extra_info         in out nocopy   varchar2,
2388    p_ghr_extra_info        in       varchar2,
2389    p_update_flag           in out nocopy   varchar2,
2390    p_auto_populate_flag    in       varchar2 default 'N'
2391   ) is
2392   Begin
2393     If nvl(p_hr_extra_info,hr_api.g_varchar2)
2394        <>  nvl(p_ghr_extra_info,hr_api.g_varchar2) then
2395        If p_auto_populate_flag = 'Y' and
2396           l_session.noa_id_correct is null then
2397           -- since it is autopopulated the user might have made it null
2398           -- and is not a correction
2399           p_hr_extra_info   := p_ghr_extra_info;
2400 
2401        else
2402           If p_ghr_extra_info is not null then
2403              p_hr_extra_info   := p_ghr_extra_info;
2404           elsif l_session.noa_id_correct is not null then
2405             -- VR -- Bug 2356243
2406             -- In the correction action -- All the extra info considred as auto
2407             -- populated. Update core with rpa extra info even if rpa extra
2408             -- info is null
2409              p_hr_extra_info   := p_ghr_extra_info;
2410           End if;
2411        end if;
2412        p_update_flag      := 'Y';
2413     End if;
2414 
2415   End set_extra_info;
2416   --
2417   --
2418   Procedure appt_info is
2419     l_proc     varchar2(70) := 'Process_non_sf52 - App1';
2420   --
2421   Begin
2422     hr_utility.set_location('Entering ' ||l_proc,5);
2423     hr_utility.set_location('before retr info in appt-info',1);
2424 
2425   -- If a CORRECTION action is being performed, then, we cannot force the User to
2426   -- enter the Mandatory Items on the SF52, as it might already exist in the Core
2427   -- Extra Information. In such cases , fetch the value from the CORE Extra information,
2428   -- if it is null on the SF52 Extra Information.
2429 
2430   -- In case of a correction ,org_app_auth_code1 and 2 will still be read from the
2431   -- LA Codes 1 and 2 and they have the potential to change it during a CORRECTION.
2432 
2433     If l_session.noa_id_correct is not null then
2434        set_extra_info(p_per_group1.appointment_type ,
2435                       l_pa_request_ei_rec.rei_information3,
2436                       p_per_group1.per_group1_flag);
2437        set_extra_info(p_per_group1.org_appointment_auth_code1,
2438                       p_pa_request_rec.first_action_la_code1,
2439                       p_per_group1.per_group1_flag);
2440        set_extra_info(p_per_group1.org_appointment_auth_code2,
2441                       p_pa_request_rec.first_action_la_code2,
2442                       p_per_group1.per_group1_flag);
2443        --Bug# 4941984(AFHR2)
2444        set_extra_info(p_per_group1.org_appointment_desc1,
2445                       p_pa_request_rec.first_action_la_desc1,
2446                       p_per_group1.per_group1_flag);
2447        set_extra_info(p_per_group1.org_appointment_desc2,
2448                       p_pa_request_rec.first_action_la_desc2,
2449                       p_per_group1.per_group1_flag);
2450        --Bug# 4941984(AFHR2)
2451     Else
2452       p_per_group1.appointment_type            :=  l_pa_request_ei_rec.rei_information3;
2453       p_per_group1.Org_appointment_auth_code1  :=  p_pa_request_rec.first_action_la_code1;
2454       p_per_group1.org_appointment_auth_code2  :=  p_pa_request_rec.first_action_la_code2;
2455       p_per_group1.org_appointment_desc1       :=  p_pa_request_rec.first_action_la_desc1;
2456       p_per_group1.org_appointment_desc2       :=  p_pa_request_rec.first_action_la_desc2;
2457       p_per_group1.per_group1_flag             :=  'Y';
2458     End if;
2459 
2460     --Begin Bug# 12557463, commented following and added in  proc ghr_scd_info
2461     /*set_extra_info(p_per_uniformed_services.creditable_military_service ,
2462                    l_pa_request_ei_rec.rei_information4,
2463                    p_per_uniformed_services.per_uniformed_services_flag, 'Y');
2464     set_extra_info(p_per_separate_retire.frozen_service,
2465                    l_pa_request_ei_rec.rei_information7,
2466                    p_per_separate_Retire.per_sep_Retire_flag, 'Y' );
2467     set_extra_info (p_per_scd_info.scd_creditable_svc_annl_leave,
2468                    l_pa_request_ei_rec.rei_information23,
2469                    p_per_scd_info.per_scd_info_flag, 'Y');
2470     End Bug# 12557463*/
2471     set_extra_info(p_asg_non_sf52.Date_Arr_Personnel_office,
2472                    l_pa_request_ei_rec.rei_information5,
2473                    p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2474     set_extra_info(p_within_grade_increase.p_date_wgi_due,
2475                    l_pa_request_ei_rec.rei_information6,
2476                    p_within_grade_increase.p_wgi_flag, 'N');
2477     set_extra_info(p_within_grade_increase.p_last_equi_incr,
2478                    l_pa_request_ei_rec.rei_information18,
2479                    p_within_grade_increase.p_wgi_flag, 'N');
2480     set_extra_info(p_per_group1.handicap_code,
2481                    l_pa_request_ei_rec.rei_information8,
2482                    p_per_group1.per_group1_flag, 'Y');
2483     set_extra_info(p_asg_non_sf52.non_disc_agmt_status,
2484                    l_pa_request_ei_rec.rei_information9,
2485                    p_per_group1.per_group1_flag, 'Y');
2486     set_extra_info(p_asg_non_sf52.parttime_indicator,
2487                    l_pa_request_ei_rec.rei_information12,
2488                    p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2489     set_extra_info(p_pos_grp1.position_working_title,
2490                    l_pa_request_ei_rec.rei_information13,
2491                    p_pos_grp1.pos_grp1_flag, 'Y');
2492     set_extra_info(p_per_separate_retire.prev_retirement_coverage,
2493                    l_pa_request_ei_rec.rei_information14,
2494                    p_per_separate_Retire.per_sep_Retire_flag, 'Y' );
2495     set_extra_info(p_asg_non_sf52.qualification_standard_waiver,
2496                    l_pa_request_ei_rec.rei_information15,
2497                    p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2498     set_extra_info(p_per_group1.race_national_origin,
2499                    l_pa_request_ei_rec.rei_information16,
2500                    p_per_group1.per_group1_flag, 'Y');
2501     set_extra_info(p_per_group1.type_of_employment,
2502                    l_pa_request_ei_rec.rei_information17,
2503                    p_per_group1.per_group1_flag, 'Y');
2504     --Begin Bug# 14514445
2505     set_extra_info(p_per_group1.promotion_eligibility_date ,
2506 		   l_pa_request_ei_rec.rei_information28,
2507 		   p_per_group1.per_group1_flag, 'Y');
2508     --End Bug# 14514445
2509     set_extra_info(p_per_separate_retire.fers_coverage,
2510                    l_pa_request_ei_rec.rei_information19,
2511                    p_per_separate_retire.per_sep_retire_flag, 'Y');
2512 
2513     --Bug # 12652438
2514     set_extra_info(p_asg_non_sf52.pay_status_userra_status,
2515                    l_pa_request_ei_rec.rei_information24,
2516                    p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2517 
2518     --Bug # 14276354
2519     set_extra_info(p_per_group2.pathways_program_start_date,
2520                    l_pa_request_ei_rec.rei_information25,
2521                    p_per_group2.per_group2_flag, 'Y');
2522     set_extra_info(p_per_group2.pathways_program_extn_date,
2523                    l_pa_request_ei_rec.rei_information26,
2524                    p_per_group2.per_group2_flag, 'Y');
2525     set_extra_info(p_per_group2.pathways_program_end_date,
2526                    l_pa_request_ei_rec.rei_information27,
2527                    p_per_group2.per_group2_flag, 'Y');
2528 
2529 
2530 
2531 
2532    --bug 4443968
2533     hr_utility.set_location('Creditable service' ||l_pa_request_ei_rec.rei_information23,0000);
2534     hr_utility.set_location('Populate flag' ||p_per_scd_info.per_scd_info_flag,3333);
2535     --
2536     --
2537     hr_utility.set_location('Leaving  ' || l_proc,20);
2538 
2539   End appt_info;
2540   --
2541   --
2542 
2543   --Begin Bug# 8724192
2544 Procedure appt_transfer_app is
2545 l_proc  varchar2(70) := 'non_sf52_extra_info - appt_transfer_app';
2546 
2547 Begin
2548 	hr_utility.set_location('Entering  ' || l_proc,5);
2549 	set_extra_info(p_per_group1.org_appointment_auth_code1,
2550 		nvl(l_pa_request_ei_rec.rei_information1,p_pa_request_rec.first_action_la_code1),p_per_group1.per_group1_flag);
2551 	set_extra_info(p_per_group1.org_appointment_desc1,
2552 		nvl(l_pa_request_ei_rec.rei_information2,p_pa_request_rec.first_action_la_desc1),p_per_group1.per_group1_flag);
2553 	set_extra_info(p_per_group1.org_appointment_auth_code2,
2554 		nvl(l_pa_request_ei_rec.rei_information3,p_pa_request_rec.first_action_la_code2),p_per_group1.per_group1_flag);
2555 	set_extra_info(p_per_group1.org_appointment_desc2,
2556 		nvl(l_pa_request_ei_rec.rei_information4,p_pa_request_rec.first_action_la_desc2),p_per_group1.per_group1_flag);
2557 
2558 	hr_utility.set_location('Leaving  ' ||l_proc,20);
2559 
2560 End appt_transfer_app;
2561 
2562 Procedure mass_transfer_nte is
2563 l_proc  varchar2(70) := 'non_sf52_extra_info - mass_transfer_nte';
2564 
2565 Begin
2566 	hr_utility.set_location('Entering  ' || l_proc,5);
2567 	p_asg_nte_dates.asg_nte_dates_flag 	:= 'Y';
2568 	p_asg_nte_dates.asg_nte_start_date := l_pa_request_ei_rec.rei_information10;
2569 	p_asg_nte_dates.assignment_nte := l_pa_request_ei_rec.rei_information11;
2570 	hr_utility.set_location('Leaving  ' ||l_proc,20);
2571 
2572 End mass_transfer_nte;
2573 --End Bug# 8724192
2574 
2575   Procedure appt_transfer is
2576     l_proc  varchar2(70) := 'non_sf52_extra_info - app_3 ';
2577 
2578   Begin
2579     hr_utility.set_location('Entering  ' || l_proc,5);
2580     --
2581     --
2582     If l_session.noa_id_correct is not null then
2583        set_extra_info(p_per_group1.agency_code_transfer_from ,
2584                       l_pa_request_ei_rec.rei_information3, p_per_group1.per_group1_flag);
2585        set_extra_info(p_per_group1.appointment_type,
2586                       l_pa_request_ei_rec.rei_information4, p_per_group1.per_group1_flag);
2587        If p_pa_request_rec.first_noa_code <> '132' then
2588          set_extra_info(p_per_group1.org_appointment_auth_code1,
2589                       p_pa_request_rec.first_action_la_code1,p_per_group1.per_group1_flag);
2590          set_extra_info(p_per_group1.org_appointment_auth_code2,
2591                       p_pa_request_rec.first_action_la_code2,p_per_group1.per_group1_flag);
2592          --Bug# 4941984(AFHR2)
2593          set_extra_info(p_per_group1.org_appointment_desc1,
2594                       p_pa_request_rec.first_action_la_desc1,p_per_group1.per_group1_flag);
2595          set_extra_info(p_per_group1.org_appointment_desc2,
2596                       p_pa_request_rec.first_action_la_desc2,p_per_group1.per_group1_flag);
2597          --Bug# 4941984(AFHR2)
2598       End if;
2599     Else
2600        p_per_group1.agency_code_transfer_from     :=  l_pa_request_ei_rec.rei_information3;
2601        p_per_group1.appointment_type              :=  l_pa_request_ei_rec.rei_information4;
2602        If p_pa_request_rec.first_noa_code <> '132' then
2603           p_per_group1.org_appointment_auth_code1    :=  p_pa_request_rec.first_action_la_code1;
2604           p_per_group1.org_appointment_auth_code2    :=  p_pa_request_rec.first_action_la_code2;
2605           --Bug# 4941984(AFHR2)
2606           p_per_group1.org_appointment_desc1         :=  p_pa_request_rec.first_action_la_desc1;
2607           p_per_group1.org_appointment_desc2         :=  p_pa_request_rec.first_action_la_desc2;
2608           --Bug# 4941984(AFHR2)
2609        End if;
2610        p_per_group1.per_group1_flag               :=  'Y';
2611     End if;
2612     hr_utility.set_location('cOre CMS ' || p_per_uniformed_services.creditable_military_service,1);
2613     hr_utility.set_location('REI 7 '  || l_pa_request_ei_rec.rei_information7,2);
2614     hr_utility.set_location('REI CMS '  || l_pa_request_ei_rec.rei_information6,2);
2615     --Begin Bug# 12557463, commented following and added in  proc ghr_scd_info
2616     --set_extra_info(p_per_uniformed_services.creditable_military_service,
2617     --               l_pa_request_ei_rec.rei_information6,
2618     --               p_per_uniformed_services.per_uniformed_services_flag);
2619     --End  Bug# 12557463
2620    hr_utility.set_location('agency code trans from ' || p_per_group1.agency_code_transfer_from,1);
2621    hr_utility.set_location('CMS '  || p_per_uniformed_services.creditable_military_service,2);
2622     set_extra_info(p_asg_non_sf52.Date_Arr_Personnel_office,
2623                    l_pa_request_ei_rec.rei_information7, p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2624     set_extra_info(p_within_grade_increase.p_date_wgi_due,
2625                    l_pa_request_ei_rec.rei_information8, p_within_grade_increase.p_wgi_flag, 'N');
2626     set_extra_info(p_within_grade_increase.p_last_equi_incr,
2627                    l_pa_request_ei_rec.rei_information20, p_within_grade_increase.p_wgi_flag, 'N');
2628     --Begin Bug# 12557463, commented following and added in  proc ghr_scd_info
2629     --set_extra_info(p_per_separate_retire.frozen_service,
2630     --               l_pa_request_ei_rec.rei_information9, p_per_separate_retire.per_sep_retire_flag, 'Y');
2631     --End  Bug# 12557463
2632     set_extra_info(p_per_group1.handicap_code,
2633                    l_pa_request_ei_rec.rei_information10, p_per_group1.per_group1_flag, 'Y');
2634     set_extra_info(p_asg_non_sf52.non_disc_agmt_status,
2635                    l_pa_request_ei_rec.rei_information11,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2636     set_extra_info(p_asg_non_sf52.parttime_indicator,
2637                    l_pa_request_ei_rec.rei_information14,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2638     set_extra_info(p_pos_grp1.position_working_title,
2639                    l_pa_request_ei_rec.rei_information15,p_pos_grp1.pos_grp1_flag, 'Y');
2640     set_extra_info(p_per_separate_retire.prev_retirement_coverage,
2641                    l_pa_request_ei_rec.rei_information16,p_per_separate_retire.per_sep_retire_flag, 'Y');
2642     set_extra_info(p_asg_non_sf52.qualification_standard_waiver,
2643                    l_pa_request_ei_rec.rei_information17,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2644     set_extra_info(p_per_group1.race_national_origin,
2645                    l_pa_request_ei_rec.rei_information18,p_per_group1.per_group1_flag, 'Y');
2646     set_extra_info(p_per_group1.type_of_employment,
2647                    l_pa_request_ei_rec.rei_information19,p_per_group1.per_group1_flag, 'Y');
2648     set_extra_info(p_per_separate_retire.fers_coverage,
2649                    l_pa_request_ei_rec.rei_information21,
2650                    p_per_separate_retire.per_sep_retire_flag, 'Y');
2651     --bug 4443968
2652     --Begin Bug# 12557463, commented following and added in  proc ghr_scd_info
2653     --set_extra_info(p_per_scd_info.scd_creditable_svc_annl_leave,
2654     --              l_pa_request_ei_rec.rei_information25, p_per_scd_info.per_scd_info_flag, 'Y');
2655      --End  Bug# 12557463
2656       --Bug # 12652438
2657     set_extra_info(p_asg_non_sf52.pay_status_userra_status,
2658                    l_pa_request_ei_rec.rei_information26,
2659                    p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2660     --Begin Bug# 14514445
2661     set_extra_info(p_per_group1.promotion_eligibility_date ,
2662 		  l_pa_request_ei_rec.rei_information27,p_per_group1.per_group1_flag, 'Y');
2663     --End Bug# 14514445
2664     hr_utility.set_location('Leaving  ' ||l_proc,20);
2665 
2666   End appt_transfer;
2667   --
2668 
2669   PROCEDURE appt_benefits IS
2670     l_proc  varchar2(70);
2671 
2672     --Bug # 12552732
2673     cursor c_get_shadow_rec(p_pa_request_id in number,
2674                             p_information_type in varchar2)
2675         is
2676 	select *
2677 	from   ghr_pa_request_ei_shadow
2678 	where  pa_request_id = p_pa_request_id
2679 	and    information_type = p_information_type;
2680 
2681     --Bug # 12562230
2682     cursor get_business_group
2683         is
2684         SELECT per.business_group_id
2685         FROM   per_all_people_f per
2686         WHERE  per.person_id = p_pa_request_rec.person_id
2687         and    p_pa_request_rec.effective_date between per.effective_start_date and per.effective_end_date;
2688 
2689     cursor get_enrollment_option (p_business_group_id in NUMBER)
2690         is
2691         SELECT ghr_ss_views_pkg.get_ele_entry_value_ason_date (eef.element_entry_id, 'Enrollment', eef.effective_start_date) enrollment
2692         FROM   pay_element_entries_f eef,
2693                pay_element_types_f elt
2694         WHERE  assignment_id = p_pa_request_rec.employee_assignment_id
2695         AND    elt.element_type_id = eef.element_type_id
2696         AND    eef.effective_start_date BETWEEN elt.effective_start_date  AND elt.effective_end_date
2697         AND    p_pa_request_rec.effective_date between eef.effective_start_date and eef.effective_end_date
2698         AND    upper(pqp_fedhr_uspay_int_utils.return_old_element_name(elt.element_name,
2699                                                                        p_business_group_id,
2700                                                                        p_pa_request_rec.effective_date)) IN  ('HEALTH BENEFITS','HEALTH BENEFITS PRE TAX');
2701 
2702 
2703 
2704     shadow_ei_rec      ghr_pa_request_ei_shadow%rowtype;
2705     l_curr_bg          per_all_people_f.business_group_id%type;
2706     l_prev_enrollment  pay_element_entry_values_f.screen_entry_value%type;
2707 
2708   BEGIN
2709     -- bug# 9680314
2710     -- bug# 10185849 removed auto update falg to stop the null value update for families CONV_APP , EXT_NTE
2711     --Bug# 11775548 reversed changes done for 10185849 and coded for FEHB_Date_temp_eligibility
2712         l_proc := 'non sf52 extra - appt_benefits';
2713 
2714 	for sh_rec in c_get_shadow_rec(p_pa_request_id => l_pa_request_ei_rec.pa_request_id,
2715                           	       p_information_type => l_pa_request_ei_rec.information_type)
2716 	loop
2717 	  shadow_ei_rec := sh_rec;
2718 	end loop;
2719 
2720 
2721         --Bug # 12562230
2722 	for curr_bg in get_business_group
2723 	loop
2724 	   l_curr_bg := curr_bg.business_group_id;
2725 	 end loop;
2726 
2727   	 for enr in  get_enrollment_option (p_business_group_id => l_curr_bg)
2728          loop
2729   	    l_prev_enrollment := enr.enrollment;
2730  	 end loop;
2731 
2732         --Begin Bug# 11775548
2733 	--Begin Bug 12562230 Modified to consider enrollment Option instead of health plan
2734 	-- and also made null value to be updated only if previous enrollment is Z and Current Enrollment is other
2735 	-- than Z
2736 	--bug# 12761010 added familiy code EXT_NTE condition
2737 	If (p_pa_request_rec.noa_family_code = 'CONV_APP' OR (p_pa_request_rec.noa_family_code = 'EXT_NTE' AND l_pa_request_ei_rec.rei_information3 IS NOT NULL))
2738 	   AND (l_prev_enrollment = 'Z' and NVL(l_pa_request_ei_rec.rei_information6,'Z') <> 'Z') THEN
2739 		set_extra_info(p_per_benefit_info.FEHB_Date_temp_eligibility,
2740                    l_pa_request_ei_rec.rei_information4,p_per_benefit_info.per_benefit_info_flag, 'Y');
2741 	ELSE
2742 		set_extra_info(p_per_benefit_info.FEHB_Date_temp_eligibility,
2743                    l_pa_request_ei_rec.rei_information4,p_per_benefit_info.per_benefit_info_flag);
2744 	END IF;
2745 	--End Bug# 11775548
2746 
2747 	--Bug # 12552732 Modified to send auto populate flag as N to not to update Null unless the user
2748 	--- Nullifies any field
2749 	if p_pa_request_rec.noa_family_code = 'APP' then
2750 	    set_extra_info(p_per_benefit_info.FEHB_Date_Eligibility_Expires,
2751                             l_pa_request_ei_rec.rei_information3,p_per_benefit_info.per_benefit_info_flag, 'Y');
2752 
2753 	   set_extra_info(p_per_benefit_info.FEHB_Date_dependent_cert_expir,
2754                           l_pa_request_ei_rec.rei_information7,p_per_benefit_info.per_benefit_info_flag, 'Y');
2755 
2756            set_extra_info(p_per_benefit_info.FEGLI_Date_Eligibility_Expires,
2757                   l_pa_request_ei_rec.rei_information10,p_per_benefit_info.per_benefit_info_flag, 'Y');
2758            --Begin Bug# 12557463, commented following and added in  proc ghr_scd_info
2759 	   /*set_extra_info(p_per_scd_info.scd_tsp,
2760                         l_pa_request_ei_rec.rei_information12,p_per_scd_info.per_scd_info_flag, 'Y');*/
2761            --End Bug# 12557463
2762     	   set_extra_info(p_per_benefit_info.TSP_Agncy_Contrib_Elig_date,
2763                    l_pa_request_ei_rec.rei_information17,p_per_benefit_info.per_benefit_info_flag,'Y');
2764 
2765 	   set_extra_info(p_per_benefit_info.TSP_Emp_Contrib_Elig_date,
2766                    l_pa_request_ei_rec.rei_information18,p_per_benefit_info.per_benefit_info_flag, 'Y');
2767 
2768 
2769         else
2770 	--Bug # 12552732 Modified to send auto populate flag as N to not to update Null unless the user
2771 	--- Nullifies any field
2772           If shadow_ei_rec.rei_information3 is NOT NULL and l_pa_request_ei_rec.rei_information3 is NULL then
2773   	     set_extra_info(p_per_benefit_info.FEHB_Date_Eligibility_Expires,
2774                             l_pa_request_ei_rec.rei_information3,p_per_benefit_info.per_benefit_info_flag, 'Y');
2775           else
2776     	     set_extra_info(p_per_benefit_info.FEHB_Date_Eligibility_Expires,
2777                             l_pa_request_ei_rec.rei_information3,p_per_benefit_info.per_benefit_info_flag, 'N');
2778           end if;
2779 
2780   	  If shadow_ei_rec.rei_information7 is NOT NULL and l_pa_request_ei_rec.rei_information7 is NULL then
2781 	     set_extra_info(p_per_benefit_info.FEHB_Date_dependent_cert_expir,
2782                             l_pa_request_ei_rec.rei_information7,p_per_benefit_info.per_benefit_info_flag, 'Y');
2783           else
2784 	     set_extra_info(p_per_benefit_info.FEHB_Date_dependent_cert_expir,
2785                           l_pa_request_ei_rec.rei_information7,p_per_benefit_info.per_benefit_info_flag, 'N');
2786           end if;
2787 
2788           If shadow_ei_rec.rei_information10 is NOT NULL and l_pa_request_ei_rec.rei_information10 is NULL then
2789 	     set_extra_info(p_per_benefit_info.FEGLI_Date_Eligibility_Expires,
2790                          l_pa_request_ei_rec.rei_information10,p_per_benefit_info.per_benefit_info_flag, 'Y');
2791           else
2792 	     set_extra_info(p_per_benefit_info.FEGLI_Date_Eligibility_Expires,
2793                          l_pa_request_ei_rec.rei_information10,p_per_benefit_info.per_benefit_info_flag, 'N');
2794           end if;
2795           --Begin Bug# 12557463, commented following and added in  proc ghr_scd_info
2796           /*If shadow_ei_rec.rei_information12 is NOT NULL and l_pa_request_ei_rec.rei_information12 is NULL then
2797      	     set_extra_info(p_per_scd_info.scd_tsp,
2798                          l_pa_request_ei_rec.rei_information12,p_per_scd_info.per_scd_info_flag, 'Y');
2799           else
2800 	     set_extra_info(p_per_scd_info.scd_tsp,
2801                          l_pa_request_ei_rec.rei_information12,p_per_scd_info.per_scd_info_flag, 'N');
2802 	  end if;*/
2803 	  --End Bug# 12557463
2804 
2805           If shadow_ei_rec.rei_information17 is NOT NULL and l_pa_request_ei_rec.rei_information17 is NULL then
2806              set_extra_info(p_per_benefit_info.TSP_Agncy_Contrib_Elig_date,
2807                         l_pa_request_ei_rec.rei_information17,p_per_benefit_info.per_benefit_info_flag,'Y');
2808 	  else
2809              set_extra_info(p_per_benefit_info.TSP_Agncy_Contrib_Elig_date,
2810                         l_pa_request_ei_rec.rei_information17,p_per_benefit_info.per_benefit_info_flag,'N');
2811           end if;
2812 
2813           If shadow_ei_rec.rei_information18 is NOT NULL and l_pa_request_ei_rec.rei_information18 is NULL then
2814 	     set_extra_info(p_per_benefit_info.TSP_Emp_Contrib_Elig_date,
2815                    l_pa_request_ei_rec.rei_information18,p_per_benefit_info.per_benefit_info_flag, 'Y');
2816           else
2817 	     set_extra_info(p_per_benefit_info.TSP_Emp_Contrib_Elig_date,
2818                    l_pa_request_ei_rec.rei_information18,p_per_benefit_info.per_benefit_info_flag, 'N');
2819           end if;
2820 	end if;
2821 
2822 
2823 	-- Populating health benefits record group and flag
2824     p_health_benefits.enrollment       := l_pa_request_ei_rec.rei_information6;
2825     p_health_benefits.health_plan      := l_pa_request_ei_rec.rei_information5;
2826     p_health_benefits.temps_total_cost := l_pa_request_ei_rec.rei_information8;
2827     p_health_benefits.pre_tax_waiver   := l_pa_request_ei_rec.rei_information9;
2828 
2829     if p_health_benefits.enrollment       is not null or
2830        p_health_benefits.health_plan      is not null or
2831        p_health_benefits.temps_total_cost is not null or
2832        p_health_benefits.pre_tax_waiver is not null then
2833        p_health_benefits.health_benefits_flag := 'Y';
2834     end if;
2835 
2836 	-- Populating TSP record group
2837 	p_thrift_saving_plan.amount           := l_pa_request_ei_rec.rei_information13;
2838     p_thrift_saving_plan.rate             := l_pa_request_ei_rec.rei_information14;
2839     p_thrift_saving_plan.status           := l_pa_request_ei_rec.rei_information15;
2840     p_thrift_saving_plan.status_date      := l_pa_request_ei_rec.rei_information16;
2841     p_thrift_saving_plan.agncy_contrib_elig_date := l_pa_request_ei_rec.rei_information17;
2842     p_thrift_saving_plan.emp_contrib_elig_date := l_pa_request_ei_rec.rei_information18;
2843 
2844     if p_thrift_saving_plan.amount           is not null or
2845        p_thrift_saving_plan.rate             is not null or
2846        p_thrift_saving_plan.status           is not null or
2847        p_thrift_saving_plan.status_date      is not null then
2848        p_thrift_saving_plan.tsp_flag  := 'Y';
2849     end if;
2850 
2851       --Bug # 13571004 Added TSP Roth amount and rate
2852     p_tsp_roth.tsp_roth_401k_amount           := l_pa_request_ei_rec.rei_information19;
2853     p_tsp_roth.tsp_roth_401k_rate             := l_pa_request_ei_rec.rei_information20;
2854 
2855     if p_tsp_roth.tsp_roth_401k_amount is not null or
2856        p_tsp_roth.tsp_roth_401k_rate is not null then
2857            p_tsp_roth.tsp_roth_flag := 'Y';
2858     end if;
2859 
2860   END appt_benefits;
2861 
2862 
2863   --
2864   PROCEDURE chg_data_elm is
2865     l_proc  varchar2(70) := 'non_sf52_extra - chg_data_elm';
2866   --
2867   Begin
2868     hr_utility.set_location('Entering  ' || l_proc,5);
2869 
2870 	-- Bug#4126188 begin
2871 	IF NVL(l_pa_request_ei_rec.rei_information3,hr_api.g_varchar2) <>
2872 		NVL(p_pos_grp1.personnel_office_id,hr_api.g_varchar2) THEN
2873 		set_extra_info(p_asg_non_sf52.date_arr_personnel_office,
2874                    l_pa_request_ei_rec.rei_information5, p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2875 	END IF;
2876 	-- Bug#4126188 End
2877     set_extra_info(p_pos_grp1.personnel_office_id,
2878                    l_pa_request_ei_rec.rei_information3, p_pos_grp1.pos_grp1_flag, 'Y');
2879     hr_utility.set_location('Leaving '||l_proc,20);
2880 
2881   End chg_data_elm;
2882   --
2883   --
2884   Procedure chg_sched_hours is
2885     l_proc  varchar2(70) := 'non_sf52_extra - chg_hours';
2886 
2887   Begin
2888     hr_utility.set_location('Entering ' ||l_proc,5);
2889     set_extra_info(p_per_probations.date_prob_trial_period_begin ,
2890                    l_pa_request_ei_rec.rei_information3,p_per_probations.per_probation_flag);
2891     set_extra_info(p_per_probations.date_prob_trial_period_ends  ,
2892                    l_pa_request_ei_rec.rei_information4,p_per_probations.per_probation_flag);
2893     set_extra_info(p_within_grade_increase.p_date_wgi_due,
2894                    l_pa_request_ei_rec.rei_information5,p_within_grade_increase.p_wgi_flag);
2895     set_extra_info(p_within_grade_increase.p_date_wgi_postpone_effective,
2896                    l_pa_request_ei_rec.rei_information6,p_within_grade_increase.p_wgi_flag);
2897     set_extra_info(p_asg_non_sf52.parttime_indicator,l_pa_request_ei_rec.rei_information7,
2898                    p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2899   --Added by deenath to fix bug 4542401.
2900     IF (p_pa_request_rec.first_noa_code  IN ('781','782') OR
2901         p_pa_request_rec.second_noa_code IN ('781','782')) THEN
2902        ghr_history_fetch.fetch_element_entry_value
2903                         (p_element_name          =>  'Within Grade Increase',
2904                          p_input_value_name      =>  'Last Equivalent Increase',
2905                          p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
2906                          p_date_effective        =>  p_pa_request_rec.effective_date,
2907                          p_screen_entry_value    =>  p_within_grade_increase.p_last_equi_incr);
2908     END IF;
2909   --End added by deenath to fix bug 4542401
2910     hr_utility.set_location('Leaving ' || l_proc,20);
2911 
2912   End chg_sched_hours;
2913   --
2914   --
2915   Procedure chg_ret_plan is
2916    l_proc        varchar2(70) := 'non_sf52_extra_info - chg_ret_plan';
2917 
2918   Begin
2919     hr_utility.set_location('Entering ' ||l_proc,5);
2920     set_extra_info(p_per_uniformed_services.creditable_military_service,
2921                    l_pa_request_ei_rec.rei_information3,
2922                    p_per_uniformed_services.per_uniformed_services_flag, 'Y');
2923     -- Start Bug # 1518650
2924        p_per_separate_retire.fers_coverage       := l_pa_request_ei_rec.rei_information4;
2925        p_per_separate_retire.per_sep_retire_flag := 'Y';
2926     -- End Bug # 1518650
2927     set_extra_info(p_per_separate_retire.frozen_service,
2928                    l_pa_request_ei_rec.rei_information5,
2929                    p_per_separate_Retire.per_sep_Retire_flag, 'Y');
2930     set_extra_info(p_per_separate_retire.prev_retirement_coverage,
2931                    l_pa_request_ei_rec.rei_information6,
2932                    p_per_separate_Retire.per_sep_Retire_flag, 'Y');
2933     --Begin Bug# 14769681
2934     set_extra_info(p_per_scd_info.scd_tsp,l_pa_request_ei_rec.rei_information7,
2935                     p_per_scd_info.per_scd_info_flag, 'Y');
2936     --End Bug# 14769681
2937     hr_utility.set_location('Leaving  ' || l_proc,20);
2938 
2939   END chg_ret_plan;
2940   --
2941   --
2942   -- Begin Bug# 12557463 commented following proc chg_scd
2943   /*PROCEDURE chg_scd is
2944      l_proc   varchar2(70)  := 'non_sf52_extra - chg_scd';
2945    Begin
2946      hr_utility.set_location('Entering ' ||l_proc,5);
2947      set_extra_info(p_per_scd_info.scd_rif,l_pa_request_ei_rec.rei_information3,
2948                     p_per_scd_info.per_scd_info_flag, 'Y');
2949      set_extra_info(p_per_scd_info.scd_civilian,l_pa_request_ei_rec.rei_information4,
2950                     p_per_scd_info.per_scd_info_flag, 'Y');
2951      -- Bug 3675673
2952      set_extra_info(p_per_scd_info.scd_retirement,l_pa_request_ei_rec.rei_information8,
2953                     p_per_scd_info.per_scd_info_flag, 'Y');
2954      -- Bug 3675673
2955      set_extra_info(p_per_uniformed_services.creditable_military_service ,
2956                     l_pa_request_ei_rec.rei_information5,
2957                     p_per_uniformed_services.per_uniformed_services_flag, 'Y');
2958      set_extra_info(p_per_separate_retire.frozen_service, l_pa_request_ei_rec.rei_information6,
2959                     p_per_separate_retire.per_sep_retire_flag, 'Y');
2960      set_extra_info(p_per_separate_retire.prev_retirement_coverage,
2961                     l_pa_request_ei_rec.rei_information7,
2962                     p_per_separate_retire.per_sep_retire_flag, 'Y');
2963      --Pradeep start of the Bug 2146899
2964 	  set_extra_info(p_per_scd_info.scd_tsp,l_pa_request_ei_rec.rei_information9,
2965                     p_per_scd_info.per_scd_info_flag, 'Y');
2966      --End of Bug 2146899
2967 
2968 	  -- eHRI New Attribution Changes
2969  	  set_extra_info(p_per_scd_info.scd_ses,l_pa_request_ei_rec.rei_information10,
2970                     p_per_scd_info.per_scd_info_flag, 'Y');
2971  	  set_extra_info(p_per_scd_info.scd_spl_retirement,l_pa_request_ei_rec.rei_information11,
2972                     p_per_scd_info.per_scd_info_flag, 'Y');
2973 	-- End eHRI New Attribution Changes
2974   --bug 4443968
2975        set_extra_info (p_per_scd_info.scd_creditable_svc_annl_leave,l_pa_request_ei_rec.rei_information12,
2976                        p_per_scd_info.per_scd_info_flag, 'Y');
2977 
2978 
2979      hr_utility.set_location('Leaving  ' ||l_proc,10);
2980    End chg_scd;*/
2981    --End Bug# 12557463
2982   --
2983   --Begin bug# 14751665,15882322,15882330
2984      PROCEDURE prv_ret_info IS
2985        l_proc varchar2(70) DEFAULT 'non_sf52_extra - prv_ret_info';
2986      BEGIN
2987             hr_utility.set_location ('Entering '|| l_proc, 5);
2988 
2989             set_extra_info (p_per_separate_retire.prev_retirement_coverage, l_pa_request_ei_rec.rei_information1
2990                            , p_per_separate_retire.per_sep_retire_flag, 'Y');
2991 
2992             hr_utility.set_location ('Leaving  '|| l_proc, 10);
2993      END prv_ret_info;
2994 
2995      --End Bug# 14751665,15882322,15882330
2996   --
2997   Procedure conv_appt is
2998     l_proc  varchar2(70) := 'non_sf52_extra - conv_1';
2999   Begin
3000     hr_utility.set_location('Entering ' ||l_proc,5);
3001     If l_session.noa_id_correct is not null then
3002       set_extra_info(p_per_group1.appointment_type,
3003                      l_pa_request_ei_rec.rei_information3,p_per_group1.per_group1_flag);
3004       set_extra_info(p_per_group1.org_appointment_auth_code1,
3005                    p_pa_request_rec.first_action_la_code1,p_per_group1.per_group1_flag);
3006       set_extra_info(p_per_group1.org_appointment_auth_code2,
3007                    p_pa_request_rec.first_action_la_code2,p_per_group1.per_group1_flag);
3008       --Bug# 4941984(AFHR2)
3009       set_extra_info(p_per_group1.org_appointment_desc1,
3010               p_pa_request_rec.first_action_la_desc1,p_per_group1.per_group1_flag);
3011       set_extra_info(p_per_group1.org_appointment_desc2,
3012               p_pa_request_rec.first_action_la_desc2,p_per_group1.per_group1_flag);
3013       --Bug# 4941984(AFHR2)
3014 
3015     Else
3016       p_per_group1.appointment_type           :=   l_pa_request_ei_rec.rei_information3;
3017       p_per_group1.org_appointment_auth_code1 := p_pa_request_rec.first_action_la_code1;
3018       p_per_group1.org_appointment_auth_code2 := p_pa_request_rec.first_action_la_code2;
3019       --Bug# 4941984(AFHR2)
3020       p_per_group1.org_appointment_desc1      := p_pa_request_rec.first_action_la_desc1;
3021       p_per_group1.org_appointment_desc2      := p_pa_request_rec.first_action_la_desc2;
3022       --Bug# 4941984(AFHR2)
3023       p_per_group1.per_group1_flag            :=  'Y';
3024 
3025     End if;
3026     --Begin Bug# 12557463, commented following and added in  proc ghr_scd_info
3027     /*set_extra_info(p_per_uniformed_services.creditable_military_service,
3028                    l_pa_request_ei_rec.rei_information4,
3029                    p_per_uniformed_services.per_uniformed_services_flag, 'Y');*/
3030     --End Bug# 12557463
3031 	-- Begin Bug#4126188
3032 			set_extra_info(p_asg_non_sf52.date_arr_personnel_office,
3033 			l_pa_request_ei_rec.rei_information5,p_asg_non_sf52.asg_non_sf52_flag,'Y');
3034     -- Bug#4126188 End
3035    -- set_extra_info(p_asg_non_sf52.Date_Arr_Personnel_office  ,
3036      --              l_pa_request_ei_rec.rei_information5,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
3037     --Begin Bug# 12557463, commented following and added in  proc ghr_scd_info
3038     /*set_extra_info(p_per_separate_retire.frozen_service      ,
3039                    l_pa_request_ei_rec.rei_information6,p_per_separate_Retire.per_sep_Retire_flag, 'Y');*/
3040     --End Bug# 12557463
3041     set_extra_info(p_per_group1.handicap_code                ,
3042                    l_pa_request_ei_rec.rei_information7,p_per_group1.per_group1_flag, 'Y');
3043     set_extra_info(p_asg_non_sf52.parttime_indicator         ,
3044                    l_pa_request_ei_rec.rei_information8,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
3045     set_extra_info(p_pos_grp1.position_working_title         ,
3046                    l_pa_request_ei_rec.rei_information9,p_pos_grp1.pos_grp1_flag, 'Y');
3047     set_extra_info(p_per_separate_retire.prev_retirement_coverage ,
3048                    l_pa_request_ei_rec.rei_information10,p_per_separate_Retire.per_sep_Retire_flag, 'Y');
3049     set_extra_info(p_asg_non_sf52.qualification_standard_waiver,
3050                    l_pa_request_ei_rec.rei_information11,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
3051     set_extra_info(p_per_group1.race_national_origin,
3052                    l_pa_request_ei_rec.rei_information12,p_per_group1.per_group1_flag, 'Y');
3053     set_extra_info(p_per_group1.type_of_employment,
3054                    l_pa_request_ei_rec.rei_information13,p_per_group1.per_group1_flag, 'Y');
3055     --Begin Bug# 14514445
3056     set_extra_info(p_per_group1.promotion_eligibility_date ,
3057 		  l_pa_request_ei_rec.rei_information26,p_per_group1.per_group1_flag, 'Y');
3058     --End Bug# 14514445
3059  -- Start Bug 1318341
3060     set_extra_info(p_within_grade_increase.p_date_wgi_due    ,
3061                    l_pa_request_ei_rec.rei_information19,p_within_grade_increase.p_wgi_flag);
3062  -- End Bug 1318341
3063     set_extra_info(p_within_grade_increase.p_last_equi_incr    ,
3064                    l_pa_request_ei_rec.rei_information20,p_within_grade_increase.p_wgi_flag);
3065  -- Start Bug 2165782
3066     set_extra_info(p_per_separate_retire.fers_coverage,
3067                    l_pa_request_ei_rec.rei_information21,
3068                    p_per_separate_retire.per_sep_retire_flag, 'Y');
3069  -- Start Bug 2165782
3070     --
3071     -- the following fields has to be set to the user entered values (null if not entered)
3072     -- except for corrections for the requirement 'conversion rpa ddf update' - 13-oct-98
3073     -- Also changed it to not autopopulate
3074     --
3075     If l_session.noa_id_correct is not null then
3076        set_extra_info(p_per_conversions.date_conv_career_begins ,
3077                       l_pa_request_ei_rec.rei_information14,p_per_conversions.per_conversions_flag,'N');
3078        set_extra_info(p_per_conversions.date_conv_career_due    ,
3079                       l_pa_request_ei_rec.rei_information15,p_per_conversions.per_conversions_flag,'N');
3080        set_extra_info(p_per_conversions.date_recmd_conv_begins  ,
3081                       l_pa_request_ei_rec.rei_information16,p_per_conversions.per_conversions_flag,'N');
3082        set_extra_info(p_per_conversions.date_recmd_conv_due     ,
3083                       l_pa_request_ei_rec.rei_information17,p_per_conversions.per_conversions_flag,'N');
3084        set_extra_info(p_per_conversions.date_vra_conv_due       ,
3085                       l_pa_request_ei_rec.rei_information18,p_per_conversions.per_conversions_flag,'N');
3086     else
3087        p_per_conversions.date_conv_career_begins := l_pa_request_ei_rec.rei_information14;
3088        p_per_conversions.date_conv_career_due    := l_pa_request_ei_rec.rei_information15;
3089        p_per_conversions.date_recmd_conv_begins  := l_pa_request_ei_rec.rei_information16;
3090        p_per_conversions.date_recmd_conv_due     := l_pa_request_ei_rec.rei_information17;
3091        p_per_conversions.date_vra_conv_due       := l_pa_request_ei_rec.rei_information18;
3092        p_per_conversions.per_conversions_flag := 'Y';
3093     end if;
3094 
3095 
3096       --Bug # 14276354
3097     set_extra_info(p_per_group2.pathways_program_start_date,
3098                    l_pa_request_ei_rec.rei_information23,
3099                    p_per_group2.per_group2_flag, 'Y');
3100     set_extra_info(p_per_group2.pathways_program_extn_date,
3101                    l_pa_request_ei_rec.rei_information24,
3102                    p_per_group2.per_group2_flag, 'Y');
3103     set_extra_info(p_per_group2.pathways_program_end_date,
3104                    l_pa_request_ei_rec.rei_information25,
3105                    p_per_group2.per_group2_flag, 'Y');
3106 
3107   --
3108   /*
3109 
3110   -- The foll.  has been  removed as it is to be calculated in case of a CONV_APP
3111   --  set_extra_info(p_within_grade_increase.p_date_wgi_due    ,
3112   --                 l_pa_request_ei_rec.rei_information6,p_within_grade_increase.p_wgi_flag);
3113 
3114   */
3115     hr_utility.set_location('Leaving ' ||l_proc,10);
3116 
3117   END conv_appt;
3118   --
3119   --
3120   /* Denial WGI */
3121   --
3122   Procedure denial_wgi is
3123     l_proc  varchar2(70) := 'non_sf52_extra - denial_wgi';
3124   Begin
3125   --
3126   --
3127   -- Updating the record groups with NON SF52
3128   --
3129     hr_utility.set_location('Entering ' ||l_proc,5);
3130     If l_session.noa_id_correct is not null then
3131       set_extra_info(p_within_grade_increase.p_date_wgi_due,
3132                      l_pa_request_ei_rec.rei_information3,p_within_grade_increase.p_wgi_flag);
3133       set_extra_info(p_within_grade_increase.p_date_wgi_postpone_effective,
3134                      l_pa_request_ei_rec.rei_information4,p_within_grade_increase.p_wgi_flag);
3135     Else
3136       p_within_grade_increase.p_date_wgi_due                := l_pa_request_ei_rec.rei_information3;
3137       p_within_grade_increase.p_date_wgi_postpone_effective := l_pa_request_ei_rec.rei_information4;
3138       p_within_grade_increase.p_wgi_flag                    :=  'Y';
3139     End if;
3140 
3141     hr_utility.set_location('Leaving ' ||l_proc,10);
3142 
3143   End denial_wgi;
3144   --
3145   --
3146   Procedure ext_asgn_nte  is
3147     l_proc   varchar2(70) := 'ext_asgn_nte';
3148   --
3149   Begin
3150 
3151   --
3152   -- Updating the record groups with NON SF52
3153   --
3154      hr_utility.set_location('Entering ' ||l_proc,5);
3155      set_extra_info(p_asg_nte_dates.assignment_nte,
3156                     l_pa_request_ei_rec.rei_information3,p_asg_nte_dates.asg_nte_dates_flag);
3157      set_extra_info(p_within_grade_increase.p_date_wgi_due ,
3158                     l_pa_request_ei_rec.rei_information4,p_within_grade_increase.p_wgi_flag);
3159      set_extra_info(p_asg_nte_dates.lwp_nte,
3160                     l_pa_request_ei_rec.rei_information5,p_asg_nte_dates.asg_nte_dates_flag);
3161      set_extra_info(p_asg_nte_dates.sabatical_nte,
3162                     l_pa_request_ei_rec.rei_information6,p_asg_nte_dates.asg_nte_dates_flag);
3163      set_extra_info(p_asg_nte_dates.suspension_nte ,
3164                     l_pa_request_ei_rec.rei_information7,p_asg_nte_dates.asg_nte_dates_flag);
3165   --
3166      hr_utility.set_location('Leaving ' ||l_proc,10);
3167 
3168   End ext_asgn_nte  ;
3169   --
3170   --
3171   Procedure posn_chg is
3172     l_proc      varchar2(72)  :=  'non_sf52_extra - posn_chg';
3173 
3174   Begin
3175     hr_utility.set_location('Entering ' ||l_proc,5);
3176     set_extra_info(p_per_retained_grade.date_from ,
3177                    l_pa_request_ei_rec.rei_information1,p_per_retained_grade.per_retained_grade_flag);
3178     set_extra_info(p_per_retained_grade.date_to ,
3179                    l_pa_request_ei_rec.rei_information2,p_per_retained_grade.per_retained_grade_flag);
3180     set_extra_info(p_per_retained_grade.retain_grade,
3181                    l_pa_request_ei_rec.rei_information3,p_per_retained_grade.per_retained_grade_flag);
3182     set_extra_info(p_per_retained_grade.retain_step_or_rate	,
3183                    l_pa_request_ei_rec.rei_information4,p_per_retained_grade.per_retained_grade_flag);
3184     set_extra_info(p_per_retained_grade.retain_pay_plan,
3185                    l_pa_request_ei_rec.rei_information5,p_per_retained_grade.per_retained_grade_flag);
3186     set_extra_info(p_per_retained_grade.retain_pay_table_id	,
3187                    l_pa_request_ei_rec.rei_information6,p_per_retained_grade.per_retained_grade_flag);
3188     set_extra_info(p_per_retained_grade.retain_locality_percent,
3189                    l_pa_request_ei_rec.rei_information7,p_per_retained_grade.per_retained_grade_flag);
3190     set_extra_info(p_per_retained_grade.retain_pay_basis	,
3191                    l_pa_request_ei_rec.rei_information8,p_per_retained_grade.per_retained_grade_flag);
3192 	-- Begin bug# 4126188
3193 	set_extra_info(p_asg_non_sf52.date_arr_personnel_office,
3194                    l_pa_request_ei_rec.rei_information15, p_asg_non_sf52.asg_non_sf52_flag, 'Y');
3195     -- End bug# 4126188
3196     hr_utility.set_location('Leaving ' ||l_proc,10);
3197 
3198   End posn_chg;
3199   --
3200   -- Begin bug# 4126188
3201   Procedure rg_posn_chg is
3202     l_proc      varchar2(72)  :=  'non_sf52_extra - rg_posn_chg';
3203 	Begin
3204 		hr_utility.set_location('Entering ' ||l_proc,5);
3205 		set_extra_info(p_asg_non_sf52.date_arr_personnel_office,
3206 		l_pa_request_ei_rec.rei_information15, p_asg_non_sf52.asg_non_sf52_flag, 'Y');
3207 		hr_utility.set_location('Leaving ' ||l_proc,10);
3208 	End rg_posn_chg;
3209 	-- End bug# 4126188
3210 
3211   Procedure salary_change is
3212     l_proc      varchar2(72)  :=  'non_sf52_extra - salary change';
3213 
3214   Begin
3215     hr_utility.set_location('Entering ' ||l_proc,5);
3216     If l_session.noa_id_correct is not null then
3217       set_extra_info(p_within_grade_increase.p_date_wgi_postpone_effective,
3218                      l_pa_request_ei_rec.rei_information3,p_within_grade_increase.p_wgi_flag);
3219 
3220 --Added for bug 3263140
3221 
3222       set_extra_info(p_within_grade_increase.p_last_equi_incr,
3223                      l_pa_request_ei_rec.rei_information5,p_within_grade_increase.p_wgi_flag);
3224 -- Bug # 1165309
3225 -- Date Wgi Due should be calculated for GHR_US_PAR_SALARY_CHG
3226       set_extra_info(p_within_grade_increase.p_date_wgi_due,
3227                      l_pa_request_ei_rec.rei_information4,p_within_grade_increase.p_wgi_flag);
3228     Else
3229       p_within_grade_increase.p_date_wgi_postpone_effective   :=  l_pa_request_ei_rec.rei_information3;
3230       set_extra_info(p_within_grade_increase.p_date_wgi_due,
3231                      l_pa_request_ei_rec.rei_information4,p_within_grade_increase.p_wgi_flag);
3232       set_extra_info(p_within_grade_increase.p_last_equi_incr,
3233                      l_pa_request_ei_rec.rei_information5,p_within_grade_increase.p_wgi_flag);
3234       p_within_grade_increase.p_wgi_flag                      := 'Y';
3235     End if;
3236 	-- Begin Bug#4126188
3237 	IF p_pa_request_rec.first_noa_code in ('702','703','713') OR
3238 		(p_pa_request_rec.first_noa_code = '002' AND p_pa_request_rec.second_noa_code IN ('702','703','713'))THEN
3239 		set_extra_info(p_asg_non_sf52.date_arr_personnel_office,
3240 		l_pa_request_ei_rec.rei_information6,p_asg_non_sf52.asg_non_sf52_flag,'Y');
3241 		--Begin Bug# 14514445
3242 		set_extra_info(p_per_group1.promotion_eligibility_date ,
3243 			  l_pa_request_ei_rec.rei_information7,p_per_group1.per_group1_flag, 'Y');
3244 		--End Bug# 14514445
3245     END IF;
3246     -- Bug#4126188 End
3247 
3248   End salary_change;
3249   --
3250 
3251   PROCEDURE realign is
3252     l_proc  varchar2(70) := 'non_sf52_extra - realign';
3253 
3254   Begin
3255     hr_utility.set_location('Entering ' ||l_proc,5);
3256     set_extra_info(p_asg_non_sf52.Date_Arr_Personnel_office ,
3257                    l_pa_request_ei_rec.rei_information3,p_asg_non_sf52.asg_non_sf52_flag);
3258 
3259     set_extra_info(p_pos_grp1.payroll_office_id	 	   ,
3260                    l_pa_request_ei_rec.rei_information4,p_pos_grp1.pos_grp1_flag);
3261     set_extra_info(p_pos_grp1.personnel_office_id 	   ,
3262                    l_pa_request_ei_rec.rei_information5,p_pos_grp1.pos_grp1_flag);
3263     -- Bug#3593584 Added code for Organization_structure_id(This is also known as
3264     --                                                    OPM Organizational Component)
3265     set_extra_info(p_pos_grp1.organization_structure_id	   ,
3266                    l_pa_request_ei_rec.rei_information11,p_pos_grp1.pos_grp1_flag);
3267     set_extra_info(p_pos_grp1.office_symbol              ,
3268                    l_pa_request_ei_rec.rei_information6,p_pos_grp1.pos_grp1_flag);
3269     set_extra_info(p_pos_grp2.organization_function_code ,
3270                    l_pa_request_ei_rec.rei_information7,p_pos_grp2.pos_grp2_flag);
3271     set_extra_info(p_pos_grp1.positions_organization 	   ,
3272                    l_pa_request_ei_rec.rei_information8,p_pos_grp1.pos_grp1_flag);
3273  --- Bug#2406905
3274     set_extra_info(p_pos_grp1.organization_structure_id  ,
3275                    l_pa_request_ei_rec.rei_information11,p_pos_grp1.pos_grp1_flag);
3276 
3277     if l_pa_request_ei_rec.rei_information9 is not null then
3278        p_pa_request_rec.to_organization_id := l_pa_request_ei_rec.rei_information9;
3279   -- Rohini added the else part
3280     else
3281       p_pa_request_rec.to_organization_id := Null;
3282     end if;
3283     -- Bug#3593584 Added the following If condition.
3284       if l_pa_request_ei_rec.rei_information10 is not null then
3285          p_pa_request_rec.agency_code := l_pa_request_ei_rec.rei_information10;
3286       end If;
3287 
3288     hr_utility.set_location('Leaving ' ||l_proc,10);
3289 
3290   End   realign ;
3291   --
3292   --
3293   Procedure reassign is
3294     l_proc varchar2(70) := 'non_sf52_extra_info - reassign';
3295   Begin
3296     hr_utility.set_location('Entering ' ||l_proc,5);
3297 /* -- Commented - Venkat - Bug # 957209 -- 08/06/1999
3298     set_extra_info(p_asg_non_sf52.key_emer_essential_empl	,
3299                    l_pa_request_ei_rec.rei_information3,p_asg_non_sf52.asg_non_sf52_flag);
3300 */
3301     set_extra_info(p_asg_non_sf52.parttime_indicator		,
3302                    l_pa_request_ei_rec.rei_information4,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
3303     set_extra_info(p_pos_grp1.position_working_title 		,
3304                    l_pa_request_ei_rec.rei_information5,p_pos_grp1.pos_grp1_flag, 'Y');
3305     set_extra_info(p_asg_non_sf52.qualification_standard_waiver	,
3306                    l_pa_request_ei_rec.rei_information6,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
3307    -- Begin Bug#4126188
3308  	  set_extra_info(p_asg_non_sf52.date_arr_personnel_office,
3309 	   l_pa_request_ei_rec.rei_information7, p_asg_non_sf52.asg_non_sf52_flag, 'Y');
3310      -- End Bug#4126188
3311     --Begin Bug# 14514445
3312     set_extra_info(p_per_group1.promotion_eligibility_date ,
3313 		  l_pa_request_ei_rec.rei_information8,p_per_group1.per_group1_flag, 'Y');
3314     --End Bug# 14514445
3315     hr_utility.set_location('Leaving ' ||l_proc,10);
3316 
3317   End   reassign;
3318   --
3319 
3320   Procedure return_to_duty is
3321      l_proc      varchar2(70) := 'non_sf52_extra - return_to_duty';
3322 
3323   Begin
3324 
3325      hr_utility.set_location('Entering ' ||l_proc,5);
3326      --Begin Bug# 12557463, commented following and added in  proc ghr_scd_info
3327      /*set_extra_info(p_per_uniformed_services.creditable_military_service ,
3328                     l_pa_request_ei_rec.rei_information3,
3329                     p_per_uniformed_services.per_uniformed_services_flag, 'Y');
3330        set_extra_info(p_per_separate_retire.frozen_service,
3331                     l_pa_request_ei_rec.rei_information5,p_per_separate_retire.per_sep_Retire_flag, 'Y');*/
3332      --End Bug# 12557463
3333      set_extra_info(p_within_grade_increase.p_date_wgi_due ,
3334                     l_pa_request_ei_rec.rei_information4,p_within_grade_increase.p_wgi_flag, 'N');
3335      set_extra_info(p_asg_non_sf52.non_disc_agmt_status,
3336                     l_pa_request_ei_rec.rei_information6,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
3337      set_extra_info(p_asg_non_sf52.parttime_indicator,
3338                     l_pa_request_ei_rec.rei_information7,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
3339      set_extra_info(p_per_group1.type_of_employment,
3340                     l_pa_request_ei_rec.rei_information8,p_per_group1.per_group1_flag, 'Y');	-- Bug 3966783
3341 
3342     --Bug # 12652438
3343      set_extra_info(p_asg_non_sf52.pay_status_userra_status,l_pa_request_ei_rec.rei_information10,
3344                     p_asg_non_sf52.asg_non_sf52_flag, 'Y');
3345 
3346      hr_utility.set_location('Leaving ' ||l_proc,10);
3347 
3348   End return_to_duty;
3349   --
3350   --
3351   Procedure separate352 is
3352      l_proc varchar2(70) := 'non_sf52_extra - separate3';
3353 
3354   Begin
3355 
3356     hr_utility.set_location('Entering ' ||l_proc,5);
3357    hr_utility.set_location('p_per_separate_retire.agency_code_transfer_to = ' ||
3358                             p_per_separate_retire.agency_code_transfer_to ,10);
3359 	set_extra_info(p_per_separate_retire.agency_code_transfer_to,
3360                      l_pa_request_ei_rec.rei_information3,p_per_separate_Retire.per_sep_Retire_flag);
3361    hr_utility.set_location('p_per_separate_retire.agency_code_transfer_to = ' ||
3362                             p_per_separate_retire.agency_code_transfer_to ,10);
3363       hr_utility.set_location('Leaving ' ||l_proc,10);
3364 
3365   End separate352 ;
3366   --
3367   --
3368   Procedure recruitment_bonus is
3369      l_proc  varchar2(70) := 'non_sf52_extra - recruitment_bonus';
3370 
3371   Begin
3372      hr_utility.set_location('Entering ' ||l_proc,5);
3373      If l_session.noa_id_correct is not null then
3374        set_extra_info(p_recruitment_bonus.p_date_recruit_exp,
3375                       l_pa_request_ei_rec.rei_information3,p_recruitment_bonus.p_recruitment_bonus_flag);
3376      Else
3377        p_recruitment_bonus.p_date_recruit_exp        := l_pa_request_ei_rec.rei_information3 ;
3378        p_recruitment_bonus.p_recruitment_bonus_flag  := 'Y';
3379        hr_utility.set_location('Leaving ' ||l_proc,10);
3380      End if;
3381 
3382   End recruitment_bonus;
3383   --
3384   --
3385   Procedure relocation_bonus is
3386      l_proc  varchar2(70) := 'non_sf52_extra - relocation_bonus';
3387 
3388   Begin
3389      hr_utility.set_location('Entering ' ||l_proc,5);
3390      If l_session.noa_id_correct is not null then
3391        set_extra_info(p_relocation_bonus.p_date_reloc_exp,
3392                       l_pa_request_ei_rec.rei_information3,p_relocation_bonus.p_relocation_bonus_flag );
3393      Else
3394        p_relocation_bonus.p_date_reloc_exp         :=  l_pa_request_ei_rec.rei_information3;
3395        p_relocation_bonus.p_relocation_bonus_flag  :=  'Y';
3396      End if;
3397      hr_utility.set_location('Leaving ' ||l_proc,10);
3398 
3399   End  relocation_bonus;
3400   --
3401 
3402   Procedure government_awards is
3403      l_proc varchar2(72) := 'non_sf52_extra - awards_bonus';
3404 
3405   Begin
3406      --
3407      -- commented award percentage, as a new column has been added in the
3408      -- ghr_pa_requests table - 10/08/98
3409      --
3410      --Begin Bug 9538056
3411      IF NOT(p_pa_request_rec.first_noa_code = '892' AND
3412             (NVL(p_pa_request_rec.first_action_la_code1,'111') = 'RBM' or NVL(p_pa_request_rec.first_action_la_code2,'111') = 'RBM')) THEN
3413 	     p_gov_awards.award_agency             :=  l_pa_request_ei_rec.rei_information3;
3414 	     p_gov_awards.award_type               :=  l_pa_request_ei_rec.rei_information4;
3415 	     p_gov_awards.date_award_earned        :=  l_pa_request_ei_rec.rei_information9;
3416      END IF;
3417      --End Bug 9538056
3418      p_gov_awards.group_award              :=  l_pa_request_ei_rec.rei_information6;
3419      p_gov_awards.tangible_benefit_dollars :=  l_pa_request_ei_rec.rei_information7;
3420 -- Bug # 1060184 -- Venkat 03/01/00
3421      p_gov_awards.award_appropriation_code :=  l_pa_request_ei_rec.rei_information10;
3422      p_gov_awards.date_exemp_award         :=  l_pa_request_ei_rec.rei_information11;
3423 
3424      hr_utility.set_location('date award -pre ' || p_gov_awards.date_award_earned,2);
3425      If p_gov_awards.award_agency             is not null or
3426         p_gov_awards.award_type               is not null or
3427         p_gov_awards.group_award              is not null or
3428         p_gov_awards.tangible_benefit_dollars is not null or
3429         p_gov_awards.date_award_earned        is not null or
3430         p_pa_request_rec.award_amount         is not null or
3431         p_gov_awards.award_appropriation_code is not null or
3432         p_gov_awards.date_exemp_award         is not null then
3433         p_gov_awards.award_flag := 'Y';
3434 
3435         If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3436 		IF NOT(p_pa_request_rec.second_noa_code = '892' AND --Begin Bug 9538056
3437 		    (NVL(p_pa_request_rec.second_action_la_code1,'111') = 'RBM' or NVL(p_pa_request_rec.second_action_la_code2,'111') = 'RBM')) THEN
3438 		   if p_gov_awards.award_agency is null then
3439 		      ghr_history_fetch.fetch_element_entry_value
3440 		     (p_element_name          =>  'Federal Awards',
3441 		      p_input_value_name      =>  'Award Agency',
3442 		      p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3443 		      p_date_effective        =>  p_pa_request_rec.effective_date,
3444 		      p_screen_entry_value    =>  p_gov_awards.award_agency
3445 		      );
3446 		   end if;
3447 		   if p_gov_awards.award_type is null then
3448 		      ghr_history_fetch.fetch_element_entry_value
3449 		     (p_element_name          =>  'Federal Awards',
3450 		      p_input_value_name      =>  'Award Type',
3451 		      p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3452 		      p_date_effective        =>  p_pa_request_rec.effective_date,
3453 		      p_screen_entry_value    =>  p_gov_awards.award_type
3454 		      );
3455 		   end if;
3456 		   if p_gov_awards.date_award_earned is null then
3457 		      ghr_history_fetch.fetch_element_entry_value
3458 		     (p_element_name          =>  'Federal Awards',
3459 		      p_input_value_name      =>  'Date Award Earned',
3460 		      p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3461 		      p_date_effective        =>  p_pa_request_rec.effective_date,
3462 		      p_screen_entry_value    =>  p_gov_awards.date_award_earned
3463 		      );
3464 		   end if;
3465 		 END IF;-- End Bug 9538056
3466            if p_gov_awards.group_award is null then
3467               ghr_history_fetch.fetch_element_entry_value
3468               (p_element_name          =>  'Federal Awards',
3469                p_input_value_name      =>  'Group Award',
3470                p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3471                p_date_effective        =>  p_pa_request_rec.effective_date,
3472                p_screen_entry_value    =>  p_gov_awards.group_award
3473                );
3474            end if;
3475            if p_gov_awards.tangible_benefit_dollars is null then
3476               ghr_history_fetch.fetch_element_entry_value
3477               (p_element_name          =>  'Federal Awards',
3478                p_input_value_name      =>  'Tangible Benefit Dollars',
3479                p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3480                p_date_effective        =>  p_pa_request_rec.effective_date,
3481                p_screen_entry_value    =>  p_gov_awards.tangible_benefit_dollars
3482                );
3483            end if;
3484 
3485            if p_gov_awards.award_appropriation_code is null then
3486               ghr_history_fetch.fetch_element_entry_value
3487              (p_element_name          =>  'Federal Awards',
3488               p_input_value_name      =>  'Appropriation Code',
3489               p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3490               p_date_effective        =>  p_pa_request_rec.effective_date,
3491               p_screen_entry_value    =>  p_gov_awards.award_appropriation_code
3492               );
3493            end if;
3494 /*
3495            -- Bug 2835929 Allow date_exemp_award to be updated to null.
3496            if p_gov_awards.date_exemp_award is null then
3497               ghr_history_fetch.fetch_element_entry_value
3498              (p_element_name          =>  'Federal Awards',
3499               p_input_value_name      =>  'Date Ex Emp Award Paid',
3500               p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3501               p_date_effective        =>  p_pa_request_rec.effective_date,
3502               p_screen_entry_value    =>  p_gov_awards.date_exemp_award
3503               );
3504            end if;
3505 */
3506         end if;
3507      End if;
3508   End government_awards;
3509   --
3510   -- Bug#4486823 RRR Changes Added procedures service_obligation,incentive_retention.
3511   Procedure service_obligation is
3512      l_proc  varchar2(70) := 'non_sf52_extra - service_obligation';
3513 
3514   Begin
3515      hr_utility.set_location('Entering ' ||l_proc,5);
3516      If l_session.noa_id_correct is null then
3517        --6510320 Added the if condition of not creating the service obligation entry
3518        --in person EI if all the segments are null
3519        If  l_pa_request_ei_rec.rei_information3 is not null or
3520            l_pa_request_ei_rec.rei_information4 is not null or
3521 	   l_pa_request_ei_rec.rei_information5 is not null then
3522          p_per_service_oblig.service_oblig_type_code  := l_pa_request_ei_rec.rei_information3;
3523          p_per_service_oblig.service_oblig_start_date := l_pa_request_ei_rec.rei_information4;
3524          p_per_service_oblig.service_oblig_end_date   := l_pa_request_ei_rec.rei_information5;
3525          p_per_service_oblig.per_service_oblig_flag   := 'Y';
3526        End If;
3527        hr_utility.set_location('Leaving ' ||l_proc,10);
3528      End if;
3529 
3530   End service_obligation;
3531   --
3532   --
3533   Procedure incentive_retention is
3534      l_proc  varchar2(70) := 'non_sf52_extra - incentive_retention';
3535 
3536   Begin
3537      hr_utility.set_location('Entering ' ||l_proc,5);
3538       If l_session.noa_id_correct is not null then
3539        set_extra_info(p_per_group1.retention_inc_review_date ,
3540                       l_pa_request_ei_rec.rei_information3,
3541                       p_per_group1.per_group1_flag);
3542     Else
3543       p_per_group1.retention_inc_review_date   :=  l_pa_request_ei_rec.rei_information3;
3544     End if;
3545     p_per_group1.per_group1_flag             :=  'Y';
3546   End incentive_retention;
3547   --  -- Bug#4486823 RRR Changes
3548   --
3549   Procedure non_pay_duty_status is
3550     l_proc                varchar2(72) := 'non_pay_duty_status';
3551     l_special_info_type   ghr_api.special_information_type;
3552 
3553   Begin
3554     set_extra_info(p_per_group1.type_of_employment,
3555                    l_pa_request_ei_rec.rei_information3,p_per_group1.per_group1_flag, 'Y');
3556     p_conduct_performance.adverse_action_noac        :=   l_pa_request_ei_rec.rei_information4;
3557     p_conduct_performance.cause_of_disc_action       :=   l_pa_request_ei_rec.rei_information5;
3558     p_conduct_performance.date_of_adverse_action     :=   l_pa_request_ei_rec.rei_information6;
3559     p_conduct_performance.days_suspended             :=   l_pa_request_ei_rec.rei_information7;
3560     p_conduct_performance.date_suspension_over_30    :=   l_pa_request_ei_rec.rei_information8;
3561     p_conduct_performance.date_suspension_under_30   :=   l_pa_request_ei_rec.rei_information9;
3562     p_conduct_performance.pip_action_taken           :=   l_pa_request_ei_rec.rei_information10;
3563     p_conduct_performance.pip_begin_date             :=   l_pa_request_ei_rec.rei_information11;
3564     p_conduct_performance.pip_end_date               :=   l_pa_request_ei_rec.rei_information12;
3565     p_conduct_performance.pip_extensions             :=   l_pa_request_ei_rec.rei_information13;
3566     p_conduct_performance.pip_length                 :=   l_pa_request_ei_rec.rei_information14;
3567     p_conduct_performance.date_reprimand_expires     :=   l_pa_request_ei_rec.rei_information15;
3568 
3569     hr_utility.set_location('non_pay_duty_status ', 20);
3570     -- If atleast one of the  above is not null , then set the flag to 'Y'
3571 
3572     If p_conduct_performance.adverse_action_noac      is not null or
3573        p_conduct_performance.cause_of_disc_action     is not null or
3574        p_conduct_performance.date_of_adverse_action   is not null or
3575        p_conduct_performance.days_suspended           is not null or
3576        p_conduct_performance.date_suspension_over_30  is not null or
3577        p_conduct_performance.date_suspension_under_30 is not null or
3578        p_conduct_performance.pip_action_taken         is not null or
3579        p_conduct_performance.pip_begin_date    		is not null or
3580        p_conduct_performance.pip_end_date       	is not null or
3581        p_conduct_performance.pip_extensions     	is not null or
3582        p_conduct_performance.pip_length        		is not null or
3583        p_conduct_performance.date_reprimand_expires	is not null then
3584        p_conduct_performance.cond_perf_flag         :=   'Y';
3585        hr_utility.set_location('non_pay_duty_status ', 25);
3586     End if;
3587 
3588     if l_session.noa_id_correct is not null then
3589        hr_utility.set_location('non_pay_duty_status ', 30);
3590 
3591        ghr_history_fetch.return_special_information
3592          (p_person_id         =>  p_pa_request_rec.person_id,
3593           p_structure_name    =>  'US Fed Conduct Perf',
3594           p_effective_date    =>  p_pa_request_rec.effective_date,
3595           p_special_info      =>  l_special_info_type
3596           );
3597 
3598        hr_utility.set_location('non_pay_duty_status :person analysis id '||l_special_info_type.person_analysis_id, 31);
3599        hr_utility.set_location('non_pay_duty_status :ovn '||l_special_info_type.object_version_number, 32);
3600        hr_utility.set_location('non_pay_duty_status :segment1 '||l_special_info_type.segment1, 33);
3601        hr_utility.set_location('non_pay_duty_status :segment2 '||l_special_info_type.segment2, 34);
3602        hr_utility.set_location('non_pay_duty_status :segment3 '||l_special_info_type.segment3, 35);
3603        hr_utility.set_location('non_pay_duty_status :segment4 '||l_special_info_type.segment4, 36);
3604        hr_utility.set_location('non_pay_duty_status :segment5 '||l_special_info_type.segment5, 37);
3605        hr_utility.set_location('non_pay_duty_status :segment6 '||l_special_info_type.segment6, 38);
3606        hr_utility.set_location('non_pay_duty_status :segment7 '||l_special_info_type.segment7, 39);
3607 
3608        p_conduct_performance.person_analysis_id         :=   l_special_info_type.person_analysis_id;
3609        p_conduct_performance.object_version_number      :=   l_special_info_type.object_version_number;
3610        if p_conduct_performance.cause_of_disc_action is null then
3611           p_conduct_performance.cause_of_disc_action    :=   l_special_info_type.segment1;
3612        end if;
3613        if p_conduct_performance.date_of_adverse_action is null then
3614           p_conduct_performance.date_of_adverse_action  :=   l_special_info_type.segment2;
3615        end if;
3616        if p_conduct_performance.days_suspended is null then
3617           p_conduct_performance.days_suspended          :=   l_special_info_type.segment3;
3618        end if;
3619        if p_conduct_performance.date_suspension_over_30 is null then
3620           p_conduct_performance.date_suspension_over_30 :=   l_special_info_type.segment4;
3621        end if;
3622        if p_conduct_performance.date_suspension_under_30 is null then
3623           p_conduct_performance.date_suspension_under_30 :=   l_special_info_type.segment5;
3624        end if;
3625        if p_conduct_performance.pip_action_taken is null then
3626           p_conduct_performance.pip_action_taken         :=   l_special_info_type.segment6;
3627        end if;
3628        if p_conduct_performance.pip_begin_date is null then
3629           p_conduct_performance.pip_begin_date          :=   l_special_info_type.segment7;
3630        end if;
3631        if p_conduct_performance.pip_end_date is null then
3632           p_conduct_performance.pip_end_date            :=   l_special_info_type.segment8;
3633        end if;
3634        if p_conduct_performance.pip_extensions is null then
3635           p_conduct_performance.pip_extensions          :=   l_special_info_type.segment9;
3636        end if;
3637        if p_conduct_performance.pip_length is null then
3638           p_conduct_performance.pip_length              :=   l_special_info_type.segment10;
3639        end if;
3640        if p_conduct_performance.date_reprimand_expires is null then
3641           p_conduct_performance.date_reprimand_expires  :=   l_special_info_type.segment11;
3642        end if;
3643        if p_conduct_performance.adverse_action_noac is null then
3644           p_conduct_performance.adverse_action_noac     :=   l_special_info_type.segment12;
3645        end if;
3646 
3647     end if;
3648 
3649      --Bug # 12652438
3650      set_extra_info(p_asg_non_sf52.pay_status_userra_status,
3651                     l_pa_request_ei_rec.rei_information15,
3652                     p_asg_non_sf52.asg_non_sf52_flag, 'Y');
3653     hr_utility.set_location('non_pay_duty_status ', 40);
3654 
3655   End non_pay_duty_status;
3656   --
3657   --
3658   Procedure lwop_info is
3659     l_proc                varchar2(72) := 'lwop_info';
3660 
3661   Begin
3662      --
3663      set_extra_info(p_per_group1.type_of_employment,
3664                     l_pa_request_ei_rec.rei_information3,
3665                     p_per_group1.per_group1_flag,
3666                     'Y'  );
3667      --Bug # 12652438
3668      set_extra_info(p_asg_non_sf52.pay_status_userra_status,
3669                     l_pa_request_ei_rec.rei_information6,
3670                     p_asg_non_sf52.asg_non_sf52_flag, 'Y');
3671      --
3672   End;
3673   --
3674   --
3675   Function fetch_extra_info_id (p_request_id number)
3676   return number is
3677      CURSOR c2 (c_request_id number) is
3678             SELECT  par.pa_request_id, par.altered_pa_request_id, pei.rei_information3
3679             FROM    ghr_pa_requests par, ghr_pa_request_extra_info pei
3680             WHERE   par.pa_request_id     = pei.pa_request_id(+)
3681               AND   pei.pa_request_id     = c_request_id
3682               AND   pei.information_type  = 'GHR_US_PAR_TERM_RET_GRADE';
3683 
3684      l_request_id         ghr_pa_requests.pa_request_id%type;
3685      l_extra_info_id      per_people_extra_info.person_extra_info_id%type;
3686 
3687   begin
3688      l_request_id := p_request_id;
3689      loop
3690         for c2_rec in c2(l_request_id) loop
3691             hr_utility.set_location('inside fetch extra info id loop',1);
3692             if c2_rec.rei_information3 is not null then
3693                l_extra_info_id := c2_rec.rei_information3;
3694             else
3695                l_request_id := c2_rec.pa_request_id;
3696             end if;
3697          end loop;
3698          if l_extra_info_id is not null then
3699             exit;
3700          end if;
3701       end loop;
3702       hr_utility.set_location('Leaving fetch extra_info_id',1);
3703       return(l_extra_info_id);
3704   end fetch_extra_info_id;
3705   --
3706   --
3707   Procedure term_retained_grade is
3708      CURSOR c1 (p_pei_id number) is
3709             SELECT  person_extra_info_id, object_version_number
3710             FROM    per_people_extra_info
3711             WHERE   person_extra_info_id = p_pei_id;
3712 
3713      l_proc                      varchar2(72)  :=  'non_sf52_extra - sss';
3714      l_per_extra_info_rec        per_people_extra_info%rowtype;
3715      l_person_extra_info_id      per_people_extra_info.person_extra_info_id%type;
3716      l_result_code               varchar2(100);
3717 
3718   Begin
3719      -- If it is a termination of retention grade , let us nullify all the entries in the per_retained_grade
3720 
3721         if l_pa_request_ei_rec.rei_information3 is null then
3722            -- errors out during the required check
3723            null;
3724         elsif l_pa_request_ei_rec.rei_information3 is not null  then
3725             -- fetch the ovn, set flag to Y
3726            for c1_rec in c1(l_pa_request_ei_rec.rei_information3) loop
3727                p_per_retained_grade.person_extra_info_id    :=  c1_rec.person_extra_info_id;
3728                hr_utility.set_location('RG 866 - set pei id',1);
3729              If l_session.noa_id_correct is null then
3730                p_per_retained_grade.object_version_number   :=  c1_rec.object_version_number;
3731                hr_utility.set_location('non correction -- RG 866',1);
3732                p_per_retained_grade.per_retained_grade_flag :=  'Y';
3733              end if;
3734            end loop;
3735         end if;
3736 
3737 
3738      hr_utility.set_location('leaving par term ret gr',1);
3739 
3740   End term_retained_grade;
3741   --
3742   --
3743   Procedure quality_step_increase is
3744      l_proc varchar2(72) := 'non_sf52_extra - quality_step_increase';
3745 
3746   Begin
3747 	 --Begin Bug 9538056
3748 	  IF (p_pa_request_rec.first_noa_code = '892' AND
3749 	     (NVL(p_pa_request_rec.first_action_la_code1,'111') = 'RBM' or NVL(p_pa_request_rec.first_action_la_code2,'111') = 'RBM'))
3750 	      OR
3751 	     (p_pa_request_rec.second_noa_code = '892' AND
3752 	     (NVL(p_pa_request_rec.second_action_la_code1,'111') = 'RBM' or NVL(p_pa_request_rec.second_action_la_code2,'111') = 'RBM')) then
3753 	     hr_utility.set_location('Entering ' ||l_proc,55);
3754 	     p_gov_awards.award_agency             :=  l_pa_request_ei_rec.rei_information3;
3755 	     p_gov_awards.award_type               :=  '07';
3756 	     p_gov_awards.date_award_earned        :=  fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
3757 
3758 	     If l_session.noa_id_correct is null then
3759 		p_gov_awards.award_flag := 'Y';
3760 	     elsIf l_session.noa_id_correct is not null and  -- for correction fetch the existing values
3761 		p_gov_awards.award_agency is not null then
3762 		p_gov_awards.award_flag := 'Y';
3763 	     end if;
3764 	  END IF;
3765 	  -- End Bug 9538056
3766   end quality_step_increase;
3767   --
3768   --
3769   --
3770   Procedure  entitlement is
3771     l_proc        varchar2(70) := 'non_sf52_extra_info - entitlement';
3772 
3773   Begin
3774     --
3775     hr_utility.set_location('Entering ' ||l_proc,5);
3776     --
3777     p_entitlement.entitlement_code        := l_pa_request_ei_rec.rei_information3;
3778     p_entitlement.entitlement_amt_percent := l_pa_request_ei_rec.rei_information4;
3779     --Venkat 05/00 -- Bug# 1140536
3780     hr_utility.set_location('entitlement code is '||p_entitlement.entitlement_code ||l_proc,6);
3781     if nvl(p_entitlement.entitlement_code,hr_api.g_varchar2) = '9'
3782       and substr(nvl(p_pa_request_rec.duty_station_code,hr_api.g_varchar2),1,2)
3783       not in ('02','15','AQ','CQ','DQ',
3784               'FQ','GQ','HQ','JQ','KQ',
3785               'LQ','MQ','RQ','VQ','WQ') then
3786        hr_utility.set_message(8301,'GHR_38030_INV_DS_4_NON_F_COLA');
3787        hr_utility.raise_error;
3788     end if;
3789     if nvl(p_entitlement.entitlement_code,hr_api.g_varchar2) = 'C'
3790       and substr(nvl(p_pa_request_rec.duty_station_code,hr_api.g_varchar2),1,2)
3791        in ('02','15','AQ','CQ','DQ',
3792               'FQ','GQ','HQ','JQ','KQ',
3793               'LQ','MQ','RQ','VQ','WQ') then
3794        hr_utility.set_message(8301,'GHR_38032_INV_DS_4_COLA');
3795        hr_utility.raise_error;
3796     end if;
3797     if p_entitlement.entitlement_code        is not null or
3798        p_entitlement.entitlement_amt_percent is not null then
3799        p_entitlement.entitlement_flag := 'Y';
3800     end if;
3801     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3802        if p_entitlement.entitlement_code is null then
3803           ghr_history_fetch.fetch_element_entry_value
3804           (p_element_name          =>  'Entitlement',
3805            p_input_value_name      =>  'Code',
3806            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3807            p_date_effective        =>  p_pa_request_rec.effective_date,
3808            p_screen_entry_value    =>  p_entitlement.entitlement_code
3809           );
3810        end if;
3811        if p_entitlement.entitlement_amt_percent is null then
3812           ghr_history_fetch.fetch_element_entry_value
3813           (p_element_name          =>  'Entitlement',
3814            p_input_value_name      =>  'Amount or Percent',
3815            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3816            p_date_effective        =>  p_pa_request_rec.effective_date,
3817            p_screen_entry_value    =>  p_entitlement.entitlement_amt_percent
3818           );
3819        end if;
3820     end if;
3821     --
3822     hr_utility.set_location('Leaving ' ||l_proc,5);
3823     --
3824   END entitlement;
3825   --
3826   --
3827   Procedure for_lang_pay is
3828     l_proc        varchar2(70) := 'non_sf52_extra_info - for_lang_pay';
3829   Begin
3830     --
3831     hr_utility.set_location('Entering ' ||l_proc,5);
3832     --
3833     p_foreign_lang_prof_pay.certification_date := l_pa_request_ei_rec.rei_information3;
3834     p_foreign_lang_prof_pay.pay_level_or_rate  := l_pa_request_ei_rec.rei_information4;
3835     if p_foreign_lang_prof_pay.certification_date is not null or
3836        p_foreign_lang_prof_pay.pay_level_or_rate  is not null then
3837        p_foreign_lang_prof_pay.for_lang_flag := 'Y';
3838     end if;
3839     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3840        if p_foreign_lang_prof_pay.certification_date is null then
3841           ghr_history_fetch.fetch_element_entry_value
3842           (p_element_name          =>  'Foreign Lang Proficiency Pay',
3843            p_input_value_name      =>  'Certification Date',
3844            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3845            p_date_effective        =>  p_pa_request_rec.effective_date,
3846            p_screen_entry_value    =>  p_foreign_lang_prof_pay.certification_date
3847           );
3848        end if;
3849        if p_foreign_lang_prof_pay.pay_level_or_rate is null then
3850           ghr_history_fetch.fetch_element_entry_value
3851           (p_element_name          =>  'Foreign Lang Proficiency Pay',
3852            p_input_value_name      =>  'Pay Level or Rate',
3853            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3854            p_date_effective        =>  p_pa_request_rec.effective_date,
3855            p_screen_entry_value    =>  p_foreign_lang_prof_pay.pay_level_or_rate
3856           );
3857        end if;
3858     end if;
3859     --
3860     hr_utility.set_location('Leaving ' ||l_proc,5);
3861     --
3862   END for_lang_pay;
3863   --
3864   Procedure fta is
3865     l_proc        varchar2(70) := 'non_sf52_extra_info - fta';
3866   Begin
3867     --
3868     hr_utility.set_location('Entering ' ||l_proc,5);
3869     --
3870     p_imm_fta.last_action_code := l_pa_request_ei_rec.rei_information3;
3871     p_imm_fta.number_family_members := l_pa_request_ei_rec.rei_information4;
3872     p_imm_fta.Miscellaneous_Expense:= l_pa_request_ei_rec.rei_information5;
3873     p_imm_fta.Wardrobe_Expense := l_pa_request_ei_rec.rei_information6;
3874     p_imm_fta.Pre_Departure_Subs_Expense := l_pa_request_ei_rec.rei_information7;
3875     p_imm_fta.Lease_Penalty_Expense := l_pa_request_ei_rec.rei_information8;
3876     p_imm_fta.amount := l_pa_request_ei_rec.rei_information9;
3877     if p_imm_fta.last_action_code is not null or
3878        p_imm_fta.number_family_members  is not null or
3879        p_imm_fta.Miscellaneous_Expense is not null or
3880        p_imm_fta.Wardrobe_Expense is not null or
3881        p_imm_fta.Pre_Departure_Subs_Expense is not null or
3882        p_imm_fta.Lease_Penalty_Expense is not null or
3883        p_imm_fta.amount is not null then
3884        p_imm_fta.fta_flag := 'Y';
3885     end if;
3886 
3887   End fta;
3888   --
3889   --
3890   Procedure edp_pay is
3891     l_proc        varchar2(70) := 'non_sf52_extra_info - edp_pay';
3892   Begin
3893     --
3894     hr_utility.set_location('Entering ' ||l_proc,5);
3895     --
3896     p_edp_pay.premium_pay_indicator := l_pa_request_ei_rec.rei_information3;
3897     p_edp_pay.edp_type              := l_pa_request_ei_rec.rei_information4;
3898     if p_edp_pay.premium_pay_indicator is not null or
3899        p_edp_pay.edp_type              is not null then
3900        p_edp_pay.edp_flag := 'Y';
3901     end if;
3902     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3903        if p_edp_pay.premium_pay_indicator is null then
3904           ghr_history_fetch.fetch_element_entry_value
3905           (p_element_name          =>  'EDP Pay',
3906            p_input_value_name      =>  'Premium Pay Ind',
3907            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3908            p_date_effective        =>  p_pa_request_rec.effective_date,
3909            p_screen_entry_value    =>  p_edp_pay.premium_pay_indicator
3910           );
3911        end if;
3912        if p_edp_pay.edp_type is null then
3913           ghr_history_fetch.fetch_element_entry_value
3914           (p_element_name          =>  'EDP Pay',
3915            p_input_value_name      =>  'EDP Type',
3916            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3917            p_date_effective        =>  p_pa_request_rec.effective_date,
3918            p_screen_entry_value    =>  p_edp_pay.edp_type
3919           );
3920        end if;
3921     end if;
3922     --
3923     hr_utility.set_location('Leaving ' ||l_proc,5);
3924     --
3925   END edp_pay;
3926   --
3927   --
3928   Procedure hazard_pay is
3929     l_proc        varchar2(70) := 'non_sf52_extra_info - hazard_pay';
3930   Begin
3931     --
3932     hr_utility.set_location('Entering ' ||l_proc,5);
3933     --
3934     p_hazard_pay.premium_pay_indicator := l_pa_request_ei_rec.rei_information3;
3935     p_hazard_pay.hazard_type           := l_pa_request_ei_rec.rei_information4;
3936     if p_hazard_pay.premium_pay_indicator is not null or
3937        p_hazard_pay.hazard_type           is not null then
3938        p_hazard_pay.hazard_flag := 'Y';
3939     end if;
3940     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3941        if p_hazard_pay.premium_pay_indicator is null then
3942           ghr_history_fetch.fetch_element_entry_value
3943           (p_element_name          =>  'Hazard Pay',
3944            p_input_value_name      =>  'Premium Pay Ind',
3945            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3946            p_date_effective        =>  p_pa_request_rec.effective_date,
3947            p_screen_entry_value    =>  p_hazard_pay.premium_pay_indicator
3948           );
3949        end if;
3950        if p_hazard_pay.hazard_type is null then
3951           ghr_history_fetch.fetch_element_entry_value
3952           (p_element_name          =>  'Hazard Pay',
3953            p_input_value_name      =>  'Hazard Type',
3954            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3955            p_date_effective        =>  p_pa_request_rec.effective_date,
3956            p_screen_entry_value    =>  p_hazard_pay.hazard_type
3957           );
3958        end if;
3959     end if;
3960     --
3961     hr_utility.set_location('Leaving ' ||l_proc,10);
3962     --
3963   END hazard_pay;
3964   --
3965   --
3966   Procedure health_benefits is
3967     l_proc        varchar2(70) := 'non_sf52_extra_info - health_benefits';
3968   Begin
3969     --
3970     hr_utility.set_location('Entering ' ||l_proc,5);
3971     --
3972     p_health_benefits.enrollment       := l_pa_request_ei_rec.rei_information3;
3973     p_health_benefits.health_plan      := l_pa_request_ei_rec.rei_information4;
3974     p_health_benefits.temps_total_cost := l_pa_request_ei_rec.rei_information5;
3975     p_health_benefits.pre_tax_waiver := l_pa_request_ei_rec.rei_information6;
3976     if p_health_benefits.enrollment       is not null or
3977        p_health_benefits.health_plan      is not null or
3978        p_health_benefits.temps_total_cost is not null or
3979        p_health_benefits.pre_tax_waiver is not null then
3980        p_health_benefits.health_benefits_flag := 'Y';
3981     end if;
3982     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3983        if p_health_benefits.enrollment is null then
3984           ghr_history_fetch.fetch_element_entry_value
3985           (p_element_name          =>  'Health Benefits',
3986            p_input_value_name      =>  'Enrollment',
3987            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3988            p_date_effective        =>  p_pa_request_rec.effective_date,
3989            p_screen_entry_value    =>  p_health_benefits.enrollment
3990           );
3991        end if;
3992        if p_health_benefits.health_plan is null then
3993           ghr_history_fetch.fetch_element_entry_value
3994           (p_element_name          =>  'Health Benefits',
3995            p_input_value_name      =>  'Health Plan',
3996            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3997            p_date_effective        =>  p_pa_request_rec.effective_date,
3998            p_screen_entry_value    =>  p_health_benefits.health_plan
3999           );
4000        end if;
4001        if p_health_benefits.temps_total_cost is null then
4002           ghr_history_fetch.fetch_element_entry_value
4003           (p_element_name          =>  'Health Benefits',
4004            p_input_value_name      =>  'Temps Total Cost',
4005            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4006            p_date_effective        =>  p_pa_request_rec.effective_date,
4007            p_screen_entry_value    =>  p_health_benefits.temps_total_cost
4008           );
4009        end if;
4010        if p_health_benefits.pre_tax_waiver is null then
4011           ghr_history_fetch.fetch_element_entry_value
4012           (p_element_name          =>  'Health Benefits',
4013            p_input_value_name      =>  'Pre tax Waiver',
4014            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4015            p_date_effective        =>  p_pa_request_rec.effective_date,
4016            p_screen_entry_value    =>  p_health_benefits.pre_tax_waiver
4017           );
4018        end if;
4019     end if;
4020     --
4021     hr_utility.set_location('Leaving ' ||l_proc,5);
4022     --
4023   END health_benefits;
4024   --
4025   --
4026   Procedure health_ben_pre_tax is
4027     l_proc        varchar2(70) := 'non_sf52_extra_info - health_ben_pre_tax';
4028   Begin
4029     --
4030     hr_utility.set_location('Entering ' ||l_proc,5);
4031     --
4032     p_health_ben_pre_tax.enrollment       := l_pa_request_ei_rec.rei_information3;
4033     p_health_ben_pre_tax.health_plan      := l_pa_request_ei_rec.rei_information4;
4034     p_health_ben_pre_tax.temps_total_cost := l_pa_request_ei_rec.rei_information5;
4035     if p_health_ben_pre_tax.enrollment       is not null or
4036        p_health_ben_pre_tax.health_plan      is not null or
4037        p_health_ben_pre_tax.temps_total_cost is not null then
4038        p_health_ben_pre_tax.health_ben_pre_tax_flag := 'Y';
4039     end if;
4040     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4041        if p_health_ben_pre_tax.enrollment is null then
4042           ghr_history_fetch.fetch_element_entry_value
4043           (p_element_name          =>  'Health Benefits Pre tax',
4044            p_input_value_name      =>  'Enrollment',
4045            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4046            p_date_effective        =>  p_pa_request_rec.effective_date,
4047            p_screen_entry_value    =>  p_health_ben_pre_tax.enrollment
4048           );
4049        end if;
4050        if p_health_ben_pre_tax.health_plan is null then
4051           ghr_history_fetch.fetch_element_entry_value
4052           (p_element_name          =>  'Health Benefits Pre tax',
4053            p_input_value_name      =>  'Health Plan',
4054            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4055            p_date_effective        =>  p_pa_request_rec.effective_date,
4056            p_screen_entry_value    =>  p_health_ben_pre_tax.health_plan
4057           );
4058        end if;
4059        if p_health_ben_pre_tax.temps_total_cost is null then
4060           ghr_history_fetch.fetch_element_entry_value
4061           (p_element_name          =>  'Health Benefits Pre Tax',
4062            p_input_value_name      =>  'Temps Total Cost',
4063            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4064            p_date_effective        =>  p_pa_request_rec.effective_date,
4065            p_screen_entry_value    =>  p_health_ben_pre_tax.temps_total_cost
4066           );
4067        end if;
4068     end if;
4069     --
4070     hr_utility.set_location('Leaving ' ||l_proc,5);
4071     --
4072   END health_ben_pre_tax;
4073   --
4074   Procedure danger_pay is
4075     l_proc        varchar2(70) := 'non_sf52_extra_info - danger_pay';
4076   Begin
4077     --
4078     hr_utility.set_location('Entering ' ||l_proc,5);
4079     --
4080     p_danger_pay.last_action_code   := l_pa_request_ei_rec.rei_information3;
4081     p_danger_pay.location           := l_pa_request_ei_rec.rei_information4;
4082     if p_danger_pay.last_action_code    is not null or
4083        p_danger_pay.location            is not null then
4084        p_danger_pay.danger_flag := 'Y';
4085     end if;
4086     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4087        if p_danger_pay.last_action_code is null then
4088           ghr_history_fetch.fetch_element_entry_value
4089           (p_element_name          =>  'Danger Pay',
4090            p_input_value_name      =>  'Last Action Code',
4091            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4092            p_date_effective        =>  p_pa_request_rec.effective_date,
4093            p_screen_entry_value    =>  p_danger_pay.last_action_code
4094           );
4095        end if;
4096        if p_danger_pay.location is null then
4097           ghr_history_fetch.fetch_element_entry_value
4098           (p_element_name          =>  'Danger Pay',
4099            p_input_value_name      =>  'Location',
4100            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4101            p_date_effective        =>  p_pa_request_rec.effective_date,
4102            p_screen_entry_value    =>  p_danger_pay.location
4103           );
4104        end if;
4105     end if;
4106     --
4107     hr_utility.set_location('Leaving ' ||l_proc,5);
4108     --
4109   END danger_pay;
4110   --
4111   --
4112   Procedure imminent_danger_pay is
4113     l_proc        varchar2(70) := 'non_sf52_extra_info - imminent_danger_pay';
4114   Begin
4115     --
4116     hr_utility.set_location('Entering ' ||l_proc,5);
4117     --
4118     p_imminent_danger_pay.amount             := l_pa_request_ei_rec.rei_information3;
4119     p_imminent_danger_pay.location           := l_pa_request_ei_rec.rei_information4;
4120     p_imminent_danger_pay.last_action_code   := l_pa_request_ei_rec.rei_information5;
4121     if p_imminent_danger_pay.amount             is not null or
4122        p_imminent_danger_pay.last_action_code   is not null or
4123        p_imminent_danger_pay.location           is not null  then
4124        p_imminent_danger_pay.imminent_danger_flag := 'Y';
4125     end if;
4126     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4127        if p_imminent_danger_pay.amount is null then
4128           ghr_history_fetch.fetch_element_entry_value
4129           (p_element_name          =>  'Imminent Danger Pay',
4130            p_input_value_name      =>  'Amount',
4131            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4132            p_date_effective        =>  p_pa_request_rec.effective_date,
4133            p_screen_entry_value    =>  p_imminent_danger_pay.amount
4134           );
4135        end if;
4136        if p_imminent_danger_pay.last_action_code is null then
4137           ghr_history_fetch.fetch_element_entry_value
4138           (p_element_name          =>  'Imminent Danger Pay',
4139            p_input_value_name      =>  'Last Action Code',
4140            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4141            p_date_effective        =>  p_pa_request_rec.effective_date,
4142            p_screen_entry_value    =>  p_imminent_danger_pay.last_action_code
4143           );
4144        end if;
4145        if p_imminent_danger_pay.location is null then
4146           ghr_history_fetch.fetch_element_entry_value
4147           (p_element_name          =>  'Imminent Danger Pay',
4148            p_input_value_name      =>  'Location',
4149            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4150            p_date_effective        =>  p_pa_request_rec.effective_date,
4151            p_screen_entry_value    =>  p_imminent_danger_pay.location
4152           );
4153        end if;
4154     end if;
4155     --
4156     hr_utility.set_location('Leaving ' ||l_proc,5);
4157     --
4158   END imminent_danger_pay;
4159   --
4160   --
4161   Procedure living_quarters_allow is
4162     l_proc        varchar2(70) := 'non_sf52_extra_info - living_quarters_allow';
4163   Begin
4164     --
4165     hr_utility.set_location('Entering ' ||l_proc,5);
4166     --
4167     p_living_quarters_allow.purchase_amount      := l_pa_request_ei_rec.rei_information3;
4168     p_living_quarters_allow.purchase_date        := l_pa_request_ei_rec.rei_information4;
4169     p_living_quarters_allow.rent_amount          := l_pa_request_ei_rec.rei_information5;
4170     p_living_quarters_allow.utility_amount       := l_pa_request_ei_rec.rei_information6;
4171     p_living_quarters_allow.last_action_code     := l_pa_request_ei_rec.rei_information7;
4172     p_living_quarters_allow.location             := l_pa_request_ei_rec.rei_information8;
4173     p_living_quarters_allow.quarters_type        := l_pa_request_ei_rec.rei_information9;
4174     p_living_quarters_allow.shared_percent       := l_pa_request_ei_rec.rei_information10;
4175     p_living_quarters_allow.no_of_family_members := l_pa_request_ei_rec.rei_information11;
4176     p_living_quarters_allow.summer_record_ind    := l_pa_request_ei_rec.rei_information12;
4177     p_living_quarters_allow.quarters_group       := l_pa_request_ei_rec.rei_information13;
4178     p_living_quarters_allow.currency             := l_pa_request_ei_rec.rei_information14;
4179 
4180     if p_living_quarters_allow.purchase_amount      is not null or
4181        p_living_quarters_allow.purchase_date        is not null or
4182        p_living_quarters_allow.rent_amount          is not null or
4183        p_living_quarters_allow.utility_amount       is not null or
4184        p_living_quarters_allow.last_action_code     is not null or
4185        p_living_quarters_allow.location             is not null or
4186        p_living_quarters_allow.quarters_type        is not null or
4187        p_living_quarters_allow.shared_percent       is not null or
4188        p_living_quarters_allow.no_of_family_members is not null or
4189        p_living_quarters_allow.summer_record_ind    is not null or
4190        p_living_quarters_allow.quarters_group       is not null or
4191        p_living_quarters_allow.currency             is not null then
4192        p_living_quarters_allow.living_quarters_allow_flag := 'Y';
4193     end if;
4194 
4195     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4196        if p_living_quarters_allow.purchase_amount is null then
4197           ghr_history_fetch.fetch_element_entry_value
4198           (p_element_name          =>  'Living Quarters Allowance',
4199            p_input_value_name      =>  'Purchase Amount',
4200            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4201            p_date_effective        =>  p_pa_request_rec.effective_date,
4202            p_screen_entry_value    =>  p_living_quarters_allow.purchase_amount
4203           );
4204        end if;
4205        if p_living_quarters_allow.purchase_date is null then
4206           ghr_history_fetch.fetch_element_entry_value
4207           (p_element_name          =>  'Living Quarters Allowance',
4208            p_input_value_name      =>  'Purchase Date',
4209            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4210            p_date_effective        =>  p_pa_request_rec.effective_date,
4211            p_screen_entry_value    =>  p_living_quarters_allow.purchase_date
4212           );
4213        end if;
4214        if p_living_quarters_allow.rent_amount is null then
4215           ghr_history_fetch.fetch_element_entry_value
4216           (p_element_name          =>  'Living Quarters Allowance',
4217            p_input_value_name      =>  'Rent Amount',
4218            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4219            p_date_effective        =>  p_pa_request_rec.effective_date,
4220            p_screen_entry_value    =>  p_living_quarters_allow.rent_amount
4221           );
4222        end if;
4223        if p_living_quarters_allow.utility_amount is null then
4224           ghr_history_fetch.fetch_element_entry_value
4225           (p_element_name          =>  'Living Quarters Allowance',
4226            p_input_value_name      =>  'Utility Amount',
4227            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4228            p_date_effective        =>  p_pa_request_rec.effective_date,
4229            p_screen_entry_value    =>  p_living_quarters_allow.utility_amount
4230           );
4231        end if;
4232        if p_living_quarters_allow.last_action_code is null then
4233           ghr_history_fetch.fetch_element_entry_value
4234           (p_element_name          =>  'Living Quarters Allowance',
4235            p_input_value_name      =>  'Last Action Code',
4236            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4237            p_date_effective        =>  p_pa_request_rec.effective_date,
4238            p_screen_entry_value    =>  p_living_quarters_allow.last_action_code
4239           );
4240        end if;
4241        if p_living_quarters_allow.location is null then
4242           ghr_history_fetch.fetch_element_entry_value
4243           (p_element_name          =>  'Living Quarters Allowance',
4244            p_input_value_name      =>  'Location',
4245            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4246            p_date_effective        =>  p_pa_request_rec.effective_date,
4247            p_screen_entry_value    =>  p_living_quarters_allow.location
4248           );
4249        end if;
4250        if p_living_quarters_allow.quarters_type is null then
4251           ghr_history_fetch.fetch_element_entry_value
4252           (p_element_name          =>  'Living Quarters Allowance',
4253            p_input_value_name      =>  'Quarters Type',
4254            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4255            p_date_effective        =>  p_pa_request_rec.effective_date,
4256            p_screen_entry_value    =>  p_living_quarters_allow.quarters_type
4257           );
4258        end if;
4259        if p_living_quarters_allow.shared_percent is null then
4260           ghr_history_fetch.fetch_element_entry_value
4261           (p_element_name          =>  'Living Quarters Allowance',
4262            p_input_value_name      =>  'Shared Percent',
4263            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4264            p_date_effective        =>  p_pa_request_rec.effective_date,
4265            p_screen_entry_value    =>  p_living_quarters_allow.shared_percent
4266           );
4267        end if;
4268        if p_living_quarters_allow.no_of_family_members is null then
4269           ghr_history_fetch.fetch_element_entry_value
4270           (p_element_name          =>  'Living Quarters Allowance',
4271            p_input_value_name      =>  'No. Family Members',
4272            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4273            p_date_effective        =>  p_pa_request_rec.effective_date,
4274            p_screen_entry_value    =>  p_living_quarters_allow.no_of_family_members
4275           );
4276        end if;
4277        if p_living_quarters_allow.summer_record_ind is null then
4278           ghr_history_fetch.fetch_element_entry_value
4279           (p_element_name          =>  'Living Quarters Allowance',
4280            p_input_value_name      =>  'Summer Record Ind',
4281            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4282            p_date_effective        =>  p_pa_request_rec.effective_date,
4283            p_screen_entry_value    =>  p_living_quarters_allow.summer_record_ind
4284           );
4285        end if;
4286        if p_living_quarters_allow.quarters_group is null then
4287           ghr_history_fetch.fetch_element_entry_value
4288           (p_element_name          =>  'Living Quarters Allowance',
4289            p_input_value_name      =>  'Quarters Group',
4290            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4291            p_date_effective        =>  p_pa_request_rec.effective_date,
4292            p_screen_entry_value    =>  p_living_quarters_allow.quarters_group
4293           );
4294        end if;
4295        if p_living_quarters_allow.currency is null then
4296           ghr_history_fetch.fetch_element_entry_value
4297           (p_element_name          =>  'Living Quarters Allowance',
4298            p_input_value_name      =>  'Currency',
4299            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4300            p_date_effective        =>  p_pa_request_rec.effective_date,
4301            p_screen_entry_value    =>  p_living_quarters_allow.currency
4302           );
4303        end if;
4304     end if;
4305     --
4306     hr_utility.set_location('Leaving ' ||l_proc,5);
4307     --
4308   END living_quarters_allow;
4309   --
4310   --
4311   Procedure post_diff_amt is
4312     l_proc        varchar2(70) := 'non_sf52_extra_info - post_diff_amt';
4313   Begin
4314     --
4315     hr_utility.set_location('Entering ' ||l_proc,5);
4316     --
4317     p_post_diff_amt.amount               := l_pa_request_ei_rec.rei_information3;
4318     p_post_diff_amt.last_action_code     := l_pa_request_ei_rec.rei_information4;
4319     p_post_diff_amt.location             := l_pa_request_ei_rec.rei_information5;
4320     p_post_diff_amt.no_of_family_members := l_pa_request_ei_rec.rei_information6;
4321 
4322 
4323     if p_post_diff_amt.amount               is not null or
4324        p_post_diff_amt.last_action_code     is not null or
4325        p_post_diff_amt.location             is not null or
4326        p_post_diff_amt.no_of_family_members is not null then
4327        p_post_diff_amt.post_diff_amt_flag  := 'Y';
4328     end if;
4329     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4330        if p_post_diff_amt.amount is null then
4331           ghr_history_fetch.fetch_element_entry_value
4332 --          (p_element_name          =>  'Post Differential Amount', -- Bug 2645878 Renamed element
4333 			(p_element_name          =>  'Post Allowance',
4334            p_input_value_name      =>  'Amount',
4335            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4336            p_date_effective        =>  p_pa_request_rec.effective_date,
4337            p_screen_entry_value    =>  p_post_diff_amt.amount
4338           );
4339        end if;
4340        if p_post_diff_amt.last_action_code is null then
4341           ghr_history_fetch.fetch_element_entry_value
4342 --          (p_element_name          =>  'Post Differential Amount', -- Bug 2645878 Renamed element
4343 			(p_element_name          =>  'Post Allowance',
4344            p_input_value_name      =>  'Last Action Code',
4345            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4346            p_date_effective        =>  p_pa_request_rec.effective_date,
4347            p_screen_entry_value    =>  p_post_diff_amt.last_action_code
4348           );
4349        end if;
4350        if p_post_diff_amt.location is null then
4351           ghr_history_fetch.fetch_element_entry_value
4352 --          (p_element_name          =>  'Post Differential Amount', -- Bug 2645878 Renamed element
4353 			(p_element_name          =>  'Post Allowance',
4354 		   p_input_value_name      =>  'Location',
4355            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4356            p_date_effective        =>  p_pa_request_rec.effective_date,
4357            p_screen_entry_value    =>  p_post_diff_amt.location
4358           );
4359        end if;
4360        if p_post_diff_amt.no_of_family_members is null then
4361           ghr_history_fetch.fetch_element_entry_value
4362 --          (p_element_name          =>  'Post Differential Amount', -- Bug 2645878 Renamed element
4363 			(p_element_name          =>  'Post Allowance',
4364            p_input_value_name      =>  'No. Family Members',
4365            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4366            p_date_effective        =>  p_pa_request_rec.effective_date,
4367            p_screen_entry_value    =>  p_post_diff_amt.no_of_family_members
4368           );
4369        end if;
4370     end if;
4371     --
4372     hr_utility.set_location('Leaving ' ||l_proc,5);
4373     --
4374   END post_diff_amt;
4375   --
4376   --
4377   Procedure post_diff_percent is
4378     l_proc        varchar2(70) := 'non_sf52_extra_info - post_diff_percent';
4379   Begin
4380     --
4381     hr_utility.set_location('Entering ' ||l_proc,5);
4382     --
4383     p_post_diff_percent.percent              := l_pa_request_ei_rec.rei_information3;
4384     p_post_diff_percent.last_action_code     := l_pa_request_ei_rec.rei_information4;
4385     p_post_diff_percent.location             := l_pa_request_ei_rec.rei_information5;
4386     if p_post_diff_percent.percent              is not null or
4387        p_post_diff_percent.last_action_code     is not null or
4388        p_post_diff_percent.location             is not null then
4389        p_post_diff_percent.post_diff_percent_flag  := 'Y';
4390     end if;
4391     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4392        if p_post_diff_percent.percent is null then
4393           ghr_history_fetch.fetch_element_entry_value
4394 --          (p_element_name          =>  'Post Differential Percent', -- Bug 2645878 Renamed element
4395 			(p_element_name          =>  'Post Differential',
4396            p_input_value_name      =>  'Percentage',
4397            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4398            p_date_effective        =>  p_pa_request_rec.effective_date,
4399            p_screen_entry_value    =>  p_post_diff_percent.percent
4400           );
4401        end if;
4402        if p_post_diff_percent.last_action_code is null then
4403           ghr_history_fetch.fetch_element_entry_value
4404 --          (p_element_name          =>  'Post Differential Percent', -- Bug 2645878 Renamed element
4405 			(p_element_name          =>  'Post Differential',
4406            p_input_value_name      =>  'Last Action Code',
4407            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4408            p_date_effective        =>  p_pa_request_rec.effective_date,
4409            p_screen_entry_value    =>  p_post_diff_percent.last_action_code
4410           );
4411        end if;
4412        if p_post_diff_percent.location is null then
4413           ghr_history_fetch.fetch_element_entry_value
4414 --          (p_element_name          =>  'Post Differential Percent', -- Bug 2645878 Renamed element
4415 			(p_element_name          =>  'Post Differential',
4416            p_input_value_name      =>  'Location',
4417            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4418            p_date_effective        =>  p_pa_request_rec.effective_date,
4419            p_screen_entry_value    =>  p_post_diff_percent.location
4420           );
4421        end if;
4422     end if;
4423     --
4424     hr_utility.set_location('Leaving ' ||l_proc,5);
4425     --
4426   END post_diff_percent;
4427   --
4428   --
4429   Procedure sep_maintenance_allow is
4430     l_proc        varchar2(70) := 'non_sf52_extra_info - sep_maintenance_allow';
4431   Begin
4432     --
4433     hr_utility.set_location('Entering ' ||l_proc,5);
4434     --
4435     p_sep_maintenance_allow.amount               := l_pa_request_ei_rec.rei_information3;
4436     p_sep_maintenance_allow.last_action_code     := l_pa_request_ei_rec.rei_information4;
4437     p_sep_maintenance_allow.category             := l_pa_request_ei_rec.rei_information5;
4438 
4439     if p_sep_maintenance_allow.amount               is not null or
4440        p_sep_maintenance_allow.last_action_code     is not null or
4441        p_sep_maintenance_allow.category             is not null then
4442        p_sep_maintenance_allow.sep_maint_allow_flag  := 'Y';
4443     end if;
4444     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4445        if p_sep_maintenance_allow.amount is null then
4446           ghr_history_fetch.fetch_element_entry_value
4447           (p_element_name          =>  'Separate Maintenance Allowance',
4448            p_input_value_name      =>  'Amount',
4449            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4450            p_date_effective        =>  p_pa_request_rec.effective_date,
4451            p_screen_entry_value    =>  p_sep_maintenance_allow.amount
4452           );
4453        end if;
4454        if p_sep_maintenance_allow.last_action_code is null then
4455           ghr_history_fetch.fetch_element_entry_value
4456           (p_element_name          =>  'Separate Maintenance Allowance',
4457            p_input_value_name      =>  'Last Action Code',
4458            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4459            p_date_effective        =>  p_pa_request_rec.effective_date,
4460            p_screen_entry_value    =>  p_sep_maintenance_allow.last_action_code
4461           );
4462        end if;
4463        if p_sep_maintenance_allow.category is null then
4464           ghr_history_fetch.fetch_element_entry_value
4465           (p_element_name          =>  'Separate Maintenance Allowance',
4466            p_input_value_name      =>  'Category',
4467            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4468            p_date_effective        =>  p_pa_request_rec.effective_date,
4469            p_screen_entry_value    =>  p_sep_maintenance_allow.category
4470           );
4471        end if;
4472     end if;
4473     --
4474     hr_utility.set_location('Leaving ' ||l_proc,5);
4475     --
4476   END sep_maintenance_allow;
4477   --
4478   --
4479   Procedure supplemental_post_allow is
4480     l_proc        varchar2(70) := 'non_sf52_extra_info - supplemental_post_allow';
4481   Begin
4482     --
4483     hr_utility.set_location('Entering ' ||l_proc,5);
4484     --
4485     p_supplemental_post_allow.amount   := l_pa_request_ei_rec.rei_information3;
4486 
4487     if p_supplemental_post_allow.amount   is not null then
4488        p_supplemental_post_allow.sup_post_allow_flag  := 'Y';
4489     end if;
4490     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4491        if p_supplemental_post_allow.amount is null then
4492           ghr_history_fetch.fetch_element_entry_value
4493           (p_element_name          =>  'Supplemental Post Allowance',
4494            p_input_value_name      =>  'Amount',
4495            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4496            p_date_effective        =>  p_pa_request_rec.effective_date,
4497            p_screen_entry_value    =>  p_supplemental_post_allow.amount
4498           );
4499        end if;
4500     End if;
4501     hr_utility.set_location('Leaving ' ||l_proc,5);
4502     --
4503   END supplemental_post_allow;
4504   --
4505   --
4506   Procedure temp_lodge_allow is
4507     l_proc        varchar2(70) := 'non_sf52_extra_info - temp_lodge_allow';
4508   Begin
4509     --
4510     hr_utility.set_location('Entering ' ||l_proc,5);
4511     --
4512     p_temp_lodge_allow.allowance_type  := l_pa_request_ei_rec.rei_information3;
4513     p_temp_lodge_allow.daily_rate      := l_pa_request_ei_rec.rei_information4;
4514 
4515     if p_temp_lodge_allow.allowance_type   is not null and
4516        p_temp_lodge_allow.daily_rate is not null then
4517        p_temp_lodge_allow.temp_lodge_allow_flag  := 'Y';
4518     end if;
4519     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4520        if p_temp_lodge_allow.allowance_type is null then
4521           ghr_history_fetch.fetch_element_entry_value
4522           (p_element_name          =>  'Temporary Lodging Allowance',
4523            p_input_value_name      =>  'Allowance Type',
4524            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4525            p_date_effective        =>  p_pa_request_rec.effective_date,
4526            p_screen_entry_value    =>  p_temp_lodge_allow.allowance_type
4527           );
4528        end if;
4529        if p_temp_lodge_allow.daily_rate is null then
4530           ghr_history_fetch.fetch_element_entry_value
4531           (p_element_name          =>  'Temporary Lodging Allowance',
4532            p_input_value_name      =>  'Daily Rate',
4533            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4534            p_date_effective        =>  p_pa_request_rec.effective_date,
4535            p_screen_entry_value    =>  p_temp_lodge_allow.daily_rate
4536           );
4537        end if;
4538     End if;
4539     hr_utility.set_location('Leaving ' ||l_proc,5);
4540     --
4541   END temp_lodge_allow;
4542   --
4543   --
4544   Procedure premium_pay is
4545     l_proc        varchar2(70) := 'non_sf52_extra_info - premium_pay';
4546   Begin
4547     --
4548     hr_utility.set_location('Entering ' ||l_proc,5);
4549     --
4550     p_premium_pay.premium_pay_ind := l_pa_request_ei_rec.rei_information3;
4551     p_premium_pay.amount          := l_pa_request_ei_rec.rei_information4;
4552 
4553     if p_premium_pay.premium_pay_ind is not null or
4554        p_premium_pay.amount   is not null then
4555        p_premium_pay.premium_pay_flag  := 'Y';
4556     end if;
4557     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4558        if p_premium_pay.premium_pay_ind is null then
4559           ghr_history_fetch.fetch_element_entry_value
4560           (p_element_name          =>  'Premium Pay',
4561            p_input_value_name      =>  'Premium Pay Ind',
4562            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4563            p_date_effective        =>  p_pa_request_rec.effective_date,
4564            p_screen_entry_value    =>  p_premium_pay.premium_pay_ind
4565           );
4566        end if;
4567        if p_premium_pay.amount is null then
4568           ghr_history_fetch.fetch_element_entry_value
4569           (p_element_name          =>  'Premium Pay',
4570            p_input_value_name      =>  'Amount',
4571            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4572            p_date_effective        =>  p_pa_request_rec.effective_date,
4573            p_screen_entry_value    =>  p_premium_pay.amount
4574           );
4575        end if;
4576     End if;
4577     hr_utility.set_location('Leaving ' ||l_proc,5);
4578     --
4579   END premium_pay;
4580   --
4581   --
4582   Procedure retirement_annuity is
4583     l_proc        varchar2(70) := 'non_sf52_extra_info - retirement_annuity';
4584   Begin
4585     --
4586     hr_utility.set_location('Entering ' ||l_proc,5);
4587     --
4588     p_retirement_annuity.annuity_sum         := l_pa_request_ei_rec.rei_information3;
4589     p_retirement_annuity.eligibility_expires := l_pa_request_ei_rec.rei_information4;
4590 
4591     if p_retirement_annuity.annuity_sum         is not null or
4592        p_retirement_annuity.eligibility_expires is not null then
4593        p_retirement_annuity.retirement_annuity_flag  := 'Y';
4594     end if;
4595     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4596        if p_retirement_annuity.annuity_sum is null then
4597           ghr_history_fetch.fetch_element_entry_value
4598           (p_element_name          =>  'Retirement Annuity',
4599            p_input_value_name      =>  'Sum',
4600            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4601            p_date_effective        =>  p_pa_request_rec.effective_date,
4602            p_screen_entry_value    =>  p_retirement_annuity.annuity_sum
4603           );
4604        end if;
4605        if p_retirement_annuity.eligibility_expires is null then
4606           ghr_history_fetch.fetch_element_entry_value
4607           (p_element_name          =>  'Retirement Annuity',
4608            p_input_value_name      =>  'Eligibility Expires',
4609            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4610            p_date_effective        =>  p_pa_request_rec.effective_date,
4611            p_screen_entry_value    =>  p_retirement_annuity.eligibility_expires
4612           );
4613        end if;
4614     End if;
4615     hr_utility.set_location('Leaving ' ||l_proc,5);
4616     --
4617   END retirement_annuity;
4618   --
4619   --
4620   Procedure severance_pay is
4621     l_proc        varchar2(70) := 'non_sf52_extra_info - severance_pay';
4622   Begin
4623     --
4624     hr_utility.set_location('Entering ' ||l_proc,5);
4625     --
4626     p_severance_pay.amount                  := l_pa_request_ei_rec.rei_information3;
4627     p_severance_pay.total_entitlement_weeks := l_pa_request_ei_rec.rei_information4;
4628     p_severance_pay.number_weeks_paid       := l_pa_request_ei_rec.rei_information5;
4629     p_severance_pay.weekly_amount           := l_pa_request_ei_rec.rei_information6;
4630 
4631     if p_severance_pay.amount                  is not null or
4632        p_severance_pay.total_entitlement_weeks is not null or
4633        p_severance_pay.number_weeks_paid       is not null or
4634        p_severance_pay.weekly_amount           is not null then
4635        p_severance_pay.severance_pay_flag  := 'Y';
4636     end if;
4637     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4638        if p_severance_pay.amount is null then
4639           ghr_history_fetch.fetch_element_entry_value
4640           (p_element_name          =>  'Severance Pay',
4641            p_input_value_name      =>  'Amount',
4642            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4643            p_date_effective        =>  p_pa_request_rec.effective_date,
4644            p_screen_entry_value    =>  p_severance_pay.amount
4645           );
4646        end if;
4647        if p_severance_pay.total_entitlement_weeks is null then
4648           ghr_history_fetch.fetch_element_entry_value
4649           (p_element_name          =>  'Severance Pay',
4650            p_input_value_name      =>  'Total Entitlement Weeks',
4651            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4652            p_date_effective        =>  p_pa_request_rec.effective_date,
4653            p_screen_entry_value    =>  p_severance_pay.total_entitlement_weeks
4654           );
4655        end if;
4656        if p_severance_pay.number_weeks_paid is null then
4657           ghr_history_fetch.fetch_element_entry_value
4658           (p_element_name          =>  'Severance Pay',
4659            p_input_value_name      =>  'Number Weeks Paid',
4660            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4661            p_date_effective        =>  p_pa_request_rec.effective_date,
4662            p_screen_entry_value    =>  p_severance_pay.number_weeks_paid
4663           );
4664        end if;
4665        if p_severance_pay.weekly_amount is null then
4666           ghr_history_fetch.fetch_element_entry_value
4667           (p_element_name          =>  'Severance Pay',
4668            p_input_value_name      =>  'Weekly Amount',
4669            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4670            p_date_effective        =>  p_pa_request_rec.effective_date,
4671            p_screen_entry_value    =>  p_severance_pay.weekly_amount
4672           );
4673        end if;
4674     End if;
4675     hr_utility.set_location('Leaving ' ||l_proc,5);
4676     --
4677   END severance_pay;
4678   --
4679   --
4680 /*
4681   Procedure thrift_saving_plan is
4682     l_proc   varchar2(70) := 'non_sf52_extra_info - thrift_saving_plan';
4683   Begin
4684     --
4685     hr_utility.set_location('Entering ' ||l_proc,5);
4686     --
4687     p_thrift_saving_plan.amount           := l_pa_request_ei_rec.rei_information3;
4688     p_thrift_saving_plan.rate             := l_pa_request_ei_rec.rei_information4;
4689     p_thrift_saving_plan.g_fund           := l_pa_request_ei_rec.rei_information5;
4690     p_thrift_saving_plan.f_fund           := l_pa_request_ei_rec.rei_information6;
4691     p_thrift_saving_plan.c_fund           := l_pa_request_ei_rec.rei_information7;
4692     p_thrift_saving_plan.status           := l_pa_request_ei_rec.rei_information8;
4693     p_thrift_saving_plan.status_date      := l_pa_request_ei_rec.rei_information9;
4694     p_thrift_saving_plan.agncy_contrib_elig_date := l_pa_request_ei_rec.rei_information10;
4695     p_thrift_saving_plan.emp_contrib_elig_date := l_pa_request_ei_rec.rei_information11;
4696 
4697     if p_thrift_saving_plan.amount           is not null or
4698        p_thrift_saving_plan.rate             is not null or
4699        p_thrift_saving_plan.g_fund           is not null or
4700        p_thrift_saving_plan.f_fund           is not null or
4701        p_thrift_saving_plan.c_fund           is not null or
4702        p_thrift_saving_plan.status           is not null or
4703        p_thrift_saving_plan.status_date      is not null or
4704        p_thrift_saving_plan.agncy_contrib_elig_date is not null then
4705        p_thrift_saving_plan.tsp_flag  := 'Y';
4706     end if;
4707 
4708 -- Bug#2146912  Added set_extra_info call
4709      set_extra_info(p_per_scd_info.scd_tsp,l_pa_request_ei_rec.rei_information12,
4710                     p_per_scd_info.per_scd_info_flag, 'Y');
4711 
4712     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4713        if p_thrift_saving_plan.amount is null then
4714           ghr_history_fetch.fetch_element_entry_value
4715           (p_element_name          =>  'TSP',
4716            p_input_value_name      =>  'Amount',
4717            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4718            p_date_effective        =>  p_pa_request_rec.effective_date,
4719            p_screen_entry_value    =>  p_thrift_saving_plan.amount
4720           );
4721        end if;
4722        if p_thrift_saving_plan.rate is null then
4723           ghr_history_fetch.fetch_element_entry_value
4724           (p_element_name          =>  'TSP',
4725            p_input_value_name      =>  'Rate',
4726            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4727            p_date_effective        =>  p_pa_request_rec.effective_date,
4728            p_screen_entry_value    =>  p_thrift_saving_plan.rate
4729           );
4730        end if;
4731        if p_thrift_saving_plan.g_fund is null then
4732           ghr_history_fetch.fetch_element_entry_value
4733           (p_element_name          =>  'TSP',
4734            p_input_value_name      =>  'G Fund',
4735            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4736            p_date_effective        =>  p_pa_request_rec.effective_date,
4737            p_screen_entry_value    =>  p_thrift_saving_plan.g_fund
4738           );
4739        end if;
4740        if p_thrift_saving_plan.f_fund is null then
4741           ghr_history_fetch.fetch_element_entry_value
4742           (p_element_name          =>  'TSP',
4743            p_input_value_name      =>  'F Fund',
4744            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4745            p_date_effective        =>  p_pa_request_rec.effective_date,
4746            p_screen_entry_value    =>  p_thrift_saving_plan.f_fund
4747           );
4748        end if;
4749        if p_thrift_saving_plan.c_fund is null then
4750           ghr_history_fetch.fetch_element_entry_value
4751           (p_element_name          =>  'TSP',
4752            p_input_value_name      =>  'C Fund',
4753            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4754            p_date_effective        =>  p_pa_request_rec.effective_date,
4755            p_screen_entry_value    =>  p_thrift_saving_plan.c_fund
4756           );
4757        end if;
4758        if p_thrift_saving_plan.status is null then
4759           ghr_history_fetch.fetch_element_entry_value
4760           (p_element_name          =>  'TSP',
4761            p_input_value_name      =>  'Status',
4762            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4763            p_date_effective        =>  p_pa_request_rec.effective_date,
4764            p_screen_entry_value    =>  p_thrift_saving_plan.status
4765           );
4766        end if;
4767        if p_thrift_saving_plan.status_date is null then
4768           ghr_history_fetch.fetch_element_entry_value
4769           (p_element_name          =>  'TSP',
4770            p_input_value_name      =>  'Status Date',
4771            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4772            p_date_effective        =>  p_pa_request_rec.effective_date,
4773            p_screen_entry_value    =>  p_thrift_saving_plan.status_date
4774           );
4775        end if;
4776        if p_thrift_saving_plan.agncy_contrib_elig_date is null then
4777           ghr_history_fetch.fetch_element_entry_value
4778           (p_element_name          =>  'TSP',
4779            p_input_value_name      =>  'Agncy Contrib Elig Date',
4780            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4781            p_date_effective        =>  p_pa_request_rec.effective_date,
4782            p_screen_entry_value    =>  p_thrift_saving_plan.agncy_contrib_elig_date
4783           );
4784        end if;
4785        if p_thrift_saving_plan.emp_contrib_elig_date is null then
4786           ghr_history_fetch.fetch_element_entry_value
4787           (p_element_name          =>  'TSP',
4788            p_input_value_name      =>  'Emp Contrib Elig Date',
4789            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4790            p_date_effective        =>  p_pa_request_rec.effective_date,
4791            p_screen_entry_value    =>  p_thrift_saving_plan.emp_contrib_elig_date
4792           );
4793        end if;
4794     end if;
4795     hr_utility.set_location('Leaving ' ||l_proc,5);
4796     --
4797   END thrift_saving_plan;*/
4798   --
4799   --
4800   Procedure retention_allow_review is
4801     l_proc   varchar2(70) := 'non_sf52_extra_info - retention_allow_review';
4802   Begin
4803     --
4804     hr_utility.set_location('Entering ' ||l_proc,5);
4805        If  p_pa_request_rec.employee_assignment_id is not null then
4806       ghr_api.retrieve_element_entry_value
4807               (p_element_name          => 'Retention Allowance',
4808                p_input_value_name      => 'Date',
4809                p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4810                p_effective_date        => nvl(p_pa_request_rec.effective_date,trunc(sysdate)) ,
4811                p_value                 => p_retention_allow_review.review_date,
4812                p_multiple_error_flag   => l_multiple_error_flag
4813                );
4814     set_extra_info(p_retention_allow_review.review_date,
4815                    l_pa_request_ei_rec.rei_information3,
4816                    p_retention_allow_review.retention_allow_review_flag, 'N');
4817     --
4818    end if;
4819   End retention_allow_review;
4820   --
4821   Procedure chg_in_tenure is
4822     l_proc  varchar2(70) := 'non_sf52_extra - chg_in_tenure';
4823   Begin
4824     hr_utility.set_location('Entering ' ||l_proc,5);
4825     IF l_session.noa_id_correct is not null THEN
4826       set_extra_info(p_per_group1.appointment_type,l_pa_request_ei_rec.rei_information3,p_per_group1.per_group1_flag);
4827     ELSE
4828       p_per_group1.appointment_type           :=   l_pa_request_ei_rec.rei_information3;
4829       p_per_group1.per_group1_flag            :=  'Y';
4830     END IF;
4831     hr_utility.set_location('Leaving ' ||p_per_group1.appointment_type ||l_proc,10);
4832   End chg_in_tenure;
4833   --
4834   -- 4352589 BEN_EIT Changes Assinging Eligibility Expires to Benefits EIT.
4835   Procedure chg_in_fegli  is
4836     l_proc  varchar2(70) := 'non_sf52_extra - chg_in_fegli';
4837   Begin
4838       hr_utility.set_location('Entering ' ||l_proc,5);
4839       --
4840       p_per_benefit_info.FEGLI_Date_Eligibility_Expires := l_pa_request_ei_rec.rei_information1;
4841       If p_per_benefit_info.FEGLI_Date_Eligibility_Expires is not null then
4842          p_per_benefit_info.per_benefit_info_flag := 'Y';
4843       End If;
4844     hr_utility.set_location('Leaving ' ||l_proc,10);
4845   End chg_in_fegli;
4846   --
4847 --Pradeep
4848 Procedure mddds_pay is
4849   l_proc                varchar2(72) := 'mddds_pay';
4850 
4851 Begin
4852 
4853   hr_utility.set_location('Entering ' ||l_proc,6);
4854 
4855   set_extra_info(p_mddds_special_pay.Full_Time_Status,
4856 	     l_pa_request_ei_rec.rei_information9,
4857 	     p_mddds_special_pay.mddds_special_pay_flag,
4858 	     'Y'  );
4859   set_extra_info(p_mddds_special_pay.Length_of_Service,
4860 	     l_pa_request_ei_rec.rei_information10,
4861 	     p_mddds_special_pay.mddds_special_pay_flag,
4862 	     'Y'  );
4863   set_extra_info(p_mddds_special_pay.Scarce_Specialty,
4864 	     l_pa_request_ei_rec.rei_information3,
4865 	     p_mddds_special_pay.mddds_special_pay_flag,
4866 	     'Y'  );
4867   set_extra_info(p_mddds_special_pay.Specialty_or_Board_Cert,
4868 	     l_pa_request_ei_rec.rei_information4,
4869 	     p_mddds_special_pay.mddds_special_pay_flag,
4870 	     'Y'  );
4871   set_extra_info(p_mddds_special_pay.Geographic_Location,
4872 	     l_pa_request_ei_rec.rei_information5,
4873 	     p_mddds_special_pay.mddds_special_pay_flag,
4874 	     'Y'  );
4875   set_extra_info(p_mddds_special_pay.Exceptional_Qualifications,
4876 	     l_pa_request_ei_rec.rei_information6,
4877 	     p_mddds_special_pay.mddds_special_pay_flag,
4878 	     'Y'  );
4879   set_extra_info(p_mddds_special_pay.Executive_Position,
4880 	     l_pa_request_ei_rec.rei_information7,
4881 	     p_mddds_special_pay.mddds_special_pay_flag,
4882 	     'Y'  );
4883   set_extra_info(p_mddds_special_pay.Dentist_Post_Graduate_Training,
4884 	     l_pa_request_ei_rec.rei_information8,
4885 	     p_mddds_special_pay.mddds_special_pay_flag,
4886 	     'Y'  );
4887   set_extra_info(p_mddds_special_pay.amount,
4888 	     l_pa_request_ei_rec.rei_information11,
4889 	     p_mddds_special_pay.mddds_special_pay_flag,
4890 	     'Y'  );
4891 
4892   set_extra_info(p_mddds_special_pay.mddds_special_pay_date,
4893 	     fnd_date.canonical_to_date(l_pa_request_ei_rec.rei_information12),
4894 	     p_mddds_special_pay.mddds_special_pay_flag,
4895 	     'Y'  );
4896   set_extra_info(p_mddds_special_pay.premium_pay_ind,
4897 	     l_pa_request_ei_rec.rei_information13,
4898 	     p_mddds_special_pay.mddds_special_pay_flag,
4899 	     'Y'  );
4900 
4901 End;
4902   ----Pradeep
4903 Procedure premium_pay_ind is
4904   l_proc                varchar2(72) := 'premium_pay_ind';
4905 
4906 Begin
4907 
4908   hr_utility.set_location('Entering ' ||l_proc,7);
4909 
4910 
4911   set_extra_info(p_premium_pay_ind.premium_pay_ind,
4912 	     l_pa_request_ei_rec.rei_information3,
4913 	     p_premium_pay_ind.premium_pay_ind_flag,
4914 	     'Y'  );
4915 
4916 End;
4917 
4918 -- Bug 4724337 Race or National Origin changes
4919 Procedure race_ethnic_info is
4920   l_proc   varchar2(72) := 'race_ethnic_info';
4921 
4922 Begin
4923 
4924   hr_utility.set_location('Entering ' ||l_proc,7);
4925 
4926   set_extra_info(p_race_ethnic_info.p_hispanic,l_pa_request_ei_rec.rei_information3,
4927    				 p_race_ethnic_info.p_race_ethnic_info_flag, 'Y'  );
4928   set_extra_info(p_race_ethnic_info.p_american_indian,l_pa_request_ei_rec.rei_information4,
4929    				 p_race_ethnic_info.p_race_ethnic_info_flag, 'Y'  );
4930   set_extra_info(p_race_ethnic_info.p_asian,l_pa_request_ei_rec.rei_information5,
4931    				 p_race_ethnic_info.p_race_ethnic_info_flag, 'Y'  );
4932   set_extra_info(p_race_ethnic_info.p_black_afr_american,l_pa_request_ei_rec.rei_information6,
4933    				 p_race_ethnic_info.p_race_ethnic_info_flag, 'Y'  );
4934   set_extra_info(p_race_ethnic_info.p_hawaiian_pacific,l_pa_request_ei_rec.rei_information7,
4935    				 p_race_ethnic_info.p_race_ethnic_info_flag, 'Y'  );
4936   set_extra_info(p_race_ethnic_info.p_white,l_pa_request_ei_rec.rei_information8,
4937    				 p_race_ethnic_info.p_race_ethnic_info_flag, 'Y'  );
4938 End;
4939 
4940 Procedure student_loan_repay is
4941   l_proc varchar2(80):= 'non_sf52_extra - student_loan_repay';
4942 
4943 begin
4944     hr_utility.set_location('Entering ' ||l_proc,5);
4945       --
4946       set_extra_info(p_student_loan_repay.p_amount,
4947 	     p_pa_request_rec.award_amount,
4948 	     p_student_loan_repay.p_student_loan_flag,
4949 	     'Y'  );
4950 
4951       set_extra_info(p_student_loan_repay.p_repay_schedule,
4952 	     l_pa_request_ei_rec.rei_information8,
4953 	     p_student_loan_repay.p_student_loan_flag,
4954 	     'Y'  );
4955 
4956       set_extra_info(p_student_loan_repay.p_review_date,
4957 	     l_pa_request_ei_rec.rei_information9,
4958 	     p_student_loan_repay.p_student_loan_flag,
4959 	     'Y'  );
4960 
4961       If p_student_loan_repay.p_review_date is not null then
4962          p_student_loan_repay.p_student_loan_flag := 'Y';
4963       End If;
4964 
4965 --   p_student_loan_repay.p_amount :=p_pa_request_rec.award_amount;
4966 --     p_student_loan_repay.p_repay_schedule  := l_pa_request_ei_rec.rei_information8;
4967 --      p_student_loan_repay.p_review_date     := l_pa_request_ei_rec.rei_information9;
4968 
4969     hr_utility.set_location('Leaving ' ||l_proc,10);
4970 end;
4971 
4972   -- Bug 4280026
4973   Procedure key_emergency_essntl is
4974      l_proc      varchar2(70) := 'non_sf52_extra - key_emergency_essntl';
4975   Begin
4976      hr_utility.set_location('Entering ' ||l_proc,5);
4977      set_extra_info(p_asg_non_sf52.key_emer_essential_empl,
4978                     l_pa_request_ei_rec.rei_information3,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
4979      hr_utility.set_location('Leaving ' ||l_proc,10);
4980   End key_emergency_essntl;
4981 
4982   -- Bug 5482191
4983   Procedure ghr_conv_dates is
4984      l_proc      varchar2(70) := 'non_sf52_extra - ghr_conv_dates';
4985   Begin
4986      hr_utility.set_location('Entering ' ||l_proc,5);
4987      set_extra_info(p_per_conversions.date_conv_career_begins,
4988                       l_pa_request_ei_rec.rei_information3,p_per_conversions.per_conversions_flag,'Y');
4989      set_extra_info(p_per_conversions.date_conv_career_due,
4990                       l_pa_request_ei_rec.rei_information4,p_per_conversions.per_conversions_flag,'Y');
4991      set_extra_info(p_per_conversions.date_recmd_conv_begins,
4992                       l_pa_request_ei_rec.rei_information5,p_per_conversions.per_conversions_flag,'Y');
4993      set_extra_info(p_per_conversions.date_recmd_conv_due,
4994                       l_pa_request_ei_rec.rei_information7,p_per_conversions.per_conversions_flag,'Y');
4995      set_extra_info(p_per_conversions.date_vra_conv_due,
4996                       l_pa_request_ei_rec.rei_information6,p_per_conversions.per_conversions_flag,'Y');
4997      hr_utility.set_location('Leaving ' ||l_proc,10);
4998   End ghr_conv_dates;
4999 
5000 
5001 -- Start of Bug 6312144 -- New IPA Benefits Continuation EIT
5002   Procedure ipa_benefits_cont is
5003      l_proc      varchar2(70) := 'non_sf52_extra - ipa_benefits_cont';
5004   Begin
5005      hr_utility.set_location('Entering ' ||l_proc,5);
5006      set_extra_info(p_ipa_benefits_cont.FEGLI_Indicator,
5007                       l_pa_request_ei_rec.rei_information1,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
5008      set_extra_info(p_ipa_benefits_cont.FEGLI_Election_Date,
5009                       l_pa_request_ei_rec.rei_information2,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
5010      set_extra_info(p_ipa_benefits_cont.FEGLI_Elec_Not_Date,
5011                       l_pa_request_ei_rec.rei_information3,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
5012      set_extra_info(p_ipa_benefits_cont.FEHB_Indicator,
5013                       l_pa_request_ei_rec.rei_information4,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
5014      set_extra_info(p_ipa_benefits_cont.FEHB_Election_Date,
5015                       l_pa_request_ei_rec.rei_information5,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
5016      set_extra_info(p_ipa_benefits_cont.FEHB_Elec_Notf_Date,
5017                       l_pa_request_ei_rec.rei_information6,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
5018      set_extra_info(p_ipa_benefits_cont.retirement_Indicator,
5019                       l_pa_request_ei_rec.rei_information7,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
5020      set_extra_info(p_ipa_benefits_cont.retirement_Elec_Date,
5021                       l_pa_request_ei_rec.rei_information12,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
5022      set_extra_info(p_ipa_benefits_cont.retirement_Elec_Notf_Date,
5023                       l_pa_request_ei_rec.rei_information8,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
5024      set_extra_info(p_ipa_benefits_cont.Cont_Term_Insuff_Pay_Elec_Date,
5025                       l_pa_request_ei_rec.rei_information9,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
5026      set_extra_info(p_ipa_benefits_cont.Cont_Term_Insuff_Pay_Notf_Date,
5027                       l_pa_request_ei_rec.rei_information10,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
5028      set_extra_info(p_ipa_benefits_cont.Cont_Term_Insuff_Pmt_Type_Code,
5029                       l_pa_request_ei_rec.rei_information11,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
5030      hr_utility.set_location('Leaving ' ||l_proc,10);
5031   End ipa_benefits_cont;
5032 
5033 
5034  -- Bug 6312144 -- New Federal Benefits Info EIT
5035   Procedure ben_info_cont is
5036      l_proc      varchar2(70) := 'non_sf52_extra - Federal Benefit Info';
5037   Begin
5038      hr_utility.set_location('Entering ' ||l_proc,5);
5039      set_extra_info(p_per_benefit_info.FEGLI_Assignment_Ind,
5040                       l_pa_request_ei_rec.rei_information1,p_per_benefit_info.per_benefit_info_flag,'Y');
5041      set_extra_info(p_per_benefit_info.FEGLI_Post_Elec_Basic_Ins_Amt,
5042                       l_pa_request_ei_rec.rei_information2,p_per_benefit_info.per_benefit_info_flag,'Y');
5043      set_extra_info(p_per_benefit_info.FEGLI_Court_Order_Ind,
5044                       l_pa_request_ei_rec.rei_information3,p_per_benefit_info.per_benefit_info_flag,'Y');
5045      set_extra_info(p_per_benefit_info.Desg_FEGLI_Benf_Ind,
5046                       l_pa_request_ei_rec.rei_information4,p_per_benefit_info.per_benefit_info_flag,'Y');
5047      set_extra_info(p_per_benefit_info.FEHB_Event_Code,
5048                       l_pa_request_ei_rec.rei_information5,p_per_benefit_info.per_benefit_info_flag,'Y');
5049      hr_utility.set_location('Leaving ' ||l_proc,10);
5050   End ben_info_cont;
5051 
5052   -- Bug 6312144 -- Retirement system information
5053   Procedure retirement_info is
5054      l_proc      varchar2(70) := 'non_sf52_extra - Retirement System Info';
5055   Begin
5056      hr_utility.set_location('Entering ' ||l_proc,5);
5057      set_extra_info(p_retirement_info.special_population_code,
5058                       l_pa_request_ei_rec.rei_information1,p_retirement_info.per_retirement_info_flag,'Y');
5059      set_extra_info(p_retirement_info.App_Exc_CSRS_Ind,
5060                       l_pa_request_ei_rec.rei_information2,p_retirement_info.per_retirement_info_flag,'Y');
5061      set_extra_info(p_retirement_info.App_Exc_FERS_Ind,
5062                       l_pa_request_ei_rec.rei_information3,p_retirement_info.per_retirement_info_flag,'Y');
5063      set_extra_info(p_retirement_info.FICA_Coverage_Ind1,
5064                       l_pa_request_ei_rec.rei_information4,p_retirement_info.per_retirement_info_flag,'Y');
5065      set_extra_info(p_retirement_info.FICA_Coverage_Ind2,
5066                       l_pa_request_ei_rec.rei_information5,p_retirement_info.per_retirement_info_flag,'Y');
5067      hr_utility.set_location('Leaving ' ||l_proc,10);
5068   End retirement_info;
5069   -- Start of Bug 8653508 -- Detail Information updating to Assignment EIT
5070   Procedure detail_info is
5071      l_proc      varchar2(70) := 'non_sf52_extra - detail_info';
5072   Begin
5073      hr_utility.set_location('Entering ' ||l_proc,5);
5074      --Begin Bug 10182526
5075      /*set_extra_info(p_asg_detail_info.detail_begin_date,
5076                       l_pa_request_ei_rec.rei_information1,p_asg_detail_info.asg_detail_info_flag,'Y');
5077      set_extra_info(p_asg_detail_info.detail_end_date,
5078                       l_pa_request_ei_rec.rei_information2,p_asg_detail_info.asg_detail_info_flag,'Y');*/--end Bug 10182526
5079      set_extra_info(p_asg_detail_info.detail_type,
5080                       l_pa_request_ei_rec.rei_information3,p_asg_detail_info.asg_detail_info_flag,'Y');
5081      set_extra_info(p_asg_detail_info.unclss_duty_ind,
5082                       l_pa_request_ei_rec.rei_information4,p_asg_detail_info.asg_detail_info_flag,'Y');
5083      set_extra_info(p_asg_detail_info.position_name,
5084                       l_pa_request_ei_rec.rei_information5,p_asg_detail_info.asg_detail_info_flag,'Y');
5085      set_extra_info(p_asg_detail_info.valid_grade,
5086                       l_pa_request_ei_rec.rei_information6,p_asg_detail_info.asg_detail_info_flag,'Y');
5087      set_extra_info(p_asg_detail_info.occ_series,
5088                       l_pa_request_ei_rec.rei_information7,p_asg_detail_info.asg_detail_info_flag,'Y');
5089      set_extra_info(p_asg_detail_info.appropriation_code,
5090                       l_pa_request_ei_rec.rei_information8,p_asg_detail_info.asg_detail_info_flag,'Y');
5091      set_extra_info(p_asg_detail_info.flsa_category,
5092                       l_pa_request_ei_rec.rei_information9,p_asg_detail_info.asg_detail_info_flag,'Y');
5093      set_extra_info(p_asg_detail_info.bargaining_unit_status,
5094                       l_pa_request_ei_rec.rei_information10,p_asg_detail_info.asg_detail_info_flag,'Y');
5095      set_extra_info(p_asg_detail_info.work_schedule,
5096                       l_pa_request_ei_rec.rei_information11,p_asg_detail_info.asg_detail_info_flag,'Y');
5097      set_extra_info(p_asg_detail_info.duty_location,
5098                       l_pa_request_ei_rec.rei_information12,p_asg_detail_info.asg_detail_info_flag,'Y');
5099      set_extra_info(p_asg_detail_info.organization,
5100                       l_pa_request_ei_rec.rei_information13,p_asg_detail_info.asg_detail_info_flag,'Y');
5101      hr_utility.set_location('Leaving ' ||l_proc,10);
5102   End detail_info;
5103 -- End of Bug 8653508
5104    /* --Begin Bug# 4588575
5105     Procedure ghr_prob_info is
5106     l_proc      varchar2(70) := 'non_sf52_extra - ghr_prob_info';
5107     Begin
5108         hr_utility.set_location('Entering ' ||l_proc,55);
5109         set_extra_info(p_per_probations.date_prob_trial_period_begin ,
5110                        l_pa_request_ei_rec.rei_information10,p_per_probations.per_probation_flag);
5111         set_extra_info(p_per_probations.date_prob_trial_period_ends  ,
5112                        l_pa_request_ei_rec.rei_information11,p_per_probations.per_probation_flag);
5113         set_extra_info(p_per_probations.date_spvr_mgr_prob_begins  ,
5114                        l_pa_request_ei_rec.rei_information12,p_per_probations.per_probation_flag);
5115         set_extra_info(p_per_probations.date_spvr_mgr_prob_ends  ,
5116                        l_pa_request_ei_rec.rei_information13,p_per_probations.per_probation_flag);
5117         set_extra_info(p_per_probations.spvr_mgr_prob_completion  ,
5118                        l_pa_request_ei_rec.rei_information14,p_per_probations.per_probation_flag);
5119         set_extra_info(p_per_probations.date_ses_prob_expires ,
5120                        l_pa_request_ei_rec.rei_information15,p_per_probations.per_probation_flag);
5121          hr_utility.set_location('Leaving ' ||l_proc,56);
5122     End ghr_prob_info;
5123     --end Bug# 4588575
5124     */ --Backout the changes done for Bug# 4588575
5125     --Begin Bug# 12557463
5126     PROCEDURE ghr_scd_info is
5127         l_proc   varchar2(70)  := 'non_sf52_extra - ghr_scd_info';
5128     Begin
5129         hr_utility.set_location('Entering ' ||l_proc,6);
5130 	hr_utility.set_location('Entering RPA ' || l_pa_request_ei_rec.rei_information2,61);
5131 	hr_utility.set_location('Entering PER ' || p_per_scd_info.scd_retirement,62);
5132         set_extra_info(p_per_scd_info.scd_civilian,l_pa_request_ei_rec.rei_information1,
5133                 p_per_scd_info.per_scd_info_flag, 'Y');
5134         set_extra_info(p_per_scd_info.scd_retirement,l_pa_request_ei_rec.rei_information2,
5135                 p_per_scd_info.per_scd_info_flag, 'Y');
5136 	set_extra_info(p_per_scd_info.scd_rif,l_pa_request_ei_rec.rei_information3,
5137                 p_per_scd_info.per_scd_info_flag, 'Y');
5138         set_extra_info(p_per_scd_info.scd_ses,l_pa_request_ei_rec.rei_information4,
5139                 p_per_scd_info.per_scd_info_flag, 'Y');
5140         set_extra_info(p_per_scd_info.scd_spl_retirement,l_pa_request_ei_rec.rei_information5,
5141                 p_per_scd_info.per_scd_info_flag, 'Y');
5142         set_extra_info(p_per_scd_info.scd_tsp,l_pa_request_ei_rec.rei_information6,
5143                 p_per_scd_info.per_scd_info_flag, 'Y');
5144         set_extra_info(p_per_uniformed_services.creditable_military_service ,l_pa_request_ei_rec.rei_information7,
5145                 p_per_uniformed_services.per_uniformed_services_flag, 'Y');
5146 	set_extra_info(p_per_scd_info.scd_creditable_svc_annl_leave,l_pa_request_ei_rec.rei_information8,
5147                 p_per_scd_info.per_scd_info_flag, 'Y');
5148         set_extra_info(p_per_separate_retire.frozen_service,l_pa_request_ei_rec.rei_information9,
5149 	        p_per_separate_retire.per_sep_retire_flag, 'Y');
5150 
5151 	--Begin Bug# 14514445
5152 	set_extra_info(p_per_scd_info.scd_Length_of_Service ,
5153 		  l_pa_request_ei_rec.rei_information10,p_per_scd_info.per_scd_info_flag, 'Y');
5154 	--End Bug# 14514445
5155 	hr_utility.set_location('Entering PER ' || p_per_scd_info.scd_retirement,62);
5156 	hr_utility.set_location('Leaving  ' ||l_proc,60);
5157     End ghr_scd_info;
5158    --End Bug# 12557463
5159 
5160 Begin
5161 
5162   -- Get session variables  to identify if a CORRECTION action is being performed
5163   ghr_history_api.get_g_session_var(l_session);
5164   --
5165 
5166   --  l_pos_org                    := p_pos_grp1.positions_organization;
5167   -- Get Element Entry Values in case of 'CORRECTION' -- only those elements that come off an extra_info
5168 
5169   If l_session.noa_id_correct is not null then
5170     ghr_history_fetch.fetch_element_entry_value
5171     (p_element_name          =>  'Within Grade Increase',
5172      p_input_value_name      =>  'Date Due',
5173      p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
5174      p_date_effective        =>  p_pa_request_rec.effective_date,
5175      p_screen_entry_value    =>  p_within_grade_increase.p_date_wgi_due
5176      );
5177     ghr_history_fetch.fetch_element_entry_value
5178     (p_element_name          =>  'Within Grade Increase',
5179      p_input_value_name      =>  'Pay Date',
5180      p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
5181      p_date_effective        =>  p_pa_request_rec.effective_date,
5182      p_screen_entry_value    =>  p_within_grade_increase.p_wgi_pay_date
5183      );
5184     ghr_history_fetch.fetch_element_entry_value
5185     (p_element_name          =>  'Within Grade Increase',
5186      p_input_value_name      =>  'Postponmt Effective',
5187      p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
5188      p_date_effective        =>  p_pa_request_rec.effective_date,
5189      p_screen_entry_value    =>  p_within_grade_increase.p_date_wgi_postpone_effective
5190      );
5191     ghr_history_fetch.fetch_element_entry_value
5192     (p_element_name          =>  'Within Grade Increase',
5193      p_input_value_name      =>  'Last Equivalent Increase',
5194      p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
5195      p_date_effective        =>  p_pa_request_rec.effective_date,
5196      p_screen_entry_value    =>  p_within_grade_increase.p_last_equi_incr
5197      );
5198     -- The foll. if conditions ensure that we fetch the elements only
5199     -- on correction to a noa relevant to the specific  elements
5200     If p_pa_request_rec.first_noa_code = '816' then
5201       ghr_history_fetch.fetch_element_entry_value
5202       (p_element_name         =>  'Relocation Bonus',
5203       p_input_value_name      =>  'Expiration Date',
5204       p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
5205       p_date_effective        =>  p_pa_request_rec.effective_date,
5206       p_screen_entry_value    =>  p_relocation_bonus.p_date_reloc_exp
5207       );
5208     End if;
5209     If p_pa_request_rec.first_noa_code  = '815' then
5210       ghr_history_fetch.fetch_element_entry_value
5211       (p_element_name         =>  'Recruitment Bonus',
5212       p_input_value_name      =>  'Expiration Date',
5213       p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
5214       p_date_effective        =>  p_pa_request_rec.effective_date,
5215       p_screen_entry_value    =>  p_recruitment_bonus.p_date_recruit_exp
5216       );
5217     End if;
5218   End if;
5219 
5220  -- Bug 3260890
5221 
5222   For info_type in c_info_types loop
5223      l_information_type := info_type.information_type;
5224      hr_utility.set_location('l_information_type :' || l_information_type,1);
5225      l_pa_request_ei_rec := null;
5226      --Bug # 5584845
5227      IF NVL(l_information_type,'@') = 'GHR_US_PAR_TERM_RET_GRADE' THEN
5228         FOR pa_request_extra_info IN c_pa_term_rg_extra_info LOOP
5229            l_pa_request_ei_rec := pa_request_extra_info;
5230         END LOOP;
5231      ELSE
5232         FOR pa_request_extra_info IN c_pa_request_extra_info LOOP
5233            l_pa_request_ei_rec := pa_request_extra_info;
5234         END LOOP;
5235      END IF;
5236      --Bug # 5584845
5237      hr_utility.set_location('rei 3 ' || l_pa_request_ei_rec.rei_information3,1);
5238      hr_utility.set_location('rei 4 ' || l_pa_request_ei_rec.rei_information4,1);
5239      hr_utility.set_location('rei 5 ' || l_pa_request_ei_rec.rei_information5,1);
5240      hr_utility.set_location('rei 6 ' || l_pa_request_ei_rec.rei_information6,1);
5241      hr_utility.set_location('rei 7 ' || l_pa_request_ei_rec.rei_information7,1);
5242      hr_utility.set_location('rei 8 ' || l_pa_request_ei_rec.rei_information8,1);
5243      hr_utility.set_location('rei 9 ' || l_pa_request_ei_rec.rei_information9,1);
5244      hr_utility.set_location('rei 11 ' || l_pa_request_ei_rec.rei_information11,1);
5245 
5246      --
5247      if l_information_type = 'GHR_US_PAR_APPT_INFO' then
5248         hr_utility.set_location(l_proc,5);
5249         hr_utility.set_location('info type ' || l_information_type,1);
5250         appt_info;
5251      elsif l_information_type =  'GHR_US_PAR_APPT_TRANSFER' then
5252         hr_utility.set_location(l_proc,10);
5253         hr_utility.set_location('info type ' || l_information_type,2);
5254         appt_transfer;
5255      --Begin Bug# 8724192
5256      elsif l_information_type =  'GHR_US_TRANS_CURN_APP_AUTH' then
5257         hr_utility.set_location(l_proc,10);
5258         hr_utility.set_location('info type ' || l_information_type,2);
5259         appt_transfer_app;
5260      elsif l_information_type =  'GHR_US_MASS_TRNSFR_NTE_DATES' then
5261         hr_utility.set_location(l_proc,10);
5262         hr_utility.set_location('info type ' || l_information_type,2);
5263         mass_transfer_nte;
5264       --End Bug# 8724192
5265      elsif l_information_type =  'GHR_US_PAR_CONV_APP' then
5266         hr_utility.set_location(l_proc,15);
5267         hr_utility.set_location('info type ' || l_information_type,3);
5268         conv_appt;
5269      elsif l_information_type = 'GHR_US_PAR_RETURN_TO_DUTY' then
5270         hr_utility.set_location(l_proc,20);
5271         hr_utility.set_location('info type ' || l_information_type,4);
5272         return_to_duty;
5273      elsif l_information_type = 'GHR_US_PAR_REASSIGNMENT' then
5274         hr_utility.set_location(l_proc,25);
5275         hr_utility.set_location('info type ' || l_information_type,5);
5276         reassign;
5277      elsif l_information_type = 'GHR_US_PAR_POSN_CHG' then
5278         hr_utility.set_location(l_proc,30);
5279         hr_utility.set_location('info type ' || l_information_type,6);
5280         posn_chg;
5281      elsif l_information_type = 'GHR_US_PAR_CHG_HOURS' then
5282         hr_utility.set_location(l_proc,35);
5283         hr_utility.set_location('info type ' || l_information_type,7);
5284         chg_sched_hours;
5285      elsif l_information_type = 'GHR_US_PAR_REALIGNMENT' then
5286         hr_utility.set_location(l_proc,40);
5287         hr_utility.set_location('info type ' || l_information_type,8);
5288         realign;
5289      elsif l_information_type =  'GHR_US_PAR_CHG_DATA_ELEMENT' then
5290         hr_utility.set_location(l_proc,45);
5291         hr_utility.set_location('info type ' || l_information_type,9);
5292         chg_data_elm;
5293      elsif  l_information_type =  'GHR_US_PAR_CHG_RETIRE_PLAN' then
5294         hr_utility.set_location(l_proc,50);
5295         hr_utility.set_location('info type ' || l_information_type,10);
5296         chg_ret_plan;
5297      --Begin Bug# 12557463 commented following code
5298      /*elsif  l_information_type =  'GHR_US_PAR_CHG_SCD' then
5299         hr_utility.set_location(l_proc,55);
5300         hr_utility.set_location('info type ' || l_information_type,11);
5301         chg_scd;
5302      */
5303      ---End Bug# 12557463
5304      --Begin bug# 14751665,15882322,15882330
5305       elsif  l_information_type =  'GHR_US_PAR_PRV_RET_INFO' then
5306         hr_utility.set_location(l_proc ,55);
5307         hr_utility.set_location('info type ' || l_information_type,114);
5308         prv_ret_info;
5309       --End Bug# 14751665,15882322,15882330
5310 /* Bug # 1165309
5311      elsif  l_information_type =  'GHR_US_PAR_DENIAL_WGI' then
5312         hr_utility.set_location(l_proc,60);
5313         hr_utility.set_location('info type ' || l_information_type,12);
5314         denial_wgi;
5315 */
5316      elsif  l_information_type =  'GHR_US_PAR_SALARY_CHG' then
5317         hr_utility.set_location(l_proc,65);
5318         hr_utility.set_location('info type ' || l_information_type,13);
5319         salary_change;
5320      elsif  l_information_type =  'GHR_US_PAR_RECRUIT_BONUS' then
5321         hr_utility.set_location(l_proc,70);
5322         hr_utility.set_location('info type ' || l_information_type,14);
5323         recruitment_bonus;
5324      elsif  l_information_type =  'GHR_US_PAR_RELOC_BONUS' then
5325         hr_utility.set_location(l_proc,75);
5326         hr_utility.set_location('info type ' || l_information_type,15);
5327         relocation_bonus;
5328      elsif  l_information_type =  'GHR_US_PAR_AWARDS_BONUS' then
5329         hr_utility.set_location(l_proc,80);
5330         hr_utility.set_location('info type ' || l_information_type,16);
5331         government_awards;
5332      elsif  l_information_type =  'GHR_US_PAR_NON_PAY_DUTY_STATUS' then
5333         hr_utility.set_location(l_proc,85);
5334         hr_utility.set_location('info type ' || l_information_type,17);
5335         non_pay_duty_status;
5336      elsif  l_information_type =  'GHR_US_PAR_TERM_RET_GRADE' then
5337         hr_utility.set_location(l_proc,90);
5338         hr_utility.set_location('info type ' || l_information_type,18);
5339         term_retained_grade;
5340      elsif  l_information_type =  'GHR_US_PAR_QSI_AWARD' then
5341         hr_utility.set_location(l_proc,95);
5342         hr_utility.set_location('info type ' || l_information_type,19);
5343         quality_step_increase;
5344      elsif  l_information_type =  'GHR_US_PAR_LWOP_INFO' then
5345         hr_utility.set_location(l_proc,100);
5346         hr_utility.set_location('info type ' || l_information_type,20);
5347         lwop_info;
5348      elsif  l_information_type =  'GHR_US_PAR_ENTITLEMENT' then
5349         hr_utility.set_location(l_proc,105);
5350         hr_utility.set_location('info type ' || l_information_type,21);
5351         entitlement;
5352      elsif  l_information_type =  'GHR_US_PAR_FOR_LANG_PROF_PAY' then
5353         hr_utility.set_location(l_proc,110);
5354         hr_utility.set_location('info type ' || l_information_type,22);
5355         for_lang_pay;
5356      elsif  l_information_type =  'GHR_US_PAR_EDP_PAY' then
5357         hr_utility.set_location(l_proc,115);
5358         hr_utility.set_location('info type ' || l_information_type,23);
5359         edp_pay;
5360      elsif  l_information_type =  'GHR_US_PAR_HAZARD_PAY' then
5361         hr_utility.set_location(l_proc,116);
5362         hr_utility.set_location('info type ' || l_information_type,24);
5363         hazard_pay;
5364 /* Commented Out as as all future benefits enrollments are either
5365  through the Benefits PUI or FEHB module
5366      elsif  l_information_type =  'GHR_US_PAR_HEALTH_BENEFITS' then
5367         hr_utility.set_location(l_proc,120);
5368         hr_utility.set_location('info type ' || l_information_type,25);
5369         health_benefits;
5370      elsif  l_information_type =  'GHR_US_PAR_HEALTH_BEN_PRE_TAX' then
5371         hr_utility.set_location(l_proc,121);
5372         hr_utility.set_location('info type ' || l_information_type,25);
5373         health_ben_pre_tax;
5374 */
5375      elsif  l_information_type =  'GHR_US_PAR_DANGER_PAY' then
5376         hr_utility.set_location(l_proc,125);
5377         hr_utility.set_location('info type ' || l_information_type,26);
5378         danger_pay;
5379      elsif  l_information_type =  'GHR_US_PAR_IMMNT_DANGER_PAY' then
5380         hr_utility.set_location(l_proc,130);
5381         hr_utility.set_location('info type ' || l_information_type,27);
5382         imminent_danger_pay;
5383      elsif  l_information_type =  'GHR_US_PAR_LIVING_QUART_ALLOW' then
5384         hr_utility.set_location(l_proc,135);
5385         hr_utility.set_location('info type ' || l_information_type,28);
5386         living_quarters_allow;
5387      elsif  l_information_type =  'GHR_US_PAR_POST_DIFF_PERCENT' then
5388         hr_utility.set_location(l_proc,140);
5389         hr_utility.set_location('info type ' || l_information_type,29);
5390         post_diff_percent;
5391      elsif  l_information_type =  'GHR_US_PAR_POST_DIFF_AMOUNT' then
5392         hr_utility.set_location(l_proc,145);
5393         hr_utility.set_location('info type ' || l_information_type,30);
5394         post_diff_amt;
5395      elsif  l_information_type =  'GHR_US_PAR_SEP_MAINT_ALLOWANCE' then
5396         hr_utility.set_location(l_proc,150);
5397         hr_utility.set_location('info type ' || l_information_type,31);
5398         sep_maintenance_allow;
5399      elsif  l_information_type =  'GHR_US_PAR_SUP_POST_ALLOWANCE' then
5400         hr_utility.set_location(l_proc,155);
5401         hr_utility.set_location('info type ' || l_information_type,32);
5402         supplemental_post_allow;
5403      elsif  l_information_type =  'GHR_US_PAR_TMP_LODGE_ALLOWANCE' then
5404         hr_utility.set_location(l_proc,160);
5405         hr_utility.set_location('info type ' || l_information_type,33);
5406         temp_lodge_allow;
5407      elsif  l_information_type =  'GHR_US_PAR_PREMIUM_PAY' then
5408         hr_utility.set_location(l_proc,165);
5409         hr_utility.set_location('info type ' || l_information_type,34);
5410         premium_pay;
5411      elsif  l_information_type =  'GHR_US_PAR_RETIREMENT_ANNUITY' then
5412         hr_utility.set_location(l_proc,170);
5413         hr_utility.set_location('info type ' || l_information_type,35);
5414         retirement_annuity;
5415      elsif  l_information_type =  'GHR_US_PAR_SEVERANCE_PAY' then
5416         hr_utility.set_location(l_proc,175);
5417         hr_utility.set_location('info type ' || l_information_type,36);
5418         severance_pay;
5419      /*elsif  l_information_type =  'GHR_US_PAR_TSP' then
5420         hr_utility.set_location(l_proc,180);
5421         hr_utility.set_location('info type ' || l_information_type,37);
5422         thrift_saving_plan;*/
5423      elsif  l_information_type =  'GHR_US_PAR_RET_ALLOWANCE' then
5424         hr_utility.set_location(l_proc,180);
5425         hr_utility.set_location('info type ' || l_information_type,37);
5426         retention_allow_review;
5427       elsif  l_information_type = 'GHR_US_PAR_CHG_TEN' then
5428         hr_utility.set_location(l_proc,110);
5429         chg_in_tenure;
5430       --Bug#2759379  Added FEGLI related Code
5431       elsif  l_information_type = 'GHR_US_PAR_FEGLI' then
5432         hr_utility.set_location(l_proc,110);
5433         chg_in_fegli;
5434       elsif l_information_type = 'GHR_US_PAR_MD_DDS_PAY' then
5435          hr_utility.set_location(l_proc,200);
5436          mddds_pay;
5437       elsif l_information_type = 'GHR_US_PAR_PREMIUM_PAY_IND' then
5438          hr_utility.set_location(l_proc,200);
5439          premium_pay_ind;
5440       elsif l_information_type = 'GHR_US_PAR_STUDENT_LOAN' then
5441         hr_utility.set_location(l_proc,190);
5442         student_loan_repay;
5443       -- Bug#3385386 Added FTA condition.
5444       elsif  l_information_type =  'GHR_US_PAR_FOR_TRANSER_ALLOW' then
5445         hr_utility.set_location(l_proc,210);
5446         hr_utility.set_location('info type ' || l_information_type,22);
5447         fta;
5448 	  elsif l_information_type = 'GHR_US_PAR_BENEFITS'   then
5449 	    	--Bug # 10420280 Modified to not to call benefits for correction
5450 	    if l_session.noa_id_correct is null then
5451 	    hr_utility.set_location(l_proc,210);
5452 		hr_utility.set_location('info type ' || l_information_type,22);
5453 		appt_benefits;
5454 	    end if;
5455 	  elsif l_information_type = 'GHR_US_PAR_MASS_TERM' then
5456 	    hr_utility.set_location(l_proc,210);
5457 		hr_utility.set_location('info type ' || l_information_type,22);
5458 		separate352;
5459 	  -- Bug 4724337 Race or National Origin changes
5460 	  elsif l_information_type = 'GHR_US_PAR_ETHNICITY_RACE' then
5461 	  	hr_utility.set_location(l_proc,210);
5462 		hr_utility.set_location('info type ' || l_information_type,22);
5463 		race_ethnic_info;
5464       -- Bug 4486823 RRR Changes
5465 	  elsif l_information_type = 'GHR_US_PAR_SERVICE_OBLIGATION' then
5466 	  	hr_utility.set_location(l_proc,220);
5467 		hr_utility.set_location('info type ' || l_information_type,22);
5468 		service_obligation;
5469         -- Bug 4724337 Race or National Origin changes
5470 	  elsif l_information_type = 'GHR_US_PAR_RETENTION_INCENTIVE' then
5471 	  	hr_utility.set_location(l_proc,230);
5472 		hr_utility.set_location('info type ' || l_information_type,22);
5473 		incentive_retention;
5474         -- Bug 4486823 RRR Changes
5475       elsif l_information_type = 'GHR_US_PAR_EMERG_ESSNTL_ASG' then
5476         hr_utility.set_location(l_proc,240);
5477         hr_utility.set_location('info type ' || l_information_type,22);
5478         key_emergency_essntl;
5479       -- Bug 4280026 Key Emergency Essential Changes .
5480 	  -- Begin Bug# 4126188
5481 	  elsif l_information_type = 'GHR_US_PAR_TERM_RG_POSN_CHG' then
5482         hr_utility.set_location(l_proc,250);
5483         hr_utility.set_location('info type ' || l_information_type,22);
5484         rg_posn_chg;
5485 	  -- end Bug# 4126188
5486       elsif l_information_type = 'GHR_US_PAR_CONVERSION_DATES' then
5487         hr_utility.set_location(l_proc,260);
5488         hr_utility.set_location('info type ' || l_information_type,22);
5489         ghr_conv_dates;
5490         -- Bug 5482191
5491        --start of Bug# 6312144 , Bug# 8653508 added GHR_US_PAR_DET_BENEFIT_CONT
5492       elsif l_information_type IN ('GHR_US_PAR_BENEFITS_CONT','GHR_US_PAR_DET_BENEFIT_CONT') then
5493          hr_utility.set_location(l_proc,270);
5494          hr_utility.set_location('info type ' || l_information_type,22);
5495          ipa_benefits_cont;
5496       elsif l_information_type = 'GHR_US_PAR_BENEFIT_INFO' then
5497          hr_utility.set_location(l_proc,280);
5498          hr_utility.set_location('info type ' || l_information_type,22);
5499          ben_info_cont;
5500       elsif l_information_type = 'GHR_US_PAR_RETIRMENT_SYS_INFO' then
5501          hr_utility.set_location(l_proc,290);
5502          hr_utility.set_location('info type ' || l_information_type,22);
5503          retirement_info;
5504          --end of Bug# 6312144
5505          --Begin Bug# 8653508
5506       elsif l_information_type = 'GHR_US_PAR_DET_INFO' then
5507          hr_utility.set_location(l_proc,300);
5508          hr_utility.set_location('info type ' || l_information_type,22);
5509          detail_info;
5510 	 --End Bug# 8653508
5511       /*   --Begin Bug# 4588575
5512       elsif l_information_type = 'GHR_US_PAR_PROBATION_INFO' then
5513          hr_utility.set_location(l_proc,270);
5514          hr_utility.set_location('info type ' || l_information_type,270);
5515          ghr_prob_info;
5516 	 --end Bug# 4588575
5517       */ --Backout the changes done for Bug# 4588575
5518       --Begin Bug# 12557463
5519       elsif l_information_type = 'GHR_US_PAR_SCD_INFO' then
5520          hr_utility.set_location(l_proc,280);
5521          hr_utility.set_location('info type ' || l_information_type,280);
5522          ghr_scd_info;
5523        --End Bug# 12557463
5524       end if;
5525   End loop;     -- info types
5526 
5527 
5528     -- Bug#5668878 Begin
5529     IF p_pa_request_rec.first_noa_code = '892' THEN
5530 
5531         l_psi := ghr_pa_requests_pkg.get_personnel_system_indicator
5532                  (p_pa_request_rec.to_position_id,
5533                   p_pa_request_rec.effective_date);
5534 
5535          IF l_psi <> '00' THEN
5536             p_within_grade_increase.p_last_equi_incr := p_pa_request_rec.effective_date;
5537             p_within_grade_increase.p_date_wgi_due := NULL;
5538             p_within_grade_increase.p_wgi_pay_date := NULL;
5539             p_within_grade_increase.p_wgi_flag       := 'Y';
5540         END IF;
5541 
5542     END IF;
5543     -- Bug#5668878 End
5544   -- Rohini
5545   l_noa_code := p_pa_request_rec.first_noa_code;
5546  /* if l_noa_code = '352' then
5547    hr_utility.set_location('p_per_separate_retire.agency_code_transfer_to = ' ||
5548                             p_per_separate_retire.agency_code_transfer_to ,38);
5549      set_extra_info(p_per_separate_retire.agency_code_transfer_to,
5550                     l_pa_request_ei_rec.rei_information3,
5551 ------ AVR          p_pa_request_rec.first_noa_information1,
5552                     p_per_separate_Retire.per_sep_Retire_flag);
5553    hr_utility.set_location('p_per_separate_retire.agency_code_transfer_to = ' ||
5554                             p_per_separate_retire.agency_code_transfer_to ,38);
5555   End if; */
5556   --
5557   --  Process Generic Agency information
5558   --
5559   -- Updating the record groups with Agency Info
5560 
5561   p_agency_sf52.agency_use_block_25  := p_generic_ei_rec.rei_information3;
5562   p_agency_sf52.agency_data_block_40 := p_generic_ei_rec.rei_information4;
5563   p_agency_sf52.agency_data_block_41 := p_generic_ei_rec.rei_information5;
5564   p_agency_sf52.agency_data_block_42 := p_generic_ei_rec.rei_information6;
5565   p_agency_sf52.agency_data_block_43 := p_generic_ei_rec.rei_information7;
5566   p_agency_sf52.agency_data_block_44 := p_generic_ei_rec.rei_information8;
5567   -- Set Flag to 'Y'
5568   p_agency_sf52.agency_flag := 'Y';
5569   --
5570   -- Bug# 4672772 Begin
5571 	for asg_stat_rec in c_user_status loop
5572 	  l_old_user_status				:= asg_stat_rec.user_status;
5573 	  l_old_system_status			:= asg_stat_rec.per_system_status;
5574 	  l_old_effective_start_date	:= asg_stat_rec.effective_start_date -1;
5575 	  hr_utility.set_location('Old User status is '||l_old_user_status,96);
5576 	  exit;
5577     end loop;
5578 	-- Bug# 4672772 End
5579 
5580   hr_utility.set_location('Leaving  - process_non_sf52_extra_info',170);
5581 
5582   -- NTE start dates processing
5583   -- Added 515 -- Venkat 04/26
5584   If l_noa_code in ('108','115','117','122','148','149','153',
5585                     '154','171','190','508','515','517','522','548',
5586                     '549','553','554','571','590','741') then
5587     --Bug# 4602352 703 is removed from the list
5588     p_asg_nte_dates.asg_nte_start_date      := fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
5589     hr_utility.set_location('inside asg nte dates ',1);
5590     hr_utility.set_location('nte date ' || (p_asg_nte_dates.asg_nte_start_date),2);
5591     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5592   --Begin Bug# 4602352
5593   Elsif  l_noa_code ='703' and (l_old_user_status <> 'Term Limited Appt') THEN
5594     p_asg_nte_dates.asg_nte_start_date      := fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
5595     hr_utility.set_location('inside asg nte dates for 703 ',111);
5596     hr_utility.set_location('nte date ' || (p_asg_nte_dates.asg_nte_start_date),2);
5597     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5598   --End Bug# 4602352
5599   Elsif l_noa_code = '472' then
5600     p_asg_nte_dates.furlough_nte_start_date := fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
5601     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5602   Elsif l_noa_code = '462' then
5603     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5604     p_asg_nte_dates.lwp_nte_start_date :=  fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
5605   Elsif l_noa_code = '460' then
5606    p_asg_nte_dates.lwop_nte_start_date :=  fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
5607     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5608   Elsif l_noa_code = '480' then
5609     p_asg_nte_dates.sabatical_nte_start_date :=  fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
5610     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5611   Elsif l_noa_code = '450' then
5612     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5613     p_asg_nte_dates.suspension_nte_start_date :=  fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
5614   End if;
5615 
5616 
5617   -- NTE dates processing
5618 
5619   If  l_noa_code in ('108','115','117','122','148','149','153',
5620                      '154','171','190','508','515','517','522',
5621                      '548','549','553','554','571','590',--'703', Removed for Bug# 4602352
5622                      '741','750','760','761','762','765','769','770') then
5623     p_asg_nte_dates.assignment_nte       :=   p_pa_request_rec.first_noa_information1;
5624     hr_utility.set_location('dates ' || p_asg_nte_dates.assignment_nte,1);
5625     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5626   --Begin Bug# 4602352
5627   Elsif  l_noa_code ='703' and (l_old_user_status <> 'Term Limited Appt') THEN
5628     p_asg_nte_dates.assignment_nte       :=   p_pa_request_rec.first_noa_information1;
5629     hr_utility.set_location('dates ' || p_asg_nte_dates.assignment_nte,100);
5630     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5631   --End Bug# 4602352
5632   Elsif l_noa_code in ('472','772') then
5633     hr_utility.set_location(' furlough nte dates for 472 and 772',1);
5634     p_asg_nte_dates.furlough_nte         :=   p_pa_request_rec.first_noa_information1;
5635     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5636   Elsif l_noa_code  = '462' then
5637     p_asg_nte_dates.lwp_nte              :=   p_pa_request_rec.first_noa_information1;
5638     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5639   Elsif l_noa_code  in ('460','773') then
5640     p_asg_nte_dates.lwop_nte             :=   p_pa_request_rec.first_noa_information1;
5641     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5642   Elsif l_noa_code  = '480' then
5643     p_asg_nte_dates.sabatical_nte        :=   p_pa_request_rec.first_noa_information1;
5644     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5645   Elsif l_noa_code  = '450' then
5646     p_asg_nte_dates.suspension_nte       :=   p_pa_request_rec.first_noa_information1;
5647     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5648   End if;
5649 
5650   --
5651   -- Processing for clearing of NTE dates\
5652   -- Bug 2941621 Included 280 and also furlough dates in the condition
5653 
5654 
5655 
5656   if (l_noa_code IN ('293','280')) then
5657 	p_asg_nte_dates.asg_nte_dates_flag 			:= 'Y';
5658 	p_asg_nte_dates.lwp_nte 					:= null;
5659 	p_asg_nte_dates.lwp_nte_start_date 			:= null;
5660 	p_asg_nte_dates.suspension_nte 				:= null;
5661 	p_asg_nte_dates.suspension_nte_start_date 	:= null;
5662 	p_asg_nte_dates.furlough_nte	 			:= null;
5663 	p_asg_nte_dates.furlough_nte_start_date	 	:= null;
5664   elsif (l_noa_code = '292') then
5665 	p_asg_nte_dates.asg_nte_dates_flag 			:= 'Y';
5666 	p_asg_nte_dates.lwop_nte 					:= null;
5667 	p_asg_nte_dates.lwop_nte_start_date			:= null;
5668 	p_asg_nte_dates.suspension_nte 				:= null;
5669 	p_asg_nte_dates.suspension_nte_start_date 	:= null;
5670 	p_asg_nte_dates.furlough_nte	 			:= null;
5671 	p_asg_nte_dates.furlough_nte_start_date	 	:= null;
5672   elsif (l_noa_code = '452') then
5673 	p_asg_nte_dates.asg_nte_dates_flag 			:= 'Y';
5674 	p_asg_nte_dates.suspension_nte 			:= null;
5675 	p_asg_nte_dates.suspension_nte_start_date 	:= null;
5676   elsif (l_noa_code in ('500','501','507','512','520','524','540',
5677                         '541','542','543','546','549','550','551',
5678                         '555','570')) then
5679      -- Removed 721 from the list for bug# 3215526
5680      -- Removed '702','713','740' from the list 3698464
5681      --
5682 	p_asg_nte_dates.asg_nte_dates_flag 			:= 'Y';
5683 	p_asg_nte_dates.asg_nte_start_date 			:= null;
5684 	p_asg_nte_dates.assignment_nte		 	:= null;
5685 
5686   -- Bug# 4672772 Begin
5687   elsif l_noa_code in ('702','713') AND (l_old_user_status = 'Temp. Promotion NTE') THEN
5688         FOR user_apnt_status_rec IN c_user_apnt_status
5689         LOOP
5690             l_user_apnt_status := user_apnt_status_rec.user_status;
5691             l_user_apnt_eff_date := user_apnt_status_rec.effective_start_date;
5692             EXIT;
5693         END LOOP;
5694         --Begin Bug#6083404
5695         FOR user_actv_appt_rec IN c_user_actv_appt
5696         LOOP
5697             l_user_actv_apnt_status := user_actv_appt_rec.user_status;
5698             EXIT;
5699         END LOOP;
5700         --End Bug# 6083404
5701         IF l_user_apnt_status = 'Temp. Appointment NTE'
5702             and nvl(l_user_actv_apnt_status,'XXX') <>'Active Appointment' THEN
5703         --Bug# 6083404 added l_user_actv_apnt_status condition
5704             ghr_history_fetch.fetch_asgei
5705                       (p_assignment_id              =>  p_pa_request_rec.employee_assignment_id,
5706                        p_information_type           => 'GHR_US_ASG_NTE_DATES',
5707                        p_date_effective             =>  l_user_apnt_eff_date,
5708                        p_asg_ei_data                =>  l_asg_extra_info_rec
5709                       );
5710             p_asg_nte_dates.asg_nte_dates_flag 		:= 'Y';
5711             p_asg_nte_dates.asg_nte_start_date 		:= l_asg_extra_info_rec.aei_information3;
5712             p_asg_nte_dates.assignment_nte		 	:= l_asg_extra_info_rec.aei_information4;
5713         ELSE
5714             p_asg_nte_dates.asg_nte_dates_flag 		:= 'Y';
5715             p_asg_nte_dates.asg_nte_start_date 		:= null;
5716             p_asg_nte_dates.assignment_nte		 	:= null;
5717         END IF;
5718 	-- Bug# 4672772 End
5719   --Begin Bug# 4602352
5720   elsif l_noa_code in ('702','713','740') AND (l_old_user_status = 'Temp. Appointment NTE') THEN
5721     p_asg_nte_dates.asg_nte_dates_flag 			:= 'Y';
5722 	p_asg_nte_dates.asg_nte_start_date 			:= null;
5723 	p_asg_nte_dates.assignment_nte		 	    := null;
5724   --End Bug# 4602352
5725   elsif (l_noa_code in ('300','301','302','303','304','312','317',
5726                         '330','350','351','353','355','356','357','385')) then
5727 	p_asg_nte_dates.asg_nte_dates_flag 			:= 'Y';
5728 	p_asg_nte_dates.asg_nte_start_date 			:= null;
5729 	p_asg_nte_dates.assignment_nte		 	:= null;
5730 	p_asg_nte_dates.lwop_nte 				:= null;
5731 	p_asg_nte_dates.lwop_nte_start_date			:= null;
5732 	p_asg_nte_dates.suspension_nte 			:= null;
5733 	p_asg_nte_dates.suspension_nte_start_date 	:= null;
5734 	p_asg_nte_dates.furlough_nte	 			:= null;
5735 	p_asg_nte_dates.furlough_nte_start_date	 	:= null;
5736 	p_asg_nte_dates.sabatical_nte	 			:= null;
5737 	p_asg_nte_dates.sabatical_nte_start_date	 	:= null;
5738   end if;
5739   --Begin Bug# 10182526
5740   IF l_noa_code IN ('730','930')  THEN
5741 	p_asg_detail_info.detail_begin_date := fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
5742 	IF l_session.noa_id_correct IS NOT NULL THEN
5743 		FOR c_detail_second_nte_date_rec in c_detail_second_nte_date LOOP
5744 			l_detail_nte_date := c_detail_second_nte_date_rec.second_noa_information1;
5745 		END LOOP;
5746 		IF l_detail_nte_date IS NOT NULL THEN
5747 			set_extra_info(p_asg_detail_info.detail_end_date,
5748 			      l_detail_nte_date,p_asg_detail_info.asg_detail_info_flag,'N');
5749 		END IF;
5750 	ELSE
5751 		FOR c_detail_first_nte_date_rec in c_detail_first_nte_date LOOP
5752 			l_detail_nte_date := c_detail_first_nte_date_rec.first_noa_information1;
5753 		END LOOP;
5754 		set_extra_info(p_asg_detail_info.detail_end_date,
5755                       l_detail_nte_date,p_asg_detail_info.asg_detail_info_flag,'Y');
5756 	END IF;
5757   ELSIF l_noa_code IN ('731','931') THEN
5758 	set_extra_info(p_asg_detail_info.detail_begin_date,
5759                       p_asg_detail_info.detail_begin_date,p_asg_detail_info.asg_detail_info_flag,'Y');
5760 	IF l_session.noa_id_correct IS NOT NULL THEN
5761 		FOR c_detail_second_nte_date_rec in c_detail_second_nte_date LOOP
5762 			l_detail_nte_date := c_detail_second_nte_date_rec.second_noa_information1;
5763 		END LOOP;
5764 		IF l_detail_nte_date IS NOT NULL THEN
5765 			set_extra_info(p_asg_detail_info.detail_end_date,
5766 			      l_detail_nte_date,p_asg_detail_info.asg_detail_info_flag,'N');
5767 		END IF;
5768 	ELSE
5769 		FOR c_detail_first_nte_date_rec in c_detail_first_nte_date LOOP
5770 			l_detail_nte_date := c_detail_first_nte_date_rec.first_noa_information1;
5771 		END LOOP;
5772 		set_extra_info(p_asg_detail_info.detail_end_date,
5773                       l_detail_nte_date,p_asg_detail_info.asg_detail_info_flag,'Y');
5774 	END IF;
5775   ELSIF l_noa_code IN ('732','932') THEN
5776 	set_extra_info(p_asg_detail_info.detail_begin_date,
5777                       p_asg_detail_info.detail_begin_date,p_asg_detail_info.asg_detail_info_flag,'Y');
5778 	set_extra_info(p_asg_detail_info.detail_end_date,
5779                       fnd_date.date_to_canonical(p_pa_request_rec.effective_date),p_asg_detail_info.asg_detail_info_flag,'Y');
5780   END IF;
5781   --End Bug# 10182526
5782   --Begin Bug# 13942237
5783   --Bug# 14514445 commented below code since we are getting promotion_eligibility_date from RPA EITs
5784   /*IF l_noa_code IN ('100','101','130','140','141','170','500','501','540','541','570','702','713','721') THEN
5785 	hr_utility.set_location('promotion_eligibility_date Position Id '|| NVL(p_pa_request_rec.to_position_id,p_pa_request_rec.from_position_id),350);
5786 	ghr_history_fetch.fetch_positionei
5787 		(p_position_id                =>  NVL(p_pa_request_rec.to_position_id,p_pa_request_rec.from_position_id),
5788 		p_information_type           => 'GHR_US_POS_VALID_GRADE',
5789 		p_date_effective             =>  p_pa_request_rec.effective_date,
5790 		p_pos_ei_data                =>  l_pos_extra_info_rec
5791 		);
5792 	FOR  grade_name in grade_id(l_pos_extra_info_rec.poei_information3) LOOP
5793 		l_valid_grade_name := grade_name.name;
5794 		exit;
5795 	END LOOP;
5796 	FOR  grade_name in grade_id(l_pos_extra_info_rec.poei_information4) LOOP
5797 		l_target_grade_name := grade_name.name;
5798 		exit;
5799 	END LOOP;
5800 	hr_utility.set_location('promotion_eligibility_date Valid Grade '|| l_valid_grade_name,351);
5801 	hr_utility.set_location('promotion_eligibility_date Target Grade '|| l_target_grade_name,352);
5802 
5803 	IF SUBSTR(l_valid_grade_name,1,2) = SUBSTR(l_target_grade_name,1,2) AND
5804 	   TO_NUMBER(SUBSTR(l_valid_grade_name,4,5)) < TO_NUMBER(SUBSTR(l_target_grade_name,4,5)) THEN
5805 	        hr_utility.set_location('promotion_eligibility_date update '|| l_valid_grade_name,353);
5806 		set_extra_info(p_per_group1.promotion_eligibility_date,fnd_date.date_to_canonical(p_pa_request_rec.effective_date+365),
5807 		               p_per_group1.per_group1_flag);
5808 	END IF;
5809 
5810   END IF;*/
5811   --End Bug# 13942237
5812 
5813 END Process_Non_Sf52_Extra_Info;
5814 --
5815 End  GHR_SF52_PRE_UPDATE;
5816 --