34: OR (p_org_structure_id = pai.exp_org_structure_id)
35: );
36: BEGIN
37: --
38: -- hr_utility.set_location('PA_ORG.PA_OS_PREDEL_VALIDATION', 1);
39: --
40: IF (pa_imp.pa_implemented_all) THEN
41:
42: -- Check if the Org Structure being deleted
44: --
45: open check_org_structure_exists;
46: fetch check_org_structure_exists into dummy1;
47: if check_org_structure_exists%found then
48: hr_utility.set_message (275,'PA_ORG_CANT_DEL_HIER');
49: hr_utility.raise_error;
50: end if;
51: close check_org_structure_exists;
52:
45: open check_org_structure_exists;
46: fetch check_org_structure_exists into dummy1;
47: if check_org_structure_exists%found then
48: hr_utility.set_message (275,'PA_ORG_CANT_DEL_HIER');
49: hr_utility.raise_error;
50: end if;
51: close check_org_structure_exists;
52:
53: --
84: NULL;
85: END;
86:
87: IF ( dummy1 IS NOT NULL ) THEN
88: hr_utility.set_message (275,'PA_ORG_CANT_DEL_HIER');
89: hr_utility.raise_error;
90: END IF;
91:
92:
85: END;
86:
87: IF ( dummy1 IS NOT NULL ) THEN
88: hr_utility.set_message (275,'PA_ORG_CANT_DEL_HIER');
89: hr_utility.raise_error;
90: END IF;
91:
92:
93: ELSE
109: OR (p_org_structure_version_id = pai.exp_org_structure_version_id)
110: );
111: BEGIN
112: --
113: -- hr_utility.set_location('PA_ORG.PA_OSV_PREDEL_VALIDATION', 1);
114: --
115: IF (pa_imp.pa_implemented_all) THEN
116: --
117: -- Check if this Org Struct Version is not in the OSV
119: --
120: open check_org_structure_ver_exists;
121: fetch check_org_structure_ver_exists into dummy1;
122: if check_org_structure_ver_exists%found then
123: hr_utility.set_message (275,'PA_ORG_CANT_DEL_HIER');
124: hr_utility.raise_error;
125: end if;
126: close check_org_structure_ver_exists;
127:
120: open check_org_structure_ver_exists;
121: fetch check_org_structure_ver_exists into dummy1;
122: if check_org_structure_ver_exists%found then
123: hr_utility.set_message (275,'PA_ORG_CANT_DEL_HIER');
124: hr_utility.raise_error;
125: end if;
126: close check_org_structure_ver_exists;
127:
128: -- Check if structure version being deleted is the structure version
159: NULL;
160: END;
161:
162: IF ( dummy1 IS NOT NULL ) THEN
163: hr_utility.set_message (275,'PA_ORG_CANT_DEL_OSV');
164: hr_utility.raise_error;
165: END IF;
166:
167: ELSE
160: END;
161:
162: IF ( dummy1 IS NOT NULL ) THEN
163: hr_utility.set_message (275,'PA_ORG_CANT_DEL_OSV');
164: hr_utility.raise_error;
165: END IF;
166:
167: ELSE
168: -- pass validation.
198: AND ind.start_organization_id = ose.organization_id_child
199:
200: ) ;
201: BEGIN
202: -- hr_utility.trace_on(null, 'RMBUG');
203: -- hr_utility.trace('START - pa_ose_predel_validation');
204: --
205: -- hr_utility.set_location('PA_ORG.PA_OSE_PREDEL_VALIDATION',1);
206: --
199:
200: ) ;
201: BEGIN
202: -- hr_utility.trace_on(null, 'RMBUG');
203: -- hr_utility.trace('START - pa_ose_predel_validation');
204: --
205: -- hr_utility.set_location('PA_ORG.PA_OSE_PREDEL_VALIDATION',1);
206: --
207: IF (pa_imp.pa_implemented_all) THEN
201: BEGIN
202: -- hr_utility.trace_on(null, 'RMBUG');
203: -- hr_utility.trace('START - pa_ose_predel_validation');
204: --
205: -- hr_utility.set_location('PA_ORG.PA_OSE_PREDEL_VALIDATION',1);
206: --
207: IF (pa_imp.pa_implemented_all) THEN
208: --
209: -- Check if this Element is the starting org specified in
211:
212: open check_start_org_exists;
213: fetch check_start_org_exists into dummy1;
214: if check_start_org_exists%found then
215: hr_utility.set_message (275,'PA_ORG_CANT_DELETE_STARTORG'); /* Message_name changed for bug fix 1713199 */
216: hr_utility.raise_error;
217: end if;
218: close check_start_org_exists;
219:
212: open check_start_org_exists;
213: fetch check_start_org_exists into dummy1;
214: if check_start_org_exists%found then
215: hr_utility.set_message (275,'PA_ORG_CANT_DELETE_STARTORG'); /* Message_name changed for bug fix 1713199 */
216: hr_utility.raise_error;
217: end if;
218: close check_start_org_exists;
219:
220: -- Check if structure element is used by PA for burdening (10.7+):
241: );
242: */
243: /* Replacing the above SELECT with the below SELECT statement. */
244: /* Check if the organization being deleted is used in Burdening */
245: -- hr_utility.trace('before check');
246: -- hr_utility.trace('before check p_org_structure_element_id IS ' || p_org_structure_element_id);
247: SELECT 'X'
248: INTO dummy1
249: FROM sys.dual
242: */
243: /* Replacing the above SELECT with the below SELECT statement. */
244: /* Check if the organization being deleted is used in Burdening */
245: -- hr_utility.trace('before check');
246: -- hr_utility.trace('before check p_org_structure_element_id IS ' || p_org_structure_element_id);
247: SELECT 'X'
248: INTO dummy1
249: FROM sys.dual
250: WHERE exists (
261:
262:
263: EXCEPTION
264: WHEN NO_DATA_FOUND THEN
265: -- hr_utility.trace('after check exception');
266: NULL;
267: END;
268:
269: -- hr_utility.trace('after check');
265: -- hr_utility.trace('after check exception');
266: NULL;
267: END;
268:
269: -- hr_utility.trace('after check');
270: IF ( dummy1 IS NOT NULL ) THEN
271: hr_utility.set_message (275,'PA_ORG_DEL_LINK');
272: hr_utility.raise_error;
273: END IF;
267: END;
268:
269: -- hr_utility.trace('after check');
270: IF ( dummy1 IS NOT NULL ) THEN
271: hr_utility.set_message (275,'PA_ORG_DEL_LINK');
272: hr_utility.raise_error;
273: END IF;
274:
275: ELSE
268:
269: -- hr_utility.trace('after check');
270: IF ( dummy1 IS NOT NULL ) THEN
271: hr_utility.set_message (275,'PA_ORG_DEL_LINK');
272: hr_utility.raise_error;
273: END IF;
274:
275: ELSE
276: -- pass validation.
304: Begin
305: open pa_org_exists;
306: fetch pa_org_exists into dummy1;
307: if pa_org_exists%found then
308: hr_utility.set_message (275,'PA_ORG_CANT_DEL_PAORG');
309: hr_utility.raise_error;
310: end if;
311: close pa_org_exists;
312: --
305: open pa_org_exists;
306: fetch pa_org_exists into dummy1;
307: if pa_org_exists%found then
308: hr_utility.set_message (275,'PA_ORG_CANT_DEL_PAORG');
309: hr_utility.raise_error;
310: end if;
311: close pa_org_exists;
312: --
313: open nlr_org_exists;
312: --
313: open nlr_org_exists;
314: fetch nlr_org_exists into dummy1;
315: if nlr_org_exists%found then
316: hr_utility.set_message (275,'PA_ORG_CANT_DEL_NLRORG');
317: hr_utility.raise_error;
318: end if;
319: close nlr_org_exists;
320: --
313: open nlr_org_exists;
314: fetch nlr_org_exists into dummy1;
315: if nlr_org_exists%found then
316: hr_utility.set_message (275,'PA_ORG_CANT_DEL_NLRORG');
317: hr_utility.raise_error;
318: end if;
319: close nlr_org_exists;
320: --
321: open bill_rate_org_exists;
320: --
321: open bill_rate_org_exists;
322: fetch bill_rate_org_exists into dummy1;
323: if bill_rate_org_exists%found then
324: hr_utility.set_message (275,'PA_ORG_CANT_DEL_BRORG');
325: hr_utility.raise_error;
326: end if;
327: close bill_rate_org_exists;
328:
321: open bill_rate_org_exists;
322: fetch bill_rate_org_exists into dummy1;
323: if bill_rate_org_exists%found then
324: hr_utility.set_message (275,'PA_ORG_CANT_DEL_BRORG');
325: hr_utility.raise_error;
326: end if;
327: close bill_rate_org_exists;
328:
329: End;