145:
146: l_api_name constant varchar2(30) := 'update_row_calculated_values';
147:
148: l_module varchar2(200);
149: l_log_level CONSTANT NUMBER := fnd_log.g_current_runtime_level;
150: l_uLog CONSTANT BOOLEAN := fnd_log.level_unexpected >= l_log_level;
151: l_pLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_procedure >= l_log_level;
152: l_sLog CONSTANT BOOLEAN := l_pLog AND fnd_log.level_statement >= l_log_level;
153:
146: l_api_name constant varchar2(30) := 'update_row_calculated_values';
147:
148: l_module varchar2(200);
149: l_log_level CONSTANT NUMBER := fnd_log.g_current_runtime_level;
150: l_uLog CONSTANT BOOLEAN := fnd_log.level_unexpected >= l_log_level;
151: l_pLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_procedure >= l_log_level;
152: l_sLog CONSTANT BOOLEAN := l_pLog AND fnd_log.level_statement >= l_log_level;
153:
154: begin
147:
148: l_module varchar2(200);
149: l_log_level CONSTANT NUMBER := fnd_log.g_current_runtime_level;
150: l_uLog CONSTANT BOOLEAN := fnd_log.level_unexpected >= l_log_level;
151: l_pLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_procedure >= l_log_level;
152: l_sLog CONSTANT BOOLEAN := l_pLog AND fnd_log.level_statement >= l_log_level;
153:
154: begin
155:
148: l_module varchar2(200);
149: l_log_level CONSTANT NUMBER := fnd_log.g_current_runtime_level;
150: l_uLog CONSTANT BOOLEAN := fnd_log.level_unexpected >= l_log_level;
151: l_pLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_procedure >= l_log_level;
152: l_sLog CONSTANT BOOLEAN := l_pLog AND fnd_log.level_statement >= l_log_level;
153:
154: begin
155:
156: if (l_ulog) then
157: l_module := 'eam.plsql.'||g_pkg_name|| '.' || l_api_name;
158: end if;
159:
160: if (l_slog) then
161: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
162: 'Updating interface table with calculated values');
163: end if;
164:
165: update mtl_eam_asset_num_interface set
214:
215: l_api_name CONSTANT VARCHAR2(30) := 'pn_genealogy_change';
216:
217: l_module varchar2(200);
218: l_log_level CONSTANT NUMBER := fnd_log.g_current_runtime_level;
219: l_uLog CONSTANT BOOLEAN := fnd_log.level_unexpected >= l_log_level;
220: l_eLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_error >= l_log_level;
221: l_pLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_procedure >= l_log_level;
222: l_sLog CONSTANT BOOLEAN := l_pLog AND fnd_log.level_statement >= l_log_level;
215: l_api_name CONSTANT VARCHAR2(30) := 'pn_genealogy_change';
216:
217: l_module varchar2(200);
218: l_log_level CONSTANT NUMBER := fnd_log.g_current_runtime_level;
219: l_uLog CONSTANT BOOLEAN := fnd_log.level_unexpected >= l_log_level;
220: l_eLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_error >= l_log_level;
221: l_pLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_procedure >= l_log_level;
222: l_sLog CONSTANT BOOLEAN := l_pLog AND fnd_log.level_statement >= l_log_level;
223:
216:
217: l_module varchar2(200);
218: l_log_level CONSTANT NUMBER := fnd_log.g_current_runtime_level;
219: l_uLog CONSTANT BOOLEAN := fnd_log.level_unexpected >= l_log_level;
220: l_eLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_error >= l_log_level;
221: l_pLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_procedure >= l_log_level;
222: l_sLog CONSTANT BOOLEAN := l_pLog AND fnd_log.level_statement >= l_log_level;
223:
224: begin
217: l_module varchar2(200);
218: l_log_level CONSTANT NUMBER := fnd_log.g_current_runtime_level;
219: l_uLog CONSTANT BOOLEAN := fnd_log.level_unexpected >= l_log_level;
220: l_eLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_error >= l_log_level;
221: l_pLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_procedure >= l_log_level;
222: l_sLog CONSTANT BOOLEAN := l_pLog AND fnd_log.level_statement >= l_log_level;
223:
224: begin
225: if (l_ulog) then
218: l_log_level CONSTANT NUMBER := fnd_log.g_current_runtime_level;
219: l_uLog CONSTANT BOOLEAN := fnd_log.level_unexpected >= l_log_level;
220: l_eLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_error >= l_log_level;
221: l_pLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_procedure >= l_log_level;
222: l_sLog CONSTANT BOOLEAN := l_pLog AND fnd_log.level_statement >= l_log_level;
223:
224: begin
225: if (l_ulog) then
226: l_module := 'eam.plsql.'||g_pkg_name|| '.' || l_api_name;
513: l_x_moi_msg_count NUMBER;
514: l_x_moi_msg_data VARCHAR2(20000);
515:
516: l_module varchar2(200);
517: l_log_level CONSTANT NUMBER := fnd_log.g_current_runtime_level;
518: l_uLog CONSTANT BOOLEAN := fnd_log.level_unexpected >= l_log_level;
519: l_exLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_exception >= l_log_level;
520: l_eLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_error >= l_log_level;
521: l_pLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_procedure >= l_log_level;
514: l_x_moi_msg_data VARCHAR2(20000);
515:
516: l_module varchar2(200);
517: l_log_level CONSTANT NUMBER := fnd_log.g_current_runtime_level;
518: l_uLog CONSTANT BOOLEAN := fnd_log.level_unexpected >= l_log_level;
519: l_exLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_exception >= l_log_level;
520: l_eLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_error >= l_log_level;
521: l_pLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_procedure >= l_log_level;
522: l_sLog CONSTANT BOOLEAN := l_pLog AND fnd_log.level_statement >= l_log_level;
515:
516: l_module varchar2(200);
517: l_log_level CONSTANT NUMBER := fnd_log.g_current_runtime_level;
518: l_uLog CONSTANT BOOLEAN := fnd_log.level_unexpected >= l_log_level;
519: l_exLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_exception >= l_log_level;
520: l_eLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_error >= l_log_level;
521: l_pLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_procedure >= l_log_level;
522: l_sLog CONSTANT BOOLEAN := l_pLog AND fnd_log.level_statement >= l_log_level;
523:
516: l_module varchar2(200);
517: l_log_level CONSTANT NUMBER := fnd_log.g_current_runtime_level;
518: l_uLog CONSTANT BOOLEAN := fnd_log.level_unexpected >= l_log_level;
519: l_exLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_exception >= l_log_level;
520: l_eLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_error >= l_log_level;
521: l_pLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_procedure >= l_log_level;
522: l_sLog CONSTANT BOOLEAN := l_pLog AND fnd_log.level_statement >= l_log_level;
523:
524: CURSOR asset_num_cur IS
517: l_log_level CONSTANT NUMBER := fnd_log.g_current_runtime_level;
518: l_uLog CONSTANT BOOLEAN := fnd_log.level_unexpected >= l_log_level;
519: l_exLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_exception >= l_log_level;
520: l_eLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_error >= l_log_level;
521: l_pLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_procedure >= l_log_level;
522: l_sLog CONSTANT BOOLEAN := l_pLog AND fnd_log.level_statement >= l_log_level;
523:
524: CURSOR asset_num_cur IS
525: SELECT *
518: l_uLog CONSTANT BOOLEAN := fnd_log.level_unexpected >= l_log_level;
519: l_exLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_exception >= l_log_level;
520: l_eLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_error >= l_log_level;
521: l_pLog CONSTANT BOOLEAN := l_uLog AND fnd_log.level_procedure >= l_log_level;
522: l_sLog CONSTANT BOOLEAN := l_pLog AND fnd_log.level_statement >= l_log_level;
523:
524: CURSOR asset_num_cur IS
525: SELECT *
526: FROM MTL_EAM_ASSET_NUM_INTERFACE
542: l_module := 'eam.plsql.'|| l_full_name;
543: end if;
544:
545: if (l_plog) then
546: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE, l_module,
547: 'Entering ' || l_full_name);
548: end if;
549:
550:
567: l_error_code := 9999;
568: l_error_message := 'Unknown Exception';
569:
570: if (l_slog) then
571: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,'');
572:
573: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
574: 'Start Worker for Asset Import. Time now is ' ||
575: to_char(sysdate, 'Month DD, YYYY HH24:MI:SS'));
569:
570: if (l_slog) then
571: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,'');
572:
573: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
574: 'Start Worker for Asset Import. Time now is ' ||
575: to_char(sysdate, 'Month DD, YYYY HH24:MI:SS'));
576:
577: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,'');
573: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
574: 'Start Worker for Asset Import. Time now is ' ||
575: to_char(sysdate, 'Month DD, YYYY HH24:MI:SS'));
576:
577: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,'');
578: end if;
579:
580:
581:
578: end if;
579:
580:
581:
582: if (l_slog) then FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
583: 'Processing interface group ' || p_interface_group_id ||
584: ' with purge option ' || p_purge_option);
585: end if;
586:
587: --store the category set id for eAM for use in every loop
588: -- 2002-01-08: chrng: Use category_set_id directly, see bug 2175340.
589: l_category_set_id := 1000000014;
590:
591: if (l_slog) then FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
592: 'Opening cursor for records in interface table');
593: end if;
594:
595: open asset_num_cur;
598: SAVEPOINT LOOP_START;
599:
600:
601: if (l_slog) then
602: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
603: '___________________________________________________________');
604: end if;
605:
606: FETCH asset_num_cur INTO asset_rec;
607: EXIT WHEN asset_num_cur%NOTFOUND;
608:
609:
610: if (l_slog) then
611: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
612: 'Processing Record with HEADER ID: '|| asset_rec.interface_header_id);
613:
614: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
615: ' for ORGANIZATION (Id/Code): ' ||
610: if (l_slog) then
611: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
612: 'Processing Record with HEADER ID: '|| asset_rec.interface_header_id);
613:
614: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
615: ' for ORGANIZATION (Id/Code): ' ||
616: asset_rec.current_organization_id || '/' || asset_rec.organization_code ||
617: ', ITEM ID: ' || asset_rec.inventory_item_id ||
618: ', SERIAL: ' || asset_rec.serial_number);
619: end if;
620:
621:
622: if (l_slog) then
623: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
624: 'Record will be processed with SCOPE: '
625: || asset_rec.import_scope || ', MODE: ' || asset_rec.import_mode);
626: end if;
627:
691: --if mode = 0, create row
692: IF asset_rec.import_mode = 0 THEN
693:
694: if (l_slog) then
695: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
696: 'Now inserting asset...');
697: end if;
698:
699: if asset_rec.pn_location_id is not null then
744: || l_return_status || ' and message: ' || l_data;
745:
746:
747: if (l_elog) then
748: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,l_error_message);
749: end if;
750:
751: RAISE NO_DATA_FOUND;
752: ELSE
750:
751: RAISE NO_DATA_FOUND;
752: ELSE
753: if (l_slog) then
754: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
755: 'Asset was inserted.');
756: end if;
757: END IF;
758:
786: -- if mode = 1 update record
787: IF asset_rec.import_mode = 1 THEN
788:
789: if (l_slog) then
790: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
791: 'Now updating asset with ROWID: ' || l_serial_rowid || '...');
792: end if;
793:
794: -- 2002-01-16: chrng: Fixed bug 2185999.
865: l_error_message := 'Asset update failed with return status: '
866: || l_return_status || ' and message: ' || l_data;
867:
868: if (l_elog) then
869: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,l_error_message);
870: end if;
871:
872: RAISE NO_DATA_FOUND;
873: ELSE
871:
872: RAISE NO_DATA_FOUND;
873: ELSE
874: if (l_slog) then
875: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
876: 'Asset was updated');
877: end if;
878:
879: END IF;
887: --Import Asset Extensible attributes
888: IF (asset_rec.import_scope <> 1) THEN
889:
890: if (l_slog) then
891: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
892: 'Now importing Attributes...');
893: end if;
894:
895: EAM_ASSET_ATTR_IMPORT_PVT.import_asset_attr_values(
908:
909: l_error_message := 'Failed because Extensible Attributes import failed';
910:
911: if (l_elog) then
912: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,l_error_message);
913: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,'Import attribute return status= ' || l_return_status);
914: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,'Import attribute msg count= ' || l_count);
915: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,'Import attribute msg data = ' || l_data);
916: end if;
909: l_error_message := 'Failed because Extensible Attributes import failed';
910:
911: if (l_elog) then
912: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,l_error_message);
913: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,'Import attribute return status= ' || l_return_status);
914: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,'Import attribute msg count= ' || l_count);
915: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,'Import attribute msg data = ' || l_data);
916: end if;
917:
910:
911: if (l_elog) then
912: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,l_error_message);
913: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,'Import attribute return status= ' || l_return_status);
914: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,'Import attribute msg count= ' || l_count);
915: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,'Import attribute msg data = ' || l_data);
916: end if;
917:
918: RAISE attr_import_failed;
911: if (l_elog) then
912: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,l_error_message);
913: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,'Import attribute return status= ' || l_return_status);
914: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,'Import attribute msg count= ' || l_count);
915: FND_LOG.STRING(FND_LOG.LEVEL_ERROR, l_module,'Import attribute msg data = ' || l_data);
916: end if;
917:
918: RAISE attr_import_failed;
919:
919:
920: ELSE
921:
922: if (l_slog) then
923: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
924: 'Attributes were imported.');
925: end if;
926:
927: END IF;
934: WHERE interface_header_id = asset_rec.interface_header_id;
935: COMMIT;
936:
937: if (l_slog) then
938: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, l_module,
939: 'Transaction Commited.');
940: end if;
941:
942: --end validations if scope =0 or 1
967: BEGIN
968:
969:
970: if (l_exlog) then
971: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION, l_module,
972: 'ERROR: ' || l_error_code || ' - ' || l_error_message);
973: end if;
974:
975: -- Save the error messages and other calculated columns in the MEAVI table
981: ROLLBACK to LOOP_START;
982:
983:
984: if (l_exlog) then
985: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION, l_module,
986: 'After attr import failed: Transaction Rolled back to LOOP_START.');
987: end if;
988:
989: -- Update MEAVI with error messages
1018: COMMIT;
1019:
1020:
1021: if (l_exlog) then
1022: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION, l_module,
1023: 'After attr import failed: Transaction Commited');
1024: end if;
1025:
1026: END;
1027:
1028: WHEN NO_DATA_FOUND or no_rows_updated THEN
1029:
1030: if (l_exlog) then
1031: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION, l_module,
1032: 'ERROR: ' || l_error_code || ' - ' || l_error_message);
1033: end if;
1034:
1035: ROLLBACK to LOOP_START;
1034:
1035: ROLLBACK to LOOP_START;
1036:
1037: if (l_exlog) then
1038: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION, l_module,
1039: 'Transaction Rolled back to LOOP_START.');
1040: end if;
1041:
1042: update_row_error(l_error_code, l_error_message, asset_rec);
1045: end if;
1046: COMMIT;
1047:
1048: if (l_exlog) then
1049: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION, l_module,
1050: 'Transaction Commited.');
1051: end if;
1052:
1053: -- pn integration changes
1060: --dbms_output.put_line(g_msg);
1061: WHEN OTHERS THEN
1062:
1063: if (l_exlog) then
1064: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION, l_module,
1065: 'UNEXPECTED ERROR: ' || SQLERRM);
1066: end if;
1067:
1068: ROLLBACK to LOOP_START;
1067:
1068: ROLLBACK to LOOP_START;
1069:
1070: if (l_exlog) then
1071: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION, l_module,
1072: 'Transaction Rolled back to LOOP_START.');
1073: end if;
1074:
1075: update_row_error(9999, l_varchar2000, asset_rec);
1078: end if;
1079: COMMIT;
1080:
1081: if (l_exlog) then
1082: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION, l_module,
1083: 'Transaction Commited.');
1084: end if;
1085:
1086: RAISE;
1096: and interface_group_id = p_interface_group_id;
1097: END IF;
1098:
1099: if (l_plog) then
1100: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE, l_module,
1101: 'Exiting ' || l_full_name);
1102:
1103: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE, l_module,
1104: 'End Worker for Asset Import. Time now is ' ||
1099: if (l_plog) then
1100: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE, l_module,
1101: 'Exiting ' || l_full_name);
1102:
1103: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE, l_module,
1104: 'End Worker for Asset Import. Time now is ' ||
1105: to_char(sysdate, 'Month DD, YYYY HH24:MI:SS'));
1106: end if;
1107: l_conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('NORMAL', l_error_message);
1111: l_error_message := 'UNEXPECTED ERROR IN OUTER BLOCK: ' || SQLERRM;
1112: l_conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('ERROR', l_error_message);
1113:
1114: if (l_exlog) then
1115: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION, l_module,l_error_message);
1116: end if;
1117:
1118: ROLLBACK;
1119:
1117:
1118: ROLLBACK;
1119:
1120: if (l_exlog) then
1121: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION, l_module,'Transaction Rolled back.');
1122: end if;
1123:
1124: IF asset_num_cur%ISOPEN THEN
1125: CLOSE asset_num_cur;
1138: and process_flag = 'R';
1139: COMMIT;
1140:
1141: if (l_exlog) then
1142: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION, l_module,'Transaction Commited.');
1143: end if;
1144:
1145: if (l_exlog) then
1146: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION, l_module,
1142: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION, l_module,'Transaction Commited.');
1143: end if;
1144:
1145: if (l_exlog) then
1146: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION, l_module,
1147: 'End Worker for Asset Import. Time now is ' ||
1148: to_char(sysdate, 'Month DD, YYYY HH24:MI:SS'));
1149: end if;
1150: