264: IF p_datatype = qa_ss_const.number_datatype THEN
265: BEGIN
266: temp_number := to_number(p_value);
267: EXCEPTION WHEN OTHERS THEN
268: fnd_message.set_name('QA','QA_INVALID_NUMBER');
269: fnd_msg_pub.add();
270: RAISE fnd_api.g_exc_error;
271: END;
272:
273: ELSIF p_datatype = qa_ss_const.date_datatype THEN
274: BEGIN
275: temp_date := qltdate.any_to_date(p_value);
276: EXCEPTION WHEN OTHERS THEN
277: fnd_message.set_name('QA','QA_INVALID_DATE');
278: fnd_msg_pub.add();
279: RAISE fnd_api.g_exc_error;
280: END;
281: END IF;
443: --
444: dummy NUMBER;
445: BEGIN
446: dummy := qa_char_indexes_pkg.disable_index(p_char_id);
447: fnd_message.set_name('QA', 'QA_CHAR_REGENERATE_INDEX');
448: fnd_message.set_token('ELEMENT_NAME',
449: qa_chars_api.get_element_name(p_char_id));
450: fnd_msg_pub.add;
451: END disable_index_private;
444: dummy NUMBER;
445: BEGIN
446: dummy := qa_char_indexes_pkg.disable_index(p_char_id);
447: fnd_message.set_name('QA', 'QA_CHAR_REGENERATE_INDEX');
448: fnd_message.set_token('ELEMENT_NAME',
449: qa_chars_api.get_element_name(p_char_id));
450: fnd_msg_pub.add;
451: END disable_index_private;
452:
738:
739: IF (item_flag = 2) THEN
740:
741: IF (lot_number_flag = 1) THEN
742: fnd_message.set_name ('QA', 'QA_DEPENDENT_LOT_ON_ITEM');
743: fnd_msg_pub.add();
744: RAISE fnd_api.g_exc_error;
745: END IF;
746:
744: RAISE fnd_api.g_exc_error;
745: END IF;
746:
747: IF (serial_number_flag = 1) THEN
748: fnd_message.set_name ('QA', 'QA_DEPENDENT_SERIAL_ON_ITEM');
749: fnd_msg_pub.add();
750: RAISE fnd_api.g_exc_error;
751: END IF;
752:
750: RAISE fnd_api.g_exc_error;
751: END IF;
752:
753: IF (wip_line_flag = 1) THEN
754: fnd_message.set_name ('QA', 'QA_DEPENDENT_WIP_LINE_ON_ITEM');
755: fnd_msg_pub.add();
756: RAISE fnd_api.g_exc_error;
757: END IF;
758:
756: RAISE fnd_api.g_exc_error;
757: END IF;
758:
759: IF (revision_flag = 1) THEN
760: fnd_message.set_name ('QA', 'QA_DEPENDENT_REV_ON_ITEM');
761: fnd_msg_pub.add();
762: RAISE fnd_api.g_exc_error;
763: END IF;
764:
762: RAISE fnd_api.g_exc_error;
763: END IF;
764:
765: IF (subinv_flag = 1) THEN
766: fnd_message.set_name ('QA', 'QA_DEPENDENT_SUBINV_ON_ITEM');
767: fnd_msg_pub.add();
768: RAISE fnd_api.g_exc_error;
769: END IF;
770:
768: RAISE fnd_api.g_exc_error;
769: END IF;
770:
771: IF (uom_flag = 1) THEN
772: fnd_message.set_name ('QA', 'QA_DEPENDENT_UOM_ON_ITEM');
773: fnd_msg_pub.add();
774: RAISE fnd_api.g_exc_error;
775: END IF;
776:
780:
781: IF (comp_item_flag = 2) THEN
782:
783: IF (comp_lot_number_flag = 1) THEN
784: fnd_message.set_name ('QA', 'QA_DEPENDENT_COMP_LOT_ITEM');
785: fnd_msg_pub.add();
786: RAISE fnd_api.g_exc_error;
787: END IF;
788:
786: RAISE fnd_api.g_exc_error;
787: END IF;
788:
789: IF (comp_serial_number_flag = 1) THEN
790: fnd_message.set_name ('QA', 'QA_DEPENDENT_COMP_SERIAL_ITEM');
791: fnd_msg_pub.add();
792: RAISE fnd_api.g_exc_error;
793: END IF;
794:
792: RAISE fnd_api.g_exc_error;
793: END IF;
794:
795: IF (comp_revision_flag = 1) THEN
796: fnd_message.set_name ('QA', 'QA_DEPENDENT_COMP_REV_ITEM');
797: fnd_msg_pub.add();
798: RAISE fnd_api.g_exc_error;
799: END IF;
800:
798: RAISE fnd_api.g_exc_error;
799: END IF;
800:
801: IF (comp_subinv_flag = 1) THEN
802: fnd_message.set_name ('QA', 'QA_DEPENDENT_COMP_SUBINV_ITEM');
803: fnd_msg_pub.add();
804: RAISE fnd_api.g_exc_error;
805: END IF;
806:
804: RAISE fnd_api.g_exc_error;
805: END IF;
806:
807: IF (comp_uom_flag = 1) THEN
808: fnd_message.set_name ('QA', 'QA_DEPENDENT_COMP_UOM_ITEM');
809: fnd_msg_pub.add();
810: RAISE fnd_api.g_exc_error;
811: END IF;
812:
817:
818: IF (job_name_flag = 2 AND wip_line_flag = 2) THEN
819:
820: IF (to_op_seq_flag = 1 OR from_op_seq_flag = 1) THEN
821: fnd_message.set_name ('QA', 'QA_DEPENDENT_OPSEQ_ON_JOB');
822: fnd_msg_pub.add();
823: RAISE fnd_api.g_exc_error;
824: END IF;
825:
840: --
841: AND (scrap_op_seq_flag = 2) THEN
842:
843: IF (to_intraop_step_flag = 1) THEN
844: fnd_message.set_name ('QA', 'QA_DEPENDENT_INTRAOP_ON_OPSEQ');
845: fnd_msg_pub.add();
846: RAISE fnd_api.g_exc_error;
847: END IF;
848:
860: --
861: AND (scrap_op_seq_flag = 2) THEN
862:
863: IF (from_intraop_step_flag = 1) THEN
864: fnd_message.set_name ('QA', 'QA_DEPENDENT_INTRAOP_ON_OPSEQ');
865: fnd_msg_pub.add();
866: RAISE fnd_api.g_exc_error;
867: END IF;
868:
873:
874: IF (subinv_flag = 2) THEN
875:
876: IF (locator_flag = 1) THEN
877: fnd_message.set_name ('QA', 'QA_DEPENDENT_LOCATOR_ON_SUB');
878: fnd_msg_pub.add();
879: RAISE fnd_api.g_exc_error;
880: END IF;
881:
885:
886: IF (comp_subinv_flag = 2) THEN
887:
888: IF (comp_locator_flag = 1) THEN
889: fnd_message.set_name ('QA', 'QA_DEPENDENT_COMP_LOCATOR_SUB');
890: fnd_msg_pub.add();
891: RAISE fnd_api.g_exc_error;
892: END IF;
893:
898:
899: IF (po_number_flag = 2) THEN
900:
901: IF (po_line_flag = 1) THEN
902: fnd_message.set_name ('QA', 'QA_DEPENDENT_PO_LINE_ON_HEADER');
903: fnd_msg_pub.add();
904: RAISE fnd_api.g_exc_error;
905: END IF;
906:
904: RAISE fnd_api.g_exc_error;
905: END IF;
906:
907: IF (po_rel_number_flag = 1) THEN
908: fnd_message.set_name ('QA', 'QA_DEPENDENT_PO_REL_ON_HEADER');
909: fnd_msg_pub.add();
910: RAISE fnd_api.g_exc_error;
911: END IF;
912:
917:
918: IF (so_number_flag = 2) THEN
919:
920: IF (so_line_flag = 1) THEN
921: fnd_message.set_name ('QA', 'QA_DEPENDENT_SO_LINE_ON_HEADER');
922: fnd_msg_pub.add();
923: RAISE fnd_api.g_exc_error;
924: END IF;
925:
927:
928: IF (project_num_flag = 2) THEN
929:
930: IF (task_num_flag = 1) THEN
931: fnd_message.set_name ('QA', 'QA_PROJECT_TASK_DEPEND');
932: fnd_msg_pub.add();
933: RAISE fnd_api.g_exc_error;
934: END IF;
935:
938: -- R12 OPM Deviations. Bug 4345503 Start
939:
940: IF (process_resource_flag = 2) THEN
941: IF (process_parameter_flag = 1) THEN
942: fnd_message.set_name ('QA', 'QA_DEPENDENT_PLAN_CHARS');
943: fnd_message.set_token('CHILD_ELEMENT',
944: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_parameter));
945: fnd_message.set_token('ELEMENT_LIST',
946: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batch_num));
939:
940: IF (process_resource_flag = 2) THEN
941: IF (process_parameter_flag = 1) THEN
942: fnd_message.set_name ('QA', 'QA_DEPENDENT_PLAN_CHARS');
943: fnd_message.set_token('CHILD_ELEMENT',
944: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_parameter));
945: fnd_message.set_token('ELEMENT_LIST',
946: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batch_num));
947: fnd_msg_pub.add();
941: IF (process_parameter_flag = 1) THEN
942: fnd_message.set_name ('QA', 'QA_DEPENDENT_PLAN_CHARS');
943: fnd_message.set_token('CHILD_ELEMENT',
944: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_parameter));
945: fnd_message.set_token('ELEMENT_LIST',
946: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batch_num));
947: fnd_msg_pub.add();
948: RAISE fnd_api.g_exc_error;
949: END IF;
950: END IF;
951:
952: IF (process_activity_flag = 2) THEN
953: IF (process_resource_flag = 1) THEN
954: fnd_message.set_name ('QA', 'QA_DEPENDENT_PLAN_CHARS');
955: fnd_message.set_token('CHILD_ELEMENT',
956: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_resource));
957: fnd_message.set_token('ELEMENT_LIST',
958: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batch_num));
951:
952: IF (process_activity_flag = 2) THEN
953: IF (process_resource_flag = 1) THEN
954: fnd_message.set_name ('QA', 'QA_DEPENDENT_PLAN_CHARS');
955: fnd_message.set_token('CHILD_ELEMENT',
956: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_resource));
957: fnd_message.set_token('ELEMENT_LIST',
958: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batch_num));
959: fnd_msg_pub.add();
953: IF (process_resource_flag = 1) THEN
954: fnd_message.set_name ('QA', 'QA_DEPENDENT_PLAN_CHARS');
955: fnd_message.set_token('CHILD_ELEMENT',
956: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_resource));
957: fnd_message.set_token('ELEMENT_LIST',
958: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batch_num));
959: fnd_msg_pub.add();
960: RAISE fnd_api.g_exc_error;
961: END IF;
962: END IF;
963:
964: IF (process_batchstep_num_flag = 2) THEN
965: IF (process_activity_flag = 1) THEN
966: fnd_message.set_name ('QA', 'QA_DEPENDENT_PLAN_CHARS');
967: fnd_message.set_token('CHILD_ELEMENT',
968: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_activity));
969: fnd_message.set_token('ELEMENT_LIST',
970: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batch_num));
963:
964: IF (process_batchstep_num_flag = 2) THEN
965: IF (process_activity_flag = 1) THEN
966: fnd_message.set_name ('QA', 'QA_DEPENDENT_PLAN_CHARS');
967: fnd_message.set_token('CHILD_ELEMENT',
968: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_activity));
969: fnd_message.set_token('ELEMENT_LIST',
970: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batch_num));
971: fnd_msg_pub.add();
965: IF (process_activity_flag = 1) THEN
966: fnd_message.set_name ('QA', 'QA_DEPENDENT_PLAN_CHARS');
967: fnd_message.set_token('CHILD_ELEMENT',
968: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_activity));
969: fnd_message.set_token('ELEMENT_LIST',
970: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batch_num));
971: fnd_msg_pub.add();
972: RAISE fnd_api.g_exc_error;
973: END IF;
974: END IF;
975:
976: IF (process_batchstep_num_flag = 2) THEN
977: IF (process_operation_flag = 1) THEN
978: fnd_message.set_name ('QA', 'QA_DEPENDENT_PLAN_CHARS');
979: fnd_message.set_token('CHILD_ELEMENT',
980: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_operation));
981: fnd_message.set_token('ELEMENT_LIST',
982: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batch_num));
975:
976: IF (process_batchstep_num_flag = 2) THEN
977: IF (process_operation_flag = 1) THEN
978: fnd_message.set_name ('QA', 'QA_DEPENDENT_PLAN_CHARS');
979: fnd_message.set_token('CHILD_ELEMENT',
980: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_operation));
981: fnd_message.set_token('ELEMENT_LIST',
982: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batch_num));
983: fnd_msg_pub.add();
977: IF (process_operation_flag = 1) THEN
978: fnd_message.set_name ('QA', 'QA_DEPENDENT_PLAN_CHARS');
979: fnd_message.set_token('CHILD_ELEMENT',
980: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_operation));
981: fnd_message.set_token('ELEMENT_LIST',
982: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batch_num));
983: fnd_msg_pub.add();
984: RAISE fnd_api.g_exc_error;
985: END IF;
986: END IF;
987:
988: IF (process_batch_num_flag = 2) THEN
989: IF (process_batchstep_num_flag = 1) THEN
990: fnd_message.set_name ('QA', 'QA_DEPENDENT_PLAN_CHARS');
991: fnd_message.set_token('CHILD_ELEMENT',
992: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batchstep_num));
993: fnd_message.set_token('ELEMENT_LIST',
994: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batch_num));
987:
988: IF (process_batch_num_flag = 2) THEN
989: IF (process_batchstep_num_flag = 1) THEN
990: fnd_message.set_name ('QA', 'QA_DEPENDENT_PLAN_CHARS');
991: fnd_message.set_token('CHILD_ELEMENT',
992: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batchstep_num));
993: fnd_message.set_token('ELEMENT_LIST',
994: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batch_num));
995: fnd_msg_pub.add();
989: IF (process_batchstep_num_flag = 1) THEN
990: fnd_message.set_name ('QA', 'QA_DEPENDENT_PLAN_CHARS');
991: fnd_message.set_token('CHILD_ELEMENT',
992: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batchstep_num));
993: fnd_message.set_token('ELEMENT_LIST',
994: qa_plan_element_api.get_prompt(p_plan_id, qa_ss_const.process_batch_num));
995: fnd_msg_pub.add();
996: RAISE fnd_api.g_exc_error;
997: END IF;
1009:
1010: l_request_id NUMBER;
1011: BEGIN
1012: IF NOT mandatory_element_exists(p_plan_id) THEN
1013: fnd_message.set_name('QA', 'QA_QPLAN_MUST_HAVE_CHARS');
1014: fnd_msg_pub.add();
1015: RAISE fnd_api.g_exc_error;
1016: END IF;
1017:
1232: FOR pc IN c LOOP
1233:
1234: IF pc.result_column_name LIKE 'CHARACTER%' THEN
1235: IF l_char_sequence > g_max_char_columns THEN
1236: fnd_message.set_name('QA', 'QA_EXCEEDED_COLUMN_COUNT');
1237: fnd_msg_pub.add();
1238: raise fnd_api.g_exc_error;
1239: END IF;
1240: l_result_column := 'CHARACTER' || l_char_sequence;
1487: --
1488: result_column_names(i) := suggest_result_column(p_copy_to_plan_id,
1489: char_ids(i));
1490: IF result_column_names(i) IS NULL THEN
1491: fnd_message.set_name('QA', 'QA_EXCEEDED_COLUMN_COUNT');
1492: fnd_msg_pub.add();
1493: raise fnd_api.g_exc_error;
1494: END IF;
1495: mark_result_column(result_column_names(i));
2543: init_result_column_array(-1);
2544:
2545: l_user_id := get_user_id(p_user_name);
2546: IF l_user_id = -1 THEN
2547: fnd_message.set_name('QA', 'QA_API_INVALID_USER');
2548: fnd_msg_pub.add();
2549: raise fnd_api.g_exc_error;
2550: END IF;
2551:
2550: END IF;
2551:
2552: l_plan_name := upper(p_plan_name);
2553: IF (illegal_chars(l_plan_name)) THEN
2554: fnd_message.set_name('QA', 'QA_NAME_SPECIAL_CHARS');
2555: fnd_msg_pub.add();
2556: raise fnd_api.g_exc_error;
2557: END IF;
2558:
2557: END IF;
2558:
2559: l_org_id := qa_plans_api.get_org_id(p_organization_code);
2560: IF (l_org_id IS NULL) THEN
2561: fnd_message.set_name('QA', 'QA_API_INVALID_ORG_CODE');
2562: fnd_msg_pub.add();
2563: raise fnd_api.g_exc_error;
2564: END IF;
2565:
2563: raise fnd_api.g_exc_error;
2564: END IF;
2565:
2566: IF NOT valid_plan_type(p_plan_type) THEN
2567: fnd_message.set_name('QA', 'QA_API_INVALID_PLAN_TYPE');
2568: fnd_msg_pub.add();
2569: raise fnd_api.g_exc_error;
2570: ELSE
2571: l_plan_type_code := get_plan_type_code(p_plan_type);
2575: -- If the name passed as the plan name already exists then
2576: -- generate an error.
2577:
2578: IF plan_exists(l_plan_name) > 0 THEN
2579: fnd_message.set_name('QA', 'QA_PLAN_RECORD_EXISTS');
2580: fnd_msg_pub.add();
2581: raise fnd_api.g_exc_error;
2582: END IF;
2583:
2581: raise fnd_api.g_exc_error;
2582: END IF;
2583:
2584: IF (p_effective_to < p_effective_from) THEN
2585: fnd_message.set_name('QA', 'QA_EFFECTIVE_DATE_RANGE');
2586: fnd_msg_pub.add();
2587: raise fnd_api.g_exc_error;
2588: END IF;
2589:
2749: -- *** start of logic ***
2750:
2751: l_user_id := get_user_id(p_user_name);
2752: IF l_user_id = -1 THEN
2753: fnd_message.set_name('QA', 'QA_API_INVALID_USER');
2754: fnd_msg_pub.add();
2755: raise fnd_api.g_exc_error;
2756: END IF;
2757:
2756: END IF;
2757:
2758: l_plan_id := qa_plans_api.plan_id(upper(p_plan_name));
2759: IF (l_plan_id IS NULL) THEN
2760: fnd_message.set_name('QA', 'QA_API_INVALID_PLAN');
2761: fnd_msg_pub.add();
2762: raise fnd_api.g_exc_error;
2763: END IF;
2764:
2763: END IF;
2764:
2765: l_char_id := qa_chars_api.get_element_id(p_element_name);
2766: IF (l_char_id IS NULL) THEN
2767: fnd_message.set_name('QA', 'QA_API_INVALID_ELEMENT');
2768: fnd_msg_pub.add();
2769: raise fnd_api.g_exc_error;
2770: END IF;
2771:
2769: raise fnd_api.g_exc_error;
2770: END IF;
2771:
2772: IF element_exists(l_plan_id, l_char_id) THEN
2773: fnd_message.set_name('QA', 'QA_API_ELEMENT_ALREADY_ADDED');
2774: fnd_msg_pub.add();
2775: raise fnd_api.g_exc_error;
2776: END IF;
2777:
2803: IF p_prompt_sequence IS NULL THEN
2804: l_prompt_sequence := get_next_sequence(l_plan_id);
2805: ELSE
2806: IF prompt_sequence_exists(l_plan_id, p_prompt_sequence) THEN
2807: fnd_message.set_name('QA', 'QA_API_INVALID_PROMPT_SEQUENCE');
2808: fnd_msg_pub.add();
2809: RAISE fnd_api.g_exc_error;
2810: END IF;
2811: l_prompt_sequence := p_prompt_sequence;
2839: l_result_column_name := suggest_result_column(l_plan_id, l_char_id);
2840: END IF;
2841:
2842: IF l_result_column_name IS NULL THEN
2843: fnd_message.set_name('QA', 'QA_EXCEEDED_COLUMN_COUNT');
2844: fnd_msg_pub.add();
2845: raise fnd_api.g_exc_error;
2846: END IF;
2847: ELSE
2864: l_override_flag := convert_flag(p_override_flag);
2865:
2866: IF FND_PROFILE.VALUE('WIP_MES_OPS_FLAG') <> 1
2867: AND (p_device_flag IS NOT NULL AND p_override_flag IS NOT NULL OR p_device_name IS NOT NULL OR p_sensor_alias IS NOT NULL) THEN
2868: fnd_message.set_name('WIP', 'WIP_WS_NO_LICENSE');
2869: fnd_msg_pub.add();
2870: raise fnd_api.g_exc_error;
2871: END IF;
2872:
2870: raise fnd_api.g_exc_error;
2871: END IF;
2872:
2873: IF l_device_flag = 2 AND (l_override_flag = 1 OR p_device_name IS NOT NULL OR p_sensor_alias IS NOT NULL) THEN
2874: fnd_message.set_name('QA', 'QA_API_INVALID_DEVICE_FLAG');
2875: fnd_msg_pub.add();
2876: raise fnd_api.g_exc_error;
2877: END IF;
2878:
2876: raise fnd_api.g_exc_error;
2877: END IF;
2878:
2879: IF l_device_flag = 1 AND (p_device_name IS NULL OR p_sensor_alias IS NULL) THEN
2880: fnd_message.set_name('QA', 'QA_API_INVALID_DEVICE_NAME');
2881: fnd_msg_pub.add();
2882: raise fnd_api.g_exc_error;
2883: END IF;
2884:
2885: IF l_device_flag = 1 AND p_device_name IS NOT NULL AND p_sensor_alias IS NOT NULL THEN
2886: get_device_details(trim(p_device_name), trim(p_sensor_alias), x_device_id, x_override_flag);
2887:
2888: IF (x_device_id IS NULL) THEN
2889: fnd_message.set_name('QA', 'QA_API_INVALID_DEVICE_DETAILS');
2890: fnd_msg_pub.add();
2891: raise fnd_api.g_exc_error;
2892: END IF;
2893: END IF;
3021: -- *** start of logic ***
3022:
3023: l_user_id := get_user_id(p_user_name);
3024: IF l_user_id = -1 THEN
3025: fnd_message.set_name('QA', 'QA_API_INVALID_USER');
3026: fnd_msg_pub.add();
3027: raise fnd_api.g_exc_error;
3028: END IF;
3029:
3029:
3030: l_plan_name := upper(p_plan_name);
3031: l_plan_id := qa_plans_api.plan_id(l_plan_name);
3032: IF (l_plan_id IS NULL) THEN
3033: fnd_message.set_name('QA', 'QA_API_INVALID_PLAN');
3034: fnd_msg_pub.add();
3035: raise fnd_api.g_exc_error;
3036: END IF;
3037:
3129: -- *** start of logic ***
3130:
3131: l_user_id := get_user_id(p_user_name);
3132: IF l_user_id = -1 THEN
3133: fnd_message.set_name('QA', 'QA_API_INVALID_USER');
3134: fnd_msg_pub.add();
3135: raise fnd_api.g_exc_error;
3136: END IF;
3137:
3143: l_from_plan_id := qa_plans_api.plan_id(p_plan_name);
3144: IF (l_from_plan_id IS NULL) THEN
3145: l_from_plan_id := qa_plans_api.plan_id(upper(p_plan_name));
3146: IF (l_from_plan_id IS NULL) THEN
3147: fnd_message.set_name('QA', 'QA_API_INVALID_PLAN');
3148: fnd_msg_pub.add();
3149: raise fnd_api.g_exc_error;
3150: END IF;
3151: END IF;
3151: END IF;
3152:
3153: l_to_plan_name := upper(p_to_plan_name);
3154: IF (illegal_chars(l_to_plan_name)) THEN
3155: fnd_message.set_name('QA', 'QA_NAME_SPECIAL_CHARS');
3156: fnd_msg_pub.add();
3157: raise fnd_api.g_exc_error;
3158: END IF;
3159:
3158: END IF;
3159:
3160: l_to_org_id := qa_plans_api.get_org_id(p_to_organization_code);
3161: IF (l_to_org_id IS NULL) THEN
3162: fnd_message.set_name('QA', 'QA_API_INVALID_ORG_CODE');
3163: fnd_msg_pub.add();
3164: raise fnd_api.g_exc_error;
3165: END IF;
3166:
3288: -- *** start of logic ***
3289:
3290: l_user_id := get_user_id(p_user_name);
3291: IF l_user_id = -1 THEN
3292: fnd_message.set_name('QA', 'QA_API_INVALID_USER');
3293: fnd_msg_pub.add();
3294: raise fnd_api.g_exc_error;
3295: END IF;
3296:
3296:
3297: l_plan_name := upper(p_plan_name);
3298: l_plan_id := qa_plans_api.plan_id(l_plan_name);
3299: IF (l_plan_id IS NULL) THEN
3300: fnd_message.set_name('QA', 'QA_API_INVALID_PLAN');
3301: fnd_msg_pub.add();
3302: RAISE fnd_api.g_exc_error;
3303: END IF;
3304:
3303: END IF;
3304:
3305: l_element_id := qa_chars_api.get_element_id(p_element_name);
3306: IF (l_element_id IS NULL) THEN
3307: fnd_message.set_name('QA', 'QA_API_INVALID_ELEMENT');
3308: fnd_msg_pub.add();
3309: RAISE fnd_api.g_exc_error;
3310: END IF;
3311:
3309: RAISE fnd_api.g_exc_error;
3310: END IF;
3311:
3312: IF NOT element_exists(l_plan_id, l_element_id) THEN
3313: fnd_message.set_name('QA', 'QA_API_ELEMENT_NOT_IN_PLAN');
3314: fnd_msg_pub.add();
3315: RAISE fnd_api.g_exc_error;
3316: END IF;
3317:
3315: RAISE fnd_api.g_exc_error;
3316: END IF;
3317:
3318: IF results_exist(l_plan_id, l_element_id) THEN
3319: fnd_message.set_name('QA', 'QA_RESULTS_EXIST_FOR_PLANCHAR');
3320: fnd_msg_pub.add();
3321: RAISE fnd_api.g_exc_error;
3322: END IF;
3323:
3408: -- *** start of logic ***
3409:
3410: l_user_id := get_user_id(p_user_name);
3411: IF l_user_id = -1 THEN
3412: fnd_message.set_name('QA', 'QA_API_INVALID_USER');
3413: fnd_msg_pub.add();
3414: raise fnd_api.g_exc_error;
3415: END IF;
3416:
3416:
3417: l_plan_name := upper(p_plan_name);
3418: l_plan_id := qa_plans_api.plan_id(l_plan_name);
3419: IF l_plan_id IS NULL THEN
3420: fnd_message.set_name('QA', 'QA_API_INVALID_PLAN');
3421: fnd_msg_pub.add();
3422: raise fnd_api.g_exc_error;
3423: END IF;
3424:
3422: raise fnd_api.g_exc_error;
3423: END IF;
3424:
3425: IF results_exist(l_plan_id) THEN
3426: fnd_message.set_name('QA', 'QA_CANT_DELETE_QPLAN');
3427: fnd_msg_pub.add();
3428: RAISE fnd_api.g_exc_error;
3429: END IF;
3430: