DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_ASSIGNMENT_COMMON_SAVE_WEB

Source


1 PACKAGE body hr_assignment_common_save_web AS
2 /* $Header: hrascmsw.pkb 120.1 2005/09/23 13:51:17 svittal noship $*/
3 g_package      constant varchar2(75):='hr_assignment_common_save_web.';
4 g_person_id             per_all_people_f.person_id%TYPE;
5 --
6 -- --------------------------------------------------------------------------
7 -- -----------------------< validate_assignment >----------------------------
8 -- --------------------------------------------------------------------------
9 --
10 /* This is the procedure to validate and apply the assignment data, including
11    the People Group and Soft Coded Key Flexfields
12 */
13 procedure validate_assignment
14 (p_validate                 in     boolean
15 ,p_assignment_id            in     number
16 ,p_object_version_number    in     number
17 ,p_effective_date           in     date
18 ,p_datetrack_update_mode    in     varchar2
19 ,p_organization_id          in     number
20 ,p_position_id              in     number   default null
21 ,p_job_id                   in     number   default null
22 ,p_grade_id                 in     number   default null
23 ,p_location_id              in     number   default null
24 ,p_employment_category      in     varchar2 default null
25 --
26 ,p_supervisor_id            in     number   default null
27 ,p_manager_flag             in     varchar2 default null
28 ,p_normal_hours             in     number   default null
29 ,p_frequency                in     varchar2 default null
30 ,p_time_normal_finish       in     varchar2 default null
31 ,p_time_normal_start        in     varchar2 default null
32 ,p_assignment_status_type_id in    number   default null
33 ,p_change_reason            in     varchar2 default null
34 ,p_ass_attribute_category   in     varchar2 default null
35 ,p_ass_attribute1           in     varchar2 default null
36 ,p_ass_attribute2           in     varchar2 default null
37 ,p_ass_attribute3           in     varchar2 default null
38 ,p_ass_attribute4           in     varchar2 default null
39 ,p_ass_attribute5           in     varchar2 default null
40 ,p_ass_attribute6           in     varchar2 default null
41 ,p_ass_attribute7           in     varchar2 default null
42 ,p_ass_attribute8           in     varchar2 default null
43 ,p_ass_attribute9           in     varchar2 default null
44 ,p_ass_attribute10          in     varchar2 default null
45 ,p_ass_attribute11          in     varchar2 default null
46 ,p_ass_attribute12          in     varchar2 default null
47 ,p_ass_attribute13          in     varchar2 default null
48 ,p_ass_attribute14          in     varchar2 default null
49 ,p_ass_attribute15          in     varchar2 default null
50 ,p_ass_attribute16          in     varchar2 default null
51 ,p_ass_attribute17          in     varchar2 default null
52 ,p_ass_attribute18          in     varchar2 default null
53 ,p_ass_attribute19          in     varchar2 default null
54 ,p_ass_attribute20          in     varchar2 default null
55 ,p_ass_attribute21          in     varchar2 default null
56 ,p_ass_attribute22          in     varchar2 default null
57 ,p_ass_attribute23          in     varchar2 default null
58 ,p_ass_attribute24          in     varchar2 default null
59 ,p_ass_attribute25          in     varchar2 default null
60 ,p_ass_attribute26          in     varchar2 default null
61 ,p_ass_attribute27          in     varchar2 default null
62 ,p_ass_attribute28          in     varchar2 default null
63 ,p_ass_attribute29          in     varchar2 default null
64 ,p_ass_attribute30          in     varchar2 default null
65 ,p_scl_segment1             in     varchar2 default null
66 ,p_scl_segment2             in     varchar2 default null
67 ,p_scl_segment3             in     varchar2 default null
68 ,p_scl_segment4             in     varchar2 default null
69 ,p_scl_segment5             in     varchar2 default null
70 ,p_scl_segment6             in     varchar2 default null
71 ,p_scl_segment7             in     varchar2 default null
72 ,p_scl_segment8             in     varchar2 default null
73 ,p_scl_segment9             in     varchar2 default null
74 ,p_scl_segment10            in     varchar2 default null
75 ,p_scl_segment11            in     varchar2 default null
76 ,p_scl_segment12            in     varchar2 default null
77 ,p_scl_segment13            in     varchar2 default null
78 ,p_scl_segment14            in     varchar2 default null
79 ,p_scl_segment15            in     varchar2 default null
80 ,p_scl_segment16            in     varchar2 default null
81 ,p_scl_segment17            in     varchar2 default null
82 ,p_scl_segment18            in     varchar2 default null
83 ,p_scl_segment19            in     varchar2 default null
84 ,p_scl_segment20            in     varchar2 default null
85 ,p_scl_segment21            in     varchar2 default null
86 ,p_scl_segment22            in     varchar2 default null
87 ,p_scl_segment23            in     varchar2 default null
88 ,p_scl_segment24            in     varchar2 default null
89 ,p_scl_segment25            in     varchar2 default null
90 ,p_scl_segment26            in     varchar2 default null
91 ,p_scl_segment27            in     varchar2 default null
92 ,p_scl_segment28            in     varchar2 default null
93 ,p_scl_segment29            in     varchar2 default null
94 ,p_scl_segment30            in     varchar2 default null
95 ,p_pgp_segment1             in     varchar2 default null
96 ,p_pgp_segment2             in     varchar2 default null
97 ,p_pgp_segment3             in     varchar2 default null
98 ,p_pgp_segment4             in     varchar2 default null
99 ,p_pgp_segment5             in     varchar2 default null
100 ,p_pgp_segment6             in     varchar2 default null
101 ,p_pgp_segment7             in     varchar2 default null
102 ,p_pgp_segment8             in     varchar2 default null
103 ,p_pgp_segment9             in     varchar2 default null
104 ,p_pgp_segment10            in     varchar2 default null
105 ,p_pgp_segment11            in     varchar2 default null
106 ,p_pgp_segment12            in     varchar2 default null
107 ,p_pgp_segment13            in     varchar2 default null
108 ,p_pgp_segment14            in     varchar2 default null
109 ,p_pgp_segment15            in     varchar2 default null
110 ,p_pgp_segment16            in     varchar2 default null
111 ,p_pgp_segment17            in     varchar2 default null
112 ,p_pgp_segment18            in     varchar2 default null
113 ,p_pgp_segment19            in     varchar2 default null
114 ,p_pgp_segment20            in     varchar2 default null
115 ,p_pgp_segment21            in     varchar2 default null
116 ,p_pgp_segment22            in     varchar2 default null
117 ,p_pgp_segment23            in     varchar2 default null
118 ,p_pgp_segment24            in     varchar2 default null
119 ,p_pgp_segment25            in     varchar2 default null
120 ,p_pgp_segment26            in     varchar2 default null
121 ,p_pgp_segment27            in     varchar2 default null
122 ,p_pgp_segment28            in     varchar2 default null
123 ,p_pgp_segment29            in     varchar2 default null
124 ,p_pgp_segment30            in     varchar2 default null
125 --
126 ,p_business_group_id        in     per_all_assignments_f.business_group_id%TYPE
127 ,p_assignment_type          in     per_all_assignments_f.assignment_type%TYPE
128 ,p_vacancy_id               in     per_all_assignments_f.vacancy_id%TYPE
129 ,p_special_ceiling_step_id  in out nocopy per_all_assignments_f.special_ceiling_step_id%TYPE
130 ,p_primary_flag             in     per_all_assignments_f.primary_flag%TYPE
131 ,p_person_id                in     per_all_assignments_f.person_id%TYPE
132 ,p_effective_start_date        out nocopy date
133 ,p_effective_end_date          out nocopy date
134 ,p_element_warning          in     boolean
135 ,p_element_changed          in out nocopy varchar2
136 ,p_email_id                 in     varchar2 default null
137 ) is
138 --
139 
140 l_effective_date             date;
141 l_object_version_number      per_all_assignments_f.object_version_number%TYPE;
142 l_effective_start_date       date;
143 l_effective_end_date         date;
144 l_people_group_id            per_all_assignments_f.people_group_id%TYPE;
145 l_group_name                 VARCHAR2(2000);
146 l_org_now_no_manager_warning boolean;
147 l_other_manager_warning      boolean;
148 l_spp_delete_warning         boolean;
149 l_entries_changed_warning    VARCHAR2(30);
150 l_tax_district_changed_warning boolean;
151 l_soft_coding_keyflex_id     per_all_assignments_f.soft_coding_keyflex_id%TYPE;
152 l_comment_id                 per_all_assignments_f.comment_id%TYPE;
153 l_concatenated_segments      VARCHAR2(2000);
154 l_validation_start_date      per_assignments_f.effective_start_date%TYPE;
155 l_validation_end_date        per_assignments_f.effective_end_date%TYPE;
156 l_inv_pos_grade_warning      boolean;
157 l_org_error                  boolean default false;
158 l_job_error                  boolean default false;
159 l_pos_error                  boolean default false;
160 l_old_wc_code                number;
161 l_old_job_id                 number;
162 l_new_wc_code                number;
163 l_assignment_status_type     varchar2(30);
164 l_element_changed	     varchar2(2000);
165 l_special_ceiling_step_id    per_all_assignments_f.special_ceiling_step_id%TYPE;
166 --
167 cursor current_job_id is
168 select job_id
169 from per_all_assignments_f
170 where assignment_id=p_assignment_id
171 and l_effective_date between effective_start_date and effective_end_date;
172 --
173 cursor status_type is
174 select per_system_status
175 from per_assignment_status_types
176 where assignment_status_type_id=p_assignment_status_type_id;
177 --
178 begin
179 --
180 -- since we are calling chk_ procedures, we must trunc the date.
181 --
182     l_effective_date :=trunc(p_effective_date);
183 --
184 -- get the current job_id for wc_validation
185 --
186   open current_job_id;
187   fetch current_job_id into l_old_job_id;
188   if current_job_id%found then
189     close current_job_id;
190   else
191     close current_job_id;
192   end if;
193 --
194 -- since we are calling more than one api, we must issue our own
195 -- savepoint and manage the rollback ourselves.
196 --
197 savepoint validate_assignment;
198 --
199 l_object_version_number:=p_object_version_number;
200 -- Remember IN OUT parameters.
201 l_element_changed      := p_element_changed;
202 l_special_ceiling_step_id := p_special_ceiling_step_id;
203 --
204 -- perform field level validation first to obtain as much error information
205 -- as possible
206 --
207 -- lock the record and get the validation dates
208 per_asg_shd.lck
209 (p_effective_date        => l_effective_date
210 ,p_datetrack_mode        => p_datetrack_update_mode
211 ,p_assignment_id         => p_assignment_id
212 ,p_object_version_number => l_object_version_number
213 ,p_validation_start_date => l_validation_start_date
214 ,p_validation_end_date   => l_validation_end_date
215 );
216 --
217 -- check the organization_id
218 --
219 begin
220   per_asg_bus1.chk_organization_id
221     (p_assignment_id               =>  p_assignment_id
222     ,p_primary_flag                =>  p_primary_flag
223     ,p_organization_id             =>  p_organization_id
224     ,p_business_group_id           =>  p_business_group_id
225     ,p_assignment_type             =>  p_assignment_type
226     ,p_vacancy_id                  =>  p_vacancy_id
227     ,p_validation_start_date       =>  l_validation_start_date
228     ,p_validation_end_date         =>  l_validation_end_date
229     ,p_effective_date              =>  l_effective_date
230     ,p_object_version_number       =>  l_object_version_number
231     ,p_manager_flag                =>  p_manager_flag
232     ,p_org_now_no_manager_warning  =>  l_org_now_no_manager_warning
233     ,p_other_manager_warning       =>  l_other_manager_warning
234     );
235 exception
236 when others then
237 --
238   l_org_error:=TRUE;
239   hr_message.provide_error;
240 --
241 -- look for the possible messages raised by the organization check to add
242 -- them to the organization field
243 --
244   if (hr_message.last_message_name ='HR_7389_ASG_INVALID_ORG')
245       then hr_errors_api.addErrorToTable
246       (p_errorfield => 'P_ORGANIZATION_NAME'
247       ,p_errorcode  => hr_message.last_message_number
248       ,p_errormsg   => hr_message.get_message_text);
249   elsif (hr_message.last_message_name ='HR_7376_ASG_INVALID_BG_ORG')
250       then hr_errors_api.addErrorToTable
251       (p_errorfield => 'P_ORGANIZATION_NAME'
252       ,p_errorcode  => hr_message.last_message_number
253       ,p_errormsg   => hr_message.get_message_text);
254   elsif (hr_message.last_message_name ='HR_51277_ASG_INV_HR_ORG')
255       then hr_errors_api.addErrorToTable
256       (p_errorfield => 'P_ORGANIZATION_NAME'
257       ,p_errorcode  => hr_message.last_message_number
258       ,p_errormsg   => hr_message.get_message_text);
259   elsif (hr_message.last_message_name ='HR_51042_ASG_INVALID_VAC_ORG')
260       then hr_errors_api.addErrorToTable
261       (p_errorfield => 'P_ORGANIZATION_NAME'
262       ,p_errorcode  => hr_message.last_message_number
263       ,p_errormsg   => hr_message.get_message_text);
264   ELSE  -- Bug #1313212 Fix
265      hr_errors_api.addErrorToTable
266       (p_errorfield => 'P_ORGANIZATION_NAME'
267       ,p_errorcode  => hr_message.last_message_number
268       ,p_errormsg   => hr_message.get_message_text);
269   end if;
270 end;
271 --
272 -- check the position_id
273 --
274 begin
275   per_asg_bus2.chk_position_id
276     (p_assignment_id          =>  p_assignment_id
277      ,p_position_id           =>  p_position_id
278      ,p_business_group_id     =>  p_business_group_id
279      ,p_assignment_type       =>  p_assignment_type
280      ,p_vacancy_id            =>  p_vacancy_id
281      ,p_validation_start_date =>  l_validation_start_date
282      ,p_validation_end_date   =>  l_validation_end_date
283      ,p_effective_date        =>  l_effective_date
284      ,p_object_version_number =>  l_object_version_number
285     );
286 exception
287 when others then
288 --
289   l_pos_error:=TRUE;
290   hr_message.provide_error;
291 --
292 -- look for the possible messages raised by the position check to add
293 -- them to the position field
294 --
295   if (hr_message.last_message_name ='HR_51000_ASG_INVALID_POS')
296       then hr_errors_api.addErrorToTable
297       (p_errorfield => 'P_POSITION_NAME'
298       ,p_errorcode  => hr_message.last_message_number
299       ,p_errormsg   => hr_message.get_message_text);
300   elsif (hr_message.last_message_name ='HR_51009_ASG_INVALID_BG_POS')
301       then hr_errors_api.addErrorToTable
302       (p_errorfield => 'P_POSITION_NAME'
303       ,p_errorcode  => hr_message.last_message_number
304       ,p_errormsg   => hr_message.get_message_text);
305   elsif (hr_message.last_message_name ='HR_51040_ASG_INVALID_VAC_POS')
306       then hr_errors_api.addErrorToTable
307       (p_errorfield => 'P_POSITION_NAME'
308       ,p_errorcode  => hr_message.last_message_number
309       ,p_errormsg   => hr_message.get_message_text);
310   ELSE  -- Bug #1313212 Fix
311       hr_errors_api.addErrorToTable
312       (p_errorfield => 'P_POSITION_NAME'
313       ,p_errorcode  => hr_message.last_message_number
314       ,p_errormsg   => hr_message.get_message_text);
315   end if;
316 end;
317 --
318 -- check the job_id
319 begin
320   --
321   per_asg_bus1.chk_job_id
322     (p_assignment_id         =>  p_assignment_id
323     ,p_business_group_id     =>  p_business_group_id
324     ,p_assignment_type       =>  p_assignment_type
325     ,p_job_id                =>  p_job_id
326     ,p_vacancy_id            =>  p_vacancy_id
327     ,p_effective_date        =>  l_effective_date
328     ,p_validation_start_date =>  l_validation_start_date
329     ,p_validation_end_date   =>  l_validation_end_date
330     ,p_object_version_number =>  l_object_version_number
331     );
332 exception
333 when others then
334 --
335   l_job_error:=TRUE;
336   hr_message.provide_error;
337 --
338 -- look for the possible messages raised by the job check to add
339 -- them to the job field
340 --
341   if (hr_message.last_message_name ='HR_51172_ASG_INV_DT_JOB')
342       then hr_errors_api.addErrorToTable
343       (p_errorfield => 'P_JOB_NAME'
344       ,p_errorcode  => hr_message.last_message_number
345       ,p_errormsg   => hr_message.get_message_text);
346   elsif (hr_message.last_message_name ='HR_51173_ASG_INV_DT_JOB_BG')
347       then hr_errors_api.addErrorToTable
348       (p_errorfield => 'P_JOB_NAME'
349       ,p_errorcode  => hr_message.last_message_number
350       ,p_errormsg   => hr_message.get_message_text);
351   elsif (hr_message.last_message_name ='HR_51293_ASG_INV_VAC_JOB')
352       then hr_errors_api.addErrorToTable
353       (p_errorfield => 'P_JOB_NAME'
354       ,p_errorcode  => hr_message.last_message_number
355       ,p_errormsg   => hr_message.get_message_text);
356   ELSE  -- Bug #1313212 Fix
357       hr_errors_api.addErrorToTable
358       (p_errorfield => 'P_JOB_NAME'
359       ,p_errorcode  => hr_message.last_message_number
360       ,p_errormsg   => hr_message.get_message_text);
361 
362   end if;
363 end;
364 --
365 if (NOT l_pos_error) and (NOT l_job_error) then
366 -- check the job position combination if nether job nor position raised
367 -- an error
368 --
369 begin
370   --
371   per_asg_bus2.chk_position_id_job_id
372     (p_assignment_id          =>  p_assignment_id
373      ,p_position_id           =>  p_position_id
374      ,p_job_id                =>  p_job_id
375      ,p_validation_start_date =>  l_validation_start_date
376      ,p_validation_end_date   =>  l_validation_end_date
377      ,p_effective_date        =>  l_effective_date
378      ,p_object_version_number =>  l_object_version_number
379     );
380 exception
381 when others then
382 --
383   hr_message.provide_error;
384 --
385 -- look for the possible messages raised by the job/pos check to add
386 -- them to the appropriate field
387 --
388   if (hr_message.last_message_name ='HR_51056_ASG_INV_POS_JOB_COMB')
389       then hr_errors_api.addErrorToTable
390       (p_errorfield => null
391       ,p_errorcode  => hr_message.last_message_number
392       ,p_errormsg   => hr_message.get_message_text);
393   elsif (hr_message.last_message_name ='HR_51057_ASG_JOB_NULL_VALUE')
394       then hr_errors_api.addErrorToTable
395       (p_errorfield => 'P_JOB_NAME'
396       ,p_errorcode  => hr_message.last_message_number
397       ,p_errormsg   => hr_message.get_message_text);
398   ELSE  -- Bug #1313212 Fix
399       hr_errors_api.addErrorToTable
400       (p_errorfield => null
401       ,p_errorcode  => hr_message.last_message_number
402       ,p_errormsg   => hr_message.get_message_text);
403   end if;
404 end;
405 end if;
406 --
407 -- check the grade_id
408 --
409 begin
410   --
411   per_asg_bus1.chk_grade_id
412     (p_assignment_id            =>  p_assignment_id
413     ,p_business_group_id        =>  p_business_group_id
414     ,p_assignment_type          =>  p_assignment_type
415     ,p_grade_id                 =>  p_grade_id
416     ,p_vacancy_id               =>  p_vacancy_id
417     ,p_special_ceiling_step_id  =>  p_special_ceiling_step_id
418     ,p_effective_date           =>  l_effective_date
419     ,p_validation_start_date    =>  l_validation_start_date
420     ,p_validation_end_date      =>  l_validation_end_date
421     ,p_object_version_number    =>  l_object_version_number
422     );
423 exception
424 when others then
425 --
426   hr_message.provide_error;
427 --
428 -- look for the possible messages raised by the grade check to add
429 -- them to the grade field
430 --
431   if (hr_message.last_message_name ='HR_7393_ASG_INVALID_GRADE')
432       then hr_errors_api.addErrorToTable
433       (p_errorfield => 'P_GRADE_NAME'
434       ,p_errorcode  => hr_message.last_message_number
435       ,p_errormsg   => hr_message.get_message_text);
436   elsif (hr_message.last_message_name ='HR_7371_ASG_INVALID_BG_GRADE')
437       then hr_errors_api.addErrorToTable
438       (p_errorfield => 'P_GRADE_NAME'
439       ,p_errorcode  => hr_message.last_message_number
440       ,p_errormsg   => hr_message.get_message_text);
441    elsif (hr_message.last_message_name ='HR_7434_ASG_GRADE_REQUIRED')
442       then hr_errors_api.addErrorToTable
443       (p_errorfield => 'P_GRADE_NAME'
444       ,p_errorcode  => hr_message.last_message_number
445       ,p_errormsg   => hr_message.get_message_text);
446   elsif (hr_message.last_message_name ='HR_51291_ASG_INV_VAC_GRADE')
447        then hr_errors_api.addErrorToTable
448       (p_errorfield => 'P_GRADE_NAME'
449       ,p_errorcode  => hr_message.last_message_number
450       ,p_errormsg   => hr_message.get_message_text);
451   ELSE  -- Bug #1313212 Fix
452       hr_errors_api.addErrorToTable
453       (p_errorfield => 'P_GRADE_NAME'
454       ,p_errorcode  => hr_message.last_message_number
455       ,p_errormsg   => hr_message.get_message_text);
456   end if;
457 end;
458 --
459 -- check the supervisor id
460 --
461 begin
462    --
463   per_asg_bus2.chk_supervisor_id
464     (p_assignment_id          =>  p_assignment_id
465     ,p_supervisor_id          =>  p_supervisor_id
466     ,p_person_id              =>  p_person_id
467     ,p_business_group_id      =>  p_business_group_id
468     ,p_validation_start_date  =>  l_validation_start_date
469     ,p_effective_date         =>  l_effective_date
470     ,p_object_version_number  =>  l_object_version_number
471     );
472 exception
473 when others then
474 --
475   hr_message.provide_error;
476 --
477 -- look for the possible messages raised by the supervisor check to add
478 -- them to the supervisor field
479 --
480   if (hr_message.last_message_name ='HR_51143_ASG_EMP_EQUAL_SUP')
481       then hr_errors_api.addErrorToTable
482       -- As of 11.5.2, P_SUPERVISOR_NAME field is not displayed on the
483       -- Assignment page yet.  Thus, we need to set the error field to null.
484       -- When P_SUPERVISOR_NAME is displayed on the assignment page, uncomment
485       -- out the error field statement to point to the proper field.
486       -- (p_errorfield => 'P_SUPERVISOR_NAME'
487       (p_errorfield => null
488       ,p_errorcode  => hr_message.last_message_number
489       ,p_errormsg   => hr_message.get_message_text);
490   elsif (hr_message.last_message_name ='PAY_7599_SYS_SUP_DT_OUTDATE')
491       then hr_errors_api.addErrorToTable
492       -- (p_errorfield => 'P_SUPERVISOR_NAME'
493       (p_errorfield => null
494       ,p_errorcode  => hr_message.last_message_number
495       ,p_errormsg   => hr_message.get_message_text);
496   elsif (hr_message.last_message_name ='HR_51145_ASG_SUP_BG_NE_EMP_BG')
497       then hr_errors_api.addErrorToTable
498       -- (p_errorfield => 'P_SUPERVISOR_NAME'
499       (p_errorfield => null
500       ,p_errorcode  => hr_message.last_message_number
501       ,p_errormsg   => hr_message.get_message_text);
502   elsif (hr_message.last_message_name ='HR_51346_ASG_SUP_NOT_EMP')
503       then hr_errors_api.addErrorToTable
504       -- (p_errorfield => 'P_SUPERVISOR_NAME'
505       (p_errorfield => null
506       ,p_errorcode  => hr_message.last_message_number
507       ,p_errormsg   => hr_message.get_message_text);
508   ELSE  -- Bug #1313212 Fix
509       hr_errors_api.addErrorToTable
510       -- (p_errorfield => 'P_SUPERVISOR_NAME'
511       (p_errorfield => null
512       ,p_errorcode  => hr_message.last_message_number
513       ,p_errormsg   => hr_message.get_message_text);
514 
515  end if;
516 end;
517 --
518 if (NOT l_pos_error) and (NOT l_org_error) then
519 -- check the pos org combination if neither pos nor org have raised an error
520 --
521 begin
522   --
523   per_asg_bus2.chk_position_id_org_id
524     (p_assignment_id          =>  p_assignment_id
525      ,p_position_id           =>  p_position_id
526      ,p_organization_id       =>  p_organization_id
527      ,p_validation_start_date =>  l_validation_start_date
528      ,p_validation_end_date   =>  l_validation_end_date
529      ,p_effective_date        =>  l_effective_date
530      ,p_object_version_number =>  l_object_version_number
531     );
532 exception
533 when others then
534 --
535   hr_message.provide_error;
536   if (hr_message.last_message_name ='HR_51055_ASG_INV_POS_ORG_COMB')
537       then hr_errors_api.addErrorToTable
538       (p_errorfield => null
539       ,p_errorcode  => hr_message.last_message_number
540       ,p_errormsg   => hr_message.get_message_text);
541   ELSE  -- Bug #1313212 Fix
542       hr_errors_api.addErrorToTable
543       (p_errorfield => null
544       ,p_errorcode  => hr_message.last_message_number
545       ,p_errormsg   => hr_message.get_message_text);
546  end if;
547 end;
548 end if;
549 --
550 -- check the location_id
551 --
552 begin
553   per_asg_bus1.chk_location_id
554     (p_assignment_id          =>  p_assignment_id
555      ,p_location_id           =>  p_location_id
556      ,p_assignment_type       =>  p_assignment_type
557      ,p_vacancy_id            =>  p_vacancy_id
558      ,p_validation_start_date =>  l_validation_start_date
559      ,p_validation_end_date   =>  l_validation_end_date
560      ,p_effective_date        =>  l_effective_date
561      ,p_object_version_number =>  l_object_version_number
562     );
563 exception
564 when others then
565 --
566   hr_message.provide_error;
567 --
568 -- look for the possible messages raised by the location check to add
569 -- them to the location field
570 --
571   if (hr_message.last_message_name ='HR_7382_ASG_NON_EXIST_LOCATION')
572       then hr_errors_api.addErrorToTable
573       (p_errorfield => 'P_LOCATION_NAME'
574       ,p_errorcode  => hr_message.last_message_number
575       ,p_errormsg   => hr_message.get_message_text);
576   elsif (hr_message.last_message_name ='HR_51215_ASG_INACT_LOCATION')
577       then hr_errors_api.addErrorToTable
578       (p_errorfield => 'P_LOCATION_NAME'
579       ,p_errorcode  => hr_message.last_message_number
580       ,p_errormsg   => hr_message.get_message_text);
581    elsif (hr_message.last_message_name ='HR_51041_ASG_INVALID_VAC_LOC')
582       then hr_errors_api.addErrorToTable
583       (p_errorfield => 'P_LOCATION_NAME'
584       ,p_errorcode  => hr_message.last_message_number
585       ,p_errormsg   => hr_message.get_message_text);
586    ELSE  -- Bug #1313212 Fix
587       hr_errors_api.addErrorToTable
588       (p_errorfield => 'P_LOCATION_NAME'
589       ,p_errorcode  => hr_message.last_message_number
590       ,p_errormsg   => hr_message.get_message_text);
591  end if;
592 end;
593 --
594 --
595 if not hr_errors_api.errorExists then
596 --
597 -- call the assignment criteria api
598 -- this enters all of the data which have element link dependencies
599 --
600   hr_assignment_api.update_emp_asg_criteria
601       (p_effective_date               => l_effective_date
602       ,p_datetrack_update_mode        => p_datetrack_update_mode
603       ,p_assignment_id                => p_assignment_id
604       ,p_object_version_number        => l_object_version_number
605       ,p_grade_id                     => p_grade_id
606       ,p_position_id                  => p_position_id
607       ,p_job_id                       => p_job_id
608       ,p_location_id                  => p_location_id
609       ,p_special_ceiling_step_id      => p_special_ceiling_step_id
610       ,p_organization_id              => p_organization_id
611       ,p_employment_category          => p_employment_category
612       ,p_segment1                     => p_pgp_segment1
613       ,p_segment2                     => p_pgp_segment2
614       ,p_segment3                     => p_pgp_segment3
615       ,p_segment4                     => p_pgp_segment4
616       ,p_segment5                     => p_pgp_segment5
617       ,p_segment6                     => p_pgp_segment6
618       ,p_segment7                     => p_pgp_segment7
619       ,p_segment8                     => p_pgp_segment8
620       ,p_segment9                     => p_pgp_segment9
621       ,p_segment10                    => p_pgp_segment10
622       ,p_segment11                    => p_pgp_segment11
623       ,p_segment12                    => p_pgp_segment12
624       ,p_segment13                    => p_pgp_segment13
625       ,p_segment14                    => p_pgp_segment14
626       ,p_segment15                    => p_pgp_segment15
627       ,p_segment16                    => p_pgp_segment16
628       ,p_segment17                    => p_pgp_segment17
629       ,p_segment18                    => p_pgp_segment18
630       ,p_segment19                    => p_pgp_segment19
631       ,p_segment20                    => p_pgp_segment20
632       ,p_segment21                    => p_pgp_segment21
633       ,p_segment22                    => p_pgp_segment22
634       ,p_segment23                    => p_pgp_segment23
635       ,p_segment24                    => p_pgp_segment24
636       ,p_segment25                    => p_pgp_segment25
637       ,p_segment26                    => p_pgp_segment26
638       ,p_segment27                    => p_pgp_segment27
639       ,p_segment28                    => p_pgp_segment28
640       ,p_segment29                    => p_pgp_segment29
641       ,p_segment30                    => p_pgp_segment30
642       ,p_effective_start_date         => l_effective_start_date
643       ,p_effective_end_date           => l_effective_end_date
644       ,p_people_group_id              => l_people_group_id
645       ,p_group_name                   => l_group_name
646       ,p_org_now_no_manager_warning   => l_org_now_no_manager_warning
647       ,p_other_manager_warning        => l_other_manager_warning
648       ,p_spp_delete_warning           => l_spp_delete_warning
649       ,p_entries_changed_warning      => l_entries_changed_warning
650       ,p_tax_district_changed_warning => l_tax_district_changed_warning
651       );
652 --
653 -- look to see if the elements have changed
654 --
655   if (l_entries_changed_warning<>'N') then
656   --
657   -- if the elements have changed, look to see if we want a
658   -- warning or an error
659   --
660     if p_element_warning then
661     --
662     -- we want a warning, so look to see if the warning has already been
663     -- raised and this is the second time through the process
664     --
665       if p_element_changed is null then
666       --
667       -- since p_element_changed is null, the warning has not already been
668       -- raised, so raise it
669       --
670         p_element_changed:='W';
671         hr_errors_api.addErrorToTable
672         (p_errorfield   => null
673         ,p_errorcode    => to_char(SQLCODE)
674         ,p_errormsg     => hr_util_misc_web.return_msg_text
675                            (p_message_name =>'HR_ELEMENT_CHANGED_WARNING_WEB'
676                            ,p_application_id => 'PER')
677         ,p_warningflag  => true
678         );
679       else
680         --
681         -- p_element_changed is not null, so the warning has already been raised
682         -- so clear it so that the user can continue this time.
683         --
684         p_element_changed:=null;
685       end if;
686     --
687     else
688       --
689       -- we want an error , so raise one.
690       --
691       hr_errors_api.addErrorToTable
692       (p_errorfield => null
693       ,p_errorcode  => to_char(SQLCODE)
694       ,p_errormsg   => hr_util_misc_web.return_msg_text
695                        (p_message_name   => 'HR_ELEMENT_CHANGED_WEB'
696                        ,p_application_id => 'PER')
697       ,p_email_id   => p_email_id
698       ,p_email_msg  => hr_util_misc_web.return_msg_text
699                        (p_message_name => 'HR_ELEMENT_CHANGE_EMAILTXT_WEB'
700                        ,p_application_id => 'PER')
701       );
702     end if;
703   end if;
704 
705 --
706 -- if there is no manager in the organization now then raise a warning
707 --
708  if p_validate=TRUE then
709   if(l_org_now_no_manager_warning) then
710     fnd_message.set_name('PER','HR_51124_MMV_NO_MGR_EXIST_ORG');
711     hr_errors_api.addErrorToTable
712       (p_errorfield => null
713       ,p_errormsg   => fnd_message.get
714       ,p_warningflag => TRUE);
715   end if;
716 --
717 -- if there are other managers then raise a warning
718 --
719   if(l_other_manager_warning) then
720     fnd_message.set_name('PER','HR_51125_MMV_MRE_MRG_EXIST_ORG');
721     hr_errors_api.addErrorToTable
722       (p_errorfield => null
723       ,p_errormsg   => fnd_message.get
724       ,p_warningflag => TRUE);
725   end if;
726  end if;
727 end if;
728 --
729   if not hr_errors_api.errorExists then
730 --
731 -- if there are no errors from the previous api call then call the
732 -- assignment information api.
733 -- This is always called in CORRECTION mode because once we have made an UPDATE
734 -- to the row to make another change to it will be a correction.
735 --
736     hr_assignment_api.update_emp_asg
737       (p_effective_date               => l_effective_date
738       ,p_datetrack_update_mode        => 'CORRECTION'
739       ,p_assignment_id                => p_assignment_id
740       ,p_object_version_number        => l_object_version_number
741       ,p_supervisor_id                => p_supervisor_id
742       ,p_change_reason                => p_change_reason
743       ,p_manager_flag                 => p_manager_flag
744       ,p_normal_hours                 => p_normal_hours
745       ,p_frequency                    => p_frequency
746       ,p_time_normal_finish           => p_time_normal_finish
747       ,p_time_normal_start            => p_time_normal_start
748       ,p_ass_attribute_category       => p_ass_attribute_category
749       ,p_ass_attribute1               => p_ass_attribute1
750       ,p_ass_attribute2               => p_ass_attribute2
751       ,p_ass_attribute3               => p_ass_attribute3
752       ,p_ass_attribute4               => p_ass_attribute4
753       ,p_ass_attribute5               => p_ass_attribute5
754       ,p_ass_attribute6               => p_ass_attribute6
755       ,p_ass_attribute7               => p_ass_attribute7
756       ,p_ass_attribute8               => p_ass_attribute8
757       ,p_ass_attribute9               => p_ass_attribute9
758       ,p_ass_attribute10              => p_ass_attribute10
759       ,p_ass_attribute11              => p_ass_attribute11
760       ,p_ass_attribute12              => p_ass_attribute12
761       ,p_ass_attribute13              => p_ass_attribute13
762       ,p_ass_attribute14              => p_ass_attribute14
763       ,p_ass_attribute15              => p_ass_attribute15
764       ,p_ass_attribute16              => p_ass_attribute16
765       ,p_ass_attribute17              => p_ass_attribute17
766       ,p_ass_attribute18              => p_ass_attribute18
767       ,p_ass_attribute19              => p_ass_attribute19
768       ,p_ass_attribute20              => p_ass_attribute20
769       ,p_ass_attribute21              => p_ass_attribute21
770       ,p_ass_attribute22              => p_ass_attribute22
771       ,p_ass_attribute23              => p_ass_attribute23
772       ,p_ass_attribute24              => p_ass_attribute24
773       ,p_ass_attribute25              => p_ass_attribute25
774       ,p_ass_attribute26              => p_ass_attribute26
775       ,p_ass_attribute27              => p_ass_attribute27
776       ,p_ass_attribute28              => p_ass_attribute28
777       ,p_ass_attribute29              => p_ass_attribute29
778       ,p_ass_attribute30              => p_ass_attribute30
779       ,p_segment1                     => p_scl_segment1
780       ,p_segment2                     => p_scl_segment2
781       ,p_segment3                     => p_scl_segment3
782       ,p_segment4                     => p_scl_segment4
783       ,p_segment5                     => p_scl_segment5
784       ,p_segment6                     => p_scl_segment6
785       ,p_segment7                     => p_scl_segment7
786       ,p_segment8                     => p_scl_segment8
787       ,p_segment9                     => p_scl_segment9
788       ,p_segment10                    => p_scl_segment10
789       ,p_segment11                    => p_scl_segment11
790       ,p_segment12                    => p_scl_segment12
791       ,p_segment13                    => p_scl_segment13
792       ,p_segment14                    => p_scl_segment14
793       ,p_segment15                    => p_scl_segment15
794       ,p_segment16                    => p_scl_segment16
795       ,p_segment17                    => p_scl_segment17
796       ,p_segment18                    => p_scl_segment18
797       ,p_segment19                    => p_scl_segment19
798       ,p_segment20                    => p_scl_segment20
799       ,p_segment21                    => p_scl_segment21
800       ,p_segment22                    => p_scl_segment22
801       ,p_segment23                    => p_scl_segment23
802       ,p_segment24                    => p_scl_segment24
803       ,p_segment25                    => p_scl_segment25
804       ,p_segment26                    => p_scl_segment26
805       ,p_segment27                    => p_scl_segment27
806       ,p_segment28                    => p_scl_segment28
807       ,p_segment29                    => p_scl_segment29
808       ,p_segment30                    => p_scl_segment30
809       ,p_soft_coding_keyflex_id       => l_soft_coding_keyflex_id
810       ,p_comment_id                   => l_comment_id
811       ,p_effective_start_date         => l_effective_start_date
812       ,p_effective_end_date           => l_effective_end_date
813       ,p_concatenated_segments        => l_concatenated_segments
814       ,p_no_managers_warning          => l_org_now_no_manager_warning
815       ,p_other_manager_warning        => l_other_manager_warning
816       );
817 --
818 -- check the warning flags again
819 --
820   if p_validate=TRUE then
821     if(l_org_now_no_manager_warning) then
822       fnd_message.set_name('PER','HR_51124_MMV_NO_MGR_EXIST_ORG');
823       hr_errors_api.addErrorToTable
824       (p_errorfield => null
825       ,p_errormsg   => fnd_message.get
826       ,p_warningflag => TRUE);
827     end if;
828     if(l_other_manager_warning) then
829       fnd_message.set_name('PER','HR_51125_MMV_MRE_MRG_EXIST_ORG');
830       hr_errors_api.addErrorToTable
831       (p_errorfield => null
832       ,p_errormsg   => fnd_message.get
833       ,p_warningflag => TRUE);
834     end if;
835   end if;
836     --
837     -- update the assignment status type
838     --
839     --
840     -- chack to see what type of status the new id corresponds to.
841     --
842     open status_type;
843     fetch status_type into l_assignment_status_type;
844     if status_type%notfound then
845       close status_type;
846     else
847       close status_type;
848       --
849       -- if we have an active assignment type then use the activate_emp_asg api
850       if l_assignment_status_type='ACTIVE_ASSIGN' then
851       --
852       -- if we have an active assignment type then use the activate_emp_asg api
853       --
854         hr_assignment_api.activate_emp_asg
855         (p_effective_date               => l_effective_date
856         ,p_datetrack_update_mode        => 'CORRECTION'
857         ,p_assignment_id                => p_assignment_id
858         ,p_change_reason                => p_change_reason
859         ,p_object_version_number        => l_object_version_number
860         ,p_assignment_status_type_id    => p_assignment_status_type_id
861         ,p_effective_start_date         => l_effective_start_date
862         ,p_effective_end_date           => l_effective_end_date);
863       elsif l_assignment_status_type='SUSP_ASSIGN' then
864       --
865       -- if we have an active assignment type then use the suspend_emp_asg api
866       --
867         hr_assignment_api.suspend_emp_asg
868         (p_effective_date               => l_effective_date
869         ,p_datetrack_update_mode        => 'CORRECTION'
870         ,p_assignment_id                => p_assignment_id
871         ,p_change_reason                => p_change_reason
872         ,p_object_version_number        => l_object_version_number
873         ,p_assignment_status_type_id    => p_assignment_status_type_id
874         ,p_effective_start_date         => l_effective_start_date
875         ,p_effective_end_date           => l_effective_end_date);
876       end if;
877     end if;
878     --
879     p_effective_start_date:=l_effective_start_date;
880     p_effective_end_date:=l_effective_end_date;
881 --
882   end if;
883   --
884   -- if we are in validate only mode, rollback
885   --
886   if p_validate=TRUE
887   or hr_errors_api.errorExists then
888     rollback to validate_assignment;
889   end if;
890 
891 --
892 -- handle any errors that are raised.
893 --
894 exception
895 when others then
896 --
897 -- rollback because there were errors
898 --
899   rollback to validate_assignment;
900 
901 -- Reset IN OUT and set OUT parameters.
902    p_element_changed      := l_element_changed;
903    p_special_ceiling_step_id := l_special_ceiling_step_id;
904    p_effective_start_date  := null;
905    p_effective_end_date    := null;
906 
907   hr_message.provide_error;
908 --
909 -- add the error message without changing it
910 --
911   hr_errors_api.addErrorToTable
912   (p_errorfield => null
913   ,p_errorcode  => hr_message.last_message_number
914   ,p_errormsg   => hr_message.get_message_text);
915 
916 --
917 -- we do not check every error message individually because they are all passed
918 -- up without changing the error message at them moment, but they remain in the
919 -- code commented out so that if any of the error messages need to be
920 -- replaced, the code can easily be retrieved from this section.
921 --
922 /*  if (hr_message.last_message_name ='HR_6153_ALL_PROCEDURE_FAIL')
923       then hr_errors_api.addErrorToTable
924       (p_errorfield => null
925       ,p_errorcode  => hr_message.last_message_number
926       ,p_errormsg   => hr_message.get_message_text);
927   elsif (hr_message.last_message_name ='HR_6434_EMP_ASS_PER_CLOSED')
928       then hr_errors_api.addErrorToTable
929       (p_errorfield => null
930       ,p_errorcode  => hr_message.last_message_number
931       ,p_errormsg   => hr_message.get_message_text);
932   elsif (hr_message.last_message_name ='HR_7155_OBJECT_INVALID')
933       then hr_errors_api.addErrorToTable
934       (p_errorfield => null
935       ,p_errorcode  => hr_message.last_message_number
936       ,p_errormsg   => hr_message.get_message_text);
937   elsif (hr_message.last_message_name ='HR_7165_OBJECT_LOCKED')
938       then hr_errors_api.addErrorToTable
939       (p_errorfield => null
940       ,p_errorcode  => hr_message.last_message_number
941       ,p_errormsg   => hr_message.get_message_text);
942   elsif (hr_message.last_message_name ='HR_7202_COMMENT_TEXT_NOT_EXIST')
943       then hr_errors_api.addErrorToTable
944       (p_errorfield => null
945       ,p_errorcode  => hr_message.last_message_number
946       ,p_errormsg   => hr_message.get_message_text);
947   elsif (hr_message.last_message_name ='HR_7215_DT_CHILD_EXISTS')
948       then hr_errors_api.addErrorToTable
949       (p_errorfield => null
950       ,p_errorcode  => hr_message.last_message_number
951       ,p_errormsg   => hr_message.get_message_text);
952   elsif (hr_message.last_message_name ='HR_7216_DT_UPD_INTEGRITY_ERR')
953       then hr_errors_api.addErrorToTable
954       (p_errorfield => null
955       ,p_errorcode  => hr_message.last_message_number
956       ,p_errormsg   => hr_message.get_message_text);
957   elsif (hr_message.last_message_name ='HR_7220_INVALID_PRIMARY_KEY')
958       then hr_errors_api.addErrorToTable
959       (p_errorfield => null
960       ,p_errorcode  => hr_message.last_message_number
961       ,p_errormsg   => hr_message.get_message_text);
962   elsif (hr_message.last_message_name ='HR_7371_ASG_INVALID_BG_GRADE')
963       then hr_errors_api.addErrorToTable
964       (p_errorfield => null
965       ,p_errorcode  => hr_message.last_message_number
966       ,p_errormsg   => hr_message.get_message_text);
967   elsif (hr_message.last_message_name ='HR_7376_ASG_INVALID_BG_ORG')
968       then hr_errors_api.addErrorToTable
969       (p_errorfield => null
970       ,p_errorcode  => hr_message.last_message_number
971       ,p_errormsg   => hr_message.get_message_text);
972   elsif (hr_message.last_message_name ='HR_7370_ASG_INVALID_PAYROLL')
973       then hr_errors_api.addErrorToTable
974       (p_errorfield => null
975       ,p_errorcode  => hr_message.last_message_number
976       ,p_errormsg   => hr_message.get_message_text);
977   elsif (hr_message.last_message_name ='HR_7372_ASG_INV_BG_ASS_STATUS')
978       then hr_errors_api.addErrorToTable
979       (p_errorfield => null
980       ,p_errorcode  => hr_message.last_message_number
981       ,p_errormsg   => hr_message.get_message_text);
982   elsif (hr_message.last_message_name ='HR_7373_ASG_INVALID_BG_PAYROLL')
983       then hr_errors_api.addErrorToTable
984       (p_errorfield => null
985       ,p_errorcode  => hr_message.last_message_number
986       ,p_errormsg   => hr_message.get_message_text);
987   elsif (hr_message.last_message_name ='HR_7374_ASG_INVALID_BG_PERSON')
988       then hr_errors_api.addErrorToTable
989       (p_errorfield => null
990       ,p_errorcode  => hr_message.last_message_number
991       ,p_errormsg   => hr_message.get_message_text);
992   elsif (hr_message.last_message_name ='HR_7375_ASG_INV_BG_SP_CLG_STEP')
993       then hr_errors_api.addErrorToTable
994       (p_errorfield => null
995       ,p_errorcode  => hr_message.last_message_number
996       ,p_errormsg   => hr_message.get_message_text);
997   elsif (hr_message.last_message_name ='HR_7378_ASG_NO_DATE_OF_BIRTH')
998       then hr_errors_api.addErrorToTable
999       (p_errorfield => null
1000       ,p_errorcode  => hr_message.last_message_number
1001       ,p_errormsg   => hr_message.get_message_text);
1002   elsif (hr_message.last_message_name ='HR_7379_ASG_INV_SPEC_CEIL_STEP')
1003       then hr_errors_api.addErrorToTable
1004       (p_errorfield => null
1005       ,p_errorcode  => hr_message.last_message_number
1006       ,p_errormsg   => hr_message.get_message_text);
1007   elsif (hr_message.last_message_name ='HR_7380_ASG_STEP_INV_FOR_GRADE')
1008       then hr_errors_api.addErrorToTable
1009       (p_errorfield => null
1010       ,p_errorcode  => hr_message.last_message_number
1011       ,p_errormsg   => hr_message.get_message_text);
1012   elsif (hr_message.last_message_name ='HR_7381_ASG_CEIL_STEP_TOO_HIGH')
1013       then hr_errors_api.addErrorToTable
1014       (p_errorfield => null
1015       ,p_errorcode  => hr_message.last_message_number
1016       ,p_errormsg   => hr_message.get_message_text);
1017   elsif (hr_message.last_message_name ='HR_7382_ASG_NON_EXIST_LOCATION')
1018       then hr_errors_api.addErrorToTable
1019       (p_errorfield => null
1020       ,p_errorcode  => hr_message.last_message_number
1021       ,p_errormsg   => hr_message.get_message_text);
1022   elsif (hr_message.last_message_name ='HR_7383_ASG_INV_KEYFLEX')
1023       then hr_errors_api.addErrorToTable
1024       (p_errorfield => null
1025       ,p_errorcode  => hr_message.last_message_number
1026       ,p_errormsg   => hr_message.get_message_text);
1027   elsif (hr_message.last_message_name ='HR_7385_ASG_INV_PEOPLE_GROUP')
1028       then hr_errors_api.addErrorToTable
1029       (p_errorfield => null
1030       ,p_errorcode  => hr_message.last_message_number
1031       ,p_errormsg   => hr_message.get_message_text);
1032   elsif (hr_message.last_message_name ='HR_7386_ASG_INV_PEOP_GRP_LINK')
1033       then hr_errors_api.addErrorToTable
1034       (p_errorfield => null
1035       ,p_errorcode  => hr_message.last_message_number
1036       ,p_errormsg   => hr_message.get_message_text);
1037   elsif (hr_message.last_message_name ='HR_7387_ASG_NORMAL_HOURS_REQD')
1038       then hr_errors_api.addErrorToTable
1039       (p_errorfield => null
1040       ,p_errorcode  => hr_message.last_message_number
1041       ,p_errormsg   => hr_message.get_message_text);
1042   elsif (hr_message.last_message_name ='HR_7388_ASG_INVALID_FREQUENCY')
1043       then hr_errors_api.addErrorToTable
1044       (p_errorfield => null
1045       ,p_errorcode  => hr_message.last_message_number
1046       ,p_errormsg   => hr_message.get_message_text);
1047   elsif (hr_message.last_message_name ='HR_7389_ASG_INVALID_ORG')
1048       then hr_errors_api.addErrorToTable
1049       (p_errorfield => null
1050       ,p_errorcode  => hr_message.last_message_number
1051       ,p_errormsg   => hr_message.get_message_text);
1052   elsif (hr_message.last_message_name ='HR_7390_ASG_NO_EMP_NO')
1053       then hr_errors_api.addErrorToTable
1054       (p_errorfield => null
1055       ,p_errorcode  => hr_message.last_message_number
1056       ,p_errormsg   => hr_message.get_message_text);
1057   elsif (hr_message.last_message_name ='HR_7391_ASG_INV_PERIOD_OF_SERV')
1058       then hr_errors_api.addErrorToTable
1059       (p_errorfield => null
1060       ,p_errorcode  => hr_message.last_message_number
1061       ,p_errormsg   => hr_message.get_message_text);
1062   elsif (hr_message.last_message_name ='HR_7392_ASG_INV_DEL_OF_ASS')
1063       then hr_errors_api.addErrorToTable
1064       (p_errorfield => null
1065       ,p_errorcode  => hr_message.last_message_number
1066       ,p_errormsg   => hr_message.get_message_text);
1067   elsif (hr_message.last_message_name ='HR_7393_ASG_INVALID_GRADE')
1068       then hr_errors_api.addErrorToTable
1069       (p_errorfield => null
1070       ,p_errorcode  => hr_message.last_message_number
1071       ,p_errormsg   => hr_message.get_message_text);
1072   elsif (hr_message.last_message_name ='HR_7396_ASG_FREQUENCY_REQD')
1073       then hr_errors_api.addErrorToTable
1074       (p_errorfield => null
1075       ,p_errorcode  => hr_message.last_message_number
1076       ,p_errormsg   => hr_message.get_message_text);
1077   elsif (hr_message.last_message_name ='HR_7399_ASG_NO_DEL_NON_PRIM')
1078       then hr_errors_api.addErrorToTable
1079       (p_errorfield => null
1080       ,p_errorcode  => hr_message.last_message_number
1081       ,p_errormsg   => hr_message.get_message_text);
1082   elsif (hr_message.last_message_name ='HR_7400_ASG_NO_DEL_ASS_EVENTS')
1083       then hr_errors_api.addErrorToTable
1084       (p_errorfield => null
1085       ,p_errorcode  => hr_message.last_message_number
1086       ,p_errormsg   => hr_message.get_message_text);
1087   elsif (hr_message.last_message_name ='HR_7401_ASG_NO_DEL_ASS_LET_REQ')
1088       then hr_errors_api.addErrorToTable
1089       (p_errorfield => null
1090       ,p_errorcode  => hr_message.last_message_number
1091       ,p_errormsg   => hr_message.get_message_text);
1092   elsif (hr_message.last_message_name ='HR_7402_ASG_NO_DEL_COST_ALLOCS')
1093       then hr_errors_api.addErrorToTable
1094       (p_errorfield => null
1095       ,p_errorcode  => hr_message.last_message_number
1096       ,p_errormsg   => hr_message.get_message_text);
1097   elsif (hr_message.last_message_name ='HR_7403_ASG_NO_DEL_PAYROLL_ACT')
1098       then hr_errors_api.addErrorToTable
1099       (p_errorfield => null
1100       ,p_errorcode  => hr_message.last_message_number
1101       ,p_errormsg   => hr_message.get_message_text);
1102   elsif (hr_message.last_message_name ='HR_7404_ASG_NO_DEL_PER_PAY_MET')
1103       then hr_errors_api.addErrorToTable
1104       (p_errorfield => null
1105       ,p_errorcode  => hr_message.last_message_number
1106       ,p_errormsg   => hr_message.get_message_text);
1107   elsif (hr_message.last_message_name ='HR_7405_ASG_NO_DEL_COB_COV_ENR')
1108       then hr_errors_api.addErrorToTable
1109       (p_errorfield => null
1110       ,p_errorcode  => hr_message.last_message_number
1111       ,p_errormsg   => hr_message.get_message_text);
1112   elsif (hr_message.last_message_name ='HR_7406_ASG_NO_DEL_COB_COV_BEN')
1113       then hr_errors_api.addErrorToTable
1114       (p_errorfield => null
1115       ,p_errorcode  => hr_message.last_message_number
1116       ,p_errormsg   => hr_message.get_message_text);
1117   elsif (hr_message.last_message_name ='HR_7407_ASG_NO_DEL_ASS_STATUS')
1118       then hr_errors_api.addErrorToTable
1119       (p_errorfield => null
1120       ,p_errorcode  => hr_message.last_message_number
1121       ,p_errormsg   => hr_message.get_message_text);
1122   elsif (hr_message.last_message_name ='HR_7409_ASG_NO_DEL_EXTR_INFO')
1123       then hr_errors_api.addErrorToTable
1124       (p_errorfield => null
1125       ,p_errorcode  => hr_message.last_message_number
1126       ,p_errormsg   => hr_message.get_message_text);
1127   elsif (hr_message.last_message_name ='HR_7410_ASG_NO_DEL_ASS_SET_AMD')
1128       then hr_errors_api.addErrorToTable
1129       (p_errorfield => null
1130       ,p_errorcode  => hr_message.last_message_number
1131       ,p_errormsg   => hr_message.get_message_text);
1132   elsif (hr_message.last_message_name ='HR_7412_ASG_ASS_TERM_IN_FUTURE')
1133       then hr_errors_api.addErrorToTable
1134       (p_errorfield => null
1135       ,p_errorcode  => hr_message.last_message_number
1136       ,p_errormsg   => hr_message.get_message_text);
1137   elsif (hr_message.last_message_name ='HR_7427_ASG_INVALID_ASS_TYPE')
1138       then hr_errors_api.addErrorToTable
1139       (p_errorfield => null
1140       ,p_errorcode  => hr_message.last_message_number
1141       ,p_errormsg   => hr_message.get_message_text);
1142   elsif (hr_message.last_message_name ='HR_7428_ASG_INV_PRIMARY_FLAG')
1143       then hr_errors_api.addErrorToTable
1144       (p_errorfield => null
1145       ,p_errorcode  => hr_message.last_message_number
1146       ,p_errormsg   => hr_message.get_message_text);
1147   elsif (hr_message.last_message_name ='HR_7429_ASG_INV_MANAGER_FLAG')
1148       then hr_errors_api.addErrorToTable
1149       (p_errorfield => null
1150       ,p_errorcode  => hr_message.last_message_number
1151       ,p_errormsg   => hr_message.get_message_text);
1152   elsif (hr_message.last_message_name ='HR_7434_ASG_GRADE_REQUIRED')
1153       then hr_errors_api.addErrorToTable
1154       (p_errorfield => null
1155       ,p_errorcode  => hr_message.last_message_number
1156       ,p_errormsg   => hr_message.get_message_text);
1157   elsif (hr_message.last_message_name ='HR_7435_ASG_PRIM_ASS_EXISTS')
1158       then hr_errors_api.addErrorToTable
1159       (p_errorfield => null
1160       ,p_errorcode  => hr_message.last_message_number
1161       ,p_errormsg   => hr_message.get_message_text);
1162   elsif (hr_message.last_message_name ='HR_7436_ASG_NO_PRIM_ASS')
1163       then hr_errors_api.addErrorToTable
1164       (p_errorfield => null
1165       ,p_errorcode  => hr_message.last_message_number
1166       ,p_errormsg   => hr_message.get_message_text);
1167   elsif (hr_message.last_message_name ='HR_7441_API_ARG_NOT_SET')
1168       then hr_errors_api.addErrorToTable
1169       (p_errorfield => null
1170       ,p_errorcode  => hr_message.last_message_number
1171       ,p_errormsg   => hr_message.get_message_text);
1172   elsif (hr_message.last_message_name ='PAY_7599_SYS_SUP_DT_OUTDATE')
1173       then hr_errors_api.addErrorToTable
1174       (p_errorfield => null
1175       ,p_errorcode  => hr_message.last_message_number
1176       ,p_errormsg   => hr_message.get_message_text);
1177   elsif (hr_message.last_message_name ='HR_7877_API_INVALID_CONSTRAINT')
1178       then hr_errors_api.addErrorToTable
1179       (p_errorfield => null
1180       ,p_errorcode  => hr_message.last_message_number
1181       ,p_errormsg   => hr_message.get_message_text);
1182   elsif (hr_message.last_message_name ='HR_7915_ASG_INV_STAT_UPD_DATE')
1183       then hr_errors_api.addErrorToTable
1184       (p_errorfield => null
1185       ,p_errorcode  => hr_message.last_message_number
1186       ,p_errormsg   => hr_message.get_message_text);
1187   elsif (hr_message.last_message_name ='HR_7917_ASG_INV_STAT_TYPE')
1188       then hr_errors_api.addErrorToTable
1189       (p_errorfield => null
1190       ,p_errorcode  => hr_message.last_message_number
1191       ,p_errormsg   => hr_message.get_message_text);
1192   elsif (hr_message.last_message_name ='HR_7940_ASG_INV_ASG_STAT_TYPE')
1193       then hr_errors_api.addErrorToTable
1194       (p_errorfield => null
1195       ,p_errorcode  => hr_message.last_message_number
1196       ,p_errormsg   => hr_message.get_message_text);
1197   elsif (hr_message.last_message_name ='HR_7941_ASG_INV_STAT_NOT_ACT')
1198       then hr_errors_api.addErrorToTable
1199       (p_errorfield => null
1200       ,p_errorcode  => hr_message.last_message_number
1201       ,p_errormsg   => hr_message.get_message_text);
1202   elsif (hr_message.last_message_name ='HR_7942_ASG_INV_STAT_NOT_TERM')
1203       then hr_errors_api.addErrorToTable
1204       (p_errorfield => null
1205       ,p_errorcode  => hr_message.last_message_number
1206       ,p_errormsg   => hr_message.get_message_text);
1207   elsif (hr_message.last_message_name ='HR_7946_ASG_INV_TERM_ASS_UPD')
1208       then hr_errors_api.addErrorToTable
1209       (p_errorfield => null
1210       ,p_errorcode  => hr_message.last_message_number
1211       ,p_errormsg   => hr_message.get_message_text);
1212   elsif (hr_message.last_message_name ='HR_7949_ASG_DIF_SYSTEM_TYPES')
1213       then hr_errors_api.addErrorToTable
1214       (p_errorfield => null
1215       ,p_errorcode  => hr_message.last_message_number
1216       ,p_errormsg   => hr_message.get_message_text);
1217   elsif (hr_message.last_message_name ='HR_7964_ASG_INV_BUS_ATT_LEG')
1218       then hr_errors_api.addErrorToTable
1219       (p_errorfield => null
1220       ,p_errorcode  => hr_message.last_message_number
1221       ,p_errormsg   => hr_message.get_message_text);
1222   elsif (hr_message.last_message_name ='HR_7969_ASG_INV_PAYROLL_PPMS')
1223       then hr_errors_api.addErrorToTable
1224       (p_errorfield => null
1225       ,p_errorcode  => hr_message.last_message_number
1226       ,p_errormsg   => hr_message.get_message_text);
1227   elsif (hr_message.last_message_name ='HR_7975_ASG_INV_FUTURE_ASA')
1228       then hr_errors_api.addErrorToTable
1229       (p_errorfield => null
1230       ,p_errorcode  => hr_message.last_message_number
1231       ,p_errormsg   => hr_message.get_message_text);
1232   elsif (hr_message.last_message_name ='HR_51000_ASG_INVALID_POS')
1233       then hr_errors_api.addErrorToTable
1234       (p_errorfield => null
1235       ,p_errorcode  => hr_message.last_message_number
1236       ,p_errormsg   => hr_message.get_message_text);
1237   elsif (hr_message.last_message_name ='HR_51009_ASG_INVALID_BG_POS')
1238       then hr_errors_api.addErrorToTable
1239       (p_errorfield => null
1240       ,p_errorcode  => hr_message.last_message_number
1241       ,p_errormsg   => hr_message.get_message_text);
1242   elsif (hr_message.last_message_name ='HR_51017_ASG_NUM_NULL_FOR_APL')
1243       then hr_errors_api.addErrorToTable
1244       (p_errorfield => null
1245       ,p_errorcode  => hr_message.last_message_number
1246       ,p_errormsg   => hr_message.get_message_text);
1247   elsif (hr_message.last_message_name ='HR_51028_ASG_INV_EMP_CATEGORY')
1248       then hr_errors_api.addErrorToTable
1249       (p_errorfield => null
1250       ,p_errorcode  => hr_message.last_message_number
1251       ,p_errormsg   => hr_message.get_message_text);
1252   elsif (hr_message.last_message_name ='HR_51040_ASG_INVALID_VAC_POS')
1253       then hr_errors_api.addErrorToTable
1254       (p_errorfield => null
1255       ,p_errorcode  => hr_message.last_message_number
1256       ,p_errormsg   => hr_message.get_message_text);
1257   elsif (hr_message.last_message_name ='HR_51041_ASG_INVALID_VAC_LOC')
1258       then hr_errors_api.addErrorToTable
1259       (p_errorfield => null
1260       ,p_errorcode  => hr_message.last_message_number
1261       ,p_errormsg   => hr_message.get_message_text);
1262   elsif (hr_message.last_message_name ='HR_51042_ASG_INVALID_VAC_ORG')
1263       then hr_errors_api.addErrorToTable
1264       (p_errorfield => null
1265       ,p_errorcode  => hr_message.last_message_number
1266       ,p_errormsg   => hr_message.get_message_text);
1267   elsif (hr_message.last_message_name ='HR_51148_ASG_INV_DEF_COD_COM')
1268       then hr_errors_api.addErrorToTable
1269       (p_errorfield => null
1270       ,p_errorcode  => hr_message.last_message_number
1271       ,p_errormsg   => hr_message.get_message_text);
1272   elsif (hr_message.last_message_name ='HR_51055_ASG_INV_POS_ORG_COMB')
1273       then hr_errors_api.addErrorToTable
1274       (p_errorfield => null
1275       ,p_errorcode  => hr_message.last_message_number
1276       ,p_errormsg   => hr_message.get_message_text);
1277   elsif (hr_message.last_message_name ='HR_51056_ASG_INV_POS_JOB_COMB')
1278       then hr_errors_api.addErrorToTable
1279       (p_errorfield => null
1280       ,p_errorcode  => hr_message.last_message_number
1281       ,p_errormsg   => hr_message.get_message_text);
1282   elsif (hr_message.last_message_name ='HR_51057_ASG_JOB_NULL_VALUE')
1283       then hr_errors_api.addErrorToTable
1284       (p_errorfield => null
1285       ,p_errorcode  => hr_message.last_message_number
1286       ,p_errormsg   => hr_message.get_message_text);
1287   elsif (hr_message.last_message_name ='HR_51143_ASG_EMP_EQUAL_SUP')
1288       then hr_errors_api.addErrorToTable
1289       (p_errorfield => null
1290       ,p_errorcode  => hr_message.last_message_number
1291       ,p_errormsg   => hr_message.get_message_text);
1292   elsif (hr_message.last_message_name ='HR_51145_ASG_SUP_BG_NE_EMP_BG')
1293       then hr_errors_api.addErrorToTable
1294       (p_errorfield => null
1295       ,p_errorcode  => hr_message.last_message_number
1296       ,p_errormsg   => hr_message.get_message_text);
1297   elsif (hr_message.last_message_name ='HR_51147_ASG_DPE_BEF_MIN_ESD')
1298       then hr_errors_api.addErrorToTable
1299       (p_errorfield => null
1300       ,p_errorcode  => hr_message.last_message_number
1301       ,p_errormsg   => hr_message.get_message_text);
1302   elsif (hr_message.last_message_name ='HR_51149_ASG_INV_PRP_FREQ')
1303       then hr_errors_api.addErrorToTable
1304       (p_errorfield => null
1305       ,p_errorcode  => hr_message.last_message_number
1306       ,p_errormsg   => hr_message.get_message_text);
1307   elsif (hr_message.last_message_name ='HR_51151_ASG_INV_PROB_UNIT')
1308       then hr_errors_api.addErrorToTable
1309       (p_errorfield => null
1310       ,p_errorcode  => hr_message.last_message_number
1311       ,p_errormsg   => hr_message.get_message_text);
1312   elsif (hr_message.last_message_name ='HR_51160_ASG_INV_SET_OF_BOOKS')
1313       then hr_errors_api.addErrorToTable
1314       (p_errorfield => null
1315       ,p_errorcode  => hr_message.last_message_number
1316       ,p_errormsg   => hr_message.get_message_text);
1317   elsif (hr_message.last_message_name ='HR_51162_ASG_INV_SOURCE_TYPE')
1318       then hr_errors_api.addErrorToTable
1319       (p_errorfield => null
1320       ,p_errorcode  => hr_message.last_message_number
1321       ,p_errormsg   => hr_message.get_message_text);
1322   elsif (hr_message.last_message_name ='HR_51163_ASG_INV_PRPF_PRP_COMB')
1323       then hr_errors_api.addErrorToTable
1324       (p_errorfield => null
1325       ,p_errorcode  => hr_message.last_message_number
1326       ,p_errormsg   => hr_message.get_message_text);
1327   elsif (hr_message.last_message_name ='HR_51164_ASG_INV_SRP_FREQ')
1328       then hr_errors_api.addErrorToTable
1329       (p_errorfield => null
1330       ,p_errorcode  => hr_message.last_message_number
1331       ,p_errormsg   => hr_message.get_message_text);
1332   elsif (hr_message.last_message_name ='HR_51165_ASG_INV_SRPF_SRP_COMB')
1333       then hr_errors_api.addErrorToTable
1334       (p_errorfield => null
1335       ,p_errorcode  => hr_message.last_message_number
1336       ,p_errormsg   => hr_message.get_message_text);
1337   elsif (hr_message.last_message_name ='HR_51166_ASG_INV_PU_PP_COMB')
1338       then hr_errors_api.addErrorToTable
1339       (p_errorfield => null
1340       ,p_errorcode  => hr_message.last_message_number
1341       ,p_errormsg   => hr_message.get_message_text);
1342   elsif (hr_message.last_message_name ='HR_51167_ASG_PB_PD_OUT_OF_RAN')
1343       then hr_errors_api.addErrorToTable
1344       (p_errorfield => null
1345       ,p_errorcode  => hr_message.last_message_number
1346       ,p_errormsg   => hr_message.get_message_text);
1347   elsif (hr_message.last_message_name ='HR_51168_ASG_INV_PAY_BASIS_ID')
1348       then hr_errors_api.addErrorToTable
1349       (p_errorfield => null
1350       ,p_errorcode  => hr_message.last_message_number
1351       ,p_errormsg   => hr_message.get_message_text);
1352   elsif (hr_message.last_message_name ='HR_51169_ASG_INV_PAY_BAS_BG')
1353       then hr_errors_api.addErrorToTable
1354       (p_errorfield => null
1355       ,p_errorcode  => hr_message.last_message_number
1356       ,p_errormsg   => hr_message.get_message_text);
1357   elsif (hr_message.last_message_name ='HR_51171_ASG_INV_PB_PP_CD')
1358       then hr_errors_api.addErrorToTable
1359       (p_errorfield => null
1360       ,p_errorcode  => hr_message.last_message_number
1361       ,p_errormsg   => hr_message.get_message_text);
1362   elsif (hr_message.last_message_name ='HR_51172_ASG_INV_DT_JOB')
1363       then hr_errors_api.addErrorToTable
1364       (p_errorfield => null
1365       ,p_errorcode  => hr_message.last_message_number
1366       ,p_errormsg   => hr_message.get_message_text);
1367   elsif (hr_message.last_message_name ='HR_51173_ASG_INV_DT_JOB_BG')
1368       then hr_errors_api.addErrorToTable
1369       (p_errorfield => null
1370       ,p_errorcode  => hr_message.last_message_number
1371       ,p_errormsg   => hr_message.get_message_text);
1372   elsif (hr_message.last_message_name ='HR_51175_ASG_INV_ASG_TYP_SOB')
1373       then hr_errors_api.addErrorToTable
1374       (p_errorfield => null
1375       ,p_errorcode  => hr_message.last_message_number
1376       ,p_errormsg   => hr_message.get_message_text);
1377   elsif (hr_message.last_message_name ='HR_51176_ASG_INV_ASG_TYP_PBS')
1378       then hr_errors_api.addErrorToTable
1379       (p_errorfield => null
1380       ,p_errorcode  => hr_message.last_message_number
1381       ,p_errormsg   => hr_message.get_message_text);
1382   elsif (hr_message.last_message_name ='HR_51177_ASG_INV_ASG_TYP_DCC')
1383       then hr_errors_api.addErrorToTable
1384       (p_errorfield => null
1385       ,p_errorcode  => hr_message.last_message_number
1386       ,p_errormsg   => hr_message.get_message_text);
1387   elsif (hr_message.last_message_name ='HR_51178_ASG_INV_ASG_TYP_PRPF')
1388       then hr_errors_api.addErrorToTable
1389       (p_errorfield => null
1390       ,p_errorcode  => hr_message.last_message_number
1391       ,p_errormsg   => hr_message.get_message_text);
1392   elsif (hr_message.last_message_name ='HR_51179_ASG_INV_ASG_TYP_PRP')
1393       then hr_errors_api.addErrorToTable
1394       (p_errorfield => null
1395       ,p_errorcode  => hr_message.last_message_number
1396       ,p_errormsg   => hr_message.get_message_text);
1397   elsif (hr_message.last_message_name ='HR_51180_ASG_INV_ASG_TYP_SRP')
1398       then hr_errors_api.addErrorToTable
1399       (p_errorfield => null
1400       ,p_errorcode  => hr_message.last_message_number
1401       ,p_errormsg   => hr_message.get_message_text);
1402   elsif (hr_message.last_message_name ='HR_51181_ASG_INV_ASG_TYP_SRPF')
1403       then hr_errors_api.addErrorToTable
1404       (p_errorfield => null
1405       ,p_errorcode  => hr_message.last_message_number
1406       ,p_errormsg   => hr_message.get_message_text);
1407   elsif (hr_message.last_message_name ='HR_51198_ASG_INV_APL_ASG_PF')
1408       then hr_errors_api.addErrorToTable
1409       (p_errorfield => null
1410       ,p_errorcode  => hr_message.last_message_number
1411       ,p_errormsg   => hr_message.get_message_text);
1412   elsif (hr_message.last_message_name ='HR_51203_ASG_INV_ASG_TYP_PDS')
1413       then hr_errors_api.addErrorToTable
1414       (p_errorfield => null
1415       ,p_errorcode  => hr_message.last_message_number
1416       ,p_errormsg   => hr_message.get_message_text);
1417   elsif (hr_message.last_message_name ='HR_51206_ASG_INV_AST_ACT_FLG')
1418       then hr_errors_api.addErrorToTable
1419       (p_errorfield => null
1420       ,p_errorcode  => hr_message.last_message_number
1421       ,p_errormsg   => hr_message.get_message_text);
1422   elsif (hr_message.last_message_name ='HR_51207_ASG_INV_AST_BUS_GRP')
1423       then hr_errors_api.addErrorToTable
1424       (p_errorfield => null
1425       ,p_errorcode  => hr_message.last_message_number
1426       ,p_errormsg   => hr_message.get_message_text);
1427   elsif (hr_message.last_message_name ='HR_51210_ASG_INV_APL')
1428       then hr_errors_api.addErrorToTable
1429       (p_errorfield => null
1430       ,p_errorcode  => hr_message.last_message_number
1431       ,p_errormsg   => hr_message.get_message_text);
1432   elsif (hr_message.last_message_name ='HR_51211_ASG_INV_E_ASG_APL_ID')
1433       then hr_errors_api.addErrorToTable
1434       (p_errorfield => null
1435       ,p_errorcode  => hr_message.last_message_number
1436       ,p_errormsg   => hr_message.get_message_text);
1437   elsif (hr_message.last_message_name ='HR_51212_ASG_INV_APL_ASG_APL')
1438       then hr_errors_api.addErrorToTable
1439       (p_errorfield => null
1440       ,p_errorcode  => hr_message.last_message_number
1441       ,p_errormsg   => hr_message.get_message_text);
1442   elsif (hr_message.last_message_name ='HR_51213_ASG_INV_UPD_APL')
1443       then hr_errors_api.addErrorToTable
1444       (p_errorfield => null
1445       ,p_errorcode  => hr_message.last_message_number
1446       ,p_errormsg   => hr_message.get_message_text);
1447   elsif (hr_message.last_message_name ='HR_51214_ASG_INV_APL_BUS_GRP')
1448       then hr_errors_api.addErrorToTable
1449       (p_errorfield => null
1450       ,p_errorcode  => hr_message.last_message_number
1451       ,p_errormsg   => hr_message.get_message_text);
1452   elsif (hr_message.last_message_name ='HR_51215_ASG_INACT_LOCATION')
1453       then hr_errors_api.addErrorToTable
1454       (p_errorfield => null
1455       ,p_errorcode  => hr_message.last_message_number
1456       ,p_errormsg   => hr_message.get_message_text);
1457   elsif (hr_message.last_message_name ='HR_51216_ASG_INV_ASG_TYP_REC')
1458       then hr_errors_api.addErrorToTable
1459       (p_errorfield => null
1460       ,p_errorcode  => hr_message.last_message_number
1461       ,p_errormsg   => hr_message.get_message_text);
1462   elsif (hr_message.last_message_name ='HR_51217_ASG_INV_ASG_TYP_ECAT')
1463       then hr_errors_api.addErrorToTable
1464       (p_errorfield => null
1465       ,p_errorcode  => hr_message.last_message_number
1466       ,p_errormsg   => hr_message.get_message_text);
1467   elsif (hr_message.last_message_name ='HR_51219_ASG_INV_EASG_I_SORG')
1468       then hr_errors_api.addErrorToTable
1469       (p_errorfield => null
1470       ,p_errorcode  => hr_message.last_message_number
1471       ,p_errormsg   => hr_message.get_message_text);
1472   elsif (hr_message.last_message_name ='HR_51220_ASG_INV_EASG_U_SORG')
1473       then hr_errors_api.addErrorToTable
1474       (p_errorfield => null
1475       ,p_errorcode  => hr_message.last_message_number
1476       ,p_errormsg   => hr_message.get_message_text);
1477   elsif (hr_message.last_message_name ='HR_51221_ASG_INV_EASG_I_VAC')
1478       then hr_errors_api.addErrorToTable
1479       (p_errorfield => null
1480       ,p_errorcode  => hr_message.last_message_number
1481       ,p_errormsg   => hr_message.get_message_text);
1482   elsif (hr_message.last_message_name ='HR_51222_ASG_INV_EASG_U_VAC')
1483       then hr_errors_api.addErrorToTable
1484       (p_errorfield => null
1485       ,p_errorcode  => hr_message.last_message_number
1486       ,p_errormsg   => hr_message.get_message_text);
1487   elsif (hr_message.last_message_name ='HR_51223_ASG_INV_ASG_TYP_RCAT')
1488       then hr_errors_api.addErrorToTable
1489       (p_errorfield => null
1490       ,p_errorcode  => hr_message.last_message_number
1491       ,p_errormsg   => hr_message.get_message_text);
1492   elsif (hr_message.last_message_name ='HR_51224_ASG_INV_ASG_TYP_PRB')
1493       then hr_errors_api.addErrorToTable
1494       (p_errorfield => null
1495       ,p_errorcode  => hr_message.last_message_number
1496       ,p_errormsg   => hr_message.get_message_text);
1497   elsif (hr_message.last_message_name ='HR_51225_ASG_INV_ASG_TYP_SCS')
1498       then hr_errors_api.addErrorToTable
1499       (p_errorfield => null
1500       ,p_errorcode  => hr_message.last_message_number
1501       ,p_errormsg   => hr_message.get_message_text);
1502   elsif (hr_message.last_message_name ='HR_51226_ASG_INV_ASG_TYP_PAY')
1503       then hr_errors_api.addErrorToTable
1504       (p_errorfield => null
1505       ,p_errorcode  => hr_message.last_message_number
1506       ,p_errormsg   => hr_message.get_message_text);
1507   elsif (hr_message.last_message_name ='HR_51227_ASG_INV_ASG_TYP_SCF')
1508       then hr_errors_api.addErrorToTable
1509       (p_errorfield => null
1510       ,p_errorcode  => hr_message.last_message_number
1511       ,p_errormsg   => hr_message.get_message_text);
1512   elsif (hr_message.last_message_name ='HR_51228_ASG_INV_EASG_CH_REAS')
1513       then hr_errors_api.addErrorToTable
1514       (p_errorfield => null
1515       ,p_errorcode  => hr_message.last_message_number
1516       ,p_errormsg   => hr_message.get_message_text);
1517   elsif (hr_message.last_message_name ='HR_51229_ASG_INV_AASG_CH_REAS')
1518       then hr_errors_api.addErrorToTable
1519       (p_errorfield => null
1520       ,p_errorcode  => hr_message.last_message_number
1521       ,p_errormsg   => hr_message.get_message_text);
1522   elsif (hr_message.last_message_name ='HR_51230_ASG_INV_ASG_TYP_IAL')
1523       then hr_errors_api.addErrorToTable
1524       (p_errorfield => null
1525       ,p_errorcode  => hr_message.last_message_number
1526       ,p_errormsg   => hr_message.get_message_text);
1527   elsif (hr_message.last_message_name ='HR_51232_ASG_INV_AASG_AST')
1528       then hr_errors_api.addErrorToTable
1529       (p_errorfield => null
1530       ,p_errorcode  => hr_message.last_message_number
1531       ,p_errormsg   => hr_message.get_message_text);
1532   elsif (hr_message.last_message_name ='HR_51252_ASG_INV_PGP_ENBD_FLAG')
1533       then hr_errors_api.addErrorToTable
1534       (p_errorfield => null
1535       ,p_errorcode  => hr_message.last_message_number
1536       ,p_errormsg   => hr_message.get_message_text);
1537   elsif (hr_message.last_message_name ='HR_51275_ASG_INV_F_DT_AST_PSS')
1538       then hr_errors_api.addErrorToTable
1539       (p_errorfield => null
1540       ,p_errorcode  => hr_message.last_message_number
1541       ,p_errormsg   => hr_message.get_message_text);
1542   elsif (hr_message.last_message_name ='HR_51277_ASG_INV_HR_ORG')
1543       then hr_errors_api.addErrorToTable
1544       (p_errorfield => null
1545       ,p_errorcode  => hr_message.last_message_number
1546       ,p_errormsg   => hr_message.get_message_text);
1547   elsif (hr_message.last_message_name ='HR_51280_ASG_INV_RECRUIT_ID')
1548       then hr_errors_api.addErrorToTable
1549       (p_errorfield => null
1550       ,p_errorcode  => hr_message.last_message_number
1551       ,p_errormsg   => hr_message.get_message_text);
1552   elsif (hr_message.last_message_name ='HR_51281_ASG_INV_VAC_REC')
1553       then hr_errors_api.addErrorToTable
1554       (p_errorfield => null
1555       ,p_errorcode  => hr_message.last_message_number
1556       ,p_errormsg   => hr_message.get_message_text);
1557   elsif (hr_message.last_message_name ='HR_51284_ASG_INV_RECRUIT_BG')
1558       then hr_errors_api.addErrorToTable
1559       (p_errorfield => null
1560       ,p_errorcode  => hr_message.last_message_number
1561       ,p_errormsg   => hr_message.get_message_text);
1562   elsif (hr_message.last_message_name ='HR_51289_ASG_APL_EQUAL_RECRUIT')
1563       then hr_errors_api.addErrorToTable
1564       (p_errorfield => null
1565       ,p_errorcode  => hr_message.last_message_number
1566       ,p_errormsg   => hr_message.get_message_text);
1567   elsif (hr_message.last_message_name ='HR_51290_ASG_RECRUIT_NOT_EMP')
1568       then hr_errors_api.addErrorToTable
1569       (p_errorfield => null
1570       ,p_errorcode  => hr_message.last_message_number
1571       ,p_errormsg   => hr_message.get_message_text);
1572   elsif (hr_message.last_message_name ='HR_51291_ASG_INV_VAC_GRADE')
1573       then hr_errors_api.addErrorToTable
1574       (p_errorfield => null
1575       ,p_errorcode  => hr_message.last_message_number
1576       ,p_errormsg   => hr_message.get_message_text);
1577   elsif (hr_message.last_message_name ='HR_51293_ASG_INV_VAC_JOB')
1578       then hr_errors_api.addErrorToTable
1579       (p_errorfield => null
1580       ,p_errorcode  => hr_message.last_message_number
1581       ,p_errormsg   => hr_message.get_message_text);
1582   elsif (hr_message.last_message_name ='HR_51294_ASG_INV_AASG_PET')
1583       then hr_errors_api.addErrorToTable
1584       (p_errorfield => null
1585       ,p_errorcode  => hr_message.last_message_number
1586       ,p_errormsg   => hr_message.get_message_text);
1587   elsif (hr_message.last_message_name ='HR_51296_ASG_INV_VAC_PEO_GRP')
1588       then hr_errors_api.addErrorToTable
1589       (p_errorfield => null
1590       ,p_errorcode  => hr_message.last_message_number
1591       ,p_errormsg   => hr_message.get_message_text);
1592   elsif (hr_message.last_message_name ='HR_51297_ASG_INV_VACANCY')
1593       then hr_errors_api.addErrorToTable
1594       (p_errorfield => null
1595       ,p_errorcode  => hr_message.last_message_number
1596       ,p_errormsg   => hr_message.get_message_text);
1597   elsif (hr_message.last_message_name ='HR_51300_ASG_INV_VAC_BG')
1598       then hr_errors_api.addErrorToTable
1599       (p_errorfield => null
1600       ,p_errorcode  => hr_message.last_message_number
1601       ,p_errormsg   => hr_message.get_message_text);
1602   elsif (hr_message.last_message_name ='HR_51302_ASG_INV_PER_REF_BY')
1603       then hr_errors_api.addErrorToTable
1604       (p_errorfield => null
1605       ,p_errorcode  => hr_message.last_message_number
1606       ,p_errormsg   => hr_message.get_message_text);
1607   elsif (hr_message.last_message_name ='HR_51303_ASG_INV_PER_REF_BY_BG')
1608       then hr_errors_api.addErrorToTable
1609       (p_errorfield => null
1610       ,p_errorcode  => hr_message.last_message_number
1611       ,p_errormsg   => hr_message.get_message_text);
1612   elsif (hr_message.last_message_name ='HR_51304_ASG_APL_EQUAL_PRB')
1613       then hr_errors_api.addErrorToTable
1614       (p_errorfield => null
1615       ,p_errorcode  => hr_message.last_message_number
1616       ,p_errormsg   => hr_message.get_message_text);
1617   elsif (hr_message.last_message_name ='HR_51305_ASG_PER_RB_NOT_EMP')
1618       then hr_errors_api.addErrorToTable
1619       (p_errorfield => null
1620       ,p_errorcode  => hr_message.last_message_number
1621       ,p_errormsg   => hr_message.get_message_text);
1622   elsif (hr_message.last_message_name ='HR_51306_ASG_INV_REC_ACT')
1623       then hr_errors_api.addErrorToTable
1624       (p_errorfield => null
1625       ,p_errorcode  => hr_message.last_message_number
1626       ,p_errormsg   => hr_message.get_message_text);
1627   elsif (hr_message.last_message_name ='HR_51307_ASG_INV_REC_ACT_BG')
1628       then hr_errors_api.addErrorToTable
1629       (p_errorfield => null
1630       ,p_errorcode  => hr_message.last_message_number
1631       ,p_errormsg   => hr_message.get_message_text);
1632   elsif (hr_message.last_message_name ='HR_51308_ASG_INV_SOURCE_ORG')
1633       then hr_errors_api.addErrorToTable
1634       (p_errorfield => null
1635       ,p_errorcode  => hr_message.last_message_number
1636       ,p_errormsg   => hr_message.get_message_text);
1637   elsif (hr_message.last_message_name ='HR_51309_ASG_INV_SOURCE_ORG_BG')
1638       then hr_errors_api.addErrorToTable
1639       (p_errorfield => null
1640       ,p_errorcode  => hr_message.last_message_number
1641       ,p_errormsg   => hr_message.get_message_text);
1642   elsif (hr_message.last_message_name ='HR_51316_ASG_INV_FSP_SOB_BG')
1643       then hr_errors_api.addErrorToTable
1644       (p_errorfield => null
1645       ,p_errorcode  => hr_message.last_message_number
1646       ,p_errormsg   => hr_message.get_message_text);
1647   elsif (hr_message.last_message_name ='HR_51320_ASG_INV_PDS_BG')
1648       then hr_errors_api.addErrorToTable
1649       (p_errorfield => null
1650       ,p_errorcode  => hr_message.last_message_number
1651       ,p_errormsg   => hr_message.get_message_text);
1652   elsif (hr_message.last_message_name ='HR_51323_ASG_INV_PRIM_ASG_EED')
1653       then hr_errors_api.addErrorToTable
1654       (p_errorfield => null
1655       ,p_errorcode  => hr_message.last_message_number
1656       ,p_errormsg   => hr_message.get_message_text);
1657   elsif (hr_message.last_message_name ='HR_51325_ASG_INV_SOU_TYP_RAT')
1658       then hr_errors_api.addErrorToTable
1659       (p_errorfield => null
1660       ,p_errorcode  => hr_message.last_message_number
1661       ,p_errormsg   => hr_message.get_message_text);
1662   elsif (hr_message.last_message_name ='HR_51329_ASG_INV_EASG_PET')
1663       then hr_errors_api.addErrorToTable
1664       (p_errorfield => null
1665       ,p_errorcode  => hr_message.last_message_number
1666       ,p_errormsg   => hr_message.get_message_text);
1667   elsif (hr_message.last_message_name ='HR_51346_ASG_SUP_NOT_EMP')
1668       then hr_errors_api.addErrorToTable
1669       (p_errorfield => null
1670       ,p_errorcode  => hr_message.last_message_number
1671       ,p_errormsg   => hr_message.get_message_text);
1672   elsif (hr_message.last_message_name ='HR_51375_ASG_INV_APL_NOT_1_ASG')
1673       then hr_errors_api.addErrorToTable
1674       (p_errorfield => null
1675       ,p_errorcode  => hr_message.last_message_number
1676       ,p_errormsg   => hr_message.get_message_text);
1677   elsif (hr_message.last_message_name ='HR_52217_DUP_APL_VACANCY')
1678       then hr_errors_api.addErrorToTable
1679       (p_errorfield => null
1680       ,p_errorcode  => hr_message.last_message_number
1681       ,p_errormsg   => hr_message.get_message_text);
1682   elsif (hr_message.last_message_name ='PER_52990_ASG_PRADD_NE_PAY')
1683       then hr_errors_api.addErrorToTable
1684       (p_errorfield => null
1685       ,p_errorcode  => hr_message.last_message_number
1686       ,p_errormsg   => hr_message.get_message_text);
1687   elsif (hr_message.last_message_name ='PER_74800_CAGR_STRUCT_GRADE')
1688       then hr_errors_api.addErrorToTable
1689       (p_errorfield => null
1690       ,p_errorcode  => hr_message.last_message_number
1691       ,p_errormsg   => hr_message.get_message_text);
1692   elsif (hr_message.last_message_name ='PER_74801_GRADE_NOT_STRUCT')
1693       then hr_errors_api.addErrorToTable
1694       (p_errorfield => null
1695       ,p_errorcode  => hr_message.last_message_number
1696       ,p_errormsg   => hr_message.get_message_text);
1697   elsif (hr_message.last_message_name ='PER_74802_INVALID_CAGR_GRADE')
1698       then hr_errors_api.addErrorToTable
1699       (p_errorfield => null
1700       ,p_errorcode  => hr_message.last_message_number
1701       ,p_errormsg   => hr_message.get_message_text);
1702   elsif (hr_message.last_message_name ='PER_74803_CAGR_ONLY_SELECT')
1703       then hr_errors_api.addErrorToTable
1704       (p_errorfield => null
1705       ,p_errorcode  => hr_message.last_message_number
1706       ,p_errormsg   => hr_message.get_message_text);
1707   elsif (hr_message.last_message_name ='PER_74804_INVALID_STRUCTURE')
1708       then hr_errors_api.addErrorToTable
1709       (p_errorfield => null
1710       ,p_errorcode  => hr_message.last_message_number
1711       ,p_errormsg   => hr_message.get_message_text);
1712   elsif (hr_message.last_message_name ='PER_74806_INVALID_CONTRACT')
1713       then hr_errors_api.addErrorToTable
1714       (p_errorfield => null
1715       ,p_errorcode  => hr_message.last_message_number
1716       ,p_errormsg   => hr_message.get_message_text);
1717   elsif (hr_message.last_message_name ='PER_74807_CONTRACT_PERSON')
1718       then hr_errors_api.addErrorToTable
1719       (p_errorfield => null
1720       ,p_errorcode  => hr_message.last_message_number
1721       ,p_errormsg   => hr_message.get_message_text);
1722   elsif (hr_message.last_message_name ='PER_74808_CONTRACT_IN_BG')
1723       then hr_errors_api.addErrorToTable
1724       (p_errorfield => null
1725       ,p_errorcode  => hr_message.last_message_number
1726       ,p_errormsg   => hr_message.get_message_text);
1727   elsif (hr_message.last_message_name ='PER_74809_CONTRACT_AFTER_ASG')
1728       then hr_errors_api.addErrorToTable
1729       (p_errorfield => null
1730       ,p_errorcode  => hr_message.last_message_number
1731       ,p_errormsg   => hr_message.get_message_text);
1732   elsif (hr_message.last_message_name ='PER_74810_COLLECTIVE_AGREEMENT')
1733       then hr_errors_api.addErrorToTable
1734       (p_errorfield => null
1735       ,p_errorcode  => hr_message.last_message_number
1736       ,p_errormsg   => hr_message.get_message_text);
1737   elsif (hr_message.last_message_name ='PER_74811_COLLECTIVE_NOT_IN_BG')
1738       then hr_errors_api.addErrorToTable
1739       (p_errorfield => null
1740       ,p_errorcode  => hr_message.last_message_number
1741       ,p_errormsg   => hr_message.get_message_text);
1742   elsif (hr_message.last_message_name ='PER_74812_INVALID_ESTAB')
1743       then hr_errors_api.addErrorToTable
1744       (p_errorfield => null
1745       ,p_errorcode  => hr_message.last_message_number
1746       ,p_errormsg   => hr_message.get_message_text);
1747    elsif (hr_message.last_message_name ='FLEX-NULL SEGMENT')
1748       then hr_errors_api.addErrorToTable
1749       (p_errorfield => null
1750       ,p_errorcode  => hr_message.last_message_number
1751       ,p_errormsg   => hr_message.get_message_text);
1752   elsif (hr_message.last_message_name ='FLEX-VALUE NOT FOUND')
1753       then hr_errors_api.addErrorToTable
1754       (p_errorfield => null
1755       ,p_errorcode  => hr_message.last_message_number
1756       ,p_errormsg   => hr_message.get_message_text);
1757   elsif (hr_message.last_message_name ='HR_FLEX_VALUE_INVALID')
1758       then hr_errors_api.addErrorToTable
1759       (p_errorfield => null
1760       ,p_errorcode  => hr_message.last_message_number
1761       ,p_errormsg   => hr_message.get_message_text);
1762   else
1763     null;
1764   end if;*/
1765 
1766 end validate_assignment;
1767 --
1768 --
1769 procedure get_asg_from_tt
1770           (p_transaction_step_id in     number
1771           ,p_assignment_rec         out nocopy per_all_assignments_f%rowtype
1772 ) is
1773 /* this procedure gets all of the assignment data from the transaction tables
1774 */
1775 l_assignment_id  per_all_assignments_f.assignment_id%TYPE;
1776 l_effective_date date;
1777 
1778 begin
1779 --
1780   l_assignment_id:=
1781     hr_transaction_api.get_number_value
1782     (p_transaction_step_id =>  p_transaction_step_id
1783     ,p_name                => 'P_ASSIGNMENT_ID');
1784 --
1785   l_effective_date:=
1786     hr_transaction_api.get_date_value
1787     (p_transaction_step_id => p_transaction_step_id
1788     ,p_name                => 'P_EFFECTIVE_DATE');
1789 --
1790 -- first of all get all of the old values
1791 --
1792   get_asg_from_asg(p_assignment_id     => l_assignment_id
1793                   ,p_effective_date    => l_effective_date
1794                   ,p_assignment_rec    => p_assignment_rec);
1795 --
1796 -- then replace the new values that were written to the transaction table
1797 --
1798   p_assignment_rec.object_version_number:=
1799     hr_transaction_api.get_number_value
1800     (p_transaction_step_id =>  p_transaction_step_id
1801     ,p_name                => 'P_OBJECT_VERSION_NUMBER');
1802 --
1803   p_assignment_rec.organization_id:=
1804     hr_transaction_api.get_number_value
1805     (p_transaction_step_id => p_transaction_step_id
1806     ,p_name                => 'P_ORGANIZATION_ID');
1807 --
1808   p_assignment_rec.position_id:=
1809     hr_transaction_api.get_number_value
1810     (p_transaction_step_id => p_transaction_step_id
1811     ,p_name                => 'P_POSITION_ID');
1812 --
1813   p_assignment_rec.job_id:=
1814     hr_transaction_api.get_number_value
1815     (p_transaction_step_id => p_transaction_step_id
1816     ,p_name                => 'P_JOB_ID');
1817 --
1818   p_assignment_rec.grade_id:=
1819     hr_transaction_api.get_number_value
1820     (p_transaction_step_id => p_transaction_step_id
1821     ,p_name                => 'P_GRADE_ID');
1822 --
1823   p_assignment_rec.location_id:=
1824     hr_transaction_api.get_number_value
1825     (p_transaction_step_id => p_transaction_step_id
1826     ,p_name                => 'P_LOCATION_ID');
1827 --
1828   p_assignment_rec.employment_category:=
1829     hr_transaction_api.get_varchar2_value
1830     (p_transaction_step_id => p_transaction_step_id
1831     ,p_name                => 'P_EMPLOYMENT_CATEGORY');
1832 --
1833   p_assignment_rec.supervisor_id:=
1834     hr_transaction_api.get_number_value
1835     (p_transaction_step_id => p_transaction_step_id
1836     ,p_name                => 'P_SUPERVISOR_ID');
1837 --
1838   p_assignment_rec.manager_flag:=
1839     hr_transaction_api.get_varchar2_value
1840     (p_transaction_step_id => p_transaction_step_id
1841     ,p_name                => 'P_MANAGER_FLAG');
1842 --
1843   p_assignment_rec.normal_hours:=
1844     hr_transaction_api.get_number_value
1845     (p_transaction_step_id => p_transaction_step_id
1846     ,p_name                => 'P_NORMAL_HOURS');
1847 --
1848   p_assignment_rec.frequency:=
1849     hr_transaction_api.get_varchar2_value
1850     (p_transaction_step_id => p_transaction_step_id
1851     ,p_name                => 'P_FREQUENCY');
1852 --
1853   p_assignment_rec.time_normal_finish:=
1854     substr(hr_transaction_api.get_varchar2_value
1855     (p_transaction_step_id => p_transaction_step_id
1856     ,p_name                => 'P_TIME_NORMAL_FINISH'),0,5);
1857 --
1858   p_assignment_rec.time_normal_start:=
1859     substr(hr_transaction_api.get_varchar2_value
1860     (p_transaction_step_id => p_transaction_step_id
1861     ,p_name                => 'P_TIME_NORMAL_START'),0,5);
1862 --
1863   p_assignment_rec.special_ceiling_step_id:=
1864     hr_transaction_api.get_number_value
1865     (p_transaction_step_id => p_transaction_step_id
1866     ,p_name                => 'P_SPECIAL_CEILING_STEP_ID');
1867 --
1868   p_assignment_rec.assignment_status_type_id:=
1869     hr_transaction_api.get_number_value
1870     (p_transaction_step_id => p_transaction_step_id
1871     ,p_name                => 'P_ASSIGNMENT_STATUS_TYPE_ID');
1872 --
1873   p_assignment_rec.ass_attribute_category:=
1874     hr_transaction_api.get_varchar2_value
1875     (p_transaction_step_id => p_transaction_step_id
1876     ,p_name                => 'P_ASS_ATTRIBUTE_CATEGORY');
1877 --
1878   p_assignment_rec.change_reason:=
1879     hr_transaction_api.get_varchar2_value
1880     (p_transaction_step_id => p_transaction_step_id
1881     ,p_name                => 'P_CHANGE_REASON');
1882 --
1883   p_assignment_rec.ass_attribute1:=
1884     hr_transaction_api.get_varchar2_value
1885     (p_transaction_step_id => p_transaction_step_id
1886     ,p_name                => 'P_ASS_ATTRIBUTE1');
1887 --
1888   p_assignment_rec.ass_attribute2:=
1889     hr_transaction_api.get_varchar2_value
1890     (p_transaction_step_id => p_transaction_step_id
1891     ,p_name                => 'P_ASS_ATTRIBUTE2');
1892 --
1893   p_assignment_rec.ass_attribute3:=
1894     hr_transaction_api.get_varchar2_value
1895     (p_transaction_step_id => p_transaction_step_id
1896     ,p_name                => 'P_ASS_ATTRIBUTE3');
1897 --
1898   p_assignment_rec.ass_attribute4:=
1899     hr_transaction_api.get_varchar2_value
1900     (p_transaction_step_id => p_transaction_step_id
1901     ,p_name                => 'P_ASS_ATTRIBUTE4');
1902 --
1903   p_assignment_rec.ass_attribute5:=
1904     hr_transaction_api.get_varchar2_value
1905     (p_transaction_step_id => p_transaction_step_id
1906     ,p_name                => 'P_ASS_ATTRIBUTE5');
1907 --
1908   p_assignment_rec.ass_attribute6:=
1909     hr_transaction_api.get_varchar2_value
1910     (p_transaction_step_id => p_transaction_step_id
1911     ,p_name                => 'P_ASS_ATTRIBUTE6');
1912 --
1913   p_assignment_rec.ass_attribute7:=
1914     hr_transaction_api.get_varchar2_value
1915     (p_transaction_step_id => p_transaction_step_id
1916     ,p_name                => 'P_ASS_ATTRIBUTE7');
1917 --
1918   p_assignment_rec.ass_attribute8:=
1919     hr_transaction_api.get_varchar2_value
1920     (p_transaction_step_id => p_transaction_step_id
1921     ,p_name                => 'P_ASS_ATTRIBUTE8');
1922 --
1923   p_assignment_rec.ass_attribute9:=
1924     hr_transaction_api.get_varchar2_value
1925     (p_transaction_step_id => p_transaction_step_id
1926     ,p_name                => 'P_ASS_ATTRIBUTE9');
1927 --
1928   p_assignment_rec.ass_attribute10:=
1929     hr_transaction_api.get_varchar2_value
1930     (p_transaction_step_id => p_transaction_step_id
1931     ,p_name                => 'P_ASS_ATTRIBUTE10');
1932 --
1933   p_assignment_rec.ass_attribute11:=
1934     hr_transaction_api.get_varchar2_value
1935     (p_transaction_step_id => p_transaction_step_id
1936     ,p_name                => 'P_ASS_ATTRIBUTE11');
1937 --
1938   p_assignment_rec.ass_attribute12:=
1939     hr_transaction_api.get_varchar2_value
1940     (p_transaction_step_id => p_transaction_step_id
1941     ,p_name                => 'P_ASS_ATTRIBUTE12');
1942 --
1943   p_assignment_rec.ass_attribute13:=
1944     hr_transaction_api.get_varchar2_value
1945     (p_transaction_step_id => p_transaction_step_id
1946     ,p_name                => 'P_ASS_ATTRIBUTE13');
1947 --
1948   p_assignment_rec.ass_attribute14:=
1949     hr_transaction_api.get_varchar2_value
1950     (p_transaction_step_id => p_transaction_step_id
1951     ,p_name                => 'P_ASS_ATTRIBUTE14');
1952 --
1953   p_assignment_rec.ass_attribute15:=
1954     hr_transaction_api.get_varchar2_value
1955     (p_transaction_step_id => p_transaction_step_id
1956     ,p_name                => 'P_ASS_ATTRIBUTE15');
1957 --
1958   p_assignment_rec.ass_attribute16:=
1959     hr_transaction_api.get_varchar2_value
1960     (p_transaction_step_id => p_transaction_step_id
1961     ,p_name                => 'P_ASS_ATTRIBUTE16');
1962 --
1963   p_assignment_rec.ass_attribute17:=
1964     hr_transaction_api.get_varchar2_value
1965     (p_transaction_step_id => p_transaction_step_id
1966     ,p_name                => 'P_ASS_ATTRIBUTE17');
1967 --
1968   p_assignment_rec.ass_attribute18:=
1969     hr_transaction_api.get_varchar2_value
1970     (p_transaction_step_id => p_transaction_step_id
1971     ,p_name                => 'P_ASS_ATTRIBUTE18');
1972 --
1973   p_assignment_rec.ass_attribute19:=
1974     hr_transaction_api.get_varchar2_value
1975     (p_transaction_step_id => p_transaction_step_id
1976     ,p_name                => 'P_ASS_ATTRIBUTE19');
1977 --
1978   p_assignment_rec.ass_attribute20:=
1979     hr_transaction_api.get_varchar2_value
1980     (p_transaction_step_id => p_transaction_step_id
1981     ,p_name                => 'P_ASS_ATTRIBUTE20');
1982 --
1983   p_assignment_rec.ass_attribute21:=
1984     hr_transaction_api.get_varchar2_value
1985     (p_transaction_step_id => p_transaction_step_id
1986     ,p_name                => 'P_ASS_ATTRIBUTE21');
1987 --
1988   p_assignment_rec.ass_attribute22:=
1989     hr_transaction_api.get_varchar2_value
1990     (p_transaction_step_id => p_transaction_step_id
1991     ,p_name                => 'P_ASS_ATTRIBUTE22');
1992 --
1993   p_assignment_rec.ass_attribute23:=
1994     hr_transaction_api.get_varchar2_value
1995     (p_transaction_step_id => p_transaction_step_id
1996     ,p_name                => 'P_ASS_ATTRIBUTE23');
1997 --
1998   p_assignment_rec.ass_attribute24:=
1999     hr_transaction_api.get_varchar2_value
2000     (p_transaction_step_id => p_transaction_step_id
2001     ,p_name                => 'P_ASS_ATTRIBUTE24');
2002 --
2003   p_assignment_rec.ass_attribute25:=
2004     hr_transaction_api.get_varchar2_value
2005     (p_transaction_step_id => p_transaction_step_id
2006     ,p_name                => 'P_ASS_ATTRIBUTE25');
2007 --
2008   p_assignment_rec.ass_attribute26:=
2009     hr_transaction_api.get_varchar2_value
2010     (p_transaction_step_id => p_transaction_step_id
2011     ,p_name                => 'P_ASS_ATTRIBUTE26');
2012 --
2013   p_assignment_rec.ass_attribute27:=
2014     hr_transaction_api.get_varchar2_value
2015     (p_transaction_step_id => p_transaction_step_id
2016     ,p_name                => 'P_ASS_ATTRIBUTE27');
2017 --
2018   p_assignment_rec.ass_attribute28:=
2019     hr_transaction_api.get_varchar2_value
2020     (p_transaction_step_id => p_transaction_step_id
2021     ,p_name                => 'P_ASS_ATTRIBUTE28');
2022 --
2023   p_assignment_rec.ass_attribute29:=
2024     hr_transaction_api.get_varchar2_value
2025     (p_transaction_step_id => p_transaction_step_id
2026     ,p_name                => 'P_ASS_ATTRIBUTE29');
2027 --
2028   p_assignment_rec.ass_attribute30:=
2029     hr_transaction_api.get_varchar2_value
2030     (p_transaction_step_id => p_transaction_step_id
2031     ,p_name                => 'P_ASS_ATTRIBUTE30');
2032 --
2033 end get_asg_from_tt;
2034 --
2035 procedure get_pgp_from_tt
2036           (p_transaction_step_id in     number
2037           ,p_pgp_rec         out nocopy pay_people_groups%rowtype
2038 ) is
2039 /* this procedure gets all of the people group data from the transaction tables
2040 */
2041 begin
2042 --
2043   p_pgp_rec.segment1:=
2044     hr_transaction_api.get_varchar2_value
2045     (p_transaction_step_id => p_transaction_step_id
2046     ,p_name                => 'P_PGP_SEGMENT1');
2047 --
2048   p_pgp_rec.segment2:=
2049     hr_transaction_api.get_varchar2_value
2050     (p_transaction_step_id => p_transaction_step_id
2051     ,p_name                => 'P_PGP_SEGMENT2');
2052 --
2053   p_pgp_rec.segment3:=
2054     hr_transaction_api.get_varchar2_value
2055     (p_transaction_step_id => p_transaction_step_id
2056     ,p_name                => 'P_PGP_SEGMENT3');
2057 --
2058   p_pgp_rec.segment4:=
2059     hr_transaction_api.get_varchar2_value
2060     (p_transaction_step_id => p_transaction_step_id
2061     ,p_name                => 'P_PGP_SEGMENT4');
2062 --
2063   p_pgp_rec.segment5:=
2064     hr_transaction_api.get_varchar2_value
2065     (p_transaction_step_id => p_transaction_step_id
2066     ,p_name                => 'P_PGP_SEGMENT5');
2067 --
2068   p_pgp_rec.segment6:=
2069     hr_transaction_api.get_varchar2_value
2070     (p_transaction_step_id => p_transaction_step_id
2071     ,p_name                => 'P_PGP_SEGMENT6');
2072 --
2073   p_pgp_rec.segment7:=
2074     hr_transaction_api.get_varchar2_value
2075     (p_transaction_step_id => p_transaction_step_id
2076     ,p_name                => 'P_PGP_SEGMENT7');
2077 --
2078   p_pgp_rec.segment8:=
2079     hr_transaction_api.get_varchar2_value
2080     (p_transaction_step_id => p_transaction_step_id
2081     ,p_name                => 'P_PGP_SEGMENT8');
2082 --
2083   p_pgp_rec.segment9:=
2084     hr_transaction_api.get_varchar2_value
2085     (p_transaction_step_id => p_transaction_step_id
2086     ,p_name                => 'P_PGP_SEGMENT9');
2087 --
2088   p_pgp_rec.segment10:=
2089     hr_transaction_api.get_varchar2_value
2090     (p_transaction_step_id => p_transaction_step_id
2091     ,p_name                => 'P_PGP_SEGMENT10');
2092 --
2093   p_pgp_rec.segment11:=
2094     hr_transaction_api.get_varchar2_value
2095     (p_transaction_step_id => p_transaction_step_id
2096     ,p_name                => 'P_PGP_SEGMENT11');
2097 --
2098   p_pgp_rec.segment12:=
2099     hr_transaction_api.get_varchar2_value
2100     (p_transaction_step_id => p_transaction_step_id
2101     ,p_name                => 'P_PGP_SEGMENT12');
2102 --
2103   p_pgp_rec.segment13:=
2104     hr_transaction_api.get_varchar2_value
2105     (p_transaction_step_id => p_transaction_step_id
2106     ,p_name                => 'P_PGP_SEGMENT13');
2107 --
2108   p_pgp_rec.segment14:=
2109     hr_transaction_api.get_varchar2_value
2110     (p_transaction_step_id => p_transaction_step_id
2111     ,p_name                => 'P_PGP_SEGMENT14');
2112 --
2113   p_pgp_rec.segment15:=
2114     hr_transaction_api.get_varchar2_value
2115     (p_transaction_step_id => p_transaction_step_id
2116     ,p_name                => 'P_PGP_SEGMENT15');
2117 --
2118   p_pgp_rec.segment16:=
2119     hr_transaction_api.get_varchar2_value
2120     (p_transaction_step_id => p_transaction_step_id
2121     ,p_name                => 'P_PGP_SEGMENT16');
2122 --
2123   p_pgp_rec.segment17:=
2124     hr_transaction_api.get_varchar2_value
2125     (p_transaction_step_id => p_transaction_step_id
2126     ,p_name                => 'P_PGP_SEGMENT17');
2127 --
2128   p_pgp_rec.segment18:=
2129     hr_transaction_api.get_varchar2_value
2130     (p_transaction_step_id => p_transaction_step_id
2131     ,p_name                => 'P_PGP_SEGMENT18');
2132 --
2133   p_pgp_rec.segment19:=
2134     hr_transaction_api.get_varchar2_value
2135     (p_transaction_step_id => p_transaction_step_id
2136     ,p_name                => 'P_PGP_SEGMENT19');
2137 --
2138   p_pgp_rec.segment20:=
2139     hr_transaction_api.get_varchar2_value
2140     (p_transaction_step_id => p_transaction_step_id
2141     ,p_name                => 'P_PGP_SEGMENT20');
2142 --
2143   p_pgp_rec.segment21:=
2144     hr_transaction_api.get_varchar2_value
2145     (p_transaction_step_id => p_transaction_step_id
2146     ,p_name                => 'P_PGP_SEGMENT21');
2147 --
2148   p_pgp_rec.segment22:=
2149     hr_transaction_api.get_varchar2_value
2150     (p_transaction_step_id => p_transaction_step_id
2151     ,p_name                => 'P_PGP_SEGMENT22');
2152 --
2153   p_pgp_rec.segment23:=
2154     hr_transaction_api.get_varchar2_value
2155     (p_transaction_step_id => p_transaction_step_id
2156     ,p_name                => 'P_PGP_SEGMENT23');
2157 --
2158   p_pgp_rec.segment24:=
2159     hr_transaction_api.get_varchar2_value
2160     (p_transaction_step_id => p_transaction_step_id
2161     ,p_name                => 'P_PGP_SEGMENT24');
2162 --
2163   p_pgp_rec.segment25:=
2164     hr_transaction_api.get_varchar2_value
2165     (p_transaction_step_id => p_transaction_step_id
2166     ,p_name                => 'P_PGP_SEGMENT25');
2167 --
2168   p_pgp_rec.segment26:=
2169     hr_transaction_api.get_varchar2_value
2170     (p_transaction_step_id => p_transaction_step_id
2171     ,p_name                => 'P_PGP_SEGMENT26');
2172 --
2173   p_pgp_rec.segment27:=
2174     hr_transaction_api.get_varchar2_value
2175     (p_transaction_step_id => p_transaction_step_id
2176     ,p_name                => 'P_PGP_SEGMENT27');
2177 --
2178   p_pgp_rec.segment28:=
2179     hr_transaction_api.get_varchar2_value
2180     (p_transaction_step_id => p_transaction_step_id
2181     ,p_name                => 'P_PGP_SEGMENT28');
2182 --
2183   p_pgp_rec.segment29:=
2184     hr_transaction_api.get_varchar2_value
2185     (p_transaction_step_id => p_transaction_step_id
2186     ,p_name                => 'P_PGP_SEGMENT29');
2187 --
2188   p_pgp_rec.segment30:=
2189     hr_transaction_api.get_varchar2_value
2190     (p_transaction_step_id => p_transaction_step_id
2191     ,p_name                => 'P_PGP_SEGMENT30');
2192 --
2193 end get_pgp_from_tt;
2194 --
2195 --
2196 procedure get_scl_from_tt
2197           (p_transaction_step_id in     number
2198           ,p_scl_rec         out nocopy hr_soft_coding_keyflex%rowtype
2199 ) is
2200 /* this procedure gets all of the SCL data from the transaction tables
2201 */
2202 begin
2203 --
2204   p_scl_rec.segment1:=
2205     hr_transaction_api.get_varchar2_value
2206     (p_transaction_step_id => p_transaction_step_id
2207     ,p_name                => 'P_SCL_SEGMENT1');
2208 --
2209   p_scl_rec.segment2:=
2210     hr_transaction_api.get_varchar2_value
2211     (p_transaction_step_id => p_transaction_step_id
2212     ,p_name                => 'P_SCL_SEGMENT2');
2213 --
2214   p_scl_rec.segment3:=
2215     hr_transaction_api.get_varchar2_value
2216     (p_transaction_step_id => p_transaction_step_id
2217     ,p_name                => 'P_SCL_SEGMENT3');
2218 --
2219   p_scl_rec.segment4:=
2220     hr_transaction_api.get_varchar2_value
2221     (p_transaction_step_id => p_transaction_step_id
2222     ,p_name                => 'P_SCL_SEGMENT4');
2223 --
2224   p_scl_rec.segment5:=
2225     hr_transaction_api.get_varchar2_value
2226     (p_transaction_step_id => p_transaction_step_id
2227     ,p_name                => 'P_SCL_SEGMENT5');
2228 --
2229   p_scl_rec.segment6:=
2230     hr_transaction_api.get_varchar2_value
2231     (p_transaction_step_id => p_transaction_step_id
2232     ,p_name                => 'P_SCL_SEGMENT6');
2233 --
2234   p_scl_rec.segment7:=
2235     hr_transaction_api.get_varchar2_value
2236     (p_transaction_step_id => p_transaction_step_id
2237     ,p_name                => 'P_SCL_SEGMENT7');
2238 --
2239   p_scl_rec.segment8:=
2240     hr_transaction_api.get_varchar2_value
2241     (p_transaction_step_id => p_transaction_step_id
2242     ,p_name                => 'P_SCL_SEGMENT8');
2243 --
2244   p_scl_rec.segment9:=
2245     hr_transaction_api.get_varchar2_value
2246     (p_transaction_step_id => p_transaction_step_id
2247     ,p_name                => 'P_SCL_SEGMENT9');
2248 --
2249   p_scl_rec.segment10:=
2250     hr_transaction_api.get_varchar2_value
2251     (p_transaction_step_id => p_transaction_step_id
2252     ,p_name                => 'P_SCL_SEGMENT10');
2253 --
2254   p_scl_rec.segment11:=
2255     hr_transaction_api.get_varchar2_value
2256     (p_transaction_step_id => p_transaction_step_id
2257     ,p_name                => 'P_SCL_SEGMENT11');
2258 --
2259   p_scl_rec.segment12:=
2260     hr_transaction_api.get_varchar2_value
2261     (p_transaction_step_id => p_transaction_step_id
2262     ,p_name                => 'P_SCL_SEGMENT12');
2263 --
2264   p_scl_rec.segment13:=
2265     hr_transaction_api.get_varchar2_value
2266     (p_transaction_step_id => p_transaction_step_id
2267     ,p_name                => 'P_SCL_SEGMENT13');
2268 --
2269   p_scl_rec.segment14:=
2270     hr_transaction_api.get_varchar2_value
2271     (p_transaction_step_id => p_transaction_step_id
2272     ,p_name                => 'P_SCL_SEGMENT14');
2273 --
2274   p_scl_rec.segment15:=
2275     hr_transaction_api.get_varchar2_value
2276     (p_transaction_step_id => p_transaction_step_id
2277     ,p_name                => 'P_SCL_SEGMENT15');
2278 --
2279   p_scl_rec.segment16:=
2280     hr_transaction_api.get_varchar2_value
2281     (p_transaction_step_id => p_transaction_step_id
2282     ,p_name                => 'P_SCL_SEGMENT16');
2283 --
2284   p_scl_rec.segment17:=
2285     hr_transaction_api.get_varchar2_value
2286     (p_transaction_step_id => p_transaction_step_id
2287     ,p_name                => 'P_SCL_SEGMENT17');
2288 --
2289   p_scl_rec.segment18:=
2290     hr_transaction_api.get_varchar2_value
2291     (p_transaction_step_id => p_transaction_step_id
2292     ,p_name                => 'P_SCL_SEGMENT18');
2293 --
2294   p_scl_rec.segment19:=
2295     hr_transaction_api.get_varchar2_value
2296     (p_transaction_step_id => p_transaction_step_id
2297     ,p_name                => 'P_SCL_SEGMENT19');
2298 --
2299   p_scl_rec.segment20:=
2300     hr_transaction_api.get_varchar2_value
2301     (p_transaction_step_id => p_transaction_step_id
2302     ,p_name                => 'P_SCL_SEGMENT20');
2303 --
2304   p_scl_rec.segment21:=
2305     hr_transaction_api.get_varchar2_value
2306     (p_transaction_step_id => p_transaction_step_id
2307     ,p_name                => 'P_SCL_SEGMENT21');
2308 --
2309   p_scl_rec.segment22:=
2310     hr_transaction_api.get_varchar2_value
2311     (p_transaction_step_id => p_transaction_step_id
2312     ,p_name                => 'P_SCL_SEGMENT22');
2313 --
2314   p_scl_rec.segment23:=
2315     hr_transaction_api.get_varchar2_value
2316     (p_transaction_step_id => p_transaction_step_id
2317     ,p_name                => 'P_SCL_SEGMENT23');
2318 --
2319   p_scl_rec.segment24:=
2320     hr_transaction_api.get_varchar2_value
2321     (p_transaction_step_id => p_transaction_step_id
2322     ,p_name                => 'P_SCL_SEGMENT24');
2323 --
2324   p_scl_rec.segment25:=
2325     hr_transaction_api.get_varchar2_value
2326     (p_transaction_step_id => p_transaction_step_id
2327     ,p_name                => 'P_SCL_SEGMENT25');
2328 --
2329   p_scl_rec.segment26:=
2330     hr_transaction_api.get_varchar2_value
2331     (p_transaction_step_id => p_transaction_step_id
2332     ,p_name                => 'P_SCL_SEGMENT26');
2333 --
2334   p_scl_rec.segment27:=
2335     hr_transaction_api.get_varchar2_value
2336     (p_transaction_step_id => p_transaction_step_id
2337     ,p_name                => 'P_SCL_SEGMENT27');
2338 --
2339   p_scl_rec.segment28:=
2340     hr_transaction_api.get_varchar2_value
2341     (p_transaction_step_id => p_transaction_step_id
2342     ,p_name                => 'P_SCL_SEGMENT28');
2343 --
2344   p_scl_rec.segment29:=
2345     hr_transaction_api.get_varchar2_value
2346     (p_transaction_step_id => p_transaction_step_id
2347     ,p_name                => 'P_SCL_SEGMENT29');
2348 --
2349   p_scl_rec.segment30:=
2350     hr_transaction_api.get_varchar2_value
2351     (p_transaction_step_id => p_transaction_step_id
2352     ,p_name                => 'P_SCL_SEGMENT30');
2353 --
2354 end get_scl_from_tt;
2355 --
2356 procedure get_asg_from_asg(p_assignment_id  in     number
2357                           ,p_effective_date in     date
2358                           ,p_assignment_rec    out nocopy per_all_assignments_f%rowtype)
2359 is
2360 /* This procedure gets all of the assignment data from the online tables
2361 */
2362 cursor csr_get_asg is
2363 select *
2364 from per_all_assignments_f
2365 where assignment_id=p_assignment_id
2366 and p_effective_date between effective_start_date and effective_end_date;
2367 --
2368 begin
2369 --
2370   open csr_get_asg;
2371   fetch csr_get_asg into p_assignment_rec;
2372   if csr_get_asg%notfound then
2373     close csr_get_asg;
2374 --
2375 -- The primary key is invalid therefore we must error
2376 --
2377      hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
2378      hr_utility.raise_error;
2379 --
2380   else
2381     close csr_get_asg;
2382   end if;
2383 --
2384 end get_asg_from_asg;
2385 --
2386 procedure get_pgp_from_pgp(p_people_group_id  in     number
2387                           ,p_pgp_rec    out nocopy pay_people_groups%rowtype)
2388 is
2389 /* This procedure gets all of the People Group data from the online tables
2390 */
2391 --
2392 cursor csr_get_pgp is
2393 select *
2394 from pay_people_groups
2395 where people_group_id=p_people_group_id;
2396 --
2397 begin
2398   if p_people_group_id is not null then
2399     open csr_get_pgp;
2400     fetch csr_get_pgp into p_pgp_rec;
2401     if csr_get_pgp%notfound then
2402       close csr_get_pgp;
2403     --
2404     -- The primary key is invalid therefore we must error
2405     --
2406       hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
2407       hr_utility.raise_error;
2408           --
2409     else
2410       close csr_get_pgp;
2411     end if;
2412   end if;
2413 end get_pgp_from_pgp;
2414 --
2415 procedure get_scl_from_scl(p_soft_coding_keyflex_id  in     number
2416                           ,p_scl_rec                    out nocopy hr_soft_coding_keyflex%rowtype)
2417 is
2418 /* This procedure gets all of the SCL data from the online tables
2419 */
2420 --
2421 cursor csr_get_scl is
2422 select *
2423 from hr_soft_coding_keyflex
2424 where soft_coding_keyflex_id=p_soft_coding_keyflex_id;
2425 --
2426 begin
2427   if p_soft_coding_keyflex_id is not null then
2428     open csr_get_scl;
2429     fetch csr_get_scl into p_scl_rec;
2430     if csr_get_scl%notfound then
2431       close csr_get_scl;
2432     --
2433     -- The primary key is invalid therefore we must error
2434     --
2435       hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
2436       hr_utility.raise_error;
2437           --
2438     else
2439       close csr_get_scl;
2440     end if;
2441   end if;
2442 --
2443 end get_scl_from_scl;
2444 --
2445 procedure get_asg(
2446      p_item_type                in     wf_items.item_type%TYPE
2447     ,p_item_key                 in     wf_items.item_key%TYPE
2448     ,p_assignment_id            in     per_all_assignments_f.assignment_id%type
2449     ,p_effective_date           in     date
2450     ,p_assignment_rec              out nocopy per_all_assignments_f%rowtype) is
2451 /* This procedure gets all of the assignment data from the transaction tables
2452    or the online tables if no processing step exists, based in a given item type
2453    and item key
2454 */
2455 --
2456 l_transaction_step_id number;
2457 l_transaction_id      number;
2458 --
2459 begin
2460   get_step(p_item_type           => p_item_type
2461           ,p_item_key            => p_item_key
2462           ,p_api_name            => g_package || 'process_api'
2463           ,p_transaction_step_id => l_transaction_step_id
2464           ,p_transaction_id      => l_transaction_id);
2465   if l_transaction_step_id is not null then
2466     --
2467     get_asg_from_tt(p_transaction_step_id =>l_transaction_step_id
2468                    ,p_assignment_rec      => p_assignment_rec);
2469   else
2470     get_asg_from_asg(p_assignment_id      => p_assignment_id
2471                     ,p_effective_date     => p_effective_date
2472                     ,p_assignment_rec     => p_assignment_rec);
2473   end if;
2474 end get_asg;
2475 --
2476 procedure get_step(
2477      p_item_type                in     wf_items.item_type%TYPE
2478     ,p_item_key                 in     wf_items.item_key%TYPE
2479     ,p_api_name                 in     varchar2
2480     ,p_transaction_step_id         out nocopy number
2481     ,p_transaction_id              out nocopy number) is
2482 /* This procedure gets the transaction_step_id based on a given item_type and
2483    item_key
2484 */
2485 --
2486 cursor transaction_step is
2487 select transaction_step_id
2488 ,      transaction_id
2489 from hr_api_transaction_steps
2490 where item_type=p_item_type
2491 and   item_key=p_item_key
2492 and   api_name=p_api_name;
2493 --
2494 begin
2495   open transaction_step;
2496   fetch transaction_step into p_transaction_step_id,p_transaction_id;
2497   if transaction_step%FOUND then
2498     close transaction_step;
2499   else
2500     close transaction_step;
2501   end if;
2502 end get_step;
2503 --
2504 function step_open(
2505      p_item_type                in     wf_items.item_type%TYPE
2506     ,p_item_key                 in     wf_items.item_key%TYPE
2507     ,p_api_name                 in     varchar2) return boolean is
2508 /* This procedure looks to see if a transaction step is open for a given
2509    item type, item key and api name
2510 */
2511 --
2512 l_transaction_step_id          number;
2513 l_transaction_id               number;
2514 --
2515 begin
2516   get_step(p_item_type           => p_item_type
2517           ,p_item_key            => p_item_key
2518           ,p_api_name            => p_api_name
2519           ,p_transaction_step_id => l_transaction_step_id
2520           ,p_transaction_id      => l_transaction_id);
2521   if l_transaction_step_id is null then
2522     return FALSE;
2523   else
2524     return TRUE;
2525   end if;
2526 end step_open;
2527 --
2528 end hr_assignment_common_save_web;