227: l_move_record.bom_revision := l_move_info.bom_revision;
228: x_move_table_pvt(x_move_table_pvt.count + 1) := l_move_record;
229: END LOOP;
230:
231: x_return_status := fnd_api.g_ret_sts_success;
232:
233: -- write to the log file
234: IF (l_log_level <= wip_constants.trace_logging) THEN
235: wip_logger.exitPoint(p_procName => 'wip_batch_move.derive_move',
238: x_returnStatus => l_return_status);
239: END IF;
240: EXCEPTION
241: WHEN others THEN
242: x_return_status := fnd_api.g_ret_sts_error;
243: IF(c_move_info%ISOPEN) THEN
244: CLOSE c_move_info;
245: END IF;
246: l_error_msg := 'process_phase = ' || l_process_phase || ';' ||
400: IF(l_default_scrap_acct_id IS NULL) THEN
401: fnd_message.set_name('WIP','WIP_NO_SCRAP_ACCT_NO_BATCH');
402: fnd_msg_pub.add;
403: l_error_msg := 'No default scrap accout defined.';
404: raise fnd_api.g_exc_unexpected_error;
405: ELSE
406: l_scrap_record.scrap_account_id := to_number(l_default_scrap_acct_id);
407: END IF;-- default scrap is null
408: END IF;
430: l_scrap_record.bom_revision := l_scrap_info.bom_revision;
431: x_move_table_pvt(x_move_table_pvt.count + 1) := l_scrap_record;
432: END LOOP;
433:
434: x_return_status := fnd_api.g_ret_sts_success;
435:
436: -- write to the log file
437: IF (l_log_level <= wip_constants.trace_logging) THEN
438: wip_logger.exitPoint(p_procName => 'wip_batch_move.derive_scrap',
440: p_msg => 'procedure complete',
441: x_returnStatus => l_return_status);
442: END IF;
443: EXCEPTION
444: WHEN fnd_api.g_exc_unexpected_error THEN
445: x_return_status := fnd_api.g_ret_sts_error;
446: IF(c_scrap_info%ISOPEN) THEN
447: CLOSE c_scrap_info;
448: END IF;
441: x_returnStatus => l_return_status);
442: END IF;
443: EXCEPTION
444: WHEN fnd_api.g_exc_unexpected_error THEN
445: x_return_status := fnd_api.g_ret_sts_error;
446: IF(c_scrap_info%ISOPEN) THEN
447: CLOSE c_scrap_info;
448: END IF;
449: IF (l_log_level <= wip_constants.trace_logging) THEN
452: p_msg => l_error_msg,
453: x_returnStatus => l_return_status);
454: END IF;
455: WHEN others THEN
456: x_return_status := fnd_api.g_ret_sts_error;
457: IF(c_scrap_info%ISOPEN) THEN
458: CLOSE c_scrap_info;
459: END IF;
460: l_error_msg := 'process_phase = ' || l_process_phase || ';' ||
534: p_fm_step_type => p_fm_step_type,
535: x_move_table_pvt => x_move_table_pvt,
536: x_return_status => x_return_status);
537:
538: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
539: l_error_msg := 'wip_batch_move.derive_move failed';
540: raise fnd_api.g_exc_unexpected_error;
541: END IF;
542: END IF;
536: x_return_status => x_return_status);
537:
538: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
539: l_error_msg := 'wip_batch_move.derive_move failed';
540: raise fnd_api.g_exc_unexpected_error;
541: END IF;
542: END IF;
543: l_process_phase := '3';
544: IF(p_scrap_qty > 0) THEN
555: p_resp_key => p_resp_key,
556: x_move_table_pvt => x_move_table_pvt,
557: x_return_status => x_return_status);
558:
559: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
560: l_error_msg := 'wip_batch_move.derive_scrap failed';
561: raise fnd_api.g_exc_unexpected_error;
562: END IF;
563: END IF;
557: x_return_status => x_return_status);
558:
559: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
560: l_error_msg := 'wip_batch_move.derive_scrap failed';
561: raise fnd_api.g_exc_unexpected_error;
562: END IF;
563: END IF;
564:
565: x_return_status := fnd_api.g_ret_sts_success;
561: raise fnd_api.g_exc_unexpected_error;
562: END IF;
563: END IF;
564:
565: x_return_status := fnd_api.g_ret_sts_success;
566: -- write to the log file
567: IF (l_log_level <= wip_constants.trace_logging) THEN
568: wip_logger.exitPoint(p_procName => 'wip_batch_move.derive_row',
569: p_procReturnStatus => x_return_status,
571: x_returnStatus => l_return_status);
572: END IF;
573:
574: EXCEPTION
575: WHEN fnd_api.g_exc_unexpected_error THEN
576: x_return_status := fnd_api.g_ret_sts_error;
577: IF (l_log_level <= wip_constants.trace_logging) THEN
578: wip_logger.exitPoint(p_procName => 'wip_batch_move.derive_row',
579: p_procReturnStatus => x_return_status,
572: END IF;
573:
574: EXCEPTION
575: WHEN fnd_api.g_exc_unexpected_error THEN
576: x_return_status := fnd_api.g_ret_sts_error;
577: IF (l_log_level <= wip_constants.trace_logging) THEN
578: wip_logger.exitPoint(p_procName => 'wip_batch_move.derive_row',
579: p_procReturnStatus => x_return_status,
580: p_msg => l_error_msg,
581: x_returnStatus => l_return_status);
582: END IF;
583:
584: WHEN others THEN
585: x_return_status := fnd_api.g_ret_sts_error;
586: l_error_msg := 'process_phase = ' || l_process_phase || ';' ||
587: ' unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
588:
589: IF (l_log_level <= wip_constants.trace_logging) THEN
648: p_level_id => l_level_id);
649: l_process_phase := '7';
650: x_default_scrap_acct_id := to_number(l_default_scrap_acct_id);
651:
652: x_return_status := fnd_api.g_ret_sts_success;
653:
654: -- write to the log file
655: IF (l_log_level <= wip_constants.trace_logging) THEN
656: wip_logger.exitPoint(p_procName => 'wip_batch_move.get_preferences',
659: x_returnStatus => l_return_status);
660: END IF;
661: EXCEPTION
662: WHEN others THEN
663: x_return_status := fnd_api.g_ret_sts_error;
664: l_error_msg := 'process_phase = ' || l_process_phase || ';' ||
665: ' unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
666:
667: IF (l_log_level <= wip_constants.trace_logging) THEN
872: transactionID => l_txn_id,
873: serialNumber => p_assy_serial,
874: errMessage => l_error_msg) = FALSE) THEN
875: -- insert statement error out
876: RAISE fnd_api.g_exc_unexpected_error;
877: END IF;
878: ELSE
879: -- If serialized express move from dispatch list or search job, quantity
880: -- can be more than one. Need to insert serial records into wsmi.
924: ORDER BY msn.serial_number;
925:
926: END IF;
927:
928: x_return_status := fnd_api.g_ret_sts_success;
929: -- write to the log file
930: IF (l_log_level <= wip_constants.trace_logging) THEN
931: wip_logger.exitPoint(p_procName => 'wip_batch_move.insert_move_records',
932: p_procReturnStatus => x_return_status,
935: END IF;
936:
937: EXCEPTION
938: WHEN others THEN
939: x_return_status := fnd_api.g_ret_sts_error;
940: l_error_msg := 'process_phase = ' || l_process_phase || ';' ||
941: ' unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
942:
943: IF (l_log_level <= wip_constants.trace_logging) THEN
1023: p_time_out => 0,
1024: p_move_mode => WIP_CONSTANTS.BACKGROUND,
1025: p_bf_mode => WIP_CONSTANTS.ONLINE,
1026: p_mtl_mode => WIP_CONSTANTS.ONLINE,
1027: p_endDebug => fnd_api.g_false,
1028: p_initMsgList => fnd_api.g_true,
1029: p_insertAssy => fnd_api.g_true,
1030: p_do_backflush => fnd_api.g_true,
1031: x_returnStatus => x_return_status);
1024: p_move_mode => WIP_CONSTANTS.BACKGROUND,
1025: p_bf_mode => WIP_CONSTANTS.ONLINE,
1026: p_mtl_mode => WIP_CONSTANTS.ONLINE,
1027: p_endDebug => fnd_api.g_false,
1028: p_initMsgList => fnd_api.g_true,
1029: p_insertAssy => fnd_api.g_true,
1030: p_do_backflush => fnd_api.g_true,
1031: x_returnStatus => x_return_status);
1032:
1025: p_bf_mode => WIP_CONSTANTS.ONLINE,
1026: p_mtl_mode => WIP_CONSTANTS.ONLINE,
1027: p_endDebug => fnd_api.g_false,
1028: p_initMsgList => fnd_api.g_true,
1029: p_insertAssy => fnd_api.g_true,
1030: p_do_backflush => fnd_api.g_true,
1031: x_returnStatus => x_return_status);
1032:
1033: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1026: p_mtl_mode => WIP_CONSTANTS.ONLINE,
1027: p_endDebug => fnd_api.g_false,
1028: p_initMsgList => fnd_api.g_true,
1029: p_insertAssy => fnd_api.g_true,
1030: p_do_backflush => fnd_api.g_true,
1031: x_returnStatus => x_return_status);
1032:
1033: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1034: l_process_phase := '4';
1029: p_insertAssy => fnd_api.g_true,
1030: p_do_backflush => fnd_api.g_true,
1031: x_returnStatus => x_return_status);
1032:
1033: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1034: l_process_phase := '4';
1035: l_error_msg := 'wip_movProc_priv.processIntf failed';
1036: raise fnd_api.g_exc_unexpected_error;
1037: ELSE
1032:
1033: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1034: l_process_phase := '4';
1035: l_error_msg := 'wip_movProc_priv.processIntf failed';
1036: raise fnd_api.g_exc_unexpected_error;
1037: ELSE
1038: l_process_phase := '5';
1039: -- If move success, call time entry API to clock off operator if there
1040: -- is no quantity left at the operation.
1053: x_returnStatus => l_return_status);
1054: END IF;
1055:
1056: EXCEPTION
1057: WHEN fnd_api.g_exc_unexpected_error THEN
1058: x_return_status := fnd_api.g_ret_sts_error;
1059: IF(c_errors%ISOPEN) THEN
1060: CLOSE c_errors;
1061: END IF;
1054: END IF;
1055:
1056: EXCEPTION
1057: WHEN fnd_api.g_exc_unexpected_error THEN
1058: x_return_status := fnd_api.g_ret_sts_error;
1059: IF(c_errors%ISOPEN) THEN
1060: CLOSE c_errors;
1061: END IF;
1062: IF(c_move_intf_records%ISOPEN) THEN
1076: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
1077: fnd_message.set_token('MESSAGE', l_error_text);
1078: fnd_msg_pub.add;
1079: WHEN others THEN
1080: x_return_status := fnd_api.g_ret_sts_error;
1081: IF(c_errors%ISOPEN) THEN
1082: CLOSE c_errors;
1083: END IF;
1084: IF(c_move_intf_records%ISOPEN) THEN
1123: wip_logger.entryPoint(p_procName => 'wip_batch_move.quality_require',
1124: p_params => l_params,
1125: x_returnStatus => l_return_status);
1126: END IF;
1127: x_quality_require := fnd_api.g_false;
1128: l_total_row := p_move_tbl.count;
1129:
1130: FOR i IN 1..l_total_row LOOP
1131: -- Build l_context_values to pass to quality API.
1163: p_txn_number => qa_ss_const.wip_move_txn,
1164: p_org_id => p_org_id,
1165: p_context_values => l_context_values,
1166: x_plan_txn_ids => l_plan_txn_ids);
1167: IF(l_quality_plan_exist = fnd_api.g_false)THEN
1168: -- If no collection plan exist, there is no need to call
1169: -- qa_txn_grp.commit_allowed().
1170: raise fnd_api.g_exc_unexpected_error;
1171: END IF;
1166: x_plan_txn_ids => l_plan_txn_ids);
1167: IF(l_quality_plan_exist = fnd_api.g_false)THEN
1168: -- If no collection plan exist, there is no need to call
1169: -- qa_txn_grp.commit_allowed().
1170: raise fnd_api.g_exc_unexpected_error;
1171: END IF;
1172: -- If quality collection plan exist, we have to check whether it is
1173: -- mandatory or not.
1174: -- Fixed bug 5335024.Call is_commit_allowed() instead of commit_allowed()
1181: --Pass 0 as Bryan suggested.
1182: p_collection_id => 0,
1183: x_plan_names => x_plan_names);
1184:
1185: IF(l_commit_allow = fnd_api.g_false)THEN
1186: -- If quality plan is mandatory, no need to do more check.
1187: x_quality_require := fnd_api.g_true;
1188: GOTO end_quality_check;
1189: END IF;
1183: x_plan_names => x_plan_names);
1184:
1185: IF(l_commit_allow = fnd_api.g_false)THEN
1186: -- If quality plan is mandatory, no need to do more check.
1187: x_quality_require := fnd_api.g_true;
1188: GOTO end_quality_check;
1189: END IF;
1190: EXCEPTION
1191: WHEN fnd_api.g_exc_unexpected_error THEN
1187: x_quality_require := fnd_api.g_true;
1188: GOTO end_quality_check;
1189: END IF;
1190: EXCEPTION
1191: WHEN fnd_api.g_exc_unexpected_error THEN
1192: -- This is not a real error, so we do not have to do anything.
1193: NULL;
1194: WHEN others THEN
1195: l_error_msg := ' unexpected error: ' || SQLERRM || 'SQLCODE = ' ||
1207:
1208: -- write to the log file
1209: IF (l_log_level <= wip_constants.trace_logging) THEN
1210: wip_logger.exitPoint(p_procName => 'wip_batch_move.quality_require',
1211: p_procReturnStatus => fnd_api.g_ret_sts_success,
1212: p_msg => 'procedure complete',
1213: x_returnStatus => l_return_status);
1214: END IF;
1215: <
1212: p_msg => 'procedure complete',
1213: x_returnStatus => l_return_status);
1214: END IF;
1215: <
1216: x_return_status := fnd_api.g_ret_sts_success;
1217:
1218: -- write to the log file
1219: IF (l_log_level <= wip_constants.trace_logging) THEN
1220: wip_logger.exitPoint(p_procName => 'wip_batch_move.derive_move',
1223: x_returnStatus => l_return_status);
1224: END IF;
1225: EXCEPTION
1226: WHEN others THEN
1227: x_return_status := fnd_api.g_ret_sts_error;
1228: l_error_msg := ' unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
1229:
1230: IF (l_log_level <= wip_constants.trace_logging) THEN
1231: wip_logger.exitPoint(p_procName => 'wip_batch_move.derive_move',
1261: -- we should move assembly to.
1262: fnd_message.set_name('WIP','WIP_NO_DEFAULT_STEP_NO_BATCH');
1263: fnd_msg_pub.add;
1264: l_error_msg := 'No default intraoperation step defined.';
1265: raise fnd_api.g_exc_unexpected_error;
1266: END IF;
1267:
1268: l_process_phase := '3';
1269: l_dff_required := fnd_flex_apis.is_descr_required(
1275: -- provide DFF information for this type of transaction.
1276: fnd_message.set_name('WIP','WIP_DFF_REQUIRE_NO_BATCH');
1277: fnd_msg_pub.add;
1278: l_error_msg := 'DFF is mandatory.';
1279: raise fnd_api.g_exc_unexpected_error;
1280: END IF;
1281:
1282: x_return_status := fnd_api.g_ret_sts_success;
1283: -- write to the log file
1278: l_error_msg := 'DFF is mandatory.';
1279: raise fnd_api.g_exc_unexpected_error;
1280: END IF;
1281:
1282: x_return_status := fnd_api.g_ret_sts_success;
1283: -- write to the log file
1284: IF (l_log_level <= wip_constants.trace_logging) THEN
1285: wip_logger.exitPoint(p_procName => 'wip_batch_move.validate_batch',
1286: p_procReturnStatus => x_return_status,
1287: p_msg => 'procedure complete',
1288: x_returnStatus => l_return_status);
1289: END IF;
1290: EXCEPTION
1291: WHEN fnd_api.g_exc_unexpected_error THEN
1292: x_return_status := fnd_api.g_ret_sts_error;
1293:
1294: IF (l_log_level <= wip_constants.trace_logging) THEN
1295: wip_logger.exitPoint(p_procName => 'wip_batch_move.validate_batch',
1288: x_returnStatus => l_return_status);
1289: END IF;
1290: EXCEPTION
1291: WHEN fnd_api.g_exc_unexpected_error THEN
1292: x_return_status := fnd_api.g_ret_sts_error;
1293:
1294: IF (l_log_level <= wip_constants.trace_logging) THEN
1295: wip_logger.exitPoint(p_procName => 'wip_batch_move.validate_batch',
1296: p_procReturnStatus => x_return_status,
1298: x_returnStatus => l_return_status);
1299: END IF;
1300:
1301: WHEN others THEN
1302: x_return_status := fnd_api.g_ret_sts_error;
1303: l_error_msg := 'process_phase = ' || l_process_phase || ';' ||
1304: ' unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
1305:
1306: IF (l_log_level <= wip_constants.trace_logging) THEN
1396: l_to_move_qty <> l_available_qty) THEN
1397: fnd_message.set_name('WIP','WIP_QTY_SPLIT_NO_BATCH');
1398: fnd_msg_pub.add;
1399: l_error_msg := 'Quantity split at from operation.';
1400: raise fnd_api.g_exc_unexpected_error;
1401: END IF;
1402:
1403: -- If quantity not split, derive from step.
1404: IF(l_queue_qty = l_available_qty)THEN
1427: IF(p_move_qty + p_scrap_qty > l_available_qty) THEN
1428: fnd_message.set_name('WIP','WIP_NOT_ENOUGH_QTY_FOR_BATCH');
1429: fnd_msg_pub.add;
1430: l_error_msg := 'Transaction quantity is greater than available quantity.';
1431: raise fnd_api.g_exc_unexpected_error;
1432: END IF;
1433:
1434: l_process_phase := '4';
1435: SELECT mandatory_scrap_flag
1443: p_default_scrap_acct_id IS NULL) THEN
1444: fnd_message.set_name('WIP','WIP_NO_SCRAP_ACCT_NO_BATCH');
1445: fnd_msg_pub.add;
1446: l_error_msg := 'No default scrap accout defined.';
1447: raise fnd_api.g_exc_unexpected_error;
1448: END IF;
1449: l_process_phase := '5';
1450: -- Derive move/scrap information
1451: derive_row(p_org_id => p_org_id,
1461: p_resp_key => p_resp_key,
1462: x_move_table_pvt => x_move_table_pvt,
1463: x_return_status => x_return_status);
1464:
1465: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1466: l_error_msg := 'wip_batch_move.derive_row failed';
1467: raise fnd_api.g_exc_unexpected_error;
1468: END IF;
1469: l_process_phase := '6';
1463: x_return_status => x_return_status);
1464:
1465: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1466: l_error_msg := 'wip_batch_move.derive_row failed';
1467: raise fnd_api.g_exc_unexpected_error;
1468: END IF;
1469: l_process_phase := '6';
1470: -- Check whether quality collection is mandatory or not.
1471: quality_require(p_org_id => p_org_id,
1473: x_quality_require => l_quality_require,
1474: x_plan_names => l_plan_names,
1475: x_return_status => x_return_status);
1476:
1477: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1478: l_error_msg := 'wip_batch_move.quality_require failed';
1479: raise fnd_api.g_exc_unexpected_error;
1480: ELSE -- If success, check whether quality is mandatory or not.
1481: IF(l_quality_require = fnd_api.g_true) THEN
1475: x_return_status => x_return_status);
1476:
1477: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1478: l_error_msg := 'wip_batch_move.quality_require failed';
1479: raise fnd_api.g_exc_unexpected_error;
1480: ELSE -- If success, check whether quality is mandatory or not.
1481: IF(l_quality_require = fnd_api.g_true) THEN
1482: -- Fixed bug 5335024. Change error message from a generic error message
1483: -- WIP_QUALITY_REQUIRE_NO_BATCH to QA_TXN_INCOMPLETE which contain plan
1477: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1478: l_error_msg := 'wip_batch_move.quality_require failed';
1479: raise fnd_api.g_exc_unexpected_error;
1480: ELSE -- If success, check whether quality is mandatory or not.
1481: IF(l_quality_require = fnd_api.g_true) THEN
1482: -- Fixed bug 5335024. Change error message from a generic error message
1483: -- WIP_QUALITY_REQUIRE_NO_BATCH to QA_TXN_INCOMPLETE which contain plan
1484: -- name.
1485: fnd_message.set_name('QA','QA_TXN_INCOMPLETE');
1485: fnd_message.set_name('QA','QA_TXN_INCOMPLETE');
1486: fnd_message.set_token('PLANS1', l_plan_names);
1487: fnd_msg_pub.add;
1488: l_error_msg := 'Quality collection is mandatory.';
1489: raise fnd_api.g_exc_unexpected_error;
1490: END IF;
1491: END IF;
1492:
1493: x_return_status := fnd_api.g_ret_sts_success;
1489: raise fnd_api.g_exc_unexpected_error;
1490: END IF;
1491: END IF;
1492:
1493: x_return_status := fnd_api.g_ret_sts_success;
1494:
1495: -- write to the log file
1496: IF (l_log_level <= wip_constants.trace_logging) THEN
1497: wip_logger.exitPoint(p_procName => 'wip_batch_move.validate_row',
1499: p_msg => 'procedure complete',
1500: x_returnStatus => l_return_status);
1501: END IF;
1502: EXCEPTION
1503: WHEN fnd_api.g_exc_unexpected_error THEN
1504: x_return_status := fnd_api.g_ret_sts_error;
1505: IF (l_log_level <= wip_constants.trace_logging) THEN
1506: wip_logger.exitPoint(p_procName => 'wip_batch_move.validate_row',
1507: p_procReturnStatus => x_return_status,
1500: x_returnStatus => l_return_status);
1501: END IF;
1502: EXCEPTION
1503: WHEN fnd_api.g_exc_unexpected_error THEN
1504: x_return_status := fnd_api.g_ret_sts_error;
1505: IF (l_log_level <= wip_constants.trace_logging) THEN
1506: wip_logger.exitPoint(p_procName => 'wip_batch_move.validate_row',
1507: p_procReturnStatus => x_return_status,
1508: p_msg => l_error_msg,
1509: x_returnStatus => l_return_status);
1510: END IF;
1511:
1512: WHEN others THEN
1513: x_return_status := fnd_api.g_ret_sts_error;
1514: l_error_msg := 'process_phase = ' || l_process_phase || ';' ||
1515: ' unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
1516:
1517: IF (l_log_level <= wip_constants.trace_logging) THEN
1570: x_default_step_type => l_default_step_type,
1571: x_default_scrap_acct_id => l_default_scrap_acct_id,
1572: x_return_status => x_return_status);
1573:
1574: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1575: l_error_msg := 'wip_batch_move.get_preferences failed';
1576: raise fnd_api.g_exc_unexpected_error;
1577: END IF;
1578: -- Perform generic validation for the whole batch.
1572: x_return_status => x_return_status);
1573:
1574: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1575: l_error_msg := 'wip_batch_move.get_preferences failed';
1576: raise fnd_api.g_exc_unexpected_error;
1577: END IF;
1578: -- Perform generic validation for the whole batch.
1579: validate_batch(p_default_step_type => l_default_step_type,
1580: x_return_status => x_return_status);
1578: -- Perform generic validation for the whole batch.
1579: validate_batch(p_default_step_type => l_default_step_type,
1580: x_return_status => x_return_status);
1581:
1582: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1583: l_error_msg := 'wip_batch_move.validate_batch failed';
1584: raise fnd_api.g_exc_unexpected_error;
1585: END IF;
1586:
1580: x_return_status => x_return_status);
1581:
1582: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1583: l_error_msg := 'wip_batch_move.validate_batch failed';
1584: raise fnd_api.g_exc_unexpected_error;
1585: END IF;
1586:
1587: l_total_row := p_move_table.count;
1588:
1602: p_assy_serial => p_move_table(i).assy_serial,
1603: x_move_table_pvt => l_move_table_pvt,
1604: x_return_status => x_return_status);
1605:
1606: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1607: l_error_msg := 'wip_batch_move.validate_row failed';
1608: raise fnd_api.g_exc_unexpected_error;
1609: END IF;
1610: -- Insert move/scrap record into WMTI
1604: x_return_status => x_return_status);
1605:
1606: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1607: l_error_msg := 'wip_batch_move.validate_row failed';
1608: raise fnd_api.g_exc_unexpected_error;
1609: END IF;
1610: -- Insert move/scrap record into WMTI
1611: insert_move_records(p_org_id => p_org_id,
1612: p_employee_id => p_employee_id,
1614: p_assy_serial => p_move_table(i).assy_serial,
1615: x_group_id => l_group_id,
1616: x_return_status => x_return_status);
1617:
1618: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1619: l_error_msg := 'wip_batch_move.insert_move_records failed';
1620: raise fnd_api.g_exc_unexpected_error;
1621: END IF;
1622: -- Clear all move information.
1616: x_return_status => x_return_status);
1617:
1618: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1619: l_error_msg := 'wip_batch_move.insert_move_records failed';
1620: raise fnd_api.g_exc_unexpected_error;
1621: END IF;
1622: -- Clear all move information.
1623: l_move_table_pvt.delete;
1624:
1625: -- Process move records
1626: process_move_records(p_group_id => l_group_id,
1627: x_return_status => x_return_status);
1628:
1629: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1630: l_error_msg := 'wip_batch_move.process_move_records failed';
1631: raise fnd_api.g_exc_unexpected_error;
1632: ELSE
1633: -- Initialize message stack to clear "Txn Success" inventory put in
1627: x_return_status => x_return_status);
1628:
1629: IF(x_return_status <> fnd_api.g_ret_sts_success) THEN
1630: l_error_msg := 'wip_batch_move.process_move_records failed';
1631: raise fnd_api.g_exc_unexpected_error;
1632: ELSE
1633: -- Initialize message stack to clear "Txn Success" inventory put in
1634: -- the stack.
1635: fnd_msg_pub.initialize;
1636: COMMIT;
1637: END IF;
1638:
1639: EXCEPTION
1640: WHEN fnd_api.g_exc_unexpected_error THEN
1641: ROLLBACK TO SAVEPOINT s_batch_move1;
1642: -- Put a useful error message in the stack to display back to the user.
1643: wip_utilities.get_message_stack(p_msg => l_error_text);
1644: add_error(p_job_name => p_move_table(i).wip_entity_name,
1669: END;
1670: END LOOP;
1671:
1672: IF(l_error_row = 0) THEN
1673: x_return_status := fnd_api.g_ret_sts_success;
1674: ELSE
1675: -- Put all error message to message stack.
1676: load_errors;
1677: x_return_status := fnd_api.g_ret_sts_error;
1673: x_return_status := fnd_api.g_ret_sts_success;
1674: ELSE
1675: -- Put all error message to message stack.
1676: load_errors;
1677: x_return_status := fnd_api.g_ret_sts_error;
1678: END IF;
1679: -- Write to the log file.
1680: IF (l_log_level <= wip_constants.trace_logging) THEN
1681: wip_logger.exitPoint(p_procName => 'wip_batch_move.process',
1684: x_returnStatus => l_return_status);
1685: wip_logger.cleanUp(x_returnStatus => l_return_status);
1686: END IF;
1687: EXCEPTION
1688: WHEN fnd_api.g_exc_unexpected_error THEN
1689: x_return_status := fnd_api.g_ret_sts_error;
1690: IF (l_log_level <= wip_constants.trace_logging) THEN
1691: wip_logger.exitPoint(p_procName => 'wip_batch_move.process',
1692: p_procReturnStatus => x_return_status,
1685: wip_logger.cleanUp(x_returnStatus => l_return_status);
1686: END IF;
1687: EXCEPTION
1688: WHEN fnd_api.g_exc_unexpected_error THEN
1689: x_return_status := fnd_api.g_ret_sts_error;
1690: IF (l_log_level <= wip_constants.trace_logging) THEN
1691: wip_logger.exitPoint(p_procName => 'wip_batch_move.process',
1692: p_procReturnStatus => x_return_status,
1693: p_msg => l_error_msg,
1695: wip_logger.cleanUp(x_returnStatus => l_return_status);
1696: END IF;
1697:
1698: WHEN others THEN
1699: x_return_status := fnd_api.g_ret_sts_error;
1700: l_error_msg := ' unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
1701:
1702: IF (l_log_level <= wip_constants.trace_logging) THEN
1703: wip_logger.exitPoint(p_procName => 'wip_batch_move.process',