72: p_sup_name OUT NOCOPY Varchar2) IS
73:
74: l_proc Varchar2(200) := g_package || 'get_supervisor_details';
75: Begin
76: hr_utility.set_location(' Entering:' || l_proc,5);
77: Open c_supDetails(p_emp_id);
78: Fetch c_supDetails into p_sup_name, p_sup_id;
79: hr_utility.set_location( l_proc , 10);
80: If c_supDetails%notfound Then
75: Begin
76: hr_utility.set_location(' Entering:' || l_proc,5);
77: Open c_supDetails(p_emp_id);
78: Fetch c_supDetails into p_sup_name, p_sup_id;
79: hr_utility.set_location( l_proc , 10);
80: If c_supDetails%notfound Then
81: hr_utility.set_location( l_proc,15);
82: p_sup_id := Null;
83: p_sup_name := Null;
77: Open c_supDetails(p_emp_id);
78: Fetch c_supDetails into p_sup_name, p_sup_id;
79: hr_utility.set_location( l_proc , 10);
80: If c_supDetails%notfound Then
81: hr_utility.set_location( l_proc,15);
82: p_sup_id := Null;
83: p_sup_name := Null;
84: End If;
85: hr_utility.set_location( l_proc, 20);
81: hr_utility.set_location( l_proc,15);
82: p_sup_id := Null;
83: p_sup_name := Null;
84: End If;
85: hr_utility.set_location( l_proc, 20);
86: close c_supDetails;
87: hr_utility.set_location(' Leaving:' || l_proc,25);
88:
89: Exception When others then
83: p_sup_name := Null;
84: End If;
85: hr_utility.set_location( l_proc, 20);
86: close c_supDetails;
87: hr_utility.set_location(' Leaving:' || l_proc,25);
88:
89: Exception When others then
90: hr_utility.set_location(' Leaving:' || l_proc,555);
91: close c_supDetails;
86: close c_supDetails;
87: hr_utility.set_location(' Leaving:' || l_proc,25);
88:
89: Exception When others then
90: hr_utility.set_location(' Leaving:' || l_proc,555);
91: close c_supDetails;
92: p_sup_id := Null;
93: p_sup_name := Null;
94: hr_utility.set_location(' Leaving:' || l_proc,560);
90: hr_utility.set_location(' Leaving:' || l_proc,555);
91: close c_supDetails;
92: p_sup_id := Null;
93: p_sup_name := Null;
94: hr_utility.set_location(' Leaving:' || l_proc,560);
95: End get_supervisor_details;
96:
97: procedure get_noaccess_list(document_id IN Varchar2,
98: display_type IN Varchar2,
99: document IN OUT NOCOPY Clob,
100: document_type IN OUT NOCOPY Varchar2) IS
101: l_proc Varchar2(200) := g_package || 'get_noaccess_list';
102: Begin
103: hr_utility.set_location(' Entering:' || l_proc,5);
104: /* ld_effective_date := wf_engine.GetItemAttrDate
105: (itemtype => itemtype
106: ,itemkey => itemkey
107: ,aname => 'CURRENT_EFFECTIVE_DATE'); */
107: ,aname => 'CURRENT_EFFECTIVE_DATE'); */
108:
109: -- hr_java_script_web.alert('Person Id:'||document_id);
110: document_type := 'text/html';
111: hr_utility.set_location(l_proc,10);
112: For I in c_noaccess_list(document_id) Loop
113: If I.hasUpdateAccess = 'N' Then
114: WF_NOTIFICATION.WriteToClob(document, I.organization_name||'
');
115: End If;
113: If I.hasUpdateAccess = 'N' Then
114: WF_NOTIFICATION.WriteToClob(document, I.organization_name||'
');
115: End If;
116: End Loop;
117: hr_utility.set_location(' Leaving:' || l_proc,15);
118: End get_noaccess_list;
119:
120: procedure issue_notify(itemtype IN Varchar2,
121: itemkey IN Varchar2,
126: lnSupId Number;
127: lnSupName Varchar2(240);
128: lnSupUserName Varchar2(30);
129: Begin
130: hr_utility.set_location(' Entering:' || l_proc,5);
131: result := 'COMPLETE:'||'N';
132: lnSupId := wf_engine.GetItemAttrNumber(itemtype => itemtype,
133: itemkey => itemkey,
134: aname => 'HR_MGR_ID_OF_LOGIN_PERSON');
131: result := 'COMPLETE:'||'N';
132: lnSupId := wf_engine.GetItemAttrNumber(itemtype => itemtype,
133: itemkey => itemkey,
134: aname => 'HR_MGR_ID_OF_LOGIN_PERSON');
135: hr_utility.set_location(l_proc,10);
136: --
137: If (lnSupId is not Null And
138: nvl(wf_engine.GetItemAttrText(itemtype => itemtype, itemkey => itemkey,
139: aname => 'HR_TERM_SUP_FLAG'),'#') = 'Y') Then
136: --
137: If (lnSupId is not Null And
138: nvl(wf_engine.GetItemAttrText(itemtype => itemtype, itemkey => itemkey,
139: aname => 'HR_TERM_SUP_FLAG'),'#') = 'Y') Then
140: hr_utility.set_location(l_proc,15);
141: result := 'COMPLETE:'||'Y';
142: wf_directory.GetUserName ('PER',
143: lnSupId,
144: lnSupUserName,
142: wf_directory.GetUserName ('PER',
143: lnSupId,
144: lnSupUserName,
145: lnSupName);
146: hr_utility.set_location(l_proc,20);
147: wf_engine.SetItemAttrText(itemtype,
148: itemkey,
149: 'SUPERVISOR_USERNAME',
150: lnSupUserName);
147: wf_engine.SetItemAttrText(itemtype,
148: itemkey,
149: 'SUPERVISOR_USERNAME',
150: lnSupUserName);
151: hr_utility.set_location(l_proc,25);
152: wf_engine.SetItemAttrText(itemtype,
153: itemkey,
154: 'SUPERVISOR_DISPLAY_NAME',
155: lnSupName);
153: itemkey,
154: 'SUPERVISOR_DISPLAY_NAME',
155: lnSupName);
156: End If;
157: hr_utility.set_location(' Leaving:' || l_proc,30);
158: Exception
159: When Others then
160: result := 'COMPLETE:'||'N';
161: hr_utility.set_location(' Leaving:' || l_proc,555);
157: hr_utility.set_location(' Leaving:' || l_proc,30);
158: Exception
159: When Others then
160: result := 'COMPLETE:'||'N';
161: hr_utility.set_location(' Leaving:' || l_proc,555);
162: End issue_notify;
163:
164: --
165: procedure delete_trans_steps(itemtype IN Varchar2
166: ,itemkey IN Varchar2
167: ,actid IN Number) IS
168: l_proc Varchar2(200) := g_package || 'delete_trans_steps';
169: Begin
170: hr_utility.set_location(' Entering:' || l_proc,5);
171: if (itemtype is Null or itemkey is Null) Then
172: hr_utility.set_location(' Leaving:' || l_proc,10);
173: return;
174: End If;
168: l_proc Varchar2(200) := g_package || 'delete_trans_steps';
169: Begin
170: hr_utility.set_location(' Entering:' || l_proc,5);
171: if (itemtype is Null or itemkey is Null) Then
172: hr_utility.set_location(' Leaving:' || l_proc,10);
173: return;
174: End If;
175:
176: Delete From hr_api_transaction_values tv
179: Where ts.item_key = itemkey
180: And ts.item_type = itemtype
181: And ts.activity_id = actid
182: And ts.api_name = 'HR_CCMGR_SS.PROCESS_API');
183: hr_utility.set_location(l_proc,15);
184: Delete From hr_api_transaction_steps
185: Where item_key = itemkey
186: And item_type = itemtype
187: And activity_id = actid
185: Where item_key = itemkey
186: And item_type = itemtype
187: And activity_id = actid
188: And api_name = 'HR_CCMGR_SS.PROCESS_API';
189: hr_utility.set_location(' Leaving:' || l_proc,20);
190: End delete_trans_steps;
191:
192:
193: --
199: l_ccmgr_rec HR_CCMGR_TYPE;
200: l_eff_date Date;
201: l_warning boolean;
202: Begin
203: hr_utility.set_location(' Entering:' || l_proc,5);
204: l_eff_date := nvl(hr_transaction_api.get_date_value(p_transaction_step_id, 'P_EFFECTIVE_DATE'),trunc(sysdate));
205:
206: dt_fndate.set_effective_date(l_eff_date);
207: hr_utility.set_location(l_proc,10);
203: hr_utility.set_location(' Entering:' || l_proc,5);
204: l_eff_date := nvl(hr_transaction_api.get_date_value(p_transaction_step_id, 'P_EFFECTIVE_DATE'),trunc(sysdate));
205:
206: dt_fndate.set_effective_date(l_eff_date);
207: hr_utility.set_location(l_proc,10);
208:
209: l_ccmgr_rec := HR_CCMGR_TYPE(hr_transaction_api.get_number_value(p_transaction_step_id, 'P_ORG_INFORMATION_ID'),
210: hr_transaction_api.get_number_value(p_transaction_step_id, 'P_ORGANIZATION_ID'),
211: Null, -- organization name
219: hr_transaction_api.get_date_value(p_transaction_step_id, 'P_CURR_END_DATE'),
220: hr_transaction_api.get_date_value(p_transaction_step_id, 'P_END_DATE'),
221: hr_transaction_api.get_number_value(p_transaction_step_id, 'P_OVN_NUMBER'),
222: Null, Null, Null);
223: hr_utility.set_location(l_proc,15);
224:
225: -- SFL on update page might not have captured manager info.
226: if (l_ccmgr_rec.manager_id is null and l_ccmgr_rec.manager is null) then
227: hr_utility.set_location(l_proc,20);
223: hr_utility.set_location(l_proc,15);
224:
225: -- SFL on update page might not have captured manager info.
226: if (l_ccmgr_rec.manager_id is null and l_ccmgr_rec.manager is null) then
227: hr_utility.set_location(l_proc,20);
228: l_ccmgr_rec.manager := l_ccmgr_rec.current_manager;
229: l_ccmgr_rec.manager_id := l_ccmgr_rec.current_manager_id;
230: end if;
231: hr_utility.set_location(l_proc,25);
227: hr_utility.set_location(l_proc,20);
228: l_ccmgr_rec.manager := l_ccmgr_rec.current_manager;
229: l_ccmgr_rec.manager_id := l_ccmgr_rec.current_manager_id;
230: end if;
231: hr_utility.set_location(l_proc,25);
232: validate_ccmgr_record(l_ccmgr_rec, p_validate,l_eff_date, l_warning);
233: hr_utility.set_location(' Leaving:' || l_proc,30);
234: Exception When others then
235: hr_utility.set_location(' Leaving:' || l_proc,555);
229: l_ccmgr_rec.manager_id := l_ccmgr_rec.current_manager_id;
230: end if;
231: hr_utility.set_location(l_proc,25);
232: validate_ccmgr_record(l_ccmgr_rec, p_validate,l_eff_date, l_warning);
233: hr_utility.set_location(' Leaving:' || l_proc,30);
234: Exception When others then
235: hr_utility.set_location(' Leaving:' || l_proc,555);
236: raise;
237: End process_api;
231: hr_utility.set_location(l_proc,25);
232: validate_ccmgr_record(l_ccmgr_rec, p_validate,l_eff_date, l_warning);
233: hr_utility.set_location(' Leaving:' || l_proc,30);
234: Exception When others then
235: hr_utility.set_location(' Leaving:' || l_proc,555);
236: raise;
237: End process_api;
238:
239: --
249: l_end_date Date;
250: l_upd_mode Boolean;
251: l_mode Varchar2(30);
252: Begin
253: hr_utility.set_location(' Entering:' || l_proc,5);
254: l_upd_mode := true;
255: savepoint save_ccmgr_rec;
256:
257: If (p_ccmgr_rec.current_manager_id = nvl(p_ccmgr_rec.manager_id,p_ccmgr_rec.current_manager_id) And
256:
257: If (p_ccmgr_rec.current_manager_id = nvl(p_ccmgr_rec.manager_id,p_ccmgr_rec.current_manager_id) And
258: nvl(p_ccmgr_rec.current_start_date,p_ccmgr_rec.start_date) = p_ccmgr_rec.start_date) Then
259: -- mode CORRECTION iff startDate and manager have not changed
260: hr_utility.set_location(l_proc,10);
261: l_mode := 'CORRECTION';
262: l_manager_id := p_ccmgr_rec.current_manager_id;
263: l_start_date := p_ccmgr_rec.start_date;
264: l_end_date := p_ccmgr_rec.end_date;
262: l_manager_id := p_ccmgr_rec.current_manager_id;
263: l_start_date := p_ccmgr_rec.start_date;
264: l_end_date := p_ccmgr_rec.end_date;
265: Else
266: hr_utility.set_location(l_proc,15);
267: l_mode := 'UPDATE';
268: l_manager_id := p_ccmgr_rec.current_manager_id;
269: l_start_date := p_ccmgr_rec.current_start_date;
270: l_end_date := p_ccmgr_rec.start_date-1;
271: If (p_ccmgr_rec.current_end_date is not Null) Then
272: l_upd_mode := false;
273: End If;
274: End If;
275: hr_utility.set_location(l_proc,20);
276: x_obj_number := p_ccmgr_rec.object_version_number;
277:
278: If (l_upd_mode) Then
279: hr_utility.set_location(l_proc,25);
275: hr_utility.set_location(l_proc,20);
276: x_obj_number := p_ccmgr_rec.object_version_number;
277:
278: If (l_upd_mode) Then
279: hr_utility.set_location(l_proc,25);
280: hr_organization_api.update_org_manager
281: (p_validate => false
282: ,p_effective_date => p_eff_date
283: ,p_organization_id => p_ccmgr_rec.organization_id
305: ,p_org_information20 => Null
306: ,p_object_version_number => x_obj_number
307: ,p_warning => p_warning);
308: End If;
309: hr_utility.set_location(l_proc,30);
310: If (p_ccmgr_rec.current_manager_id <> p_ccmgr_rec.manager_id Or
311: p_ccmgr_rec.current_start_date <> p_ccmgr_rec.start_date) Then
312: -- creating the new record
313: hr_utility.set_location(l_proc,35);
309: hr_utility.set_location(l_proc,30);
310: If (p_ccmgr_rec.current_manager_id <> p_ccmgr_rec.manager_id Or
311: p_ccmgr_rec.current_start_date <> p_ccmgr_rec.start_date) Then
312: -- creating the new record
313: hr_utility.set_location(l_proc,35);
314: hr_organization_api.create_org_manager
315: (p_validate => false
316: ,p_effective_date => p_eff_date
317: ,p_organization_id => p_ccmgr_rec.organization_id
339: ,p_org_information_id => x_org_information_id
340: ,p_object_version_number => x_obj_number
341: ,p_warning => p_warning);
342: End If;
343: hr_utility.set_location(l_proc,40);
344: If p_validate_mode = true Then
345: hr_utility.set_location(l_proc,45);
346: rollback to save_ccmgr_rec;
347: End If;
341: ,p_warning => p_warning);
342: End If;
343: hr_utility.set_location(l_proc,40);
344: If p_validate_mode = true Then
345: hr_utility.set_location(l_proc,45);
346: rollback to save_ccmgr_rec;
347: End If;
348: hr_utility.set_location(' Leaving:' || l_proc,50);
349:
344: If p_validate_mode = true Then
345: hr_utility.set_location(l_proc,45);
346: rollback to save_ccmgr_rec;
347: End If;
348: hr_utility.set_location(' Leaving:' || l_proc,50);
349:
350: Exception When others then
351: hr_utility.set_location(' Leaving:' || l_proc,555);
352: rollback to save_ccmgr_rec;
347: End If;
348: hr_utility.set_location(' Leaving:' || l_proc,50);
349:
350: Exception When others then
351: hr_utility.set_location(' Leaving:' || l_proc,555);
352: rollback to save_ccmgr_rec;
353: raise;
354: End validate_ccmgr_record;
355:
357: Function getattrName(msgName OUT NOCOPY Varchar2) Return Varchar2 IS
358: l_proc Varchar2(200) := g_package || 'getattrName';
359: Begin
360:
361: hr_utility.set_location(' Entering:' || l_proc,5);
362: If (sqlcode <> '-20001') Then
363: hr_utility.set_location(' Leaving:' || l_proc,10);
364: Return Null; End If;
365: msgName := ltrim(replace(replace(sqlerrm,'ORA-20001',''),':',''));
359: Begin
360:
361: hr_utility.set_location(' Entering:' || l_proc,5);
362: If (sqlcode <> '-20001') Then
363: hr_utility.set_location(' Leaving:' || l_proc,10);
364: Return Null; End If;
365: msgName := ltrim(replace(replace(sqlerrm,'ORA-20001',''),':',''));
366: If msgName in ('PER_289693_START_DATE_NULL','PER_289695_START_DATE_FORMAT',
367: 'PER_289697_START_BEFORE_END','PER_289699_START_DATE_BFR_HIRE') Then
364: Return Null; End If;
365: msgName := ltrim(replace(replace(sqlerrm,'ORA-20001',''),':',''));
366: If msgName in ('PER_289693_START_DATE_NULL','PER_289695_START_DATE_FORMAT',
367: 'PER_289697_START_BEFORE_END','PER_289699_START_DATE_BFR_HIRE') Then
368: hr_utility.set_location(' Leaving:' || l_proc,15);
369: return 'StartDate';
370: Elsif msgName in ('PER_289696_END_DATE_FORMAT','PER_289700_END_DATE_AFTER_TERM') Then
371: hr_utility.set_location(' Leaving:' || l_proc,20);
372: return 'EndDate';
367: 'PER_289697_START_BEFORE_END','PER_289699_START_DATE_BFR_HIRE') Then
368: hr_utility.set_location(' Leaving:' || l_proc,15);
369: return 'StartDate';
370: Elsif msgName in ('PER_289696_END_DATE_FORMAT','PER_289700_END_DATE_AFTER_TERM') Then
371: hr_utility.set_location(' Leaving:' || l_proc,20);
372: return 'EndDate';
373: Elsif msgName in ('PER_289694_NO_MANAGER','PER_289698_PERSON_ID_INVALID',
374: 'PER_289702_INVALID_MANAGER','PER_289703_CCM_OVERLAP') Then
375: hr_utility.set_location(' Leaving:' || l_proc,25);
371: hr_utility.set_location(' Leaving:' || l_proc,20);
372: return 'EndDate';
373: Elsif msgName in ('PER_289694_NO_MANAGER','PER_289698_PERSON_ID_INVALID',
374: 'PER_289702_INVALID_MANAGER','PER_289703_CCM_OVERLAP') Then
375: hr_utility.set_location(' Leaving:' || l_proc,25);
376: return 'Manager';
377: Elsif msgName in ('PER_289746_CCM_AFTER_ORG','PER_289701_INVALID_COST_CENTER') Then
378: hr_utility.set_location(' Leaving:' || l_proc,30);
379: return 'OrganizationName';
374: 'PER_289702_INVALID_MANAGER','PER_289703_CCM_OVERLAP') Then
375: hr_utility.set_location(' Leaving:' || l_proc,25);
376: return 'Manager';
377: Elsif msgName in ('PER_289746_CCM_AFTER_ORG','PER_289701_INVALID_COST_CENTER') Then
378: hr_utility.set_location(' Leaving:' || l_proc,30);
379: return 'OrganizationName';
380: End If;
381: hr_utility.set_location(' Leaving:' || l_proc,35);
382: return Null;
377: Elsif msgName in ('PER_289746_CCM_AFTER_ORG','PER_289701_INVALID_COST_CENTER') Then
378: hr_utility.set_location(' Leaving:' || l_proc,30);
379: return 'OrganizationName';
380: End If;
381: hr_utility.set_location(' Leaving:' || l_proc,35);
382: return Null;
383: End getattrName;
384:
385: --
401: l_eff_date Date;
402:
403:
404: Begin
405: hr_utility.set_location(' Entering:' || l_proc,5);
406: p_login_person_id := nvl(fnd_global.employee_id,p_login_person_id);
407:
408: Begin
409: hr_utility.set_location(l_proc,10);
405: hr_utility.set_location(' Entering:' || l_proc,5);
406: p_login_person_id := nvl(fnd_global.employee_id,p_login_person_id);
407:
408: Begin
409: hr_utility.set_location(l_proc,10);
410: l_eff_date := nvl(fnd_date.canonical_to_date(wf_engine.GetItemAttrText(p_item_key,p_item_type,'P_EFFECTIVE_DATE')),trunc(sysdate));
411: Exception when others then
412: l_eff_date := trunc(sysdate);
413: hr_utility.set_location(l_proc,555);
409: hr_utility.set_location(l_proc,10);
410: l_eff_date := nvl(fnd_date.canonical_to_date(wf_engine.GetItemAttrText(p_item_key,p_item_type,'P_EFFECTIVE_DATE')),trunc(sysdate));
411: Exception when others then
412: l_eff_date := trunc(sysdate);
413: hr_utility.set_location(l_proc,555);
414: End;
415: hr_utility.set_location(l_proc,15);
416: l_transaction_id := hr_transaction_ss.get_transaction_id(p_item_type ,p_item_key);
417: dt_fndate.set_effective_date(l_eff_date);
411: Exception when others then
412: l_eff_date := trunc(sysdate);
413: hr_utility.set_location(l_proc,555);
414: End;
415: hr_utility.set_location(l_proc,15);
416: l_transaction_id := hr_transaction_ss.get_transaction_id(p_item_type ,p_item_key);
417: dt_fndate.set_effective_date(l_eff_date);
418:
419: If l_transaction_id is Null Then
416: l_transaction_id := hr_transaction_ss.get_transaction_id(p_item_type ,p_item_key);
417: dt_fndate.set_effective_date(l_eff_date);
418:
419: If l_transaction_id is Null Then
420: hr_utility.set_location(l_proc,20);
421: hr_transaction_ss.start_transaction
422: (itemtype => p_item_type
423: ,itemkey => p_item_key
424: ,actid => p_activity_id
426: ,p_login_person_id => p_login_person_id
427: ,result => l_result);
428: l_transaction_id := hr_transaction_ss.get_transaction_id(p_item_type ,p_item_key);
429: End If;
430: hr_utility.set_location(l_proc,25);
431: For I in 1 .. p_ccmgr_tbl.count Loop
432: Begin
433: hr_utility.set_location(l_proc || 'Entering: p_ccmgr_tbl.count Loop' ,30);
434: If nvl(p_mode,'#') <> 'S' Then
429: End If;
430: hr_utility.set_location(l_proc,25);
431: For I in 1 .. p_ccmgr_tbl.count Loop
432: Begin
433: hr_utility.set_location(l_proc || 'Entering: p_ccmgr_tbl.count Loop' ,30);
434: If nvl(p_mode,'#') <> 'S' Then
435:
436: if (p_ccmgr_tbl(I).manager is not Null and p_ccmgr_tbl(I).manager_id is Null) Then
437: Begin
434: If nvl(p_mode,'#') <> 'S' Then
435:
436: if (p_ccmgr_tbl(I).manager is not Null and p_ccmgr_tbl(I).manager_id is Null) Then
437: Begin
438: hr_utility.set_location(l_proc ,35);
439: Select person_id into p_ccmgr_tbl(I).manager_id
440: From per_all_people_f
441: where full_name = p_ccmgr_tbl(I).manager
442: and current_employee_flag = 'Y'
447: p_ccmgr_tbl(I).p_error_message := hr_java_conv_util_ss.get_formatted_error_message(
448: p_attr_name => 'Manager'
449: ,p_app_short_name => 'PER'
450: ,p_message_name => 'HR_CCMGR_USE_MGR_LOV');
451: hr_utility.set_location(l_proc,560);
452: goto exit_point;
453: End;
454: End If;
455: hr_utility.set_location(l_proc ,40);
451: hr_utility.set_location(l_proc,560);
452: goto exit_point;
453: End;
454: End If;
455: hr_utility.set_location(l_proc ,40);
456: -- Record has not changed
457: If p_ccmgr_tbl(I).current_manager_id = nvl(p_ccmgr_tbl(I).manager_id,p_ccmgr_tbl(I).current_manager_id) And
458: nvl(trunc(p_ccmgr_tbl(I).current_start_date),sysdate) = nvl(trunc(p_ccmgr_tbl(I).start_date),sysdate) And
459: nvl(trunc(p_ccmgr_tbl(I).current_end_date),sysdate) = nvl(trunc(p_ccmgr_tbl(I).end_date),sysdate) Then
457: If p_ccmgr_tbl(I).current_manager_id = nvl(p_ccmgr_tbl(I).manager_id,p_ccmgr_tbl(I).current_manager_id) And
458: nvl(trunc(p_ccmgr_tbl(I).current_start_date),sysdate) = nvl(trunc(p_ccmgr_tbl(I).start_date),sysdate) And
459: nvl(trunc(p_ccmgr_tbl(I).current_end_date),sysdate) = nvl(trunc(p_ccmgr_tbl(I).end_date),sysdate) Then
460: -- Rolling back unchanged saved step if not Save for later mode.
461: hr_utility.set_location(l_proc ,45);
462: If (p_ccmgr_tbl(I).trans_step_id is not Null) Then
463: hr_utility.set_location(l_proc ,50);
464: Delete From hr_api_transaction_values where transaction_step_id = p_ccmgr_tbl(I).trans_step_id;
465: Delete From hr_api_transaction_steps where transaction_step_id = p_ccmgr_tbl(I).trans_step_id;
459: nvl(trunc(p_ccmgr_tbl(I).current_end_date),sysdate) = nvl(trunc(p_ccmgr_tbl(I).end_date),sysdate) Then
460: -- Rolling back unchanged saved step if not Save for later mode.
461: hr_utility.set_location(l_proc ,45);
462: If (p_ccmgr_tbl(I).trans_step_id is not Null) Then
463: hr_utility.set_location(l_proc ,50);
464: Delete From hr_api_transaction_values where transaction_step_id = p_ccmgr_tbl(I).trans_step_id;
465: Delete From hr_api_transaction_steps where transaction_step_id = p_ccmgr_tbl(I).trans_step_id;
466: End If;
467: hr_utility.set_location(l_proc ,55);
463: hr_utility.set_location(l_proc ,50);
464: Delete From hr_api_transaction_values where transaction_step_id = p_ccmgr_tbl(I).trans_step_id;
465: Delete From hr_api_transaction_steps where transaction_step_id = p_ccmgr_tbl(I).trans_step_id;
466: End If;
467: hr_utility.set_location(l_proc ,55);
468: goto exit_point;
469: End If;
470:
471: -- correction
468: goto exit_point;
469: End If;
470:
471: -- correction
472: hr_utility.set_location(l_proc ,60);
473: If p_ccmgr_tbl(I).manager is Null Then
474: hr_utility.set_location(l_proc ,65);
475: p_ccmgr_tbl(I).manager := p_ccmgr_tbl(I).current_manager;
476: p_ccmgr_tbl(I).manager_id := p_ccmgr_tbl(I).current_manager_id;
470:
471: -- correction
472: hr_utility.set_location(l_proc ,60);
473: If p_ccmgr_tbl(I).manager is Null Then
474: hr_utility.set_location(l_proc ,65);
475: p_ccmgr_tbl(I).manager := p_ccmgr_tbl(I).current_manager;
476: p_ccmgr_tbl(I).manager_id := p_ccmgr_tbl(I).current_manager_id;
477: End If;
478: hr_utility.set_location(l_proc ,70);
474: hr_utility.set_location(l_proc ,65);
475: p_ccmgr_tbl(I).manager := p_ccmgr_tbl(I).current_manager;
476: p_ccmgr_tbl(I).manager_id := p_ccmgr_tbl(I).current_manager_id;
477: End If;
478: hr_utility.set_location(l_proc ,70);
479: Begin
480: -- invoke orgInformation api
481: x_warning := False;
482: validate_ccmgr_record(p_ccmgr_tbl(I), true, l_eff_date, x_warning);
480: -- invoke orgInformation api
481: x_warning := False;
482: validate_ccmgr_record(p_ccmgr_tbl(I), true, l_eff_date, x_warning);
483: If x_warning Then -- handling api warnings
484: hr_utility.set_location(l_proc ,75);
485: p_ccmgr_tbl(I).p_warning_message := hr_java_conv_util_ss.get_formatted_error_message(
486: p_attr_name => 'OrganizationName'
487: ,p_error_message => p_ccmgr_tbl(I).p_warning_message
488: ,p_app_short_name => 'PER'
489: ,p_message_name => 'PER_289738_CCM_GAPS_CREATED');
490: p_status := 'W';
491:
492: End If;
493: hr_utility.set_location(l_proc ,80);
494: Exception when others then
495: -- handling api errors
496: p_status := 'E';
497: l_attrName := getattrName(p_ccmgr_tbl(I).p_error_message);
494: Exception when others then
495: -- handling api errors
496: p_status := 'E';
497: l_attrName := getattrName(p_ccmgr_tbl(I).p_error_message);
498: hr_utility.set_location(l_proc,565);
499: If (l_attrName is not null) Then
500: hr_utility.set_location(l_proc,570);
501: p_ccmgr_tbl(I).p_error_message := hr_java_conv_util_ss.get_formatted_error_message(
502: p_attr_name => l_attrName
496: p_status := 'E';
497: l_attrName := getattrName(p_ccmgr_tbl(I).p_error_message);
498: hr_utility.set_location(l_proc,565);
499: If (l_attrName is not null) Then
500: hr_utility.set_location(l_proc,570);
501: p_ccmgr_tbl(I).p_error_message := hr_java_conv_util_ss.get_formatted_error_message(
502: p_attr_name => l_attrName
503: ,p_app_short_name => 'PER'
504: ,p_message_name => p_ccmgr_tbl(I).p_error_message);
502: p_attr_name => l_attrName
503: ,p_app_short_name => 'PER'
504: ,p_message_name => p_ccmgr_tbl(I).p_error_message);
505: Else
506: hr_utility.set_location( l_proc,575);
507: p_ccmgr_tbl(I).p_error_message := hr_java_conv_util_ss.get_formatted_error_message(
508: p_attr_name => 'Manager'
509: ,p_app_short_name => 'ERR'
510: ,p_single_error_message => nvl(fnd_message.get,
507: p_ccmgr_tbl(I).p_error_message := hr_java_conv_util_ss.get_formatted_error_message(
508: p_attr_name => 'Manager'
509: ,p_app_short_name => 'ERR'
510: ,p_single_error_message => nvl(fnd_message.get,
511: nvl(hr_utility.get_message,substr(sqlerrm,255))));
512: End If;
513: End;
514: End If;
515:
513: End;
514: End If;
515:
516: --
517: hr_utility.set_location(l_proc ,85);
518: If p_ccmgr_tbl(I).trans_step_id is Null Then
519: hr_utility.set_location(l_proc ,90);
520: x_trans_ovn := Null;
521: hr_transaction_api.create_transaction_step
515:
516: --
517: hr_utility.set_location(l_proc ,85);
518: If p_ccmgr_tbl(I).trans_step_id is Null Then
519: hr_utility.set_location(l_proc ,90);
520: x_trans_ovn := Null;
521: hr_transaction_api.create_transaction_step
522: (p_validate => false
523: ,p_creator_person_id => p_login_person_id
528: ,p_activity_id => p_activity_id
529: ,p_transaction_step_id => p_ccmgr_tbl(I).trans_step_id
530: ,p_object_version_number => x_trans_ovn);
531: End If;
532: hr_utility.set_location(l_proc ,95);
533: -- populating transaction table
534:
535: l_count := 1;
536: l_trans_tbl(l_count).param_name := 'P_ORG_INFORMATION_ID';
601: l_trans_tbl(l_count).param_name := 'P_END_DATE';
602: l_trans_tbl(l_count).param_value := to_char(p_ccmgr_tbl(I).end_date,g_date_format);
603: l_trans_tbl(l_count).param_data_type := 'DATE';
604:
605: hr_utility.set_location(l_proc ,100);
606: l_count := l_count+1;
607: l_trans_tbl(l_count).param_name := 'P_REVIEW_PROC_CALL';
608: l_trans_tbl(l_count).param_value := wf_engine.GetActivityAttrText(p_item_type,p_item_key,
609: p_activity_id, 'HR_REVIEW_REGION_ITEM', False);
609: p_activity_id, 'HR_REVIEW_REGION_ITEM', False);
610:
611: l_trans_tbl(l_count).param_data_type := 'VARCHAR2';
612:
613: hr_utility.set_location(l_proc ,105);
614: l_count := l_count+1;
615: l_trans_tbl(l_count).param_name := 'P_REVIEW_ACTID';
616: l_trans_tbl(l_count).param_value := p_activity_id;
617: l_trans_tbl(l_count).param_data_type := 'VARCHAR2';
614: l_count := l_count+1;
615: l_trans_tbl(l_count).param_name := 'P_REVIEW_ACTID';
616: l_trans_tbl(l_count).param_value := p_activity_id;
617: l_trans_tbl(l_count).param_data_type := 'VARCHAR2';
618: hr_utility.set_location(l_proc ,110);
619: hr_transaction_ss.save_transaction_step
620: (p_item_type => p_item_type
621: ,p_item_key => p_item_key
622: ,p_actid => p_activity_id
623: ,p_login_person_id => p_login_person_id
624: ,p_transaction_step_id => p_ccmgr_tbl(I).trans_step_id
625: ,p_api_name => g_package||'.PROCESS_API'
626: ,p_transaction_data => l_trans_tbl);
627: hr_utility.set_location(l_proc ,115);
628: <
629: commit;
630: hr_utility.set_location(l_proc || 'Leaving: p_ccmgr_tbl.count Loop' ,120);
631: Exception when others then
626: ,p_transaction_data => l_trans_tbl);
627: hr_utility.set_location(l_proc ,115);
628: <
629: commit;
630: hr_utility.set_location(l_proc || 'Leaving: p_ccmgr_tbl.count Loop' ,120);
631: Exception when others then
632: p_status := 'E';
633: p_ccmgr_tbl(I).p_error_message := hr_java_conv_util_ss.get_formatted_error_message(
634: p_error_message => p_ccmgr_tbl(I).p_error_message
633: p_ccmgr_tbl(I).p_error_message := hr_java_conv_util_ss.get_formatted_error_message(
634: p_error_message => p_ccmgr_tbl(I).p_error_message
635: ,p_attr_name => 'Manager'
636: ,p_single_error_message => substr(sqlerrm,255));
637: hr_utility.set_location(l_proc ,555);
638: End;
639: End Loop;
640: hr_utility.set_location(' Leaving:' || l_proc,125);
641: Exception when others then
636: ,p_single_error_message => substr(sqlerrm,255));
637: hr_utility.set_location(l_proc ,555);
638: End;
639: End Loop;
640: hr_utility.set_location(' Leaving:' || l_proc,125);
641: Exception when others then
642: p_status := 'E';
643: hr_utility.set_location(' Leaving:' || l_proc,560);
644: raise;
639: End Loop;
640: hr_utility.set_location(' Leaving:' || l_proc,125);
641: Exception when others then
642: p_status := 'E';
643: hr_utility.set_location(' Leaving:' || l_proc,560);
644: raise;
645: End update_ccmgr_recs;
646: End HR_CCMGR_SS;