258: x_lotSerRequired => l_ls_required,
259: x_bfRequired => l_bf_required,
260: x_returnStatus => l_returnStatus);
261:
262: IF(l_returnStatus <> fnd_api.g_ret_sts_success) THEN
263: raise fnd_api.g_exc_unexpected_error;
264: ELSE
265: IF(l_ls_required = WIP_CONSTANTS.YES) THEN
266: -- If we need to gather more lot/serial, error out because
259: x_bfRequired => l_bf_required,
260: x_returnStatus => l_returnStatus);
261:
262: IF(l_returnStatus <> fnd_api.g_ret_sts_success) THEN
263: raise fnd_api.g_exc_unexpected_error;
264: ELSE
265: IF(l_ls_required = WIP_CONSTANTS.YES) THEN
266: -- If we need to gather more lot/serial, error out because
267: -- we cannot gather lot/serial for background transaction.
266: -- If we need to gather more lot/serial, error out because
267: -- we cannot gather lot/serial for background transaction.
268: fnd_message.set_name('WIP', 'WIP_NO_LOT_SER_COMP_BKGND');
269: fnd_msg_pub.add;
270: raise fnd_api.g_exc_unexpected_error;
271: END IF;
272: END IF; -- check return status
273: END LOOP; -- repetitive schedule
274: ELSIF(p_entity_type = WIP_CONSTANTS.DISCRETE) THEN
302: x_lotSerRequired => l_ls_required,
303: x_bfRequired => l_bf_required,
304: x_returnStatus => l_returnStatus);
305:
306: IF(l_returnStatus <> fnd_api.g_ret_sts_success) THEN
307: raise fnd_api.g_exc_unexpected_error;
308: ELSE
309: IF(l_ls_required = WIP_CONSTANTS.YES) THEN
310: -- If we need to gather more lot/serial, error out because
303: x_bfRequired => l_bf_required,
304: x_returnStatus => l_returnStatus);
305:
306: IF(l_returnStatus <> fnd_api.g_ret_sts_success) THEN
307: raise fnd_api.g_exc_unexpected_error;
308: ELSE
309: IF(l_ls_required = WIP_CONSTANTS.YES) THEN
310: -- If we need to gather more lot/serial, error out because
311: -- we cannot gather lot/serial for background transaction.
310: -- If we need to gather more lot/serial, error out because
311: -- we cannot gather lot/serial for background transaction.
312: fnd_message.set_name('WIP', 'WIP_NO_LOT_SER_COMP_BKGND');
313: fnd_msg_pub.add;
314: raise fnd_api.g_exc_unexpected_error;
315: END IF;
316: END IF; -- check return status
317: END LOOP; -- Discrete (MMT)
318: /*Bug 12942986: Because of fix 4343850 in wipmovpb.pls asembly completion record gets committed in MMTT.
350: x_lotSerRequired => l_ls_required,
351: x_bfRequired => l_bf_required,
352: x_returnStatus => l_returnStatus);
353:
354: IF(l_returnStatus <> fnd_api.g_ret_sts_success) THEN
355: raise fnd_api.g_exc_unexpected_error;
356: ELSE
357: IF(l_ls_required = WIP_CONSTANTS.YES) THEN
358: -- If we need to gather more lot/serial, error out because
351: x_bfRequired => l_bf_required,
352: x_returnStatus => l_returnStatus);
353:
354: IF(l_returnStatus <> fnd_api.g_ret_sts_success) THEN
355: raise fnd_api.g_exc_unexpected_error;
356: ELSE
357: IF(l_ls_required = WIP_CONSTANTS.YES) THEN
358: -- If we need to gather more lot/serial, error out because
359: -- we cannot gather lot/serial for background transaction.
358: -- If we need to gather more lot/serial, error out because
359: -- we cannot gather lot/serial for background transaction.
360: fnd_message.set_name('WIP', 'WIP_NO_LOT_SER_COMP_BKGND');
361: fnd_msg_pub.add;
362: raise fnd_api.g_exc_unexpected_error;
363: END IF;
364: END IF; -- check return status
365: END LOOP; -- Discrete (MMTT)
366: ELSIF(p_entity_type = WIP_CONSTANTS.LOTBASED) THEN
384: p_cplTxnID => l_OSFMAssembly.cpl_txn_id,
385: p_mtlTxnMode => p_gib.mtl_mode,
386: p_reasonID => l_OSFMAssembly.reason_id,
387: p_reference => l_OSFMAssembly.reference,
388: p_init_msg_list => fnd_api.g_true,
389: x_lotSerRequired => l_ls_required,
390: x_returnStatus => l_returnStatus,
391: x_error_msg => l_error_msg, -- throw away value
392: x_error_count => l_error_count); -- throw away value
390: x_returnStatus => l_returnStatus,
391: x_error_msg => l_error_msg, -- throw away value
392: x_error_count => l_error_count); -- throw away value
393:
394: IF(l_returnStatus <> fnd_api.g_ret_sts_success) THEN
395: raise fnd_api.g_exc_unexpected_error;
396: ELSE
397: IF(l_ls_required = WIP_CONSTANTS.YES) THEN
398: -- If we need to gather more lot/serial, error out because
391: x_error_msg => l_error_msg, -- throw away value
392: x_error_count => l_error_count); -- throw away value
393:
394: IF(l_returnStatus <> fnd_api.g_ret_sts_success) THEN
395: raise fnd_api.g_exc_unexpected_error;
396: ELSE
397: IF(l_ls_required = WIP_CONSTANTS.YES) THEN
398: -- If we need to gather more lot/serial, error out because
399: -- we cannot gather lot/serial for background transaction.
398: -- If we need to gather more lot/serial, error out because
399: -- we cannot gather lot/serial for background transaction.
400: fnd_message.set_name('WIP', 'WIP_NO_LOT_SER_COMP_BKGND');
401: fnd_msg_pub.add;
402: raise fnd_api.g_exc_unexpected_error;
403: END IF;
404: END IF; -- check return status
405: END LOOP; -- OSFM
406: END IF; -- entity_type check
521: wip_logger.log(p_msg => l_msg,
522: x_returnStatus => l_returnStatus);
523: END IF;
524:
525: l_returnStatus := fnd_api.g_ret_sts_success;
526: IF (l_logLevel <= wip_constants.trace_logging) THEN
527: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.component_cleanup',
528: p_procReturnStatus => l_returnStatus,
529: p_msg => 'procedure complete',
650: wip_logger.log(p_msg => l_count || ' records inserted',
651: x_returnStatus => l_returnStatus);
652: END IF;
653:
654: l_returnStatus := fnd_api.g_ret_sts_success;
655: IF (l_logLevel <= wip_constants.trace_logging) THEN
656: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.write_mtl_errors',
657: p_procReturnStatus => l_returnStatus,
658: p_msg => 'procedure complete',
659: x_returnStatus => l_returnStatus);
660: END IF;
661: EXCEPTION
662: WHEN others THEN
663: l_returnStatus := fnd_api.g_ret_sts_unexp_error;
664: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
665:
666: IF (l_logLevel <= wip_constants.trace_logging) THEN
667: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.write_mtl_errors',
733:
734: IF(c_wipops%ISOPEN) THEN
735: CLOSE c_wipops;
736: END IF;
737: x_returnStatus := fnd_api.g_ret_sts_success;
738:
739: -- write to the log file
740: IF (l_logLevel <= wip_constants.trace_logging) THEN
741: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.lock_wipops',
748: WHEN wip_constants.records_locked THEN
749: IF(c_wipops%ISOPEN) THEN
750: CLOSE c_wipops;
751: END IF;
752: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
753: l_errMsg := 'Unable to lock the record in wip_operations';
754:
755: IF (l_logLevel <= wip_constants.trace_logging) THEN
756: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.lock_wipops',
764: WHEN others THEN
765: IF(c_wipops%ISOPEN) THEN
766: CLOSE c_wipops;
767: END IF;
768: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
769: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
770:
771: IF (l_logLevel <= wip_constants.trace_logging) THEN
772: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.lock_wipops',
966: -- fulfilled without needing overcompletion. In that case it must be
967: -- an error
968: x_proc_status := TVE_OVERCOMPLETION_MISMATCH;
969: l_errMsg := 'Overcompletion mismatch';
970: raise fnd_api.g_exc_unexpected_error;
971: END IF;
972:
973: -- for parent transaction, it always come here because the available
974: -- qty is not enough. Child transaction also come here
975: <
976:
977: IF (l_recordFound = 0) THEN -- no schedule found
978: l_errMsg := 'No repetitive schedule found';
979: raise fnd_api.g_exc_unexpected_error;
980: ELSIF((p_oc_txn_type = WIP_CONSTANTS.parent_txn OR
981: (p_txnType = WIP_CONSTANTS.RET_TXN AND
982: p_fm_form = WIP_CONSTANTS.YES)) AND
983: l_quantity > 0) THEN
1014: -- user insert incorrect value for normal transaction txn qty must
1015: -- be less than or equal to available qty
1016: x_proc_status := TVE_NO_MOVE_ALLOC;
1017: l_errMsg := 'Not enough qty to move';
1018: raise fnd_api.g_exc_unexpected_error;
1019: END IF;
1020: END IF;
1021: END IF; -- no schedule found
1022:
1022:
1023: IF(c_rsa%ISOPEN) THEN
1024: CLOSE c_rsa;
1025: END IF;
1026: x_returnStatus := fnd_api.g_ret_sts_success;
1027: x_proc_status := WIP_CONSTANTS.RUNNING;
1028: -- write to the log file
1029: IF (l_logLevel <= wip_constants.trace_logging) THEN
1030: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.schedule_alloc',
1033: x_returnStatus => l_returnStatus);
1034: END IF;
1035:
1036: EXCEPTION
1037: WHEN fnd_api.g_exc_unexpected_error THEN
1038: IF(c_rsa%ISOPEN) THEN
1039: CLOSE c_rsa;
1040: END IF;
1041: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1037: WHEN fnd_api.g_exc_unexpected_error THEN
1038: IF(c_rsa%ISOPEN) THEN
1039: CLOSE c_rsa;
1040: END IF;
1041: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1042:
1043: IF (l_logLevel <= wip_constants.trace_logging) THEN
1044: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.schedule_alloc',
1045: p_procReturnStatus => x_returnStatus,
1055: WHEN others THEN
1056: IF(c_rsa%ISOPEN) THEN
1057: CLOSE c_rsa;
1058: END IF;
1059: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1060: x_proc_status := WIP_CONSTANTS.ERROR;
1061: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
1062:
1063: IF (l_logLevel <= wip_constants.trace_logging) THEN
1135: p_err_mesg => l_msgData);
1136:
1137: IF(p_gib.move_profile.child_txn_id IS NULL) THEN
1138: l_errMsg := 'WIP_OVERCOMPLETION.insert_child_move_txn failed';
1139: raise fnd_api.g_exc_unexpected_error;
1140: END IF;
1141:
1142: IF(l_first_op_seq_num IS NOT NULL) THEN
1143: x_oc_fm_op := l_first_op_seq_num;
1142: IF(l_first_op_seq_num IS NOT NULL) THEN
1143: x_oc_fm_op := l_first_op_seq_num;
1144: ELSE
1145: l_errMsg := 'wip_operations_INFO.first_operation failed';
1146: raise fnd_api.g_exc_unexpected_error;
1147: END IF;
1148:
1149: IF(p_scheID > 0) THEN
1150: -- this is a repetitvie schedule, hence must insert allocation records
1186: FROM wip_move_txn_allocations wmta1
1187: WHERE wmta1.transaction_id = wmta.transaction_id
1188: AND wmta1.organization_id = wmta.organization_id));
1189: END IF; -- p_scheID > 0
1190: x_returnStatus := fnd_api.g_ret_sts_success;
1191:
1192: -- write to the log file
1193: IF (l_logLevel <= wip_constants.trace_logging) THEN
1194: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.insert_alloc_child',
1197: x_returnStatus => l_returnStatus);
1198: END IF;
1199:
1200: EXCEPTION
1201: WHEN fnd_api.g_exc_unexpected_error THEN
1202:
1203: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1204:
1205: IF (l_logLevel <= wip_constants.trace_logging) THEN
1199:
1200: EXCEPTION
1201: WHEN fnd_api.g_exc_unexpected_error THEN
1202:
1203: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1204:
1205: IF (l_logLevel <= wip_constants.trace_logging) THEN
1206: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.insert_alloc_child',
1207: p_procReturnStatus => x_returnStatus,
1213: fnd_message.set_token('MESSAGE', l_msgData);
1214: fnd_msg_pub.add;
1215:
1216: WHEN others THEN
1217: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1218: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
1219:
1220: IF (l_logLevel <= wip_constants.trace_logging) THEN
1221: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.insert_alloc_child',
1403:
1404:
1405: END LOOP; -- END for loop
1406:
1407: x_returnStatus := fnd_api.g_ret_sts_success;
1408:
1409: -- write to the log file
1410: IF (l_logLevel <= wip_constants.trace_logging) THEN
1411: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.update_wo_rs',
1415: END IF;
1416:
1417: EXCEPTION
1418: WHEN others THEN
1419: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1420: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
1421:
1422: IF (l_logLevel <= wip_constants.trace_logging) THEN
1423: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.update_wo_rs',
1515: -- Picked the row corresponding to the txn. 1 each for such txns
1516: -- Rowids can be duplicate because there might be 2 wmti records with
1517: -- the same fm_op
1518:
1519: x_returnStatus := fnd_api.g_ret_sts_success;
1520:
1521: -- write to the log file
1522: IF (l_logLevel <= wip_constants.trace_logging) THEN
1523: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.update_wipops',
1527: END IF;
1528:
1529: EXCEPTION
1530: WHEN OTHERS THEN
1531: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1532: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
1533:
1534: IF (l_logLevel <= wip_constants.trace_logging) THEN
1535: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.update_wipops',
1708: update_wipops(p_txn_id => l_rs_txn.txn_id,
1709: p_gib => p_gib,
1710: x_returnStatus => x_returnStatus);
1711:
1712: IF (x_returnStatus <> fnd_api.g_ret_sts_success) THEN
1713: l_errMsg := 'wip_movProc_priv.update_wipops failed';
1714: raise fnd_api.g_exc_unexpected_error;
1715: END IF;
1716:
1710: x_returnStatus => x_returnStatus);
1711:
1712: IF (x_returnStatus <> fnd_api.g_ret_sts_success) THEN
1713: l_errMsg := 'wip_movProc_priv.update_wipops failed';
1714: raise fnd_api.g_exc_unexpected_error;
1715: END IF;
1716:
1717: END IF; -- child txns
1718:
1726: p_gib => p_gib,
1727: x_oc_fm_op => l_oc_fm_op,
1728: x_returnStatus => x_returnStatus);
1729:
1730: IF (x_returnStatus <> fnd_api.g_ret_sts_success) THEN
1731:
1732: IF (l_rs_txn.past_timeout = 0) THEN -- not time out yet
1733: UPDATE wip_move_txn_interface
1734: SET process_status = WIP_CONSTANTS.PENDING,
1738: AND group_id = p_gib.group_id;
1739: END IF; -- time out check
1740:
1741: l_errMsg := 'wip_movProc_priv.insert_alloc_child failed';
1742: raise fnd_api.g_exc_unexpected_error;
1743:
1744: ELSE -- insert child success
1745: -- insert assemblies in the queue of the first operation after
1746: -- the child record is inserted
1747: update_wipops(p_txn_id => p_gib.move_profile.child_txn_id,
1748: p_gib => p_gib,
1749: x_returnStatus => x_returnStatus);
1750:
1751: IF (x_returnStatus <> fnd_api.g_ret_sts_success) THEN
1752: l_errMsg := 'wip_movProc_priv.update_wipops failed';
1753: raise fnd_api.g_exc_unexpected_error;
1754: END IF;
1755:
1749: x_returnStatus => x_returnStatus);
1750:
1751: IF (x_returnStatus <> fnd_api.g_ret_sts_success) THEN
1752: l_errMsg := 'wip_movProc_priv.update_wipops failed';
1753: raise fnd_api.g_exc_unexpected_error;
1754: END IF;
1755:
1756: -- prepare data before calling update_wo_rs
1757: l_update_rsa(1).scheID := l_rsa(l_sche_count).scheID;
1773: p_rsa_rec => l_update_rsa,
1774: p_txn_date => l_rs_txn.txn_date,
1775: x_returnStatus => x_returnStatus);
1776:
1777: IF (x_returnStatus <> fnd_api.g_ret_sts_success) THEN
1778: l_errMsg := 'wip_movProc_priv.update_wo_rs failed';
1779: raise fnd_api.g_exc_unexpected_error;
1780: END IF;
1781: END IF; -- insert_alloc_child check
1775: x_returnStatus => x_returnStatus);
1776:
1777: IF (x_returnStatus <> fnd_api.g_ret_sts_success) THEN
1778: l_errMsg := 'wip_movProc_priv.update_wo_rs failed';
1779: raise fnd_api.g_exc_unexpected_error;
1780: END IF;
1781: END IF; -- insert_alloc_child check
1782:
1783: IF(l_rs_txn.oc_pri_qty <> 0 AND
1800: */
1801: p_fm_op => l_rs_txn.fm_op,
1802: x_return_status => x_returnStatus);
1803:
1804: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
1805: l_errMsg := 'wip_osp.updatePOReqQuantity failed';
1806: raise fnd_api.g_exc_unexpected_error;
1807: END IF; -- l_return_status
1808: END IF; -- l_propagate_job_change_to_po = WIP_CONSTANTS.YES
1802: x_return_status => x_returnStatus);
1803:
1804: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
1805: l_errMsg := 'wip_osp.updatePOReqQuantity failed';
1806: raise fnd_api.g_exc_unexpected_error;
1807: END IF; -- l_return_status
1808: END IF; -- l_propagate_job_change_to_po = WIP_CONSTANTS.YES
1809: END IF; -- l_rs_txn.oc_pri_qty <> 0 and customer have PO FPJ
1810: END IF; -- IF parent_txn
1831: p_rsa_rec => l_update_rsa,
1832: p_txn_date => l_rs_txn.txn_date,
1833: x_returnStatus => x_returnStatus);
1834:
1835: IF (x_returnStatus <> fnd_api.g_ret_sts_success) THEN
1836: l_errMsg := 'wip_movProc_priv.update_wo_rs failed';
1837: raise fnd_api.g_exc_unexpected_error;
1838: END IF;
1839:
1833: x_returnStatus => x_returnStatus);
1834:
1835: IF (x_returnStatus <> fnd_api.g_ret_sts_success) THEN
1836: l_errMsg := 'wip_movProc_priv.update_wo_rs failed';
1837: raise fnd_api.g_exc_unexpected_error;
1838: END IF;
1839:
1840: ELSIF(l_proc_status = TVE_OVERCOMPLETION_MISMATCH OR
1841: l_proc_status = TVE_NO_MOVE_ALLOC) THEN
1854: IF(l_proc_status = TVE_OVERCOMPLETION_MISMATCH) THEN
1855: fnd_message.set_name('WIP', 'WIP_OVERCOMPLETION_MISMATCH');
1856: fnd_msg_pub.add;
1857: l_errMsg := 'parent txn is not really overcompletion txn';
1858: raise fnd_api.g_exc_unexpected_error;
1859: ELSE
1860: fnd_message.set_name('WIP', 'WIP_LESS_OR_EQUAL');
1861: fnd_message.set_token('ENTITY1', 'transaction quantity');
1862: fnd_message.set_token('ENTITY2', 'quantity available to move');
1861: fnd_message.set_token('ENTITY1', 'transaction quantity');
1862: fnd_message.set_token('ENTITY2', 'quantity available to move');
1863: fnd_msg_pub.add;
1864: l_errMsg := 'available qty is not enough to fullfill move txn';
1865: raise fnd_api.g_exc_unexpected_error;
1866: END IF;
1867:
1868: ELSIF(l_proc_status = WIP_CONSTANTS.ERROR) THEN
1869:
1873: WHERE transaction_id = l_rs_txn.txn_id
1874: AND group_id = p_gib.group_id;
1875:
1876: l_errMsg := 'wip_movProc_priv.schedule_alloc failed';
1877: raise fnd_api.g_exc_unexpected_error;
1878:
1879: END IF; -- process_status
1880:
1881: END IF; -- c_rs_txn%NOTFOUND
1884: p_gib.move_profile.child_txn_id := null;
1885: -- Fixed bug 4406536. We should error out only problematic record and
1886: -- continue to process next record.
1887: EXCEPTION
1888: WHEN fnd_api.g_exc_unexpected_error THEN
1889: IF(p_gib.move_mode = WIP_CONSTANTS.BACKGROUND) THEN
1890: IF (l_rs_txn.past_timeout = 0) THEN -- not time out yet
1891: UPDATE wip_move_txn_interface
1892: SET process_status = WIP_CONSTANTS.PENDING,
1939: AND wmti.group_id = p_gib.group_id;
1940: END IF; -- time out check
1941: ELSE--Online processing
1942: --Bug 5210073: Raise an exception to rollback the changes in online mode.
1943: raise fnd_api.g_exc_unexpected_error;
1944: END IF; -- background check
1945: END;
1946: END LOOP;
1947:
1947:
1948: <
1949: IF (l_rec_count = 0) THEN -- no record found
1950: l_errMsg := 'No reptitive move record found';
1951: raise fnd_api.g_exc_unexpected_error;
1952:
1953: ELSE
1954: IF(c_rs_txn%ISOPEN) THEN
1955: CLOSE c_rs_txn;
1953: ELSE
1954: IF(c_rs_txn%ISOPEN) THEN
1955: CLOSE c_rs_txn;
1956: END IF;
1957: x_returnStatus := fnd_api.g_ret_sts_success;
1958:
1959: -- write to the log file
1960: IF (l_logLevel <= wip_constants.trace_logging) THEN
1961: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.rep_move_alloc',
1967: END IF;
1968:
1969: EXCEPTION
1970:
1971: WHEN fnd_api.g_exc_unexpected_error THEN
1972: IF(c_rs_txn%ISOPEN) THEN
1973: CLOSE c_rs_txn;
1974: END IF;
1975: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1971: WHEN fnd_api.g_exc_unexpected_error THEN
1972: IF(c_rs_txn%ISOPEN) THEN
1973: CLOSE c_rs_txn;
1974: END IF;
1975: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1976:
1977: IF (l_logLevel <= wip_constants.trace_logging) THEN
1978: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.rep_move_alloc',
1979: p_procReturnStatus => x_returnStatus,
1983: WHEN others THEN
1984: IF(c_rs_txn%ISOPEN) THEN
1985: CLOSE c_rs_txn;
1986: END IF;
1987: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1988: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
1989:
1990: IF (l_logLevel <= wip_constants.trace_logging) THEN
1991: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.rep_move_alloc',
2181: WIP_CONSTANTS.SCRAP,p_fm_op,
2182: p_to_op));
2183: END IF;
2184:
2185: x_returnStatus := fnd_api.g_ret_sts_success;
2186:
2187: -- write to the log file
2188: IF (l_logLevel <= wip_constants.trace_logging) THEN
2189: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.update_wo_dj',
2193: END IF;
2194:
2195: EXCEPTION
2196: WHEN others THEN
2197: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
2198: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
2199:
2200: IF (l_logLevel <= wip_constants.trace_logging) THEN
2201: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.update_wo_dj',
2356: l_ser_loc.sn_step <> l_dj_txn.fm_step)) THEN
2357: fnd_message.set_name('WIP', 'WIP_SERIAL_LOCATION_MISSMATCH');
2358: fnd_msg_pub.add;
2359: l_errMsg := 'current serial location missmatch';
2360: raise fnd_api.g_exc_unexpected_error;
2361: ELSE -- serial location is valid to move
2362: -- If user move back to Queue of serialization start op, we clear
2363: -- operation_seq_num and intraoperation_step_type in MSNT
2364: IF (l_dj_txn.to_op = l_dj_txn.sn_start_op AND
2380: p_operation_seq_num => l_opSeq,
2381: p_intraoperation_step_type => l_step,
2382: x_return_status => l_returnStatus);
2383:
2384: IF(l_returnStatus <> fnd_api.g_ret_sts_success) THEN
2385: l_errMsg := 'wip_utilities.update_serial failed';
2386: raise fnd_api.g_exc_unexpected_error;
2387: END IF;
2388: END IF; -- IF(l_dj_txn.txn_type
2382: x_return_status => l_returnStatus);
2383:
2384: IF(l_returnStatus <> fnd_api.g_ret_sts_success) THEN
2385: l_errMsg := 'wip_utilities.update_serial failed';
2386: raise fnd_api.g_exc_unexpected_error;
2387: END IF;
2388: END IF; -- IF(l_dj_txn.txn_type
2389: END LOOP; -- l_ser_loc IN c_ser_loc
2390: END IF; -- serialized move
2409: update_wipops(p_txn_id => l_dj_txn.txn_id,
2410: p_gib => p_gib,
2411: x_returnStatus => x_returnStatus);
2412:
2413: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
2414: l_errMsg := 'wip_movProc_priv.update_wipops failed';
2415: raise fnd_api.g_exc_unexpected_error;
2416: END IF; -- check return status
2417:
2411: x_returnStatus => x_returnStatus);
2412:
2413: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
2414: l_errMsg := 'wip_movProc_priv.update_wipops failed';
2415: raise fnd_api.g_exc_unexpected_error;
2416: END IF; -- check return status
2417:
2418: ELSE -- IF it is parent or normal txn, validate qty
2419:
2455: fnd_message.set_token('ENTITY1', 'transaction quantity');
2456: fnd_message.set_token('ENTITY2', 'quantity available to move');
2457: fnd_msg_pub.add;
2458: l_errMsg := 'available qty is not enough to fullfill move txn';
2459: raise fnd_api.g_exc_unexpected_error;
2460: ELSE -- enough qty to move
2461: IF(l_dj_txn.oc_txn_type = WIP_CONSTANTS.parent_txn) THEN
2462:
2463: -- all procedure in this loop is pretty much for child record
2469: p_gib => p_gib,
2470: x_oc_fm_op => l_oc_fm_op,
2471: x_returnStatus => x_returnStatus);
2472:
2473: IF (x_returnStatus <> fnd_api.g_ret_sts_success) THEN
2474: IF (l_dj_txn.past_timeout = 0) THEN -- not time out yet
2475: UPDATE wip_move_txn_interface
2476: SET process_status = WIP_CONSTANTS.PENDING,
2477: group_id = NULL,
2480: AND group_id = p_gib.group_id;
2481: END IF; -- time out check
2482:
2483: l_errMsg := 'wip_movProc_priv.insert_alloc_child failed';
2484: raise fnd_api.g_exc_unexpected_error;
2485:
2486: ELSE -- insert child success
2487: -- insert assemblies in the queue of the first operation after
2488: -- the child record is inserted
2489: update_wipops(p_txn_id => p_gib.move_profile.child_txn_id,
2490: p_gib => p_gib,
2491: x_returnStatus => x_returnStatus);
2492:
2493: IF (x_returnStatus <> fnd_api.g_ret_sts_success) THEN
2494: l_errMsg := 'wip_movProc_priv.update_wipops failed';
2495: raise fnd_api.g_exc_unexpected_error;
2496: END IF;
2497:
2491: x_returnStatus => x_returnStatus);
2492:
2493: IF (x_returnStatus <> fnd_api.g_ret_sts_success) THEN
2494: l_errMsg := 'wip_movProc_priv.update_wipops failed';
2495: raise fnd_api.g_exc_unexpected_error;
2496: END IF;
2497:
2498: -- update wip_operations for child move txns
2499: update_wo_dj(p_gib => p_gib,
2506: p_wip_id => l_dj_txn.wip_id,
2507: p_txn_date => l_dj_txn.txn_date,
2508: x_returnStatus => x_returnStatus);
2509:
2510: IF (x_returnStatus <> fnd_api.g_ret_sts_success) THEN
2511: l_errMsg := 'wip_movProc_priv.update_wo_dj failed';
2512: raise fnd_api.g_exc_unexpected_error;
2513: END IF;
2514: END IF; -- insert_alloc_child check
2508: x_returnStatus => x_returnStatus);
2509:
2510: IF (x_returnStatus <> fnd_api.g_ret_sts_success) THEN
2511: l_errMsg := 'wip_movProc_priv.update_wo_dj failed';
2512: raise fnd_api.g_exc_unexpected_error;
2513: END IF;
2514: END IF; -- insert_alloc_child check
2515:
2516: -- Increase PO/requisition quantity if overmove
2533: */
2534: p_fm_op => l_dj_txn.fm_op,
2535: x_return_status => x_returnStatus);
2536:
2537: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
2538: l_errMsg := 'wip_osp.updatePOReqQuantity failed';
2539: raise fnd_api.g_exc_unexpected_error;
2540: END IF; -- x_returnStatus
2541: END IF; -- l_propagate_job_change_to_po = WIP_CONSTANTS.YES
2535: x_return_status => x_returnStatus);
2536:
2537: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
2538: l_errMsg := 'wip_osp.updatePOReqQuantity failed';
2539: raise fnd_api.g_exc_unexpected_error;
2540: END IF; -- x_returnStatus
2541: END IF; -- l_propagate_job_change_to_po = WIP_CONSTANTS.YES
2542: END IF; -- l_dj_txn.oc_pri_qty <> 0 and customer have PO FPJ
2543: END IF; -- IF parent_txn
2553: p_wip_id => l_dj_txn.wip_id,
2554: p_txn_date => l_dj_txn.txn_date,
2555: x_returnStatus => x_returnStatus);
2556:
2557: IF (x_returnStatus <> fnd_api.g_ret_sts_success) THEN
2558: l_errMsg := 'wip_movProc_priv.update_wo_dj failed';
2559: raise fnd_api.g_exc_unexpected_error;
2560: END IF;
2561:
2555: x_returnStatus => x_returnStatus);
2556:
2557: IF (x_returnStatus <> fnd_api.g_ret_sts_success) THEN
2558: l_errMsg := 'wip_movProc_priv.update_wo_dj failed';
2559: raise fnd_api.g_exc_unexpected_error;
2560: END IF;
2561:
2562: END IF; -- check enough qty
2563:
2567: p_gib.move_profile.child_txn_id := null;
2568: -- Fixed bug 4406536. We should error out only problematic record and
2569: -- continue to process next record.
2570: EXCEPTION
2571: WHEN fnd_api.g_exc_unexpected_error THEN
2572: IF(p_gib.move_mode = WIP_CONSTANTS.BACKGROUND) THEN
2573: /*Bug 10379152: when there is exception happenes after serial update, we want to rollback
2574: to this savepoint check_qty_dj_savepoint to avoid serial number being updated for failed move transaction*/
2575: rollback to check_qty_dj_savepoint;
2625: AND wmti.group_id = p_gib.group_id;
2626: END IF; -- time out check
2627: ELSE--Online processing
2628: --Bug 5210073: Raise an exception to rollback the changes in online mode.
2629: raise fnd_api.g_exc_unexpected_error;
2630: END IF; -- background check
2631: END;
2632: END LOOP; -- c_dj_txn
2633:
2634: <
2635: IF(c_dj_txn%ISOPEN) THEN
2636: CLOSE c_dj_txn;
2637: END IF;
2638: x_returnStatus := fnd_api.g_ret_sts_success;
2639:
2640: -- write to the log file
2641: IF (l_logLevel <= wip_constants.trace_logging) THEN
2642: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.check_qty_dj',
2646: END IF;
2647:
2648: EXCEPTION
2649:
2650: WHEN fnd_api.g_exc_unexpected_error THEN
2651: IF(c_dj_txn%ISOPEN) THEN
2652: CLOSE c_dj_txn;
2653: END IF;
2654: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
2650: WHEN fnd_api.g_exc_unexpected_error THEN
2651: IF(c_dj_txn%ISOPEN) THEN
2652: CLOSE c_dj_txn;
2653: END IF;
2654: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
2655:
2656: IF (l_logLevel <= wip_constants.trace_logging) THEN
2657: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.check_qty_dj',
2658: p_procReturnStatus => x_returnStatus,
2663: WHEN others THEN
2664: IF(c_dj_txn%ISOPEN) THEN
2665: CLOSE c_dj_txn;
2666: END IF;
2667: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
2668: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
2669:
2670: IF (l_logLevel <= wip_constants.trace_logging) THEN
2671: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.check_qty_dj',
2858:
2859: -- return move profile back
2860: p_gib.move_profile := l_move;
2861:
2862: x_returnStatus := fnd_api.g_ret_sts_success;
2863:
2864: -- write to the log file
2865: IF (l_logLevel <= wip_constants.trace_logging) THEN
2866: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.get_move_profile',
2870: END IF;
2871:
2872: EXCEPTION
2873: WHEN others THEN
2874: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
2875: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
2876:
2877: IF (l_logLevel <= wip_constants.trace_logging) THEN
2878: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.get_move_profile',
3234: wip_logger.log(p_msg => l_msg,
3235: x_returnStatus => l_returnStatus);
3236: END IF;
3237:
3238: x_returnStatus := fnd_api.g_ret_sts_success;
3239:
3240: -- write to the log file
3241: IF (l_logLevel <= wip_constants.trace_logging) THEN
3242: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.insert_txn_history',
3246: END IF;
3247:
3248: EXCEPTION
3249: WHEN others THEN
3250: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
3251: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
3252:
3253: IF (l_logLevel <= wip_constants.trace_logging) THEN
3254: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.insert_txn_history',
3300: AND wmti.fm_intraoperation_step_type =
3301: wmti.to_intraoperation_step_type
3302: AND wmti.fm_intraoperation_step_type = WIP_CONSTANTS.QUEUE;
3303:
3304: x_returnStatus := fnd_api.g_ret_sts_success;
3305:
3306: -- write to the log file
3307: IF (l_logLevel <= wip_constants.trace_logging) THEN
3308: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.delete_child_txn',
3312: END IF;
3313:
3314: EXCEPTION
3315: WHEN others THEN
3316: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
3317: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
3318: IF (l_logLevel <= wip_constants.trace_logging) THEN
3319: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.delete_child_txn',
3320: p_procReturnStatus => x_returnStatus,
4452: END IF;
4453:
4454: END IF; -- Per order basis type for repetitive
4455:
4456: x_returnStatus := fnd_api.g_ret_sts_success;
4457:
4458: -- write to the log file
4459: IF (l_logLevel <= wip_constants.trace_logging) THEN
4460: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.insert_auto_resource',
4464: END IF;
4465:
4466: EXCEPTION
4467: WHEN others THEN
4468: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
4469: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
4470:
4471: IF (l_logLevel <= wip_constants.trace_logging) THEN
4472: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.insert_auto_resource',
4592: wip_logger.log(p_msg => l_msg,
4593: x_returnStatus => l_returnStatus);
4594: END IF;
4595:
4596: x_returnStatus := fnd_api.g_ret_sts_success;
4597:
4598: -- write to the log file
4599: IF (l_logLevel <= wip_constants.trace_logging) THEN
4600: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.insert_txn_alloc',
4604: END IF;
4605:
4606: EXCEPTION
4607: WHEN others THEN
4608: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
4609: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
4610:
4611: IF (l_logLevel <= wip_constants.trace_logging) THEN
4612: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.insert_txn_alloc',
5723: END IF;
5724:
5725: END IF; -- For repetitive
5726:
5727: x_returnStatus := fnd_api.g_ret_sts_success;
5728:
5729: -- write to the log file
5730: IF (l_logLevel <= wip_constants.trace_logging) THEN
5731: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.insert_dept_overhead',
5735: END IF;
5736:
5737: EXCEPTION
5738: WHEN others THEN
5739: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
5740: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
5741:
5742: IF (l_logLevel <= wip_constants.trace_logging) THEN
5743: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.insert_dept_overhead',
5790: wip_logger.log(p_msg => l_msg,
5791: x_returnStatus => l_returnStatus);
5792: END IF;
5793:
5794: x_returnStatus := fnd_api.g_ret_sts_success;
5795:
5796: -- write to the log file
5797: IF (l_logLevel <= wip_constants.trace_logging) THEN
5798: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.release_cost_txn',
5802: END IF;
5803:
5804: EXCEPTION
5805: WHEN others THEN
5806: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
5807: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
5808:
5809: IF (l_logLevel <= wip_constants.trace_logging) THEN
5810: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.release_cost_txn',
6857: IF(c_additional_reqs%ISOPEN) THEN
6858: CLOSE c_additional_reqs;
6859: END IF;
6860: END IF; -- check PO patchset
6861: x_returnStatus := fnd_api.g_ret_sts_success;
6862:
6863: -- write to the log file
6864: IF (l_logLevel <= wip_constants.trace_logging) THEN
6865: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.insert_po_req',
6872: WHEN others THEN
6873: IF(c_additional_reqs%ISOPEN) THEN
6874: CLOSE c_additional_reqs;
6875: END IF;
6876: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
6877: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
6878:
6879: IF (l_logLevel <= wip_constants.trace_logging) THEN
6880: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.insert_po_req',
7067: where org_id = l_ou_id;
7068:
7069: EXCEPTION
7070: WHEN NO_DATA_FOUND THEN
7071: raise fnd_api.g_exc_unexpected_error;
7072: END;
7073: /*ER 4276433*/
7074: if(fnd_profile.value('WIP_OSP_INITIATE_REQAPPR') = WIP_CONSTANTS.NO) then
7075: l_init_reqappr := 'N';
7095:
7096: IF(c_wmti_txn%ISOPEN) THEN
7097: CLOSE c_wmti_txn;
7098: END IF;
7099: x_returnStatus := fnd_api.g_ret_sts_success;
7100: -- write to the log file
7101: IF (l_logLevel <= wip_constants.trace_logging) THEN
7102: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.start_workflow',
7103: p_procReturnStatus => x_returnStatus,
7110: WHEN others THEN
7111: IF(c_wmti_txn%ISOPEN) THEN
7112: CLOSE c_wmti_txn;
7113: END IF;
7114: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
7115: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
7116:
7117: IF (l_logLevel <= wip_constants.trace_logging) THEN
7118: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.start_workflow',
7310: wip_logger.log(p_msg => l_msg,
7311: x_returnStatus => l_returnStatus);
7312: END IF;
7313:
7314: x_returnStatus := fnd_api.g_ret_sts_success;
7315:
7316: -- write to the log file
7317: IF (l_logLevel <= wip_constants.trace_logging) THEN
7318: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.update_complete_qty',
7322: END IF;
7323:
7324: EXCEPTION
7325: WHEN others THEN
7326: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
7327: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
7328:
7329: IF (l_logLevel <= wip_constants.trace_logging) THEN
7330: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.update_complete_qty',
7368: err_code => l_errCode,
7369: err_msg => l_errMsg);
7370: IF(l_returnValue <> 1) THEN
7371: l_errMsg := 'CSTACOSN.op_snapshot failed';
7372: raise fnd_api.g_exc_unexpected_error;
7373: END IF;
7374:
7375: x_returnStatus := fnd_api.g_ret_sts_success;
7376:
7371: l_errMsg := 'CSTACOSN.op_snapshot failed';
7372: raise fnd_api.g_exc_unexpected_error;
7373: END IF;
7374:
7375: x_returnStatus := fnd_api.g_ret_sts_success;
7376:
7377: -- write to the log file
7378: IF (l_logLevel <= wip_constants.trace_logging) THEN
7379: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.op_snapshot',
7382: x_returnStatus => l_returnStatus);
7383: END IF;
7384:
7385: EXCEPTION
7386: WHEN fnd_api.g_exc_unexpected_error THEN
7387: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
7388:
7389: IF (l_logLevel <= wip_constants.trace_logging) THEN
7390: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.op_snapshot',
7383: END IF;
7384:
7385: EXCEPTION
7386: WHEN fnd_api.g_exc_unexpected_error THEN
7387: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
7388:
7389: IF (l_logLevel <= wip_constants.trace_logging) THEN
7390: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.op_snapshot',
7391: p_procReturnStatus => x_returnStatus,
7396: fnd_message.set_name('CST', l_errCode);
7397: fnd_msg_pub.add;
7398:
7399: WHEN others THEN
7400: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
7401: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
7402:
7403: IF (l_logLevel <= wip_constants.trace_logging) THEN
7404: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.op_snapshot',
7496: FOR l_mmtt IN c_mmtt LOOP
7497: op_snapshot(p_mtl_temp_id => l_mmtt.mtl_temp_id,
7498: x_returnStatus => x_returnStatus);
7499:
7500: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
7501: l_errMsg := 'wip_movProc_priv.op_snapshot failed';
7502: raise fnd_api.g_exc_unexpected_error;
7503: END IF; -- check return status
7504: END LOOP; -- END for loop
7498: x_returnStatus => x_returnStatus);
7499:
7500: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
7501: l_errMsg := 'wip_movProc_priv.op_snapshot failed';
7502: raise fnd_api.g_exc_unexpected_error;
7503: END IF; -- check return status
7504: END LOOP; -- END for loop
7505: END IF;
7506:
7503: END IF; -- check return status
7504: END LOOP; -- END for loop
7505: END IF;
7506:
7507: x_returnStatus := fnd_api.g_ret_sts_success;
7508:
7509: -- write to the log file
7510: IF (l_logLevel <= wip_constants.trace_logging) THEN
7511: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.snapshot_online',
7514: x_returnStatus => l_returnStatus);
7515: END IF;
7516:
7517: EXCEPTION
7518: WHEN fnd_api.g_exc_unexpected_error THEN
7519: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
7520:
7521: IF (l_logLevel <= wip_constants.trace_logging) THEN
7522: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.snapshot_online',
7515: END IF;
7516:
7517: EXCEPTION
7518: WHEN fnd_api.g_exc_unexpected_error THEN
7519: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
7520:
7521: IF (l_logLevel <= wip_constants.trace_logging) THEN
7522: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.snapshot_online',
7523: p_procReturnStatus => x_returnStatus,
7525: x_returnStatus => l_returnStatus);
7526: END IF;
7527:
7528: WHEN others THEN
7529: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
7530: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
7531:
7532: IF (l_logLevel <= wip_constants.trace_logging) THEN
7533: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.snapshot_online',
7704: IF(l_returnValue <> 1) THEN
7705: fnd_message.set_name('CST', l_errCode);
7706: fnd_msg_pub.add;
7707: l_errMsg := 'CSTACOSN.validate_move_snap_to_temp failed';
7708: raise fnd_api.g_exc_unexpected_error;
7709: END IF; -- check return status
7710: ELSE
7711: op_snapshot(p_mtl_temp_id => l_txns.mtl_temp_id,
7712: x_returnStatus => x_returnStatus);
7710: ELSE
7711: op_snapshot(p_mtl_temp_id => l_txns.mtl_temp_id,
7712: x_returnStatus => x_returnStatus);
7713:
7714: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
7715: l_errMsg := 'wip_movProc_priv.op_snapshot failed';
7716: raise fnd_api.g_exc_unexpected_error;
7717: END IF; -- check return status
7718: END IF; -- check load from interface and source code
7712: x_returnStatus => x_returnStatus);
7713:
7714: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
7715: l_errMsg := 'wip_movProc_priv.op_snapshot failed';
7716: raise fnd_api.g_exc_unexpected_error;
7717: END IF; -- check return status
7718: END IF; -- check load from interface and source code
7719: END LOOP;
7720:
7718: END IF; -- check load from interface and source code
7719: END LOOP;
7720:
7721: <
7722: x_returnStatus := fnd_api.g_ret_sts_success;
7723:
7724: -- write to the log file
7725: IF (l_logLevel <= wip_constants.trace_logging) THEN
7726: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.snapshot_background',
7729: x_returnStatus => l_returnStatus);
7730: END IF;
7731:
7732: EXCEPTION
7733: WHEN fnd_api.g_exc_unexpected_error THEN
7734: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
7735:
7736: IF (l_logLevel <= wip_constants.trace_logging) THEN
7737: wip_logger.exitPoint(p_procName =>'wip_movProc_priv.snapshot_background',
7730: END IF;
7731:
7732: EXCEPTION
7733: WHEN fnd_api.g_exc_unexpected_error THEN
7734: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
7735:
7736: IF (l_logLevel <= wip_constants.trace_logging) THEN
7737: wip_logger.exitPoint(p_procName =>'wip_movProc_priv.snapshot_background',
7738: p_procReturnStatus => x_returnStatus,
7740: x_returnStatus => l_returnStatus);
7741: END IF;
7742:
7743: WHEN others THEN
7744: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
7745: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
7746:
7747: IF (l_logLevel <= wip_constants.trace_logging) THEN
7748: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.snapshot_background',
7794: update_complete_qty(p_gib => p_gib,
7795: p_txn_id => l_move_rec.txn_id,
7796: x_returnStatus => x_returnStatus);
7797:
7798: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
7799: l_errMsg := 'wip_movProc_priv.update_complete_qty failed';
7800: raise fnd_api.g_exc_unexpected_error;
7801: END IF; -- check return status
7802:
7796: x_returnStatus => x_returnStatus);
7797:
7798: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
7799: l_errMsg := 'wip_movProc_priv.update_complete_qty failed';
7800: raise fnd_api.g_exc_unexpected_error;
7801: END IF; -- check return status
7802:
7803: snapshot_background(p_group_id => p_gib.group_id,
7804: p_txn_id => l_move_rec.txn_id,
7804: p_txn_id => l_move_rec.txn_id,
7805: p_txn_date => p_gib.txn_date,
7806: x_returnStatus => x_returnStatus);
7807:
7808: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
7809: l_errMsg := 'wip_movProc_priv.snapshot_background failed';
7810: raise fnd_api.g_exc_unexpected_error;
7811: END IF; -- check return status
7812: END LOOP;
7806: x_returnStatus => x_returnStatus);
7807:
7808: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
7809: l_errMsg := 'wip_movProc_priv.snapshot_background failed';
7810: raise fnd_api.g_exc_unexpected_error;
7811: END IF; -- check return status
7812: END LOOP;
7813: ELSE
7814: -- update quantity_completed and take snapshot for the whole group
7814: -- update quantity_completed and take snapshot for the whole group
7815: update_complete_qty(p_gib => p_gib,
7816: x_returnStatus => x_returnStatus);
7817:
7818: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
7819: l_errMsg := 'wip_movProc_priv.update_complete_qty failed';
7820: raise fnd_api.g_exc_unexpected_error;
7821: END IF; -- check return status
7822:
7816: x_returnStatus => x_returnStatus);
7817:
7818: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
7819: l_errMsg := 'wip_movProc_priv.update_complete_qty failed';
7820: raise fnd_api.g_exc_unexpected_error;
7821: END IF; -- check return status
7822:
7823: snapshot_background(p_group_id => p_gib.group_id,
7824: p_txn_date => p_gib.txn_date,
7823: snapshot_background(p_group_id => p_gib.group_id,
7824: p_txn_date => p_gib.txn_date,
7825: x_returnStatus => x_returnStatus);
7826:
7827: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
7828: l_errMsg := 'wip_movProc_priv.snapshot_background failed';
7829: raise fnd_api.g_exc_unexpected_error;
7830: END IF; -- check return status
7831: END IF;
7825: x_returnStatus => x_returnStatus);
7826:
7827: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
7828: l_errMsg := 'wip_movProc_priv.snapshot_background failed';
7829: raise fnd_api.g_exc_unexpected_error;
7830: END IF; -- check return status
7831: END IF;
7832:
7833: x_returnStatus := fnd_api.g_ret_sts_success;
7829: raise fnd_api.g_exc_unexpected_error;
7830: END IF; -- check return status
7831: END IF;
7832:
7833: x_returnStatus := fnd_api.g_ret_sts_success;
7834: -- write to the log file
7835: IF (l_logLevel <= wip_constants.trace_logging) THEN
7836: wip_logger.exitPoint(p_procName =>'wip_movProc_priv.update_wo_and_snapshot',
7837: p_procReturnStatus => x_returnStatus,
7838: p_msg => 'procedure complete',
7839: x_returnStatus => l_returnStatus);
7840: END IF;
7841: EXCEPTION
7842: WHEN fnd_api.g_exc_unexpected_error THEN
7843: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
7844: IF (l_logLevel <= wip_constants.trace_logging) THEN
7845: wip_logger.exitPoint(p_procName =>'wip_movProc_priv.update_wo_and_snapshot',
7846: p_procReturnStatus => x_returnStatus,
7839: x_returnStatus => l_returnStatus);
7840: END IF;
7841: EXCEPTION
7842: WHEN fnd_api.g_exc_unexpected_error THEN
7843: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
7844: IF (l_logLevel <= wip_constants.trace_logging) THEN
7845: wip_logger.exitPoint(p_procName =>'wip_movProc_priv.update_wo_and_snapshot',
7846: p_procReturnStatus => x_returnStatus,
7847: p_msg => l_errMsg,
7848: x_returnStatus => l_returnStatus);
7849: END IF;
7850:
7851: WHEN others THEN
7852: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
7853: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
7854:
7855: IF (l_logLevel <= wip_constants.trace_logging) THEN
7856: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.update_wo_and_snapshot',
8025: x_return_status => l_returnstatus,
8026: x_msg_count => l_msg_count,
8027: x_msg_data => l_msg_data
8028: );
8029: IF (l_returnstatus <> fnd_api.g_ret_sts_success) THEN
8030: IF (l_returnstatus = fnd_api.g_ret_sts_error) THEN
8031: fnd_msg_pub.count_and_get(
8032: p_encoded => fnd_api.g_false,
8033: p_count => l_msg_count,
8026: x_msg_count => l_msg_count,
8027: x_msg_data => l_msg_data
8028: );
8029: IF (l_returnstatus <> fnd_api.g_ret_sts_success) THEN
8030: IF (l_returnstatus = fnd_api.g_ret_sts_error) THEN
8031: fnd_msg_pub.count_and_get(
8032: p_encoded => fnd_api.g_false,
8033: p_count => l_msg_count,
8034: p_data => l_errmsg);
8028: );
8029: IF (l_returnstatus <> fnd_api.g_ret_sts_success) THEN
8030: IF (l_returnstatus = fnd_api.g_ret_sts_error) THEN
8031: fnd_msg_pub.count_and_get(
8032: p_encoded => fnd_api.g_false,
8033: p_count => l_msg_count,
8034: p_data => l_errmsg);
8035: RAISE fnd_api.g_exc_error;
8036: ELSE
8031: fnd_msg_pub.count_and_get(
8032: p_encoded => fnd_api.g_false,
8033: p_count => l_msg_count,
8034: p_data => l_errmsg);
8035: RAISE fnd_api.g_exc_error;
8036: ELSE
8037: fnd_msg_pub.count_and_get(
8038: p_encoded => fnd_api.g_false,
8039: p_count => l_msg_count,
8034: p_data => l_errmsg);
8035: RAISE fnd_api.g_exc_error;
8036: ELSE
8037: fnd_msg_pub.count_and_get(
8038: p_encoded => fnd_api.g_false,
8039: p_count => l_msg_count,
8040: p_data => l_errmsg);
8041:
8042: RAISE fnd_api.g_exc_unexpected_error;
8038: p_encoded => fnd_api.g_false,
8039: p_count => l_msg_count,
8040: p_data => l_errmsg);
8041:
8042: RAISE fnd_api.g_exc_unexpected_error;
8043: END IF;
8044: END IF;
8045:
8046:
8517: p_txn_type_id => WIP_CONSTANTS.SCRASSY_TYPE,
8518: p_txn_action_id => WIP_CONSTANTS.SCRASSY_ACTION,
8519: x_returnStatus => x_returnStatus);
8520:
8521: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
8522: l_errMsg := 'wip_movProc_priv.snapshot_online failed';
8523: raise fnd_api.g_exc_unexpected_error;
8524: END IF; -- check return status
8525: END IF; -- move mode check
8519: x_returnStatus => x_returnStatus);
8520:
8521: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
8522: l_errMsg := 'wip_movProc_priv.snapshot_online failed';
8523: raise fnd_api.g_exc_unexpected_error;
8524: END IF; -- check return status
8525: END IF; -- move mode check
8526: END IF; -- IF job txns
8527: END IF; -- scrap transactions
8552: wip_osp.cancelPOReq(
8553: p_job_id => l_update_po.job_id,
8554: p_org_id => l_update_po.org_id,
8555: x_return_status => x_returnStatus);
8556: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
8557: l_errMsg := 'wip_osp.cancelPOReq failed';
8558: raise fnd_api.g_exc_unexpected_error;
8559: END IF;
8560: ELSE
8554: p_org_id => l_update_po.org_id,
8555: x_return_status => x_returnStatus);
8556: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
8557: l_errMsg := 'wip_osp.cancelPOReq failed';
8558: raise fnd_api.g_exc_unexpected_error;
8559: END IF;
8560: ELSE
8561: /* end of fix 6607192 */
8562:
8569: /* Fix for Bug#4734309 */
8570: p_is_scrap_txn => WIP_CONSTANTS.YES,
8571: x_return_status => x_returnStatus);
8572:
8573: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
8574: l_errMsg := 'wip_osp.updatePOReqQuantity failed';
8575: raise fnd_api.g_exc_unexpected_error;
8576: END IF;
8577: END IF;
8571: x_return_status => x_returnStatus);
8572:
8573: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
8574: l_errMsg := 'wip_osp.updatePOReqQuantity failed';
8575: raise fnd_api.g_exc_unexpected_error;
8576: END IF;
8577: END IF;
8578:
8579: END LOOP;
8581:
8582:
8583: -- assign l_move back to move profile
8584: p_gib.move_profile := l_move;
8585: x_returnStatus := fnd_api.g_ret_sts_success;
8586:
8587: -- write to the log file
8588: IF (l_logLevel <= wip_constants.trace_logging) THEN
8589: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.scrap_txns',
8592: x_returnStatus => l_returnStatus);
8593: END IF;
8594:
8595: EXCEPTION
8596: WHEN fnd_api.g_exc_unexpected_error THEN
8597: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
8598: IF (l_logLevel <= wip_constants.trace_logging) THEN
8599: wip_logger.exitPoint(p_procName =>'wip_movProc_priv.scrap_txns',
8600: p_procReturnStatus => x_returnStatus,
8593: END IF;
8594:
8595: EXCEPTION
8596: WHEN fnd_api.g_exc_unexpected_error THEN
8597: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
8598: IF (l_logLevel <= wip_constants.trace_logging) THEN
8599: wip_logger.exitPoint(p_procName =>'wip_movProc_priv.scrap_txns',
8600: p_procReturnStatus => x_returnStatus,
8601: p_msg => l_errMsg,
8602: x_returnStatus => l_returnStatus);
8603: END IF;
8604:
8605: WHEN others THEN
8606: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
8607: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
8608:
8609: IF (l_logLevel <= wip_constants.trace_logging) THEN
8610: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.scrap_txns',
9342: END IF;
9343: END IF; -- Discrete or OSFM jobs
9344:
9345: IF(p_gib.move_mode = WIP_CONSTANTS.ONLINE) THEN
9346: l_addMsgToStack := fnd_api.g_true;
9347: ELSE
9348: -- Message stack is only useful for online transaction. For background,
9349: -- we never used message stack.
9350: l_addMsgToStack := fnd_api.g_false;
9346: l_addMsgToStack := fnd_api.g_true;
9347: ELSE
9348: -- Message stack is only useful for online transaction. For background,
9349: -- we never used message stack.
9350: l_addMsgToStack := fnd_api.g_false;
9351: END IF;
9352: -- Move all assembly records from mti to mmtt
9353: wip_mtlTempProc_priv.validateInterfaceTxns(
9354: p_txnHdrID => p_gib.assy_header_id,
9352: -- Move all assembly records from mti to mmtt
9353: wip_mtlTempProc_priv.validateInterfaceTxns(
9354: p_txnHdrID => p_gib.assy_header_id,
9355: p_addMsgToStack => l_addMsgToStack,
9356: p_rollbackOnErr => fnd_api.g_false,
9357: x_returnStatus => x_returnStatus);
9358:
9359: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9360: --FP bug 5752485 (base bug 4128207) Added the IF condition below since write_mtl_errors
9355: p_addMsgToStack => l_addMsgToStack,
9356: p_rollbackOnErr => fnd_api.g_false,
9357: x_returnStatus => x_returnStatus);
9358:
9359: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9360: --FP bug 5752485 (base bug 4128207) Added the IF condition below since write_mtl_errors
9361: --is not applicable for ONLINE completions. Otherwise the fnd_msg_pub stack is initialized
9362: --inside write_mtl_errors which suppresses messages to be shown to the user in the UI
9363: IF (l_transaction_mode <> WIP_CONSTANTS.ONLINE) THEN
9365: write_mtl_errors(p_mtl_header_id => p_gib.assy_header_id);
9366: END IF;
9367: l_errMsg := 'wip_mtlTempProc_priv.validateInterfaceTxns failed' ||
9368: ' (assembly records)' ;
9369: raise fnd_api.g_exc_unexpected_error;
9370: END IF;
9371:
9372: FOR l_repAssembly IN c_repAssembly(p_header_id => p_gib.assy_header_id) LOOP
9373: -- Preallocate if repetitive schedule. This API will allocate primary
9378: p_txnActionID => l_repAssembly.txn_action_id,
9379: p_wipEntityID => l_repAssembly.txn_src_id,
9380: p_repLineID => l_repAssembly.rep_line_id,
9381: p_tblName => WIP_CONSTANTS.MMTT_TBL,
9382: p_endDebug => fnd_api.g_false,
9383: x_returnStatus => x_returnStatus);
9384:
9385: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9386: l_errMsg := 'wip_cplProc_priv.preAllocateSchedules failed' ;
9381: p_tblName => WIP_CONSTANTS.MMTT_TBL,
9382: p_endDebug => fnd_api.g_false,
9383: x_returnStatus => x_returnStatus);
9384:
9385: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9386: l_errMsg := 'wip_cplProc_priv.preAllocateSchedules failed' ;
9387: raise fnd_api.g_exc_unexpected_error;
9388: END IF;
9389: END LOOP;
9383: x_returnStatus => x_returnStatus);
9384:
9385: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9386: l_errMsg := 'wip_cplProc_priv.preAllocateSchedules failed' ;
9387: raise fnd_api.g_exc_unexpected_error;
9388: END IF;
9389: END LOOP;
9390:
9391: IF(p_gib.move_mode = WIP_CONSTANTS.ONLINE) THEN
9395: p_txn_type_id => l_txn_type_id,
9396: p_txn_action_id => l_txn_action_id,
9397: x_returnStatus => x_returnStatus);
9398:
9399: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9400: l_errMsg := 'wip_movProc_priv.snapshot_online failed';
9401: raise fnd_api.g_exc_unexpected_error;
9402: END IF; -- check return status
9403: ELSE -- move is background
9397: x_returnStatus => x_returnStatus);
9398:
9399: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9400: l_errMsg := 'wip_movProc_priv.snapshot_online failed';
9401: raise fnd_api.g_exc_unexpected_error;
9402: END IF; -- check return status
9403: ELSE -- move is background
9404: IF(p_txn_type = WIP_CONSTANTS.RET_TXN) THEN
9405: snapshot_background(p_group_id => p_gib.group_id,
9405: snapshot_background(p_group_id => p_gib.group_id,
9406: p_txn_date => p_gib.txn_date,
9407: x_returnStatus => x_returnStatus);
9408:
9409: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9410: l_errMsg := 'wip_movProc_priv.snapshot_background failed';
9411: raise fnd_api.g_exc_unexpected_error;
9412: END IF; -- check return status
9413: END IF; -- return transaction
9407: x_returnStatus => x_returnStatus);
9408:
9409: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9410: l_errMsg := 'wip_movProc_priv.snapshot_background failed';
9411: raise fnd_api.g_exc_unexpected_error;
9412: END IF; -- check return status
9413: END IF; -- return transaction
9414: END IF; -- move mode check
9415:
9412: END IF; -- check return status
9413: END IF; -- return transaction
9414: END IF; -- move mode check
9415:
9416: x_returnStatus := fnd_api.g_ret_sts_success;
9417:
9418: -- write to the log file
9419: IF (l_logLevel <= wip_constants.trace_logging) THEN
9420: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.ez_completion',
9423: x_returnStatus => l_returnStatus);
9424: END IF;
9425:
9426: EXCEPTION
9427: WHEN fnd_api.g_exc_unexpected_error THEN
9428: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
9429: IF (l_logLevel <= wip_constants.trace_logging) THEN
9430: wip_logger.exitPoint(p_procName =>'wip_movProc_priv.ez_completion',
9431: p_procReturnStatus => x_returnStatus,
9424: END IF;
9425:
9426: EXCEPTION
9427: WHEN fnd_api.g_exc_unexpected_error THEN
9428: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
9429: IF (l_logLevel <= wip_constants.trace_logging) THEN
9430: wip_logger.exitPoint(p_procName =>'wip_movProc_priv.ez_completion',
9431: p_procReturnStatus => x_returnStatus,
9432: p_msg => l_errMsg,
9433: x_returnStatus => l_returnStatus);
9434: END IF;
9435:
9436: WHEN others THEN
9437: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
9438: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
9439:
9440: IF (l_logLevel <= wip_constants.trace_logging) THEN
9441: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.ez_completion',
9532: AND NVL(wma2.repetitive_schedule_id,0)
9533: = NVL(wro2.repetitive_schedule_id,0))
9534: AND nvl(wro.basis_type,1) <> WIP_CONSTANTS.LOT_BASED_MTL; /* LBM Project */
9535:
9536: x_returnStatus := fnd_api.g_ret_sts_success;
9537:
9538: -- write to the log file
9539: IF (l_logLevel <= wip_constants.trace_logging) THEN
9540: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.update_wro',
9544: END IF;
9545:
9546: EXCEPTION
9547: WHEN others THEN
9548: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
9549: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
9550:
9551: IF (l_logLevel <= wip_constants.trace_logging) THEN
9552: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.update_wro',
9651: -- Lock record in WIP_OPERATIONS table
9652: lock_wipops(p_gib => p_gib,
9653: x_returnStatus => x_returnStatus);
9654:
9655: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9656: l_errMsg := 'wip_movProc_priv.lock_wipops failed';
9657: raise fnd_api.g_exc_unexpected_error;
9658: END IF; -- check return status
9659:
9653: x_returnStatus => x_returnStatus);
9654:
9655: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9656: l_errMsg := 'wip_movProc_priv.lock_wipops failed';
9657: raise fnd_api.g_exc_unexpected_error;
9658: END IF; -- check return status
9659:
9660: -- Call repetitive allocatioin for repetitive schedule
9661: IF(l_move.scheTxn = WIP_CONSTANTS.YES) THEN
9661: IF(l_move.scheTxn = WIP_CONSTANTS.YES) THEN
9662: rep_move_alloc(p_gib => p_gib,
9663: x_returnStatus => x_returnStatus);
9664:
9665: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9666: l_errMsg := 'wip_movProc_priv.rep_move_alloc failed';
9667: raise fnd_api.g_exc_unexpected_error;
9668: END IF; -- check return status
9669: END IF; -- check repetitive schedules
9663: x_returnStatus => x_returnStatus);
9664:
9665: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9666: l_errMsg := 'wip_movProc_priv.rep_move_alloc failed';
9667: raise fnd_api.g_exc_unexpected_error;
9668: END IF; -- check return status
9669: END IF; -- check repetitive schedules
9670:
9671: -- Check for the step unit quantities for discrete and OSFM jobs
9672: IF(l_move.jobTxn = WIP_CONSTANTS.YES) THEN
9673: check_qty_dj(p_gib => p_gib,
9674: x_returnStatus => x_returnStatus);
9675:
9676: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9677: l_errMsg := 'wip_movProc_priv.check_qty_dj failed';
9678: raise fnd_api.g_exc_unexpected_error;
9679: END IF; -- check return status
9680: END IF; -- check discrete and OSFM jobs
9674: x_returnStatus => x_returnStatus);
9675:
9676: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9677: l_errMsg := 'wip_movProc_priv.check_qty_dj failed';
9678: raise fnd_api.g_exc_unexpected_error;
9679: END IF; -- check return status
9680: END IF; -- check discrete and OSFM jobs
9681:
9682: -- Lock record in WIP_OPERATIONS table
9683: -- Update the WRO quantities for the Overcompletion
9684: update_wro(p_gib => p_gib,
9685: x_returnStatus => x_returnStatus);
9686:
9687: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9688: l_errMsg := 'wip_movProc_priv.update_wro failed';
9689: raise fnd_api.g_exc_unexpected_error;
9690: END IF; -- check return status
9691:
9685: x_returnStatus => x_returnStatus);
9686:
9687: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9688: l_errMsg := 'wip_movProc_priv.update_wro failed';
9689: raise fnd_api.g_exc_unexpected_error;
9690: END IF; -- check return status
9691:
9692: -- Record move transactions history in WIP_MOVE_TRANSACTIONS
9693: insert_txn_history(p_gib => p_gib,
9692: -- Record move transactions history in WIP_MOVE_TRANSACTIONS
9693: insert_txn_history(p_gib => p_gib,
9694: x_returnStatus => x_returnStatus);
9695:
9696: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9697: l_errMsg := 'wip_movProc_priv.insert_txn_history failed';
9698: raise fnd_api.g_exc_unexpected_error;
9699: END IF; -- check return status
9700:
9694: x_returnStatus => x_returnStatus);
9695:
9696: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9697: l_errMsg := 'wip_movProc_priv.insert_txn_history failed';
9698: raise fnd_api.g_exc_unexpected_error;
9699: END IF; -- check return status
9700:
9701: -- Delete child record (overmove/overcompletion/overreturn)
9702: delete_child_txn(p_gib => p_gib,
9702: delete_child_txn(p_gib => p_gib,
9703: x_returnStatus => x_returnStatus);
9704:
9705: -- Delete child record (overmove/overcompletion/overreturn)
9706: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9707: l_errMsg := 'wip_movProc_priv.delete_child_txn failed';
9708: raise fnd_api.g_exc_unexpected_error;
9709: END IF; -- check return status
9710:
9704:
9705: -- Delete child record (overmove/overcompletion/overreturn)
9706: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9707: l_errMsg := 'wip_movProc_priv.delete_child_txn failed';
9708: raise fnd_api.g_exc_unexpected_error;
9709: END IF; -- check return status
9710:
9711: -- Delete child record (overmove/overcompletion/overreturn)
9712: -- Insert auto-resources associated with move
9713: -- (insert into WIP_COST_TXN_INTERFACE)
9714: insert_auto_resource(p_gib => p_gib,
9715: x_returnStatus => x_returnStatus);
9716:
9717: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9718: l_errMsg := 'wip_movProc_priv.insert_auto_resource failed';
9719: raise fnd_api.g_exc_unexpected_error;
9720: END IF; -- check return status
9721:
9715: x_returnStatus => x_returnStatus);
9716:
9717: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9718: l_errMsg := 'wip_movProc_priv.insert_auto_resource failed';
9719: raise fnd_api.g_exc_unexpected_error;
9720: END IF; -- check return status
9721:
9722: -- Only call the cost allocation IF schedule transactions and auto resource
9723: -- per item exist (insert into WIP_TXN_ALLOCATIONS)
9726:
9727: insert_txn_alloc(p_gib => p_gib,
9728: x_returnStatus => x_returnStatus);
9729:
9730: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9731: l_errMsg := 'wip_movProc_priv.insert_txn_alloc failed';
9732: raise fnd_api.g_exc_unexpected_error;
9733: END IF; -- check return status
9734: END IF; -- repetitive schedule and resource per item exist
9728: x_returnStatus => x_returnStatus);
9729:
9730: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9731: l_errMsg := 'wip_movProc_priv.insert_txn_alloc failed';
9732: raise fnd_api.g_exc_unexpected_error;
9733: END IF; -- check return status
9734: END IF; -- repetitive schedule and resource per item exist
9735:
9736: -- Insert department overhead into WIP_COST_TXN_INTERFACE
9736: -- Insert department overhead into WIP_COST_TXN_INTERFACE
9737: insert_dept_overhead(p_gib => p_gib,
9738: x_returnStatus => x_returnStatus);
9739:
9740: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9741: l_errMsg := 'wip_movProc_priv.insert_dept_overhead failed';
9742: raise fnd_api.g_exc_unexpected_error;
9743: END IF; -- check return status
9744:
9738: x_returnStatus => x_returnStatus);
9739:
9740: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9741: l_errMsg := 'wip_movProc_priv.insert_dept_overhead failed';
9742: raise fnd_api.g_exc_unexpected_error;
9743: END IF; -- check return status
9744:
9745: -- Release costing transactions
9746: release_cost_txn(p_gib => p_gib,
9745: -- Release costing transactions
9746: release_cost_txn(p_gib => p_gib,
9747: x_returnStatus => x_returnStatus);
9748:
9749: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9750: l_errMsg := 'wip_movProc_priv.release_cost_txn failed';
9751: raise fnd_api.g_exc_unexpected_error;
9752: END IF; -- check return status
9753:
9747: x_returnStatus => x_returnStatus);
9748:
9749: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9750: l_errMsg := 'wip_movProc_priv.release_cost_txn failed';
9751: raise fnd_api.g_exc_unexpected_error;
9752: END IF; -- check return status
9753:
9754: -- IF PO installed and PO, insert PO info into PO_REQUISITIONS_INTERFACE_ALL
9755: l_po := fnd_installation.get_app_info
9759: oracle_schema => l_poSchema);
9760:
9761: IF(l_po = FALSE) THEN -- there is an error calling fnd_installion package
9762: l_errMsg := 'fnd_installation.get_app_info failed';
9763: raise fnd_api.g_exc_unexpected_error;
9764: ELSE -- no error
9765: IF(l_poStatus = 'I') THEN -- IF PO installed, insert PO info
9766: insert_po_req(p_gib => p_gib,
9767: x_returnStatus => x_returnStatus);
9765: IF(l_poStatus = 'I') THEN -- IF PO installed, insert PO info
9766: insert_po_req(p_gib => p_gib,
9767: x_returnStatus => x_returnStatus);
9768:
9769: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9770: l_errMsg := 'wip_movProc_priv.insert_po_req failed';
9771: raise fnd_api.g_exc_unexpected_error;
9772: END IF; -- check return status
9773: END IF;
9767: x_returnStatus => x_returnStatus);
9768:
9769: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9770: l_errMsg := 'wip_movProc_priv.insert_po_req failed';
9771: raise fnd_api.g_exc_unexpected_error;
9772: END IF; -- check return status
9773: END IF;
9774: END IF;
9775:
9778: -- quantity completed in update_wo_and_snapshot
9779: update_complete_qty(p_gib => p_gib,
9780: x_returnStatus => x_returnStatus);
9781:
9782: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9783: l_errMsg := 'wip_movProc_priv.update_complete_qty failed';
9784: raise fnd_api.g_exc_unexpected_error;
9785: END IF; -- check return status
9786: END IF;
9780: x_returnStatus => x_returnStatus);
9781:
9782: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9783: l_errMsg := 'wip_movProc_priv.update_complete_qty failed';
9784: raise fnd_api.g_exc_unexpected_error;
9785: END IF; -- check return status
9786: END IF;
9787:
9788: -- Update scrap quantity in WIP_DISCRETE_JOBS and insert into MMTT IF
9789: -- scrap account provided
9790: scrap_txns(p_gib => p_gib,
9791: x_returnStatus => x_returnStatus);
9792:
9793: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9794: l_errMsg := 'wip_movProc_priv.scrap_txns failed';
9795: raise fnd_api.g_exc_unexpected_error;
9796: END IF; -- check return status
9797:
9791: x_returnStatus => x_returnStatus);
9792:
9793: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9794: l_errMsg := 'wip_movProc_priv.scrap_txns failed';
9795: raise fnd_api.g_exc_unexpected_error;
9796: END IF; -- check return status
9797:
9798: -- Start workflow for OSP stuff
9799: start_workflow(p_gib => p_gib,
9798: -- Start workflow for OSP stuff
9799: start_workflow(p_gib => p_gib,
9800: x_returnStatus => x_returnStatus);
9801:
9802: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9803: l_errMsg := 'wip_movProc_priv.start_workflow failed';
9804: raise fnd_api.g_exc_unexpected_error;
9805: END IF; -- check return status
9806:
9800: x_returnStatus => x_returnStatus);
9801:
9802: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
9803: l_errMsg := 'wip_movProc_priv.start_workflow failed';
9804: raise fnd_api.g_exc_unexpected_error;
9805: END IF; -- check return status
9806:
9807: x_returnStatus := fnd_api.g_ret_sts_success;
9808:
9803: l_errMsg := 'wip_movProc_priv.start_workflow failed';
9804: raise fnd_api.g_exc_unexpected_error;
9805: END IF; -- check return status
9806:
9807: x_returnStatus := fnd_api.g_ret_sts_success;
9808:
9809: -- write to the log file
9810: IF (l_logLevel <= wip_constants.trace_logging) THEN
9811: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.move_txns',
9814: x_returnStatus => l_returnStatus);
9815: END IF;
9816:
9817: EXCEPTION
9818: WHEN fnd_api.g_exc_unexpected_error THEN
9819: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
9820: IF (l_logLevel <= wip_constants.trace_logging) THEN
9821: wip_logger.exitPoint(p_procName =>'wip_movProc_priv.move_txns',
9822: p_procReturnStatus => x_returnStatus,
9815: END IF;
9816:
9817: EXCEPTION
9818: WHEN fnd_api.g_exc_unexpected_error THEN
9819: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
9820: IF (l_logLevel <= wip_constants.trace_logging) THEN
9821: wip_logger.exitPoint(p_procName =>'wip_movProc_priv.move_txns',
9822: p_procReturnStatus => x_returnStatus,
9823: p_msg => l_errMsg,
9824: x_returnStatus => l_returnStatus);
9825: END IF;
9826:
9827: WHEN others THEN
9828: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
9829: l_errMsg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
9830:
9831: IF (l_logLevel <= wip_constants.trace_logging) THEN
9832: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.move_txns',
9973: l_wip_entity_id NUMBER;
9974: l_job_name VARCHAR2(240);
9975: BEGIN
9976:
9977: IF(fnd_api.to_boolean(p_initMsgList)) THEN
9978: fnd_msg_pub.initialize;
9979: END IF;
9980:
9981: IF (l_logLevel <= wip_constants.trace_logging) THEN
10164: | Move Validation |
10165: +-----------------*/
10166: -- derive and validate all necessary info
10167: wip_move_validator.validate(p_group_id => p_group_id,
10168: p_initMsgList => fnd_api.g_true);
10169:
10170: -- There is no return status from this routine. IF some record error out,
10171: -- just neglect it and continue validating other records. The error record
10172: -- will have process_status in WIP_MOVE_TXN_INTERFACE equal to (3) or
10217: /* get profile of this group of transactions */
10218: get_move_profile(p_gib => l_gib,
10219: x_returnStatus => x_returnStatus);
10220:
10221: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10222: l_errMsg := 'wip_movProc_priv.get_move_profile failed';
10223: raise fnd_api.g_exc_unexpected_error;
10224: END IF; -- check return status
10225:
10219: x_returnStatus => x_returnStatus);
10220:
10221: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10222: l_errMsg := 'wip_movProc_priv.get_move_profile failed';
10223: raise fnd_api.g_exc_unexpected_error;
10224: END IF; -- check return status
10225:
10226: -- check IF easy return txns
10227: IF(l_gib.move_profile.easyReturn = WIP_CONSTANTS.YES) THEN
10224: END IF; -- check return status
10225:
10226: -- check IF easy return txns
10227: IF(l_gib.move_profile.easyReturn = WIP_CONSTANTS.YES) THEN
10228: IF(p_insertAssy = fnd_api.g_true) THEN
10229: ez_completion(p_gib => l_gib,
10230: p_txn_type => WIP_CONSTANTS.RET_TXN,
10231: x_returnStatus => x_returnStatus);
10232:
10229: ez_completion(p_gib => l_gib,
10230: p_txn_type => WIP_CONSTANTS.RET_TXN,
10231: x_returnStatus => x_returnStatus);
10232:
10233: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10234: l_errMsg := 'wip_movProc_priv.ez_completion (return) failed';
10235: raise fnd_api.g_exc_unexpected_error;
10236: END IF; -- check return status
10237: ELSE /* Bug fix 5026797 (base 4901865) - Assembly completion/return transaction through Discrete Workstation are
10231: x_returnStatus => x_returnStatus);
10232:
10233: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10234: l_errMsg := 'wip_movProc_priv.ez_completion (return) failed';
10235: raise fnd_api.g_exc_unexpected_error;
10236: END IF; -- check return status
10237: ELSE /* Bug fix 5026797 (base 4901865) - Assembly completion/return transaction through Discrete Workstation are
10238: processed with p_insertAssy = fnd_api.g_false. Added the following call to snapshot
10239: for assembly return transaction.*/
10234: l_errMsg := 'wip_movProc_priv.ez_completion (return) failed';
10235: raise fnd_api.g_exc_unexpected_error;
10236: END IF; -- check return status
10237: ELSE /* Bug fix 5026797 (base 4901865) - Assembly completion/return transaction through Discrete Workstation are
10238: processed with p_insertAssy = fnd_api.g_false. Added the following call to snapshot
10239: for assembly return transaction.*/
10240: snapshot_online(p_mtl_header_id => l_gib.assy_header_id,
10241: p_org_id => l_gib.move_profile.org_id,
10242: p_txn_type => WIP_CONSTANTS.RET_TXN,
10243: p_txn_type_id => WIP_CONSTANTS.RETASSY_TYPE,
10244: p_txn_action_id => WIP_CONSTANTS.RETASSY_ACTION,
10245: x_returnStatus => x_returnStatus);
10246:
10247: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10248: l_errMsg := 'wip_movProc_priv.snapshot_online (return) failed';
10249: raise fnd_api.g_exc_unexpected_error;
10250: END IF; -- check return status
10251: END IF; -- p_insertAssy = fnd_api.g_true
10245: x_returnStatus => x_returnStatus);
10246:
10247: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10248: l_errMsg := 'wip_movProc_priv.snapshot_online (return) failed';
10249: raise fnd_api.g_exc_unexpected_error;
10250: END IF; -- check return status
10251: END IF; -- p_insertAssy = fnd_api.g_true
10252: /* End of bug fix 5026797 */
10253:
10247: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10248: l_errMsg := 'wip_movProc_priv.snapshot_online (return) failed';
10249: raise fnd_api.g_exc_unexpected_error;
10250: END IF; -- check return status
10251: END IF; -- p_insertAssy = fnd_api.g_true
10252: /* End of bug fix 5026797 */
10253:
10254: IF(l_gib.assy_header_id IS NOT NULL AND
10255: l_gib.assy_header_id <> -1) THEN
10254: IF(l_gib.assy_header_id IS NOT NULL AND
10255: l_gib.assy_header_id <> -1) THEN
10256: -- Process assembly return record
10257: wip_mtlTempProc_priv.processTemp
10258: (p_initMsgList => fnd_api.g_true,
10259: p_txnHdrID => l_gib.assy_header_id,
10260: p_txnMode => WIP_CONSTANTS.ONLINE,
10261: x_returnStatus => x_returnStatus,
10262: x_errorMsg => l_errMsg);
10260: p_txnMode => WIP_CONSTANTS.ONLINE,
10261: x_returnStatus => x_returnStatus,
10262: x_errorMsg => l_errMsg);
10263:
10264: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10265: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
10266: fnd_message.set_token('MESSAGE', l_errMsg);
10267: fnd_msg_pub.add;
10268: l_errMsg := 'wip_mtlTempProc_priv.processTemp failed' ;
10265: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
10266: fnd_message.set_token('MESSAGE', l_errMsg);
10267: fnd_msg_pub.add;
10268: l_errMsg := 'wip_mtlTempProc_priv.processTemp failed' ;
10269: raise fnd_api.g_exc_unexpected_error;
10270: END IF;
10271: l_return_hdr_id := l_gib.assy_header_id;
10272: -- reset l_gib.assy_header_id to null
10273: l_gib.assy_header_id := null;
10280: -- call main move processor
10281: move_txns(p_gib => l_gib,
10282: x_returnStatus => x_returnStatus);
10283:
10284: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10285: l_errMsg := 'wip_movProc_priv.move_txns failed';
10286: raise fnd_api.g_exc_unexpected_error;
10287: END IF; -- check return status
10288:
10282: x_returnStatus => x_returnStatus);
10283:
10284: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10285: l_errMsg := 'wip_movProc_priv.move_txns failed';
10286: raise fnd_api.g_exc_unexpected_error;
10287: END IF; -- check return status
10288:
10289: -- check IF easy completion txns
10290: IF(l_gib.move_profile.easyComplete = WIP_CONSTANTS.YES) THEN
10287: END IF; -- check return status
10288:
10289: -- check IF easy completion txns
10290: IF(l_gib.move_profile.easyComplete = WIP_CONSTANTS.YES) THEN
10291: IF( p_insertAssy = fnd_api.g_true) THEN
10292: ez_completion(p_gib => l_gib,
10293: p_txn_type => WIP_CONSTANTS.COMP_TXN,
10294: x_returnStatus => x_returnStatus);
10295:
10292: ez_completion(p_gib => l_gib,
10293: p_txn_type => WIP_CONSTANTS.COMP_TXN,
10294: x_returnStatus => x_returnStatus);
10295:
10296: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10297: l_errMsg := 'wip_movProc_priv.ez_completion (complete) failed';
10298: raise fnd_api.g_exc_unexpected_error;
10299: END IF; -- check return status
10300: ELSE /* Bug fix 5026797 (base 4901865) - Assembly completion/return transaction through Discrete Workstation are
10294: x_returnStatus => x_returnStatus);
10295:
10296: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10297: l_errMsg := 'wip_movProc_priv.ez_completion (complete) failed';
10298: raise fnd_api.g_exc_unexpected_error;
10299: END IF; -- check return status
10300: ELSE /* Bug fix 5026797 (base 4901865) - Assembly completion/return transaction through Discrete Workstation are
10301: processed with p_insertAssy = fnd_api.g_false. Added the following call to snapshot for assembly completion transaction.*/
10302: snapshot_online(p_mtl_header_id => l_gib.assy_header_id,
10297: l_errMsg := 'wip_movProc_priv.ez_completion (complete) failed';
10298: raise fnd_api.g_exc_unexpected_error;
10299: END IF; -- check return status
10300: ELSE /* Bug fix 5026797 (base 4901865) - Assembly completion/return transaction through Discrete Workstation are
10301: processed with p_insertAssy = fnd_api.g_false. Added the following call to snapshot for assembly completion transaction.*/
10302: snapshot_online(p_mtl_header_id => l_gib.assy_header_id,
10303: p_org_id => l_gib.move_profile.org_id,
10304: p_txn_type => WIP_CONSTANTS.COMP_TXN,
10305: p_txn_type_id => WIP_CONSTANTS.CPLASSY_TYPE,
10305: p_txn_type_id => WIP_CONSTANTS.CPLASSY_TYPE,
10306: p_txn_action_id => WIP_CONSTANTS.CPLASSY_ACTION,
10307: x_returnStatus => x_returnStatus);
10308:
10309: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10310: l_errMsg := 'wip_movProc_priv.snapshot_online(complete) failed';
10311: raise fnd_api.g_exc_unexpected_error;
10312: END IF; -- check return status
10313: END IF; -- p_insertAssy = fnd_api.g_true
10307: x_returnStatus => x_returnStatus);
10308:
10309: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10310: l_errMsg := 'wip_movProc_priv.snapshot_online(complete) failed';
10311: raise fnd_api.g_exc_unexpected_error;
10312: END IF; -- check return status
10313: END IF; -- p_insertAssy = fnd_api.g_true
10314: /* End of bug fix 5026797 */
10315: END IF; -- easy complete txn
10309: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10310: l_errMsg := 'wip_movProc_priv.snapshot_online(complete) failed';
10311: raise fnd_api.g_exc_unexpected_error;
10312: END IF; -- check return status
10313: END IF; -- p_insertAssy = fnd_api.g_true
10314: /* End of bug fix 5026797 */
10315: END IF; -- easy complete txn
10316:
10317: -- update completed quantity and take snapshot before calling inventory
10318: -- to process aseembly completion record
10319: IF(l_gib.move_mode = WIP_CONSTANTS.BACKGROUND) THEN
10320: update_wo_and_snapshot(p_gib => l_gib,
10321: x_returnStatus => x_returnStatus);
10322: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10323: l_errMsg := 'wip_movProc_priv.update_wo_and_snapshot';
10324: raise fnd_api.g_exc_unexpected_error;
10325: END IF; -- check return status
10326: END IF;
10320: update_wo_and_snapshot(p_gib => l_gib,
10321: x_returnStatus => x_returnStatus);
10322: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10323: l_errMsg := 'wip_movProc_priv.update_wo_and_snapshot';
10324: raise fnd_api.g_exc_unexpected_error;
10325: END IF; -- check return status
10326: END IF;
10327:
10328: /* call qualtiy to enable results */
10332: EXIT WHEN c_qa_id%NOTFOUND;
10333:
10334: QA_RESULT_GRP.ENABLE(
10335: p_api_version => 1.0,
10336: p_init_msg_list => fnd_api.g_true,
10337: p_commit => fnd_api.g_false,
10338: p_validation_level => 0,
10339: p_collection_id => l_qa_collection_id,
10340: p_return_status => x_returnStatus,
10333:
10334: QA_RESULT_GRP.ENABLE(
10335: p_api_version => 1.0,
10336: p_init_msg_list => fnd_api.g_true,
10337: p_commit => fnd_api.g_false,
10338: p_validation_level => 0,
10339: p_collection_id => l_qa_collection_id,
10340: p_return_status => x_returnStatus,
10341: p_msg_count => l_msgCount,
10340: p_return_status => x_returnStatus,
10341: p_msg_count => l_msgCount,
10342: p_msg_data => l_errMsg);
10343:
10344: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10345: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
10346: fnd_message.set_token('MESSAGE', l_errMsg);
10347: fnd_msg_pub.add;
10348: l_errMsg := 'QA Failed. Collection ID:' || l_qa_collection_id;
10345: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
10346: fnd_message.set_token('MESSAGE', l_errMsg);
10347: fnd_msg_pub.add;
10348: l_errMsg := 'QA Failed. Collection ID:' || l_qa_collection_id;
10349: raise fnd_api.g_exc_unexpected_error;
10350: END IF;
10351: END LOOP; -- c_qa_id FETCH
10352:
10353: CLOSE c_qa_id; /* Bug 4204892 - Close the cursor c_qa_id to avoid ORA-6511. */
10401: IF(l_gib.assy_header_id IS NOT NULL AND
10402: l_gib.assy_header_id <> -1) THEN
10403: -- Process assembly completion record
10404: wip_mtlTempProc_priv.processTemp
10405: (p_initMsgList => fnd_api.g_true,
10406: p_txnHdrID => l_gib.assy_header_id,
10407: p_txnMode => WIP_CONSTANTS.ONLINE,
10408: x_returnStatus => x_returnStatus,
10409: x_errorMsg => l_errMsg);
10407: p_txnMode => WIP_CONSTANTS.ONLINE,
10408: x_returnStatus => x_returnStatus,
10409: x_errorMsg => l_errMsg);
10410:
10411: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10412: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
10413: fnd_message.set_token('MESSAGE', l_errMsg);
10414: fnd_msg_pub.add;
10415: l_errMsg := 'wip_mtlTempProc_priv.processTemp failed' ;
10412: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
10413: fnd_message.set_token('MESSAGE', l_errMsg);
10414: fnd_msg_pub.add;
10415: l_errMsg := 'wip_mtlTempProc_priv.processTemp failed' ;
10416: raise fnd_api.g_exc_unexpected_error;
10417: END IF;
10418: END IF; -- check l_gib.assy_header_id
10419:
10420: IF(p_allow_partial_commit = WIP_CONSTANTS.YES) THEN
10438: p_proc_phase = WIP_CONSTANTS.MOVE_PROC OR
10439: p_proc_phase = WIP_CONSTANTS.BF_SETUP) THEN
10440:
10441: IF(l_gib.bf_mode = WIP_CONSTANTS.ONLINE) THEN
10442: IF(p_do_backflush = fnd_api.g_true) THEN
10443: IF(l_gib.mtl_header_id IS NULL OR
10444: l_gib.mtl_header_id = -1) THEN
10445: SELECT mtl_material_transactions_s.nextval
10446: INTO l_gib.mtl_header_id
10477: p_movTxnID => l_backflush.txn_id,
10478: p_mtlTxnMode => l_gib.mtl_mode,
10479: p_reasonID => l_backflush.reason_id,
10480: p_reference => l_backflush.reference,
10481: p_init_msg_list => fnd_api.g_true,
10482: x_lotSerRequired => l_ls_required,
10483: x_returnStatus => l_returnStatus,
10484: x_error_msg => l_error_msg, -- throw away value
10485: x_error_count => l_error_count); -- throw away value
10483: x_returnStatus => l_returnStatus,
10484: x_error_msg => l_error_msg, -- throw away value
10485: x_error_count => l_error_count); -- throw away value
10486:
10487: IF(l_returnStatus <> fnd_api.g_ret_sts_success) THEN
10488: l_errMsg := 'wsm_serial_support_grp.backflush_comp failed' ;
10489: raise fnd_api.g_exc_unexpected_error;
10490: ELSE
10491: IF(l_ls_required = WIP_CONSTANTS.YES) THEN
10485: x_error_count => l_error_count); -- throw away value
10486:
10487: IF(l_returnStatus <> fnd_api.g_ret_sts_success) THEN
10488: l_errMsg := 'wsm_serial_support_grp.backflush_comp failed' ;
10489: raise fnd_api.g_exc_unexpected_error;
10490: ELSE
10491: IF(l_ls_required = WIP_CONSTANTS.YES) THEN
10492: -- If we need to gather more lot/serial, error out because
10493: -- we cannot gather lot/serial for background transaction.
10492: -- If we need to gather more lot/serial, error out because
10493: -- we cannot gather lot/serial for background transaction.
10494: fnd_message.set_name('WIP', 'WIP_NO_LOT_SER_COMP_BKGND');
10495: fnd_msg_pub.add;
10496: raise fnd_api.g_exc_unexpected_error;
10497: END IF;
10498: END IF; -- check return status
10499: ELSE -- discrete job or repetitive schedule
10500: wip_bflProc_priv.backflush(
10522: x_lotSerRequired => l_ls_required,
10523: x_bfRequired => l_bf_required,
10524: x_returnStatus => l_returnStatus);
10525:
10526: IF(l_returnStatus <> fnd_api.g_ret_sts_success) THEN
10527: l_errMsg := 'wip_bflProc_priv.backflush failed' ;
10528: raise fnd_api.g_exc_unexpected_error;
10529: ELSE
10530: IF(l_ls_required = WIP_CONSTANTS.YES) THEN
10524: x_returnStatus => l_returnStatus);
10525:
10526: IF(l_returnStatus <> fnd_api.g_ret_sts_success) THEN
10527: l_errMsg := 'wip_bflProc_priv.backflush failed' ;
10528: raise fnd_api.g_exc_unexpected_error;
10529: ELSE
10530: IF(l_ls_required = WIP_CONSTANTS.YES) THEN
10531: -- If we need to gather more lot/serial, error out because
10532: -- we cannot gather lot/serial for background transaction.
10531: -- If we need to gather more lot/serial, error out because
10532: -- we cannot gather lot/serial for background transaction.
10533: fnd_message.set_name('WIP', 'WIP_NO_LOT_SER_COMP_BKGND');
10534: fnd_msg_pub.add;
10535: raise fnd_api.g_exc_unexpected_error;
10536: END IF;
10537: END IF; -- check return status
10538: END IF; -- check entity type
10539: EXCEPTION
10536: END IF;
10537: END IF; -- check return status
10538: END IF; -- check entity type
10539: EXCEPTION
10540: WHEN fnd_api.g_exc_unexpected_error THEN
10541: ROLLBACK TO SAVEPOINT s_backflush_proc;
10542: wip_utilities.get_message_stack(p_msg =>l_errMsg);
10543: IF(l_errMsg IS NULL) THEN
10544: -- initialize message to something because we cannot
10585: WHERE wmti.group_id = p_group_id
10586: AND transaction_id = l_backflush.txn_id;
10587:
10588: ELSE -- move mode is online, write to log file
10589: IF(x_returnStatus = fnd_api.g_ret_sts_error) THEN
10590: -- let the user know that more lot/serial info required
10591: x_returnStatus := fnd_api.g_ret_sts_error;
10592: END IF;
10593: IF (l_logLevel <= wip_constants.trace_logging) THEN
10587:
10588: ELSE -- move mode is online, write to log file
10589: IF(x_returnStatus = fnd_api.g_ret_sts_error) THEN
10590: -- let the user know that more lot/serial info required
10591: x_returnStatus := fnd_api.g_ret_sts_error;
10592: END IF;
10593: IF (l_logLevel <= wip_constants.trace_logging) THEN
10594: l_errMsg := 'move_txn_id: ' || l_backflush.txn_id ||
10595: ' failed because ' || l_errMsg;
10603:
10604: CLOSE c_backflush; /* Bug 4204892 - Close the cursor c_backflush to avoid ORA-6511. */
10605:
10606: -- Move assembly pull and operation pull records from mti to mmtt
10607: -- pass fnd_api.g_false to p_addMsgToStack because we never used
10608: -- message stack for background transaction. Moreover, this will
10609: -- improve performance if there are lots of errors.
10610: wip_mtlTempProc_priv.validateInterfaceTxns(
10611: p_txnHdrID => l_gib.mtl_header_id,
10608: -- message stack for background transaction. Moreover, this will
10609: -- improve performance if there are lots of errors.
10610: wip_mtlTempProc_priv.validateInterfaceTxns(
10611: p_txnHdrID => l_gib.mtl_header_id,
10612: p_addMsgToStack => fnd_api.g_false,
10613: p_rollbackOnErr => fnd_api.g_false,
10614: x_returnStatus => x_returnStatus);
10615:
10616: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10609: -- improve performance if there are lots of errors.
10610: wip_mtlTempProc_priv.validateInterfaceTxns(
10611: p_txnHdrID => l_gib.mtl_header_id,
10612: p_addMsgToStack => fnd_api.g_false,
10613: p_rollbackOnErr => fnd_api.g_false,
10614: x_returnStatus => x_returnStatus);
10615:
10616: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10617: -- write error into WIP_TXN_INTERFACE_ERRORS
10612: p_addMsgToStack => fnd_api.g_false,
10613: p_rollbackOnErr => fnd_api.g_false,
10614: x_returnStatus => x_returnStatus);
10615:
10616: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10617: -- write error into WIP_TXN_INTERFACE_ERRORS
10618: write_mtl_errors(p_mtl_header_id => l_gib.mtl_header_id);
10619: IF (l_logLevel <= wip_constants.full_logging) THEN
10620: l_errMsg := 'wip_mtlTempProc_priv.validateInterfaceTxns failed'||
10623: x_returnStatus => l_returnStatus);
10624: END IF;
10625: -- Fixed bug 5056289. We will not raise exception because we still
10626: -- want to process the components that pass validation.
10627: -- raise fnd_api.g_exc_unexpected_error;
10628:
10629: -- Call component_cleanup to set the status of corresponding move
10630: -- records to error and delete error records from MTI and MTLI.
10631: component_cleanup(p_mtl_header_id => l_gib.mtl_header_id,
10645: l_gib.mtl_mode <> WIP_CONSTANTS.NO_PROCESSING) THEN
10646: -- Call material processor to process backflush components, and
10647: -- scrap assembly.
10648: wip_mtlTempProc_priv.processTemp
10649: (p_initMsgList => fnd_api.g_true,
10650: p_txnHdrID => l_gib.mtl_header_id,
10651: p_txnMode => l_gib.mtl_mode,
10652: x_returnStatus => x_returnStatus,
10653: x_errorMsg => l_errMsg);
10651: p_txnMode => l_gib.mtl_mode,
10652: x_returnStatus => x_returnStatus,
10653: x_errorMsg => l_errMsg);
10654:
10655: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
10656: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
10657: fnd_message.set_token('MESSAGE', l_errMsg);
10658: fnd_msg_pub.add;
10659: l_errMsg := 'wip_mtlTempProc_priv.processTemp failed' ;
10656: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
10657: fnd_message.set_token('MESSAGE', l_errMsg);
10658: fnd_msg_pub.add;
10659: l_errMsg := 'wip_mtlTempProc_priv.processTemp failed' ;
10660: raise fnd_api.g_exc_unexpected_error;
10661: END IF;
10662: END IF; -- there is the records in MMTT with this header_id
10663: ELSE -- backflush is background
10664: UPDATE wip_move_txn_interface
10687: l_gib.mtl_header_id := -1;
10688:
10689: EXCEPTION
10690:
10691: WHEN fnd_api.g_exc_unexpected_error THEN
10692:
10693: IF(p_move_mode = WIP_CONSTANTS.BACKGROUND) THEN
10694:
10695: ROLLBACK TO SAVEPOINT s_move_proc;
10746: FROM wip_txn_interface_errors wtie
10747: WHERE wtie.transaction_id = wmti.transaction_id);
10748:
10749: ELSE -- move mode is online, write to log file
10750: IF(x_returnStatus = fnd_api.g_ret_sts_error) THEN
10751: -- let the user know that more lot/serial info required
10752: x_returnStatus := fnd_api.g_ret_sts_error;
10753: ELSE
10754: ROLLBACK TO SAVEPOINT s_move_proc;
10748:
10749: ELSE -- move mode is online, write to log file
10750: IF(x_returnStatus = fnd_api.g_ret_sts_error) THEN
10751: -- let the user know that more lot/serial info required
10752: x_returnStatus := fnd_api.g_ret_sts_error;
10753: ELSE
10754: ROLLBACK TO SAVEPOINT s_move_proc;
10755: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
10756: END IF;
10751: -- let the user know that more lot/serial info required
10752: x_returnStatus := fnd_api.g_ret_sts_error;
10753: ELSE
10754: ROLLBACK TO SAVEPOINT s_move_proc;
10755: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
10756: END IF;
10757: IF (l_logLevel <= wip_constants.trace_logging) THEN
10758: wip_logger.exitPoint(p_procName =>'wip_movProc_priv.processIntf',
10759: p_procReturnStatus => x_returnStatus,
10760: p_msg => l_errMsg,
10761: x_returnStatus => l_returnStatus);
10762: END IF;
10763: -- close log file
10764: IF (p_ENDDebug = fnd_api.g_true) THEN
10765: wip_logger.cleanUp(x_returnStatus => l_returnStatus);
10766: END IF;
10767: GOTO END_program;
10768: END IF; -- move mode is background
10813: AND NOT EXISTS (SELECT 1
10814: FROM wip_txn_interface_errors wtie
10815: WHERE wtie.transaction_id = wmti.transaction_id);
10816: ELSE -- move mode is online
10817: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
10818: IF (l_logLevel <= wip_constants.trace_logging) THEN
10819: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.processIntf',
10820: p_procReturnStatus => x_returnStatus,
10821: p_msg => 'unexpected error: ' || SQLERRM,
10821: p_msg => 'unexpected error: ' || SQLERRM,
10822: x_returnStatus => l_returnStatus);
10823: END IF;
10824: -- close log file
10825: IF (p_ENDDebug = fnd_api.g_true) THEN
10826: wip_logger.cleanUp(x_returnStatus => l_returnStatus);
10827: END IF;
10828: GOTO END_program;
10829: END IF; -- move mode is background
10883: /*===========================================================*/
10884: /* transactions in current group left in interface table - */
10885: /* worker exit with warning signal */
10886: /*===========================================================*/
10887: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
10888: -- Fixed bug 5355443. We should not always put WIP_SOME_RECORDS_ERROR in
10889: -- the message stack because this API will be called for both online and
10890: -- background transaction. However, WIP_SOME_RECORDS_ERROR is only
10891: -- applicable for background transaction.
10897: p_msg => 'some records error out',
10898: x_returnStatus => l_returnStatus);
10899: END IF;
10900: -- close log file
10901: IF (p_ENDDebug = fnd_api.g_true) THEN
10902: wip_logger.cleanUp(x_returnStatus => l_returnStatus);
10903: END IF;
10904: /*Bug 5727221 (FP of 5580093): Mobile WIP Transaction seems to be leaving
10905: transaction in WMTI in some exception case. However there is no error
10906: message propagated back to UI. As a result transaction goes through fine
10907: with no UI error but record remains in WMTI. x_returnStatus is changed
10908: to sucess by cleanup procedure after closing file . Hence repopulate
10909: x_returnStatus to error again */
10910: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
10911: ELSE
10912: x_returnStatus := fnd_api.g_ret_sts_success;
10913: IF (l_logLevel <= wip_constants.trace_logging) THEN
10914: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.processIntf',
10908: to sucess by cleanup procedure after closing file . Hence repopulate
10909: x_returnStatus to error again */
10910: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
10911: ELSE
10912: x_returnStatus := fnd_api.g_ret_sts_success;
10913: IF (l_logLevel <= wip_constants.trace_logging) THEN
10914: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.processIntf',
10915: p_procReturnStatus => x_returnStatus,
10916: p_msg => 'no record in this group error out',
10916: p_msg => 'no record in this group error out',
10917: x_returnStatus => l_returnStatus);
10918: END IF;
10919: -- close log file
10920: IF (p_ENDDebug = fnd_api.g_true) THEN
10921: wip_logger.cleanUp(x_returnStatus => l_returnStatus);
10922: END IF;
10923: END IF;
10924:
10966: p_time_out => p_time_out,
10967: p_move_mode => WIP_CONSTANTS.BACKGROUND,
10968: p_bf_mode => WIP_CONSTANTS.ONLINE,
10969: p_mtl_mode => WIP_CONSTANTS.ONLINE,
10970: p_endDebug => FND_API.G_TRUE,
10971: p_initMsgList => FND_API.G_TRUE,
10972: p_insertAssy => FND_API.G_TRUE,
10973: p_do_backflush => FND_API.G_TRUE,
10974: p_seq_move => p_seq_move,
10967: p_move_mode => WIP_CONSTANTS.BACKGROUND,
10968: p_bf_mode => WIP_CONSTANTS.ONLINE,
10969: p_mtl_mode => WIP_CONSTANTS.ONLINE,
10970: p_endDebug => FND_API.G_TRUE,
10971: p_initMsgList => FND_API.G_TRUE,
10972: p_insertAssy => FND_API.G_TRUE,
10973: p_do_backflush => FND_API.G_TRUE,
10974: p_seq_move => p_seq_move,
10975: p_allow_partial_commit => WIP_CONSTANTS.YES, -- Fixed bug 4361566.
10968: p_bf_mode => WIP_CONSTANTS.ONLINE,
10969: p_mtl_mode => WIP_CONSTANTS.ONLINE,
10970: p_endDebug => FND_API.G_TRUE,
10971: p_initMsgList => FND_API.G_TRUE,
10972: p_insertAssy => FND_API.G_TRUE,
10973: p_do_backflush => FND_API.G_TRUE,
10974: p_seq_move => p_seq_move,
10975: p_allow_partial_commit => WIP_CONSTANTS.YES, -- Fixed bug 4361566.
10976: x_returnStatus => l_returnStatus);
10969: p_mtl_mode => WIP_CONSTANTS.ONLINE,
10970: p_endDebug => FND_API.G_TRUE,
10971: p_initMsgList => FND_API.G_TRUE,
10972: p_insertAssy => FND_API.G_TRUE,
10973: p_do_backflush => FND_API.G_TRUE,
10974: p_seq_move => p_seq_move,
10975: p_allow_partial_commit => WIP_CONSTANTS.YES, -- Fixed bug 4361566.
10976: x_returnStatus => l_returnStatus);
10977:
10978: -- Fixed bug 4361566. Reset global variable WIP_MOVE_WORKER to its original
10979: -- value.
10980: WIP_CONSTANTS.WIP_MOVE_WORKER := 'N';
10981:
10982: IF(l_returnStatus <> fnd_api.g_ret_sts_success) THEN
10983: retcode := 2; -- error
10984: -- Fixed bug 5355443. Since WIP_SOME_RECORDS_ERROR message is only
10985: -- applicable to background transaction, we should set error message here
10986: -- instead of wip_movProc_priv.processIntf().
11063: l_msg := fnd_message.get;
11064: wip_logger.log(p_msg => l_msg,
11065: x_returnStatus => l_returnStatus);
11066: END IF;
11067: x_returnStatus := fnd_api.g_ret_sts_success;
11068:
11069: EXCEPTION
11070: WHEN others THEN
11071: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
11067: x_returnStatus := fnd_api.g_ret_sts_success;
11068:
11069: EXCEPTION
11070: WHEN others THEN
11071: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
11072: l_msg := 'unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
11073:
11074: IF (l_logLevel <= wip_constants.trace_logging) THEN
11075: wip_logger.exitPoint(p_procName=>'wip_movProc_priv.repetitive_scrap',
11383: transactionID => p_group_id,
11384: serialNumber => p_assySerial,
11385: errMessage => l_error_msg) = FALSE) THEN
11386: -- insert statement error out
11387: raise fnd_api.g_exc_unexpected_error;
11388: END IF;
11389: END IF; -- from serialized page
11390: l_process_phase := '2.5';
11391: --Bug#16274722: Added the below code to default the lot expiration date
11495:
11496:
11497: wip_mtlTempProc_priv.validateInterfaceTxns(
11498: p_txnHdrID => p_mtl_header_id,
11499: p_addMsgToStack => fnd_api.g_true, -- So that we can display to user
11500: p_rollbackOnErr => fnd_api.g_false,
11501: x_returnStatus => x_returnStatus);
11502:
11503: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
11496:
11497: wip_mtlTempProc_priv.validateInterfaceTxns(
11498: p_txnHdrID => p_mtl_header_id,
11499: p_addMsgToStack => fnd_api.g_true, -- So that we can display to user
11500: p_rollbackOnErr => fnd_api.g_false,
11501: x_returnStatus => x_returnStatus);
11502:
11503: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
11504: raise fnd_api.g_exc_unexpected_error;
11499: p_addMsgToStack => fnd_api.g_true, -- So that we can display to user
11500: p_rollbackOnErr => fnd_api.g_false,
11501: x_returnStatus => x_returnStatus);
11502:
11503: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
11504: raise fnd_api.g_exc_unexpected_error;
11505: END IF;
11506: l_process_phase := '3';
11507:
11500: p_rollbackOnErr => fnd_api.g_false,
11501: x_returnStatus => x_returnStatus);
11502:
11503: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
11504: raise fnd_api.g_exc_unexpected_error;
11505: END IF;
11506: l_process_phase := '3';
11507:
11508: /*Start: Bug 13103060 print completion label for ez completion*/
11514: p_msg_data => l_error_msg,
11515: p_label_status => l_label_status,
11516: p_business_flow_code => 26); -- discrete business flow code
11517: -- do not error out if label printing, only put warning message in log
11518: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
11519: wip_utilities.get_message_stack(p_msg => l_msg_stack);
11520: IF (l_log_level <= wip_constants.full_logging) then
11521: wip_logger.log(p_msg => 'An error has occurred with label printing.\n' ||
11522: 'The following error has occurred during ' ||
11544: p_time_out => 0,
11545: p_move_mode => WIP_CONSTANTS.ONLINE,
11546: p_bf_mode => WIP_CONSTANTS.ONLINE,
11547: p_mtl_mode => WIP_CONSTANTS.ONLINE,
11548: p_endDebug => FND_API.G_FALSE,
11549: p_initMsgList => FND_API.G_TRUE,
11550: p_insertAssy => FND_API.G_FALSE,
11551: p_do_backflush => p_do_backflush,
11552: x_returnStatus => x_returnStatus);
11545: p_move_mode => WIP_CONSTANTS.ONLINE,
11546: p_bf_mode => WIP_CONSTANTS.ONLINE,
11547: p_mtl_mode => WIP_CONSTANTS.ONLINE,
11548: p_endDebug => FND_API.G_FALSE,
11549: p_initMsgList => FND_API.G_TRUE,
11550: p_insertAssy => FND_API.G_FALSE,
11551: p_do_backflush => p_do_backflush,
11552: x_returnStatus => x_returnStatus);
11553:
11546: p_bf_mode => WIP_CONSTANTS.ONLINE,
11547: p_mtl_mode => WIP_CONSTANTS.ONLINE,
11548: p_endDebug => FND_API.G_FALSE,
11549: p_initMsgList => FND_API.G_TRUE,
11550: p_insertAssy => FND_API.G_FALSE,
11551: p_do_backflush => p_do_backflush,
11552: x_returnStatus => x_returnStatus);
11553:
11554: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
11550: p_insertAssy => FND_API.G_FALSE,
11551: p_do_backflush => p_do_backflush,
11552: x_returnStatus => x_returnStatus);
11553:
11554: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
11555: l_process_phase := '5';
11556: raise fnd_api.g_exc_unexpected_error;
11557: ELSE
11558: l_process_phase := '6';
11552: x_returnStatus => x_returnStatus);
11553:
11554: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN
11555: l_process_phase := '5';
11556: raise fnd_api.g_exc_unexpected_error;
11557: ELSE
11558: l_process_phase := '6';
11559: -- If move success, call time entry API to clock off operator if there
11560: -- is no quantity left at the operation.
11573: x_status => l_return_status,
11574: x_msg_count => l_msg_count,
11575: x_msg => l_error_msg);
11576: -- do not error out if label printing, only put warning message in log
11577: IF(l_return_status <> fnd_api.g_ret_sts_success) THEN
11578: wip_utilities.get_message_stack(p_msg => l_msg_stack);
11579: IF (l_log_level <= wip_constants.full_logging) THEN
11580: wip_logger.log(p_msg => 'An error has occurred with label printing.\n' ||
11581: 'The following error has occurred during ' ||
11589:
11590: l_process_phase := '8';
11591: /* End: VJ Label Printing */
11592:
11593: x_returnStatus := fnd_api.g_ret_sts_success;
11594:
11595: -- write to the log file
11596: IF (l_log_level <= wip_constants.trace_logging) THEN
11597: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.processOATxn',
11601: END IF;
11602: -- close log file
11603: wip_logger.cleanUp(x_returnStatus => l_return_status);
11604: EXCEPTION
11605: WHEN fnd_api.g_exc_unexpected_error THEN
11606: -- Fixed bug 5518780. We should not clear message from the stack.
11607: -- If it fails inventory validation, no error will be recorded in WTIE.
11608: -- Instead, error message will be put in message stack.
11609: -- fnd_msg_pub.initialize;
11612: fnd_message.set_token('MESSAGE', l_errors.error_message);
11613: fnd_msg_pub.add;
11614: END LOOP;
11615: ROLLBACK TO SAVEPOINT s_oa_txn_proc;
11616: x_returnStatus := fnd_api.g_ret_sts_error;
11617: IF (l_log_level <= wip_constants.trace_logging) THEN
11618: wip_logger.exitPoint(p_procName => 'wip_movProc_priv.processOATxn',
11619: p_procReturnStatus => x_returnStatus,
11620: p_msg => 'wip_movProc_priv.processOATxn failed : '
11624: -- close log file
11625: wip_logger.cleanUp(x_returnStatus => l_return_status);
11626: WHEN others THEN
11627: ROLLBACK TO SAVEPOINT s_oa_txn_proc;
11628: x_returnStatus := fnd_api.g_ret_sts_error;
11629: l_error_msg := ' unexpected error: ' || SQLERRM || 'SQLCODE = ' || SQLCODE;
11630:
11631: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
11632: fnd_message.set_token('MESSAGE', l_error_msg);