32: from per_organization_structures
33: where name = p_name;
34: begin
35: --
36: hr_utility.set_location('Entering:'|| l_proc, 10);
37: --
38: --
39: hr_api.mandatory_arg_error
40: (p_api_name => l_proc
43: );
44:
45: --
46: --
47: hr_utility.set_location(l_proc, 20);
48: --
49: --
50:
51: for Crec in csr_org_name loop
50:
51: for Crec in csr_org_name loop
52: if Crec.organization_structure_id <> nvl(p_organization_structure_id,-1)
53: and Crec.business_group_id = nvl(p_business_group_id,crec.business_group_id) then
54: hr_utility.set_message('801','PER_7901_SYS_DUPLICATE_RECORDS');
55: hr_utility.raise_error;
56: end if;
57: end loop;
58: --
51: for Crec in csr_org_name loop
52: if Crec.organization_structure_id <> nvl(p_organization_structure_id,-1)
53: and Crec.business_group_id = nvl(p_business_group_id,crec.business_group_id) then
54: hr_utility.set_message('801','PER_7901_SYS_DUPLICATE_RECORDS');
55: hr_utility.raise_error;
56: end if;
57: end loop;
58: --
59: hr_utility.set_location('Leaving:'||l_proc, 30);
55: hr_utility.raise_error;
56: end if;
57: end loop;
58: --
59: hr_utility.set_location('Leaving:'||l_proc, 30);
60: --
61: end chk_org_name;
62:
63:
119: l_proc VARCHAR2(72) := g_package||'chk_no_children';
120: l_count number(2);
121: begin
122: --
123: hr_utility.set_location('Entering:'|| l_proc, 10);
124: --
125: --
126: hr_api.mandatory_arg_error
127: (p_api_name => l_proc
134: from PER_ORG_STRUCTURE_VERSIONS
135: where ORGANIZATION_STRUCTURE_ID = p_organization_Structure_Id;
136:
137: if l_count >0 then
138: hr_utility.set_message('801','HR_6084_PO_POS_HAS_HIER_VER');
139: hr_utility.raise_error;
140: end if;
141:
142: --
135: where ORGANIZATION_STRUCTURE_ID = p_organization_Structure_Id;
136:
137: if l_count >0 then
138: hr_utility.set_message('801','HR_6084_PO_POS_HAS_HIER_VER');
139: hr_utility.raise_error;
140: end if;
141:
142: --
143: hr_utility.set_location('Leaving:'||l_proc, 30);
139: hr_utility.raise_error;
140: end if;
141:
142: --
143: hr_utility.set_location('Leaving:'||l_proc, 30);
144: --
145: end chk_no_children;
146:
147: -- ---------------------------------------------------------------------------
154: ,p_flag_name in varchar2)
155: IS
156: l_proc VARCHAR2(72) := g_package||'chk_sec_profile';
157: begin
158: hr_utility.set_location('Entering:'|| l_proc, 10);
159: --
160: --
161: IF hr_api.not_exists_in_hrstanlookups
162: (p_effective_date => p_effective_date
167: fnd_message.set_token('COLUMN',p_flag_name);
168: fnd_message.raise_error;
169: end if;
170: --
171: hr_utility.set_location('Leaving:'||l_proc, 30);
172: --
173: end chk_y_or_n;
174:
175: -- ---------------------------------------------------------------------------
182: l_proc VARCHAR2(72) := g_package||'chk_sec_profile';
183: l_count number(2);
184: begin
185: --
186: hr_utility.set_location('Entering:'|| l_proc, 10);
187: --
188: --
189: hr_api.mandatory_arg_error
190: (p_api_name => l_proc
195: into l_count
196: from per_security_profiles
197: where organization_structure_id = p_organization_structure_id;
198: if l_count >0 then
199: hr_utility.set_message('801','PAY_7694_PER_NO_DEL_STRUCTURE');
200: hr_utility.raise_error;
201: end if;
202:
203: --
196: from per_security_profiles
197: where organization_structure_id = p_organization_structure_id;
198: if l_count >0 then
199: hr_utility.set_message('801','PAY_7694_PER_NO_DEL_STRUCTURE');
200: hr_utility.raise_error;
201: end if;
202:
203: --
204: hr_utility.set_location('Leaving:'||l_proc, 30);
200: hr_utility.raise_error;
201: end if;
202:
203: --
204: hr_utility.set_location('Leaving:'||l_proc, 30);
205: --
206: end chk_sec_profile;
207:
208:
226: where position_control_structure_flg = 'Y'
227: and business_group_id = p_business_group_id;
228: begin
229: --
230: hr_utility.set_location('Entering:'|| l_proc, 10);
231: --
232: --
233: --
234: --
231: --
232: --
233: --
234: --
235: hr_utility.set_location(l_proc, 20);
236: --
237: --
238: if p_pos_control_structure_flag = 'Y' then
239: for Crec in csr_org_pos loop
237: --
238: if p_pos_control_structure_flag = 'Y' then
239: for Crec in csr_org_pos loop
240: if Crec.organization_structure_id <> nvl(p_organization_structure_id,-1) then
241: hr_utility.set_message(800, 'PER_50053_POS_CTRL_DUPLICATED');
242: hr_utility.raise_error;
243: end if;
244: end loop;
245: end if;
238: if p_pos_control_structure_flag = 'Y' then
239: for Crec in csr_org_pos loop
240: if Crec.organization_structure_id <> nvl(p_organization_structure_id,-1) then
241: hr_utility.set_message(800, 'PER_50053_POS_CTRL_DUPLICATED');
242: hr_utility.raise_error;
243: end if;
244: end loop;
245: end if;
246: --
243: end if;
244: end loop;
245: end if;
246: --
247: hr_utility.set_location('Leaving:'||l_proc, 30);
248: --
249: end chk_position_control;
250:
251: --
267: from per_organization_structures
268: where primary_structure_flag = 'Y';
269: begin
270: --
271: hr_utility.set_location('Entering:'|| l_proc, 10);
272: --
273: --
274: hr_utility.set_location(l_proc, 20);
275: --
270: --
271: hr_utility.set_location('Entering:'|| l_proc, 10);
272: --
273: --
274: hr_utility.set_location(l_proc, 20);
275: --
276: --
277: if p_primary_structure_flag = 'Y' then
278: for Crec in csr_org_primary loop
277: if p_primary_structure_flag = 'Y' then
278: for Crec in csr_org_primary loop
279: if Crec.organization_structure_id <> nvl(p_organization_structure_id,-1)
280: and Crec.business_group_id = p_business_group_id then
281: hr_utility.set_message(800, 'HR_6085_PO_POS_ONE_PRIMARY');
282: hr_utility.raise_error;
283: end if;
284: end loop;
285: end if;
278: for Crec in csr_org_primary loop
279: if Crec.organization_structure_id <> nvl(p_organization_structure_id,-1)
280: and Crec.business_group_id = p_business_group_id then
281: hr_utility.set_message(800, 'HR_6085_PO_POS_ONE_PRIMARY');
282: hr_utility.raise_error;
283: end if;
284: end loop;
285: end if;
286: --
283: end if;
284: end loop;
285: end if;
286: --
287: hr_utility.set_location('Leaving:'||l_proc, 30);
288: --
289: end chk_primary_flag;
290:
291: --
312: l_proc varchar2(72) := g_package||'set_security_group_id';
313: --
314: begin
315: --
316: hr_utility.set_location('Entering:'|| l_proc, 10);
317: --
318: -- Ensure that all the mandatory parameter are not null
319: --
320: hr_api.mandatory_arg_error
343: hr_api.set_security_group_id
344: (p_security_group_id => l_security_group_id
345: );
346: --
347: hr_utility.set_location(' Leaving:'|| l_proc, 20);
348: --
349: end set_security_group_id;
350:
351: --
373: l_proc varchar2(72) := g_package||'return_legislation_code';
374: --
375: Begin
376: --
377: hr_utility.set_location('Entering:'|| l_proc, 10);
378: --
379: -- Ensure that all the mandatory parameter are not null
380: --
381: hr_api.mandatory_arg_error
391: -- call to this function. Just return the value in the global
392: -- variable.
393: --
394: l_legislation_code := per_ors_bus.g_legislation_code;
395: hr_utility.set_location(l_proc, 20);
396: else
397: --
398: -- The ID is different to the last call to this function
399: -- or this is the first call to this function.
408: close csr_leg_code;
409: fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
410: fnd_message.raise_error;
411: end if;
412: hr_utility.set_location(l_proc,30);
413: --
414: -- Set the global variables so the values are
415: -- available for the next call to this function.
416: --
417: close csr_leg_code;
418: per_ors_bus.g_organization_structure_id := p_organization_structure_id;
419: per_ors_bus.g_legislation_code := l_legislation_code;
420: end if;
421: hr_utility.set_location(' Leaving:'|| l_proc, 40);
422: return l_legislation_code;
423: end return_legislation_code;
424: --
425: -- ----------------------------------------------------------------------------
456: --
457: l_proc varchar2(72) := g_package || 'chk_df';
458: --
459: begin
460: hr_utility.set_location('Entering:'||l_proc,10);
461: --
462: if ((p_rec.organization_structure_id is not null) and (
463: nvl(per_ors_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
464: nvl(p_rec.attribute_category, hr_api.g_varchar2) or
555: ,p_attribute20_value => p_rec.attribute20
556: );
557: end if;
558: --
559: hr_utility.set_location(' Leaving:'||l_proc,20);
560: end chk_df;
561: --
562: -- ----------------------------------------------------------------------------
563: -- |-----------------------< chk_non_updateable_args >------------------------|
629: --
630: l_proc varchar2(72) := g_package||'insert_validate';
631: --
632: Begin
633: hr_utility.set_location('Entering:'||l_proc, 5);
634: --
635: -- Call all supporting business operations
636: --
637: if p_rec.business_group_id IS NOT NULL then
661: --
662: --
663: per_ors_bus.chk_df(p_rec);
664: --
665: hr_utility.set_location(' Leaving:'||l_proc, 10);
666: End insert_validate;
667: --
668: -- ----------------------------------------------------------------------------
669: -- |---------------------------< update_validate >----------------------------|
675: --
676: l_proc varchar2(72) := g_package||'update_validate';
677: --
678: Begin
679: hr_utility.set_location('Entering:'||l_proc, 5);
680: --
681: -- Call all supporting business operations
682: --
683: if p_rec.business_group_id IS NOT NULL then
711: --
712: --
713: per_ors_bus.chk_df(p_rec);
714: --
715: hr_utility.set_location(' Leaving:'||l_proc, 10);
716: End update_validate;
717: --
718: -- ----------------------------------------------------------------------------
719: -- |---------------------------< delete_validate >----------------------------|
724: --
725: l_proc varchar2(72) := g_package||'delete_validate';
726: --
727: Begin
728: hr_utility.set_location('Entering:'||l_proc, 5);
729: --
730: -- Call all supporting business operations
731: chk_no_children
732: (p_organization_structure_id => p_rec.organization_structure_id);
736: pa_org.pa_os_predel_validation(p_rec.organization_structure_id);
737: end if;
738:
739: --
740: hr_utility.set_location(' Leaving:'||l_proc, 10);
741: End delete_validate;
742: --
743: end per_ors_bus;