[Home] [Help]
374:
375: BEGIN
376: SELECT interface_status
377: INTO l_interface_status
378: FROM amw_constraint_interface
379: WHERE cst_interface_id = p_interface_id;
380: EXCEPTION
381: WHEN OTHERS THEN
382: v_err_msg :=
387: fnd_file.put_line (fnd_file.LOG, SUBSTR (v_err_msg, 1, 200));
388: END;
389:
390: BEGIN
391: UPDATE amw_constraint_interface
392: SET interface_status =
393: l_interface_status
394: || p_err_msg
395: || '**'
679: intf.cst_entries_function_id,
680: intf.cst_entries_resp_id,
681: intf.cst_entries_group_code, -- 09.13.2005 tsho added
682: intf.cst_violat_obj_type -- 09.13.2005 tsho added
683: FROM amw_constraint_interface intf
684: WHERE intf.cst_interface_id = (
685: SELECT min(ci.cst_interface_id)
686: FROM amw_constraint_interface ci
687: WHERE ci.cst_name = intf.cst_name
682: intf.cst_violat_obj_type -- 09.13.2005 tsho added
683: FROM amw_constraint_interface intf
684: WHERE intf.cst_interface_id = (
685: SELECT min(ci.cst_interface_id)
686: FROM amw_constraint_interface ci
687: WHERE ci.cst_name = intf.cst_name
688: --AND created_by = DECODE (p_user_id, NULL, created_by, p_user_id)
689: AND batch_id = DECODE (p_batch_id, NULL, batch_id, p_batch_id)
690: AND process_flag IS NULL
711: cst_entries_resp_id,
712: cst_entries_group_code, -- 09.13.2005 tsho added
713: cst_violat_obj_type, -- 09.13.2005 tsho added
714: cst_entries_appl_id -- 03.23.2007 dliao added
715: FROM amw_constraint_interface
716: WHERE cst_name = l_cst_name
717: --AND created_by = DECODE (p_user_id, NULL, created_by, p_user_id)
718: AND batch_id = DECODE (p_batch_id, NULL, batch_id, p_batch_id)
719: AND process_flag IS NULL
733: intf.cst_entries_function_id,
734: intf.cst_entries_resp_id,
735: intf.cst_entries_group_code, -- 09.13.2005 tsho added
736: intf.cst_violat_obj_type -- 09.13.2005 tsho added
737: FROM amw_constraint_interface intf
738: WHERE
739: --intf.created_by = DECODE (p_user_id, NULL, intf.created_by, p_user_id)
740: intf.batch_id = DECODE (p_batch_id, NULL, intf.batch_id, p_batch_id)
741: AND intf.process_flag IS NULL
747: -- bug : 6494262 : Modified the below code to upload function constraint of type all
748: -- with out any error.
749: cursor c_check_inv_func is
750: select intf.cst_interface_id, intf.cst_type_code
751: from amw_constraint_interface intf
752: where intf.batch_id=p_batch_id
753: and exists(select ci.cst_name
754: from (select cst_name,count(distinct cst_entries_function_id) as ct_cst_entries_function_id,
755: count(distinct cst_entries_group_code) as ct_cst_entries_group_code
752: where intf.batch_id=p_batch_id
753: and exists(select ci.cst_name
754: from (select cst_name,count(distinct cst_entries_function_id) as ct_cst_entries_function_id,
755: count(distinct cst_entries_group_code) as ct_cst_entries_group_code
756: from amw_constraint_interface
757: where batch_id=p_batch_id
758: and (cst_type_code='SET' or cst_type_code='ME')
759: group by cst_name) ci
760: where ((cst_type_code='ME' and ci.ct_cst_entries_function_id=1) or
767: -- bug : 6494262 : Modified the below code to upload Responsibility constraint of type all
768: -- with out any error.
769: cursor c_check_inv_resp is
770: select intf.cst_interface_id, intf.cst_type_code
771: from amw_constraint_interface intf
772: where intf.batch_id=p_batch_id
773: and exists ( select ci.cst_name
774: from (select cst_name,count(distinct cst_entries_resp_id) as ct_cst_entries_resp_id,
775: count(distinct cst_entries_group_code) as ct_cst_entries_group_code
772: where intf.batch_id=p_batch_id
773: and exists ( select ci.cst_name
774: from (select cst_name,count(distinct cst_entries_resp_id) as ct_cst_entries_resp_id,
775: count(distinct cst_entries_group_code) as ct_cst_entries_group_code
776: from amw_constraint_interface
777: where batch_id=p_batch_id
778: and (cst_type_code='RESPSET' or cst_type_code='RESPME')
779: group by cst_name) ci
780: where ((cst_type_code='RESPME' and ci.ct_cst_entries_resp_id=1) or
785:
786: /*02.27.2006 psomanat: added below cursor to raise errors for duplicate constraint*/
787: cursor c_chk_dup_csts is
788: select intf.cst_interface_id
789: from amw_constraint_interface intf
790: where intf.batch_id=p_batch_id
791: and exists (select ci.cst_name
792: from (select cst_name,count(cst_name) as count_diff_const
793: from (select distinct cst_name,cst_type_code,cst_start_date,cst_end_date
790: where intf.batch_id=p_batch_id
791: and exists (select ci.cst_name
792: from (select cst_name,count(cst_name) as count_diff_const
793: from (select distinct cst_name,cst_type_code,cst_start_date,cst_end_date
794: from amw_constraint_interface
795: where batch_id=p_batch_id)
796: group by cst_name) ci
797: where ci.count_diff_const>1
798: and intf.cst_name=ci.cst_name);
800:
801: /*04.21.2006 qliu: added below to raise errors for ambiguous IDs*/
802: cursor c_chk_ambiguous_cp is
803: select intf.cst_interface_id
804: from amw_constraint_interface intf
805: where intf.batch_id=p_batch_id
806: and intf.cst_violat_obj_type='CP'
807: and (select count(1) from fnd_concurrent_programs cp
808: where cp.concurrent_program_id = intf.cst_entries_function_id)>1;
808: where cp.concurrent_program_id = intf.cst_entries_function_id)>1;
809:
810: cursor c_chk_ambiguous_resp is
811: select intf.cst_interface_id
812: from amw_constraint_interface intf
813: where intf.batch_id=p_batch_id
814: and (select count(1) from fnd_responsibility resp
815: where resp.responsibility_id = intf.cst_entries_resp_id
816: and resp.START_DATE <= SYSDATE
1006: /*
1007: Should not upload the constraint, if any constraint entry is invalid.
1008: So set the error flag and the status.
1009: */
1010: UPDATE amw_constraint_interface
1011: SET error_flag = 'Y',
1012: interface_status = 'Please correct all the invalid incompatible'
1013: ||' Functions/Responsibilities defined for this'
1014: ||' Constraint'
1015: WHERE error_flag IS NULL
1016: AND batch_id = p_batch_id
1017: AND (process_flag IS NULL OR process_flag = 'N')
1018: AND CST_NAME IN ( SELECT DISTINCT CST_NAME
1019: FROM amw_constraint_interface
1020: WHERE error_flag = 'Y'
1021: AND batch_id = p_batch_id
1022: AND (process_flag IS NULL OR process_flag = 'N') );
1023:
1405: -- check option value to delete records from interface table or not
1406: IF UPPER (l_amw_delt_constraint_intf) <> 'Y' THEN
1407: -- don't delete records from interface table
1408: BEGIN
1409: UPDATE amw_constraint_interface
1410: SET process_flag = l_process_flag,
1411: last_update_date = SYSDATE,
1412: last_updated_by = p_user_id
1413: WHERE batch_id = p_batch_id
1420:
1421: -- delete records from interface table if no error found
1422: IF NOT v_error_found THEN
1423: BEGIN
1424: DELETE FROM amw_constraint_interface
1425: WHERE batch_id = p_batch_id
1426: AND error_flag IS NULL;
1427: EXCEPTION
1428: WHEN OTHERS THEN
1436: WHEN e_invalid_entered_by_id THEN
1437: BEGIN
1438: v_err_msg := FND_MESSAGE.GET_STRING('AMW', 'AMW_UNKNOWN_EMPLOYEE');
1439: fnd_file.put_line (fnd_file.LOG, 'Invalid entered_by_id.');
1440: UPDATE amw_constraint_interface
1441: SET error_flag = 'Y',
1442: interface_status = v_err_msg
1443: WHERE batch_id = p_batch_id;
1444: EXCEPTION