27: l_proc varchar2(72) := g_package||'generate_string';
28: --
29: BEGIN
30: --
31: hr_utility.set_location('Entering:' || l_proc, 10);
32:
33: IF p_id is null
34: THEN
35: return null;
63: end if;
64: end loop;
65: RETURN l_result;
66: --
67: hr_utility.set_location('Leaving:' || l_proc, 50);
68: --
69: EXCEPTION
70: WHEN others THEN
71: hr_utility.set_message(800, 'HR_GENERATE_PASSWORD_ERR');
67: hr_utility.set_location('Leaving:' || l_proc, 50);
68: --
69: EXCEPTION
70: WHEN others THEN
71: hr_utility.set_message(800, 'HR_GENERATE_PASSWORD_ERR');
72: hr_utility.raise_error;
73: return null;
74:
75: END generate_string;
68: --
69: EXCEPTION
70: WHEN others THEN
71: hr_utility.set_message(800, 'HR_GENERATE_PASSWORD_ERR');
72: hr_utility.raise_error;
73: return null;
74:
75: END generate_string;
76: --
137: e_create_fnd_user EXCEPTION; -- Fix 2288014
138: --
139: --
140: begin
141: hr_utility.set_location('Entering:'|| l_proc, 10);
142: --
143: -- Validate input parameters first
144: -- Validate p_user_start_date
145: IF p_user_start_date IS NULL
145: IF p_user_start_date IS NULL
146: THEN
147: IF p_hire_date IS NULL
148: THEN
149: hr_utility.set_message(800, 'HR_NO_HIRE_DATE');
150: hr_utility.raise_error;
151: ELSE
152: l_fnd_user_start_date := p_hire_date;
153: END IF;
146: THEN
147: IF p_hire_date IS NULL
148: THEN
149: hr_utility.set_message(800, 'HR_NO_HIRE_DATE');
150: hr_utility.raise_error;
151: ELSE
152: l_fnd_user_start_date := p_hire_date;
153: END IF;
154: ELSE
164: IF p_user_end_date >= l_fnd_user_start_date
165: THEN
166: l_fnd_user_end_date := p_user_end_date;
167: ELSE
168: hr_utility.set_message(800, 'HR_51070_CAU_START_END');
169: hr_utility.raise_error;
170: END IF;
171: END IF;
172: --
165: THEN
166: l_fnd_user_end_date := p_user_end_date;
167: ELSE
168: hr_utility.set_message(800, 'HR_51070_CAU_START_END');
169: hr_utility.raise_error;
170: END IF;
171: END IF;
172: --
173: --
173: --
174: -- Validate email address length
175: IF length(p_email_address) > g_max_email_address_length
176: THEN
177: hr_utility.set_message(800, 'HR_INVALID_EMAIL_ADDR_LENGTH');
178: hr_utility.raise_error;
179: END IF;
180: --
181: -- Validate fax length
174: -- Validate email address length
175: IF length(p_email_address) > g_max_email_address_length
176: THEN
177: hr_utility.set_message(800, 'HR_INVALID_EMAIL_ADDR_LENGTH');
178: hr_utility.raise_error;
179: END IF;
180: --
181: -- Validate fax length
182: IF length(p_fax) > g_max_fax_length
180: --
181: -- Validate fax length
182: IF length(p_fax) > g_max_fax_length
183: THEN
184: hr_utility.set_message(800, 'HR_INVALID_FAX_LENGTH');
185: hr_utility.raise_error;
186: END IF;
187: --
188: -- Validate user name
181: -- Validate fax length
182: IF length(p_fax) > g_max_fax_length
183: THEN
184: hr_utility.set_message(800, 'HR_INVALID_FAX_LENGTH');
185: hr_utility.raise_error;
186: END IF;
187: --
188: -- Validate user name
189: IF p_user_name IS NOT NULL
190: THEN
191: l_pos := length(p_user_name);
192: IF l_pos IS NULL
193: THEN
194: hr_utility.set_message(800, 'HR_USER_NAME_NOT_SUPPLIED');
195: hr_utility.raise_error;
196: ELSIF l_pos > g_max_user_name_length
197: THEN
198: hr_utility.set_message(800, 'HR_USER_NAME_LENGTH_EXCEEDED');
191: l_pos := length(p_user_name);
192: IF l_pos IS NULL
193: THEN
194: hr_utility.set_message(800, 'HR_USER_NAME_NOT_SUPPLIED');
195: hr_utility.raise_error;
196: ELSIF l_pos > g_max_user_name_length
197: THEN
198: hr_utility.set_message(800, 'HR_USER_NAME_LENGTH_EXCEEDED');
199: hr_utility.raise_error;
194: hr_utility.set_message(800, 'HR_USER_NAME_NOT_SUPPLIED');
195: hr_utility.raise_error;
196: ELSIF l_pos > g_max_user_name_length
197: THEN
198: hr_utility.set_message(800, 'HR_USER_NAME_LENGTH_EXCEEDED');
199: hr_utility.raise_error;
200: END IF;
201: ELSE
202: hr_utility.set_message(800, 'HR_USER_NAME_MISSING');
195: hr_utility.raise_error;
196: ELSIF l_pos > g_max_user_name_length
197: THEN
198: hr_utility.set_message(800, 'HR_USER_NAME_LENGTH_EXCEEDED');
199: hr_utility.raise_error;
200: END IF;
201: ELSE
202: hr_utility.set_message(800, 'HR_USER_NAME_MISSING');
203: hr_utility.raise_error;
198: hr_utility.set_message(800, 'HR_USER_NAME_LENGTH_EXCEEDED');
199: hr_utility.raise_error;
200: END IF;
201: ELSE
202: hr_utility.set_message(800, 'HR_USER_NAME_MISSING');
203: hr_utility.raise_error;
204: END IF;
205: --
206: -- Check for uniqueness of the user name
199: hr_utility.raise_error;
200: END IF;
201: ELSE
202: hr_utility.set_message(800, 'HR_USER_NAME_MISSING');
203: hr_utility.raise_error;
204: END IF;
205: --
206: -- Check for uniqueness of the user name
207: OPEN lc_get_user_name;
213: -- Issue an error if user_name already exists
214: CLOSE lc_get_user_name;
215: fnd_message.set_name('PER', 'HR_USER_NAME_ALREADY_EXISTS');
216: fnd_message.set_token('USER_NAME', p_user_name);
217: hr_utility.raise_error;
218: END IF;
219:
220: --
221: -- Check for employee id if it exists
227: WHERE person_id = p_employee_id;
228:
229: IF l_count <= 0
230: THEN
231: hr_utility.set_message(800, 'HR_INVALID_EMP_ID');
232: hr_utility.raise_error;
233: END IF;
234: ELSE
235: NULL;
228:
229: IF l_count <= 0
230: THEN
231: hr_utility.set_message(800, 'HR_INVALID_EMP_ID');
232: hr_utility.raise_error;
233: END IF;
234: ELSE
235: NULL;
236: END IF;
247: IF l_count > 8 AND p_password IS NULL
248: THEN
249: -- The random password generator can produce 8-byte alphanumeric string.
250: -- So any length more than 8 must be supplied by customers.
251: hr_utility.set_message(800, 'HR_USER_PASSWORD_LENGTH_INV');
252: hr_utility.raise_error;
253: END IF;
254: --
255: -- Customers can supply a password. If no password is supplied, we randomly
248: THEN
249: -- The random password generator can produce 8-byte alphanumeric string.
250: -- So any length more than 8 must be supplied by customers.
251: hr_utility.set_message(800, 'HR_USER_PASSWORD_LENGTH_INV');
252: hr_utility.raise_error;
253: END IF;
254: --
255: -- Customers can supply a password. If no password is supplied, we randomly
256: -- generate an 8-byte alphanumeric characters.
261: ,p_id => fnd_crypto.smallrandomnumber);
262: --
263: IF l_password IS NULL
264: THEN
265: hr_utility.set_message(800, 'HR_PASSWORD_NULL');
266: hr_utility.raise_error;
267: END IF;
268: --
269: ELSIF (length(p_password) < l_count)
262: --
263: IF l_password IS NULL
264: THEN
265: hr_utility.set_message(800, 'HR_PASSWORD_NULL');
266: hr_utility.raise_error;
267: END IF;
268: --
269: ELSIF (length(p_password) < l_count)
270: THEN
269: ELSIF (length(p_password) < l_count)
270: THEN
271: fnd_message.set_name('FND', 'PASSWORD-LONGER');
272: fnd_message.set_token('LENGTH', to_char(l_count));
273: hr_utility.raise_error;
274: ELSIF (length(p_password) > 30)
275: THEN
276: hr_utility.set_message(800, 'HR_USER_PASSWORD_TOO_LONG');
277: hr_utility.raise_error;
272: fnd_message.set_token('LENGTH', to_char(l_count));
273: hr_utility.raise_error;
274: ELSIF (length(p_password) > 30)
275: THEN
276: hr_utility.set_message(800, 'HR_USER_PASSWORD_TOO_LONG');
277: hr_utility.raise_error;
278: ELSE
279: l_password := p_password;
280: END IF;
273: hr_utility.raise_error;
274: ELSIF (length(p_password) > 30)
275: THEN
276: hr_utility.set_message(800, 'HR_USER_PASSWORD_TOO_LONG');
277: hr_utility.raise_error;
278: ELSE
279: l_password := p_password;
280: END IF;
281: --
295: END IF;
296: --
297: -- Now, we're ready to call fnd api to create a user name.
298: --
299: hr_utility.set_location (l_proc || ' before fnd_user_pkg.CreateUser', 30);
300: --
301: -- Fix 2288014 Start
302:
303: BEGIN
329: p_password := l_password;
330:
331:
332: --
333: hr_utility.set_location('Leaving:' || l_proc, 70);
334: --
335:
336: EXCEPTION
337: WHEN OTHERS THEN
335:
336: EXCEPTION
337: WHEN OTHERS THEN
338:
339: hr_utility.raise_error;
340:
341: -- Fix 2288014 End
342:
343:
433: l_data_grp_id fnd_data_groups.data_group_id%type default null;
434: l_req_grp_app_id fnd_request_groups.application_id%type default null;
435: --
436: BEGIN
437: hr_utility.set_location('Entering:' || l_proc, 10);
438: --
439: -- Validate input parameters first
440: -- Validate responsibility application id exists
441: --
447: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
448: fnd_message.set_token('TABLE', 'FND_APPLICATION');
449: fnd_message.set_token('COLUMN', 'APPLICATION_ID');
450: fnd_message.set_token('VALUE', to_char(p_resp_app_id));
451: hr_utility.raise_error;
452: ELSE
453: CLOSE lc_get_app_short_name;
454: END IF;
455:
463: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
464: fnd_message.set_token('TABLE', 'FND_APPLICATION');
465: fnd_message.set_token('COLUMN', 'APPLICATION_ID');
466: fnd_message.set_token('VALUE', to_char(p_data_group_app_id));
467: hr_utility.raise_error;
468: ELSE
469: CLOSE lc_get_app_short_name;
470: END IF;
471:
483: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
484: fnd_message.set_token('TABLE', 'FND_APPLICATION');
485: fnd_message.set_token('COLUMN', 'APPLICATION_ID');
486: fnd_message.set_token('VALUE', to_char(p_request_group_app_id));
487: hr_utility.raise_error;
488: ELSE
489: CLOSE lc_get_app_short_name;
490: END IF;
491: END IF;
500: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
501: fnd_message.set_token('TABLE', 'FND_DATA_GROUPS_STANDARD_VIEW');
502: fnd_message.set_token('COLUMN', 'DATA_GROUP_NAME');
503: fnd_message.set_token('VALUE', p_data_group_name);
504: hr_utility.raise_error;
505: ELSE
506: CLOSE lc_get_data_group_id;
507: END IF;
508: --
514: IF lc_unique_resp_key%NOTFOUND
515: THEN
516: CLOSE lc_unique_resp_key;
517: fnd_message.set_name('FND', 'SECURITY-DUPLICATE RESP NAME');
518: hr_utility.raise_error;
519: ELSE
520: CLOSE lc_unique_resp_key;
521: END IF;
522:
529: IF lc_unique_resp_name%NOTFOUND
530: THEN
531: CLOSE lc_unique_resp_name;
532: fnd_message.set_name('FND', 'SECURITY-DUPLICATE RESP NAME');
533: hr_utility.raise_error;
534: ELSE
535: CLOSE lc_unique_resp_name;
536: END IF;
537:
541: p_version = 'W'
542: THEN
543: null;
544: ELSE
545: hr_utility.set_message(800, 'HR_INVALID_RESP_VERSION');
546: hr_utility.raise_error;
547: END IF;
548: --
549: -- Validate End Date must be >= Start Date
542: THEN
543: null;
544: ELSE
545: hr_utility.set_message(800, 'HR_INVALID_RESP_VERSION');
546: hr_utility.raise_error;
547: END IF;
548: --
549: -- Validate End Date must be >= Start Date
550: IF p_end_date IS NOT NULL
550: IF p_end_date IS NOT NULL
551: THEN
552: IF p_end_date < nvl(p_start_date, p_end_date + 1)
553: THEN
554: hr_utility.set_message(800, 'HR_51070_CAU_START_END');
555: hr_utility.raise_error;
556: END IF;
557: END IF;
558: --
551: THEN
552: IF p_end_date < nvl(p_start_date, p_end_date + 1)
553: THEN
554: hr_utility.set_message(800, 'HR_51070_CAU_START_END');
555: hr_utility.raise_error;
556: END IF;
557: END IF;
558: --
559: -- Validate data_group_name
567: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
568: fnd_message.set_token('TABLE', 'FND_DATA_GROUPS_STANDARD_VIEW');
569: fnd_message.set_token('COLUMN', 'DATA_GROUP_NAME');
570: fnd_message.set_token('VALUE', p_data_group_name);
571: hr_utility.raise_error;
572: ELSE
573: CLOSE lc_get_data_group_id;
574: END IF;
575:
585: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
586: fnd_message.set_token('TABLE', 'FND_MENUS_VL');
587: fnd_message.set_token('COLUMN', 'MENU_NAME');
588: fnd_message.set_token('VALUE', p_menu_name);
589: hr_utility.raise_error;
590: ELSE
591: CLOSE lc_get_menu_id;
592: END IF;
593:
610: fnd_message.set_token('COLUMN',
611: '(REQUEST_GROUP_NAME, REQUEST_GROUP_APP_ID)');
612: fnd_message.set_token('VALUE', p_request_group_name || ', ' ||
613: to_char(p_request_group_app_id));
614: hr_utility.raise_error;
615: ELSE
616: CLOSE lc_get_req_group_id;
617: END IF;
618: END IF;
638: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
639: fnd_message.set_token('SEQUENCE', 'FND_RESPONSIBILITY_S');
640: fnd_message.set_token('COLUMN', 'RESPONSIBILITY_ID');
641: fnd_message.set_token('VALUE', 'NULL');
642: hr_utility.raise_error;
643: ELSE
644: CLOSE lc_generate_resp_id;
645: END IF;
646:
646:
647: --
648: -- Now call the fnd create responsibility api which needs the app short name.
649: --
650: hr_utility.set_location(l_proc ||
651: ' before fnd_function_security.responsibility', 30);
652: --
653: fnd_function_security.responsibility
654: (responsibility_id => l_responsibility_id
669: );
670: --
671: p_responsibility_id := l_responsibility_id;
672:
673: hr_utility.set_location('Leaving:'||l_proc, 50);
674:
675: END create_fnd_responsibility;
676: --
677: -- ----------------------------------------------------------------------------
720: l_proc varchar2(72) := g_package || 'create_fnd_user_resp_groups';
721: l_dummy number default null;
722: --
723: BEGIN
724: hr_utility.set_location('Entering:' || l_proc, 10);
725: --
726: -- Validate input parameters first. We need to validate input parameter
727: -- again here because users can just invoke this procedure without calling
728: -- create_fnd_user_api first.
739: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
740: fnd_message.set_token('TABLE', 'FND_USER');
741: fnd_message.set_token('COLUMN', 'USER_ID');
742: fnd_message.set_token('VALUE', to_char(p_user_id));
743: hr_utility.raise_error;
744: ELSE
745: CLOSE lc_get_user_id;
746: END IF;
747: --
757: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
758: fnd_message.set_token('TABLE', 'FND_RESPONSIBILITY');
759: fnd_message.set_token('COLUMN', 'RESPONSIBILITY_ID');
760: fnd_message.set_token('VALUE', to_char(p_responsibility_id));
761: hr_utility.raise_error;
762: ELSE
763: CLOSE lc_get_resp_id;
764: END IF;
765: --
775: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
776: fnd_message.set_token('TABLE', 'FND_APPLICATION');
777: fnd_message.set_token('COLUMN', 'APPLICATION_ID');
778: fnd_message.set_token('VALUE', to_char(p_application_id));
779: hr_utility.raise_error;
780: ELSE
781: CLOSE lc_get_app_id;
782: END IF;
783: --
792: --
793: IF l_dummy IS NOT NULL
794: THEN
795: fnd_message.set_name('FND', 'SECURITY-DUPLICATE USER RESP');
796: hr_utility.raise_error;
797: END IF;
798:
799: EXCEPTION
800: WHEN NO_DATA_FOUND THEN
804: --
805: -- Validate Start Date cannot be null
806: IF p_start_date IS NULL
807: THEN
808: hr_utility.set_message(800, 'HR_50374_SSL_MAND_START_DATE');
809: hr_utility.raise_error;
810: END IF;
811:
812:
805: -- Validate Start Date cannot be null
806: IF p_start_date IS NULL
807: THEN
808: hr_utility.set_message(800, 'HR_50374_SSL_MAND_START_DATE');
809: hr_utility.raise_error;
810: END IF;
811:
812:
813: -- Validate End Date must be >= Start Date
814: IF p_end_date IS NOT NULL
815: THEN
816: IF p_end_date < nvl(p_start_date, p_end_date + 1)
817: THEN
818: hr_utility.set_message(800, 'HR_51070_CAU_START_END');
819: hr_utility.raise_error;
820: END IF;
821: END IF;
822: --
815: THEN
816: IF p_end_date < nvl(p_start_date, p_end_date + 1)
817: THEN
818: hr_utility.set_message(800, 'HR_51070_CAU_START_END');
819: hr_utility.raise_error;
820: END IF;
821: END IF;
822: --
823: -- Now call the fnd_user_resp_groups_api
821: END IF;
822: --
823: -- Now call the fnd_user_resp_groups_api
824: --
825: hr_utility.set_location(l_proc ||
826: ' before fnd_user_resp_groups_api.insert_assignment', 30);
827: --
828: fnd_user_resp_groups_api.insert_assignment
829: (user_id => p_user_id
835: ,description => p_description
836: );
837:
838: --
839: hr_utility.set_location('Leaving:'||l_proc, 50);
840:
841: END create_fnd_user_resp_groups;
842: --
843: -- ----------------------------------------------------------------------------
891: per_sec_profile_assignments.object_version_number%type := null;
892: l_proc varchar2(72) := g_package|| 'create_sec_profile_asg';
893:
894: BEGIN
895: hr_utility.set_location('Entering:' || l_proc, 10);
896:
897: -- Validate input parameters first. We need to validate input parameter
898: -- again here because users can just invoke this procedure without calling
899: -- fnd_user_acct_api first.
910: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
911: fnd_message.set_token('TABLE', 'FND_USER');
912: fnd_message.set_token('COLUMN', 'USER_ID');
913: fnd_message.set_token('VALUE', to_char(p_user_id));
914: hr_utility.raise_error;
915: ELSE
916: CLOSE lc_get_user_id;
917: END IF;
918: --
926: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
927: fnd_message.set_token('TABLE', 'FND_RESPONSIBILITY');
928: fnd_message.set_token('COLUMN', 'RESPONSIBILITY_KEY');
929: fnd_message.set_token('VALUE', p_resp_key);
930: hr_utility.raise_error;
931: ELSE
932: CLOSE lc_get_resp_id;
933: END IF;
934: --
944: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
945: fnd_message.set_token('TABLE', 'FND_SECURITY_GROUPS');
946: fnd_message.set_token('COLUMN', 'SECURITY_GROUP_ID');
947: fnd_message.set_token('VALUE', to_char(p_sec_group_id));
948: hr_utility.raise_error;
949: ELSE
950: CLOSE lc_get_sec_group_id;
951: END IF;
952: --
962: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
963: fnd_message.set_token('TABLE', 'PER_SECURITY_PROFILES');
964: fnd_message.set_token('COLUMN', 'SECURITY_PROFILE_ID');
965: fnd_message.set_token('VALUE', to_char(p_sec_profile_id));
966: hr_utility.raise_error;
967: ELSE
968: CLOSE lc_get_sec_profile;
969: END IF;
970: --
970: --
971: -- Validate Start Date cannot be null
972: IF p_start_date IS NULL
973: THEN
974: hr_utility.set_message(800, 'HR_50374_SSL_MAND_START_DATE');
975: hr_utility.raise_error;
976: END IF;
977: --
978: -- Validate End Date must be >= Start Date
971: -- Validate Start Date cannot be null
972: IF p_start_date IS NULL
973: THEN
974: hr_utility.set_message(800, 'HR_50374_SSL_MAND_START_DATE');
975: hr_utility.raise_error;
976: END IF;
977: --
978: -- Validate End Date must be >= Start Date
979: IF p_end_date IS NOT NULL
979: IF p_end_date IS NOT NULL
980: THEN
981: IF p_end_date < nvl(p_start_date, p_end_date + 1)
982: THEN
983: hr_utility.set_message(800, 'HR_51070_CAU_START_END');
984: hr_utility.raise_error;
985: END IF;
986: END IF;
987: --
980: THEN
981: IF p_end_date < nvl(p_start_date, p_end_date + 1)
982: THEN
983: hr_utility.set_message(800, 'HR_51070_CAU_START_END');
984: hr_utility.raise_error;
985: END IF;
986: END IF;
987: --
988: -- Now call the per_asp_ins.ins which will insert a row into
1000: ,p_object_version_number => l_obj_vers_num
1001: );
1002:
1003: --
1004: hr_utility.set_location('Leaving:'||l_proc, 50);
1005:
1006:
1007: END create_sec_profile_asg;
1008: --
1043: l_profile_opt_value_valid boolean default null;
1044: l_proc varchar2(72) := g_package||'create_fnd_profile_values';
1045:
1046: BEGIN
1047: hr_utility.set_location('Entering:' || l_proc, 10);
1048: --
1049: -- Validate input parameters first. We need to validate input parameter
1050: -- again here because users can just invoke this procedure without calling
1051: -- fnd_user_resp_wrapper first.
1060: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
1061: fnd_message.set_token('TABLE', 'FND_PROFILE_OPTIONS');
1062: fnd_message.set_token('COLUMN', 'PROFILE_OPTION_NAME');
1063: fnd_message.set_token('VALUE', p_profile_opt_name);
1064: hr_utility.raise_error;
1065: END IF;
1066: --
1067: CLOSE lc_get_update_flag;
1068:
1072: IF upper(p_profile_level_name) = 'RESP' AND
1073: l_resp_update_allowed_flag <> 'Y'
1074: THEN
1075: fnd_message.set_name('FND', 'PROFILES- CANT UPDATE');
1076: hr_utility.raise_error;
1077: ELSIF upper(p_profile_level_name) = 'USER' AND
1078: l_user_update_allowed_flag <> 'Y'
1079: THEN
1080: fnd_message.set_name('FND', 'PROFILES- CANT UPDATE');
1077: ELSIF upper(p_profile_level_name) = 'USER' AND
1078: l_user_update_allowed_flag <> 'Y'
1079: THEN
1080: fnd_message.set_name('FND', 'PROFILES- CANT UPDATE');
1081: hr_utility.raise_error;
1082: END IF;
1083: --
1084: IF l_sql_validation IS NOT NULL
1085: THEN
1097: ,p_varchar2_data => l_varchar2_data);
1098: END IF;
1099:
1100:
1101: hr_utility.set_location(l_proc || ' before fnd_profile.save', 30);
1102: --
1103: IF l_profile_opt_value_valid THEN
1104: l_profile_val_saved := fnd_profile.save
1105: (x_name => p_profile_opt_name
1122:
1123: fnd_message.set_token('PROFILE_OPTION_NAME', p_profile_opt_name);
1124: fnd_message.set_token('PROFILE_OPTION_VALUE', p_profile_opt_value);
1125:
1126: hr_utility.raise_error;
1127: END IF;
1128:
1129: /*
1130: --
1151: */
1152:
1153: p_profile_value_saved := l_profile_val_saved;
1154:
1155: hr_utility.set_location('Leaving:'||l_proc, 50);
1156:
1157:
1158: END create_fnd_profile_values;
1159:
1597: l_lookup_type_end number default null;
1598: l_proc varchar2(30) default 'validate_profile_opt_value';
1599:
1600: BEGIN
1601: hr_utility.set_location('Entering:' || l_proc, 10);
1602:
1603: -- For those sql validations against FND_COMMON_LOOKUPS, or FND_LOOKUPS
1604: -- the validation is always against the lookup_code. So, we don't need to
1605: -- hard code the validation. But we need to first find out if the validation
1868:
1869: IF l_opt_value_valid
1870: THEN
1871: p_profile_opt_value_valid := l_opt_value_valid;
1872: hr_utility.set_location('profile opt value is valid', 19);
1873: ELSE
1874: p_profile_opt_value_valid := false;
1875: hr_utility.set_location('profile opt value is invalid', 19);
1876: END IF;
1871: p_profile_opt_value_valid := l_opt_value_valid;
1872: hr_utility.set_location('profile opt value is valid', 19);
1873: ELSE
1874: p_profile_opt_value_valid := false;
1875: hr_utility.set_location('profile opt value is invalid', 19);
1876: END IF;
1877:
1878: p_num_data := l_num_data;
1879: p_varchar2_data := l_varchar2_data;
1877:
1878: p_num_data := l_num_data;
1879: p_varchar2_data := l_varchar2_data;
1880:
1881: hr_utility.set_location('Leaving:' || l_proc, 50);
1882:
1883: EXCEPTION
1884: WHEN OTHERS THEN
1885: IF upper(p_profile_level_name) = 'RESP'
1892: END IF;
1893:
1894: fnd_message.set_token('PROFILE_OPTION_NAME', p_profile_opt_name);
1895: fnd_message.set_token('PROFILE_OPTION_VALUE', p_profile_opt_value);
1896: hr_utility.raise_error;
1897:
1898:
1899: END validate_profile_opt_value;
1900: --
1935: l_proc varchar2(72) := g_package||'build_resp_profile_val';
1936: --
1937: BEGIN
1938: --
1939: hr_utility.set_location('Entering:' || l_proc, 10);
1940: --
1941: -- Now copy the p_fnd_profile_opt_val_tbl to the local table for output
1942: -- Only copy the profile option values for the passed in responsibility.
1943: FOR i in 1..p_fnd_profile_opt_val_tbl.count
2004: END IF;
2005:
2006: p_out_profile_opt_val_tbl := l_prof_opt_val_tbl;
2007:
2008: hr_utility.set_location('Leaving:' || l_proc, 50);
2009: --
2010: EXCEPTION
2011: WHEN others THEN
2012: hr_utility.set_message(800, 'HR_BUILD_PROFILE_VAL_ERR');
2008: hr_utility.set_location('Leaving:' || l_proc, 50);
2009: --
2010: EXCEPTION
2011: WHEN others THEN
2012: hr_utility.set_message(800, 'HR_BUILD_PROFILE_VAL_ERR');
2013: hr_utility.raise_error;
2014:
2015: END build_resp_profile_val;
2016: --
2009: --
2010: EXCEPTION
2011: WHEN others THEN
2012: hr_utility.set_message(800, 'HR_BUILD_PROFILE_VAL_ERR');
2013: hr_utility.raise_error;
2014:
2015: END build_resp_profile_val;
2016: --
2017: -- ----------------------------------------------------------------------------
2063: l_rule_name fnd_menus.menu_name%type;
2064: l_func_sec_excl_err exception;
2065: --
2066: BEGIN
2067: hr_utility.set_location('Entering:'|| l_proc, 11);
2068:
2069: l_func_sec_excl_tbl_count := p_func_sec_excl_tbl.count;
2070: --
2071: FOR i in 1..l_func_sec_excl_tbl_count
2159: END LOOP;
2160: --
2161: p_out_func_sec_excl_tbl := l_out_func_sec_excl_tbl;
2162: --
2163: hr_utility.set_location('Leaving:'|| l_proc, 15);
2164: --
2165: --
2166: EXCEPTION
2167: WHEN l_func_sec_excl_err THEN
2164: --
2165: --
2166: EXCEPTION
2167: WHEN l_func_sec_excl_err THEN
2168: hr_utility.set_message(800, 'HR_BUILD_FUNC_EXCL_RULE_ERR');
2169: hr_utility.raise_error;
2170: --
2171: --
2172: WHEN others THEN
2165: --
2166: EXCEPTION
2167: WHEN l_func_sec_excl_err THEN
2168: hr_utility.set_message(800, 'HR_BUILD_FUNC_EXCL_RULE_ERR');
2169: hr_utility.raise_error;
2170: --
2171: --
2172: WHEN others THEN
2173: hr_utility.set_message(800, 'HR_BUILD_FUNC_EXCL_RULE_ERR');
2169: hr_utility.raise_error;
2170: --
2171: --
2172: WHEN others THEN
2173: hr_utility.set_message(800, 'HR_BUILD_FUNC_EXCL_RULE_ERR');
2174: hr_utility.raise_error;
2175: --
2176: END build_func_sec_exclusion_rules;
2177: --
2170: --
2171: --
2172: WHEN others THEN
2173: hr_utility.set_message(800, 'HR_BUILD_FUNC_EXCL_RULE_ERR');
2174: hr_utility.raise_error;
2175: --
2176: END build_func_sec_exclusion_rules;
2177: --
2178: --
2213: l_temp_id number default null;
2214: --
2215: --
2216: BEGIN
2217: hr_utility.set_location('Entering:'|| l_proc, 10);
2218: --
2219: -- FND API does not validate or throw an exception. So, do validations here
2220: -- instead of build_func_sec_exclusion_rules because users might call this
2221: -- procedure directly and thus bypass the build_func_sec_exclusion_rules
2231: fnd_message.set_token('TABLE', 'FND_RESPONSIBILITY');
2232: fnd_message.set_token('COLUMN', 'RESPONSIBILITY_KEY');
2233: fnd_message.set_token('VALUE', p_resp_key);
2234:
2235: hr_utility.set_message(800, 'HR_INVALID_RESP_KEY');
2236: hr_utility.raise_error;
2237: ELSE
2238: CLOSE lc_get_resp_id;
2239: END IF;
2232: fnd_message.set_token('COLUMN', 'RESPONSIBILITY_KEY');
2233: fnd_message.set_token('VALUE', p_resp_key);
2234:
2235: hr_utility.set_message(800, 'HR_INVALID_RESP_KEY');
2236: hr_utility.raise_error;
2237: ELSE
2238: CLOSE lc_get_resp_id;
2239: END IF;
2240: --
2242: IF p_rule_type = 'F' OR p_rule_type = 'M'
2243: THEN
2244: NULL;
2245: ELSE
2246: hr_utility.set_message(800, 'HR_INVALID_SEC_EXCL_RULE_TYPE');
2247: hr_utility.raise_error;
2248: END IF;
2249: --
2250: -- Validate rule_name
2243: THEN
2244: NULL;
2245: ELSE
2246: hr_utility.set_message(800, 'HR_INVALID_SEC_EXCL_RULE_TYPE');
2247: hr_utility.raise_error;
2248: END IF;
2249: --
2250: -- Validate rule_name
2251: IF p_rule_type = 'F'
2254: FETCH lc_get_function_id into l_temp_id;
2255: IF lc_get_function_id%NOTFOUND
2256: THEN
2257: CLOSE lc_get_function_id;
2258: hr_utility.set_message(800, 'HR_INVALID_SEC_EXCL_FUNC_NAME');
2259: hr_utility.raise_error;
2260: ELSE
2261: CLOSE lc_get_function_id;
2262: END IF;
2255: IF lc_get_function_id%NOTFOUND
2256: THEN
2257: CLOSE lc_get_function_id;
2258: hr_utility.set_message(800, 'HR_INVALID_SEC_EXCL_FUNC_NAME');
2259: hr_utility.raise_error;
2260: ELSE
2261: CLOSE lc_get_function_id;
2262: END IF;
2263: ELSIF p_rule_type = 'M'
2266: FETCH lc_get_menu_id into l_temp_id;
2267: IF lc_get_menu_id%NOTFOUND
2268: THEN
2269: CLOSE lc_get_menu_id;
2270: hr_utility.set_message(800, 'HR_INVALID_SEC_EXCL_MENU_NAME');
2271: hr_utility.raise_error;
2272: ELSE
2273: CLOSE lc_get_menu_id;
2274: END IF;
2267: IF lc_get_menu_id%NOTFOUND
2268: THEN
2269: CLOSE lc_get_menu_id;
2270: hr_utility.set_message(800, 'HR_INVALID_SEC_EXCL_MENU_NAME');
2271: hr_utility.raise_error;
2272: ELSE
2273: CLOSE lc_get_menu_id;
2274: END IF;
2275: ELSE
2272: ELSE
2273: CLOSE lc_get_menu_id;
2274: END IF;
2275: ELSE
2276: hr_utility.set_message(800, 'HR_INVALID_SEC_EXCL_RULE_NAME');
2277: hr_utility.raise_error;
2278: END IF;
2279: --
2280: fnd_function_security.security_rule
2273: CLOSE lc_get_menu_id;
2274: END IF;
2275: ELSE
2276: hr_utility.set_message(800, 'HR_INVALID_SEC_EXCL_RULE_NAME');
2277: hr_utility.raise_error;
2278: END IF;
2279: --
2280: fnd_function_security.security_rule
2281: (responsibility_key => p_resp_key
2283: ,rule_name => p_rule_name
2284: ,delete_flag => p_delete_flag);
2285: --
2286: --
2287: hr_utility.set_location('Leaving:'|| l_proc, 50);
2288: --
2289: --
2290: END create_fnd_resp_functions;
2291: --
2346: l_user_name VARCHAR2(80); -- Fix 2288014
2347: --
2348:
2349: BEGIN
2350: hr_utility.set_location('Entering:'|| l_proc, 10);
2351: --
2352: -- Validate input parameters first, need to convert hr_api default
2353: -- value to fnd's api default value.
2354: IF p_old_password = hr_api.g_varchar2
2367: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
2368: fnd_message.set_token('TABLE', 'FND_USER');
2369: fnd_message.set_token('COLUMN', 'USER_ID');
2370: fnd_message.set_token('VALUE', p_user_id);
2371: hr_utility.raise_error;
2372: ELSE
2373: CLOSE lc_get_user_data;
2374: END IF;
2375: --
2381: IF nvl(p_end_date, hr_api.g_eot) >= l_user_data.start_date
2382: THEN
2383: l_end_date := p_end_date;
2384: ELSE
2385: hr_utility.set_message(800, 'HR_51070_CAU_START_END');
2386: hr_utility.raise_error;
2387: END IF;
2388: END IF;
2389: --
2382: THEN
2383: l_end_date := p_end_date;
2384: ELSE
2385: hr_utility.set_message(800, 'HR_51070_CAU_START_END');
2386: hr_utility.raise_error;
2387: END IF;
2388: END IF;
2389: --
2390: -- Validate host_port
2401: l_email_address := null ; -- Fix 2951145
2402: ELSE
2403: IF length(p_email_address) > g_max_email_address_length
2404: THEN
2405: hr_utility.set_message(800, 'HR_INVALID_EMAIL_ADDR_LENGTH');
2406: hr_utility.raise_error;
2407: ELSE
2408: l_email_address := p_email_address;
2409: END IF;
2402: ELSE
2403: IF length(p_email_address) > g_max_email_address_length
2404: THEN
2405: hr_utility.set_message(800, 'HR_INVALID_EMAIL_ADDR_LENGTH');
2406: hr_utility.raise_error;
2407: ELSE
2408: l_email_address := p_email_address;
2409: END IF;
2410: END IF;
2415: l_fax := null ; -- Fix 2951145
2416: ELSE
2417: IF length(p_fax) > g_max_fax_length
2418: THEN
2419: hr_utility.set_message(800, 'HR_INVALID_FAX_LENGTH');
2420: hr_utility.raise_error;
2421: ELSE
2422: l_fax := p_fax;
2423: END IF;
2416: ELSE
2417: IF length(p_fax) > g_max_fax_length
2418: THEN
2419: hr_utility.set_message(800, 'HR_INVALID_FAX_LENGTH');
2420: hr_utility.raise_error;
2421: ELSE
2422: l_fax := p_fax;
2423: END IF;
2424: END IF;
2441: WHERE person_id = p_employee_id;
2442:
2443: IF l_count <= 0
2444: THEN
2445: hr_utility.set_message(800, 'HR_INVALLID_EMP_ID');
2446: hr_utility.raise_error;
2447: ELSE
2448: l_employee_id := p_employee_id;
2449: END IF;
2442:
2443: IF l_count <= 0
2444: THEN
2445: hr_utility.set_message(800, 'HR_INVALLID_EMP_ID');
2446: hr_utility.raise_error;
2447: ELSE
2448: l_employee_id := p_employee_id;
2449: END IF;
2450: END IF;
2467: ELSIF (length(p_new_password) < l_count)
2468: THEN
2469: fnd_message.set_name('FND', 'PASSWORD-LONGER');
2470: fnd_message.set_token('LENGTH', to_char(l_count));
2471: hr_utility.raise_error;
2472: ELSIF (length(p_new_password) > 30)
2473: THEN
2474: hr_utility.set_message(800, 'HR_USER_PASSWORD_TOO_LONG');
2475: hr_utility.raise_error;
2470: fnd_message.set_token('LENGTH', to_char(l_count));
2471: hr_utility.raise_error;
2472: ELSIF (length(p_new_password) > 30)
2473: THEN
2474: hr_utility.set_message(800, 'HR_USER_PASSWORD_TOO_LONG');
2475: hr_utility.raise_error;
2476: ELSE
2477: l_new_password := p_new_password;
2478: END IF;
2471: hr_utility.raise_error;
2472: ELSIF (length(p_new_password) > 30)
2473: THEN
2474: hr_utility.set_message(800, 'HR_USER_PASSWORD_TOO_LONG');
2475: hr_utility.raise_error;
2476: ELSE
2477: l_new_password := p_new_password;
2478: END IF;
2479: --
2494: END IF;
2495: --
2496: -- Now, we're ready to call fnd api to update a user account.
2497: --
2498: hr_utility.set_location (l_proc || ' before fnd_user_pkg.UpdateUser', 30);
2499: --
2500: -- Fix 2288014 Start
2501:
2502: select user_name into l_user_name from fnd_user
2517: x_supplier_id => l_supplier_id
2518: );
2519:
2520: --
2521: hr_utility.set_location('Leaving:' || l_proc, 70);
2522: --
2523:
2524: EXCEPTION
2525: WHEN OTHERS THEN
2522: --
2523:
2524: EXCEPTION
2525: WHEN OTHERS THEN
2526: hr_utility.raise_error;
2527:
2528: -- Fix 2288014 End
2529:
2530: END update_fnd_user;
2596: l_resp_key fnd_responsibility.responsibility_key%type default null;
2597: l_fnd_user_resp_data lc_user_resp_row%rowtype;
2598: --
2599: BEGIN
2600: hr_utility.set_location('Entering:' || l_proc, 10);
2601: --
2602: -- Validate input parameters first. We need to validate input parameter
2603: -- again here because users can just invoke this procedure without calling
2604: -- fnd_user_acct_api first.
2615: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
2616: fnd_message.set_token('TABLE', 'FND_USER');
2617: fnd_message.set_token('COLUMN', 'USER_ID');
2618: fnd_message.set_token('VALUE', to_char(p_user_id));
2619: hr_utility.raise_error;
2620: ELSE
2621: CLOSE lc_get_user_id;
2622: END IF;
2623:
2634: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
2635: fnd_message.set_token('TABLE', 'FND_RESPONSIBILITY');
2636: fnd_message.set_token('COLUMN', 'RESPONSIBILITY_ID');
2637: fnd_message.set_token('VALUE', to_char(p_responsibility_id));
2638: hr_utility.raise_error;
2639: ELSE
2640: CLOSE lc_get_resp_id_n_key;
2641: END IF;
2642:
2653: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
2654: fnd_message.set_token('TABLE', 'FND_APPLICATION');
2655: fnd_message.set_token('COLUMN', 'APPLICATION_ID');
2656: fnd_message.set_token('VALUE', to_char(p_resp_application_id));
2657: hr_utility.raise_error;
2658: ELSE
2659: CLOSE lc_get_app_id;
2660: END IF;
2661: --
2672: --
2673: IF l_dummy > 1
2674: THEN
2675: fnd_message.set_name('FND', 'SECURITY-DUPLICATE USER RESP');
2676: hr_utility.raise_error;
2677: ELSIF l_dummy = 0 OR l_dummy IS NULL
2678: THEN
2679: CLOSE lc_unique_user_resp;
2680: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
2680: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
2681: fnd_message.set_token('TABLE', 'FND_USER_RESP_GROUPS');
2682: fnd_message.set_token('COLUMN', 'USER_ID');
2683: fnd_message.set_token('VALUE', to_char(p_user_id));
2684: hr_utility.raise_error;
2685: END IF;
2686:
2687: EXCEPTION
2688: WHEN NO_DATA_FOUND THEN
2692: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
2693: fnd_message.set_token('TABLE', 'FND_USER_RESP_GROUPS');
2694: fnd_message.set_token('COLUMN', 'USER_ID');
2695: fnd_message.set_token('VALUE', to_char(p_user_id));
2696: hr_utility.raise_error;
2697: END;
2698: --
2699: -- Bug #1341128 Fix
2700: -- Get existing fnd_user_resp_groups data
2726: THEN
2727: fnd_message.set_name('PER', 'HR_RESP_START_END_DATE');
2728: fnd_message.set_token('RESP_ID', to_char(p_responsibility_id));
2729: fnd_message.set_token('USER_ID', to_char(p_user_id));
2730: hr_utility.raise_error;
2731: END IF;
2732: END IF;
2733: --
2734: IF p_description = hr_api.g_varchar2
2740: --
2741: --
2742: -- Now call the fnd_user_resp_groups_api
2743: --
2744: hr_utility.set_location(l_proc ||
2745: ' before fnd_user_resp_groups_api.update_assignment', 30);
2746: hr_utility.set_location(l_proc || ' Passing p_user_id=' || p_user_id , 31);
2747: hr_utility.set_location(l_proc || ' Security_group_id=' || p_security_group_id ,32);
2748: --
2742: -- Now call the fnd_user_resp_groups_api
2743: --
2744: hr_utility.set_location(l_proc ||
2745: ' before fnd_user_resp_groups_api.update_assignment', 30);
2746: hr_utility.set_location(l_proc || ' Passing p_user_id=' || p_user_id , 31);
2747: hr_utility.set_location(l_proc || ' Security_group_id=' || p_security_group_id ,32);
2748: --
2749: fnd_user_resp_groups_api.update_assignment
2750: (user_id => p_user_id
2743: --
2744: hr_utility.set_location(l_proc ||
2745: ' before fnd_user_resp_groups_api.update_assignment', 30);
2746: hr_utility.set_location(l_proc || ' Passing p_user_id=' || p_user_id , 31);
2747: hr_utility.set_location(l_proc || ' Security_group_id=' || p_security_group_id ,32);
2748: --
2749: fnd_user_resp_groups_api.update_assignment
2750: (user_id => p_user_id
2751: ,responsibility_id => p_responsibility_id
2756: ,description => l_description
2757: );
2758: --
2759: --
2760: hr_utility.set_location('Leaving:'||l_proc, 50);
2761:
2762: END update_fnd_user_resp_groups;
2763: --
2764: -- ----------------------------------------------------------------------------
2819: per_sec_profile_assignments.object_version_number%type := null;
2820: l_proc varchar2(72) := g_package|| 'update_sec_profile_asg';
2821:
2822: BEGIN
2823: hr_utility.set_location('Entering:' || l_proc, 10);
2824: --
2825: IF p_sec_profile_asg_id IS NOT NULL
2826: THEN
2827: l_sec_prof_asg_id := p_sec_profile_asg_id;
2846: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
2847: fnd_message.set_token('TABLE', 'FND_USER');
2848: fnd_message.set_token('COLUMN', 'USER_ID');
2849: fnd_message.set_token('VALUE', to_char(p_user_id));
2850: hr_utility.raise_error;
2851: ELSE
2852: CLOSE lc_get_user_id;
2853: END IF;
2854: END IF;
2865: fnd_message.set_name('FND', 'SQL_NO_DATA_FOUND');
2866: fnd_message.set_token('TABLE', 'FND_RESPONSIBILITY');
2867: fnd_message.set_token('COLUMN', 'RESPONSIBILITY_ID');
2868: fnd_message.set_token('VALUE', p_responsibility_id);
2869: hr_utility.raise_error;
2870: ELSE
2871: CLOSE lc_get_resp_id;
2872: END IF;
2873: END IF;
2884: ,l_bg_id;
2885: IF lc_get_sec_profile_asg_id%NOTFOUND
2886: THEN
2887: CLOSE lc_get_sec_profile_asg_id;
2888: hr_utility.set_message(800, 'PER_52524_ASP_ASN_NOT_EXISTS');
2889: hr_utility.raise_error;
2890: ELSE
2891: CLOSE lc_get_sec_profile_asg_id;
2892: END IF;
2885: IF lc_get_sec_profile_asg_id%NOTFOUND
2886: THEN
2887: CLOSE lc_get_sec_profile_asg_id;
2888: hr_utility.set_message(800, 'PER_52524_ASP_ASN_NOT_EXISTS');
2889: hr_utility.raise_error;
2890: ELSE
2891: CLOSE lc_get_sec_profile_asg_id;
2892: END IF;
2893: END IF;
2896: IF p_start_date IS NULL AND p_sec_profile_asg_id IS NULL
2897: -- IF p_sec_profile_asg_id is not supplied, then caller must supply
2898: -- all the parameters, including p_start_date.
2899: THEN
2900: hr_utility.set_message(800, 'HR_50374_SSL_MAND_START_DATE');
2901: hr_utility.raise_error;
2902: END IF;
2903: --
2904: -- Validate End Date must be >= Start Date
2897: -- IF p_sec_profile_asg_id is not supplied, then caller must supply
2898: -- all the parameters, including p_start_date.
2899: THEN
2900: hr_utility.set_message(800, 'HR_50374_SSL_MAND_START_DATE');
2901: hr_utility.raise_error;
2902: END IF;
2903: --
2904: -- Validate End Date must be >= Start Date
2905: IF p_end_date IS NOT NULL
2908: THEN
2909: fnd_message.set_name('PER', 'HR_RESP_START_END_DATE');
2910: fnd_message.set_token('RESP_ID', to_char(p_responsibility_id));
2911: fnd_message.set_token('USER_ID', to_char(p_user_id));
2912: hr_utility.raise_error;
2913: END IF;
2914: END IF;
2915: --
2916: --
2925:
2926: );
2927:
2928: --
2929: hr_utility.set_location('Leaving:'||l_proc, 50);
2930:
2931:
2932: END update_sec_profile_asg;
2933: --