13: x_returnStatus OUT NOCOPY VARCHAR2,
14: x_errorMsg OUT NOCOPY VARCHAR2) IS
15: l_errMsg VARCHAR2(2000);
16: l_errCode VARCHAR2(2000);
17: l_params wip_logger.param_tbl_t;
18: l_retStatus VARCHAR2(1);
19: l_logRetStatus VARCHAR2(1);
20: l_retCode NUMBER;
21: l_logLevel NUMBER := to_number(fnd_log.g_current_runtime_level);
41: l_params(3).paramName := 'p_txnMode';
42: l_params(3).paramValue := p_txnMode;
43: l_params(4).paramName := 'p_destroyQtyTrees';
44: l_params(4).paramValue := p_destroyQtyTrees;
45: wip_logger.entryPoint(p_procName => 'wip_mtlTempProc_priv.processTemp',
46: p_params => l_params,
47: x_returnStatus => x_returnStatus);
48: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
49: raise fnd_api.g_exc_unexpected_error;
59: p_proc_mode => p_txnMode,
60: x_proc_msg => l_errMsg);
61:
62: if(l_logLevel <= wip_constants.full_logging) then
63: wip_logger.log('inv returned:' || l_retCode, l_retStatus);
64: wip_logger.log('inv errmsg:' || l_errMsg, l_retStatus);
65: end if;
66:
67: --for some reason TM errors clear the stack so we must put the
60: x_proc_msg => l_errMsg);
61:
62: if(l_logLevel <= wip_constants.full_logging) then
63: wip_logger.log('inv returned:' || l_retCode, l_retStatus);
64: wip_logger.log('inv errmsg:' || l_errMsg, l_retStatus);
65: end if;
66:
67: --for some reason TM errors clear the stack so we must put the
68: --error message back, but successful txns do not clear the stack
86: inv_quantity_tree_pub.clear_quantity_cache;
87: end if;
88:
89: if (l_logLevel <= wip_constants.trace_logging) then
90: wip_logger.exitPoint(p_procName => 'wip_mtlTempProc_priv.processTemp',
91: p_procReturnStatus => x_returnStatus,
92: p_msg => 'success',
93: x_returnStatus => l_retStatus);
94: if(fnd_api.to_boolean(nvl(p_endDebug, fnd_api.g_false))) then
91: p_procReturnStatus => x_returnStatus,
92: p_msg => 'success',
93: x_returnStatus => l_retStatus);
94: if(fnd_api.to_boolean(nvl(p_endDebug, fnd_api.g_false))) then
95: wip_logger.cleanup(l_retStatus);
96: end if;
97: end if;
98: exception
99: when fnd_api.g_exc_unexpected_error then
101: wip_utilities.get_message_stack(p_msg => x_errorMsg,
102: p_delete_stack => fnd_api.g_false,
103: p_separator => ' ');
104: if (l_logLevel <= wip_constants.trace_logging) then
105: wip_logger.exitPoint(p_procName => 'wip_mtlTempProc_priv.processTemp',
106: p_procReturnStatus => x_returnStatus,
107: p_msg => 'unhandled exception: ' || SQLERRM,
108: x_returnStatus => l_retStatus);
109: if(fnd_api.to_boolean(nvl(p_endDebug, fnd_api.g_false))) then
106: p_procReturnStatus => x_returnStatus,
107: p_msg => 'unhandled exception: ' || SQLERRM,
108: x_returnStatus => l_retStatus);
109: if(fnd_api.to_boolean(nvl(p_endDebug, fnd_api.g_false))) then
110: wip_logger.cleanup(l_retStatus);
111: end if;
112: end if;
113: when others then
114: rollback to wiptmpvb0;
134: wip_constants.issnegc_action,
135: wip_constants.retnegc_action);
136:
137: if (l_logLevel <= wip_constants.trace_logging) then
138: wip_logger.exitPoint(p_procName => 'wip_mtlTempProc_priv.processTemp',
139: p_procReturnStatus => x_returnStatus,
140: p_msg => 'unhandled exception: ' || SQLERRM,
141: x_returnStatus => l_retStatus);
142: if(fnd_api.to_boolean(nvl(p_endDebug, fnd_api.g_false))) then
139: p_procReturnStatus => x_returnStatus,
140: p_msg => 'unhandled exception: ' || SQLERRM,
141: x_returnStatus => l_retStatus);
142: if(fnd_api.to_boolean(nvl(p_endDebug, fnd_api.g_false))) then
143: wip_logger.cleanup(l_retStatus);
144: end if;
145: end if;
146: end processTemp;
147:
150: p_endDebug in VARCHAR2 := null,
151: x_returnStatus OUT NOCOPY VARCHAR2,
152: x_errorMsg OUT NOCOPY VARCHAR2) is
153: l_retStatus VARCHAR2(1);
154: l_params wip_logger.param_tbl_t;
155: l_logLevel NUMBER := fnd_log.g_current_runtime_level;
156: l_procName VARCHAR2(20) := 'processWIP';
157: l_txnActionID NUMBER;
158: l_wipEntityType NUMBER;
186: l_params(1).paramName := 'p_txnTmpID';
187: l_params(1).paramValue := p_txnTmpID;
188: l_params(2).paramName := 'p_processLpn';
189: l_params(2).paramValue := p_processLpn;
190: wip_logger.entryPoint(p_procName => g_pkgName || '.' || l_procName,
191: p_params => l_params,
192: x_returnStatus => x_returnStatus);
193: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
194: raise fnd_api.g_exc_unexpected_error;
258: delete mtl_material_transactions_temp
259: where transaction_temp_id = p_txnTmpID;
260:
261: if(l_logLevel <= wip_constants.trace_logging) then
262: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
263: p_procReturnStatus => x_returnStatus,
264: p_msg => 'success: phantom record deleted without any action',
265: x_returnStatus => l_retStatus);
266: if(fnd_api.to_boolean(nvl(p_endDebug, fnd_api.g_false))) then
263: p_procReturnStatus => x_returnStatus,
264: p_msg => 'success: phantom record deleted without any action',
265: x_returnStatus => l_retStatus);
266: if(fnd_api.to_boolean(nvl(p_endDebug, fnd_api.g_false))) then
267: wip_logger.cleanup(l_retStatus);
268: end if;
269: end if;
270: end if;
271: return;
280: and organization_id = l_orgID;
281: end if;
282:
283: if(l_logLevel <= wip_constants.full_logging) then
284: wip_logger.log('txnActID: ' || l_txnActionID, l_retStatus);
285: wip_logger.log('wipEntityType: ' || l_wipEntityType, l_retStatus);
286: wip_logger.log('lpnID: ' || l_lpnID, l_retStatus);
287: wip_logger.log('wipEntityID: ' || l_wipEntityID, l_retStatus);
288: wip_logger.log('orgID: ' || l_orgID, l_retStatus);
281: end if;
282:
283: if(l_logLevel <= wip_constants.full_logging) then
284: wip_logger.log('txnActID: ' || l_txnActionID, l_retStatus);
285: wip_logger.log('wipEntityType: ' || l_wipEntityType, l_retStatus);
286: wip_logger.log('lpnID: ' || l_lpnID, l_retStatus);
287: wip_logger.log('wipEntityID: ' || l_wipEntityID, l_retStatus);
288: wip_logger.log('orgID: ' || l_orgID, l_retStatus);
289: wip_logger.log('postingFlag: ' || l_postingFlag, l_retStatus);
282:
283: if(l_logLevel <= wip_constants.full_logging) then
284: wip_logger.log('txnActID: ' || l_txnActionID, l_retStatus);
285: wip_logger.log('wipEntityType: ' || l_wipEntityType, l_retStatus);
286: wip_logger.log('lpnID: ' || l_lpnID, l_retStatus);
287: wip_logger.log('wipEntityID: ' || l_wipEntityID, l_retStatus);
288: wip_logger.log('orgID: ' || l_orgID, l_retStatus);
289: wip_logger.log('postingFlag: ' || l_postingFlag, l_retStatus);
290: wip_logger.log('FlowSchedule: ' || l_flowSchedule, l_retStatus);
283: if(l_logLevel <= wip_constants.full_logging) then
284: wip_logger.log('txnActID: ' || l_txnActionID, l_retStatus);
285: wip_logger.log('wipEntityType: ' || l_wipEntityType, l_retStatus);
286: wip_logger.log('lpnID: ' || l_lpnID, l_retStatus);
287: wip_logger.log('wipEntityID: ' || l_wipEntityID, l_retStatus);
288: wip_logger.log('orgID: ' || l_orgID, l_retStatus);
289: wip_logger.log('postingFlag: ' || l_postingFlag, l_retStatus);
290: wip_logger.log('FlowSchedule: ' || l_flowSchedule, l_retStatus);
291: end if;
284: wip_logger.log('txnActID: ' || l_txnActionID, l_retStatus);
285: wip_logger.log('wipEntityType: ' || l_wipEntityType, l_retStatus);
286: wip_logger.log('lpnID: ' || l_lpnID, l_retStatus);
287: wip_logger.log('wipEntityID: ' || l_wipEntityID, l_retStatus);
288: wip_logger.log('orgID: ' || l_orgID, l_retStatus);
289: wip_logger.log('postingFlag: ' || l_postingFlag, l_retStatus);
290: wip_logger.log('FlowSchedule: ' || l_flowSchedule, l_retStatus);
291: end if;
292:
285: wip_logger.log('wipEntityType: ' || l_wipEntityType, l_retStatus);
286: wip_logger.log('lpnID: ' || l_lpnID, l_retStatus);
287: wip_logger.log('wipEntityID: ' || l_wipEntityID, l_retStatus);
288: wip_logger.log('orgID: ' || l_orgID, l_retStatus);
289: wip_logger.log('postingFlag: ' || l_postingFlag, l_retStatus);
290: wip_logger.log('FlowSchedule: ' || l_flowSchedule, l_retStatus);
291: end if;
292:
293: --component issues
286: wip_logger.log('lpnID: ' || l_lpnID, l_retStatus);
287: wip_logger.log('wipEntityID: ' || l_wipEntityID, l_retStatus);
288: wip_logger.log('orgID: ' || l_orgID, l_retStatus);
289: wip_logger.log('postingFlag: ' || l_postingFlag, l_retStatus);
290: wip_logger.log('FlowSchedule: ' || l_flowSchedule, l_retStatus);
291: end if;
292:
293: --component issues
294: if(l_txnActionID in (wip_constants.isscomp_action, wip_constants.retcomp_action,
295: wip_constants.issnegc_action, wip_constants.retnegc_action)) then
296: --no action is necessary for flow txns
297: if(l_wipEntityType <> wip_constants.flow) then
298: if(l_logLevel <= wip_constants.full_logging) then
299: wip_logger.log('calling component processor', l_retStatus);
300: end if;
301: wip_mtlProc_priv.processTemp(p_initMsgList => fnd_api.g_false,
302: p_endDebug => fnd_api.g_false,
303: p_txnTmpID => p_txnTmpID,
308: --no action is necessary for lpn completions
309: if(l_lpnID is null or fnd_api.to_boolean(p_processLpn)) then
310: if(l_wipEntityType = wip_constants.flow) then
311: if(l_logLevel <= wip_constants.full_logging) then
312: wip_logger.log('calling flow/wol processor', l_retStatus);
313: end if;
314: wip_cfmProc_priv.processTemp(p_initMsgList => fnd_api.g_false,
315: p_txnTempID => p_txnTmpID,
316: x_returnStatus => x_returnStatus);
315: p_txnTempID => p_txnTmpID,
316: x_returnStatus => x_returnStatus);
317: else --non flow completion
318: if(l_logLevel <= wip_constants.full_logging) then
319: wip_logger.log('calling cpl processor', l_retStatus);
320: end if;
321: wip_cplProc_priv.processTemp(p_txnTmpID => p_txnTmpID,
322: p_initMsgList => fnd_api.g_false,
323: p_endDebug => fnd_api.g_false,
327: elsif(l_txnActionID = wip_constants.scrassy_action) then
328: --for repetitive, must do allocation
329: if(l_wipEntityType = wip_constants.repetitive) then
330: if(l_logLevel <= wip_constants.full_logging) then
331: wip_logger.log('calling rep scrap processor', l_retStatus);
332: end if;
333: wip_movProc_priv.repetitive_scrap(p_tmp_id => p_txnTmpID,
334: x_returnStatus => x_returnStatus);
335: elsif (l_wipEntityType = wip_constants.flow) then
333: wip_movProc_priv.repetitive_scrap(p_tmp_id => p_txnTmpID,
334: x_returnStatus => x_returnStatus);
335: elsif (l_wipEntityType = wip_constants.flow) then
336: if(l_logLevel <= wip_constants.full_logging) then
337: wip_logger.log('calling flow/wol processor', l_retStatus);
338: end if;
339: wip_cfmProc_priv.processTemp(p_initMsgList => fnd_api.g_false,
340: p_txnTempID => p_txnTmpID,
341: x_returnStatus => x_returnStatus);
346: raise fnd_api.g_exc_unexpected_error;
347: end if;
348:
349: if(l_logLevel <= wip_constants.trace_logging) then
350: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
351: p_procReturnStatus => x_returnStatus,
352: p_msg => 'success',
353: x_returnStatus => l_retStatus);
354: if(fnd_api.to_boolean(nvl(p_endDebug, fnd_api.g_false))) then
351: p_procReturnStatus => x_returnStatus,
352: p_msg => 'success',
353: x_returnStatus => l_retStatus);
354: if(fnd_api.to_boolean(nvl(p_endDebug, fnd_api.g_false))) then
355: wip_logger.cleanup(l_retStatus);
356: end if;
357: end if;
358:
359: /*Start - Bug 6417742(FP of 6342851): Added call label printing*/
375: -- do not error out if label printing, only put warning message in log
376: if(returnStatus <> fnd_api.g_ret_sts_success) then
377: WIP_UTILITIES.get_message_stack(p_msg => l_msg_stack);
378: if (l_logLevel <= wip_constants.full_logging) then
379: wip_logger.log(p_msg => 'An error has occurred with label printing.\n' ||
380: 'The following error has occurred during ' ||
381: 'printing: ' || l_msg_stack || '\n' ||
382: 'Please check the Inventory log file for more ' ||
383: 'information.',
384: x_returnStatus =>dummyErrCode);
385: end if;
386: end if;
387: if (l_logLevel <= wip_constants.full_logging) then
388: wip_logger.log(p_msg => 'Label printing returned with status ' || returnStatus,
389: x_returnStatus => dummyErrCode);
390: end if;
391: end if;
392: /*End - Bug 6417742(FP of 6342851): Added call label printing*/
398: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
399: wip_utilities.get_message_stack(p_msg => x_errorMsg,
400: p_delete_stack => fnd_api.g_false);
401: if(l_logLevel <= wip_constants.trace_logging) then
402: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
403: p_procReturnStatus => x_returnStatus,
404: p_msg => 'error:' || x_errorMsg,
405: x_returnStatus => l_retStatus);
406: if(fnd_api.to_boolean(nvl(p_endDebug, fnd_api.g_false))) then
403: p_procReturnStatus => x_returnStatus,
404: p_msg => 'error:' || x_errorMsg,
405: x_returnStatus => l_retStatus);
406: if(fnd_api.to_boolean(nvl(p_endDebug, fnd_api.g_false))) then
407: wip_logger.cleanup(l_retStatus);
408: end if;
409: end if;
410: when others then
411: rollback to wiptmpvb100;
415: p_error_text => SQLERRM);
416: wip_utilities.get_message_stack(p_msg => x_errorMsg,
417: p_delete_stack => fnd_api.g_false);
418: if(l_logLevel <= wip_constants.trace_logging) then
419: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
420: p_procReturnStatus => x_returnStatus,
421: p_msg => 'unexp error:' || x_errorMsg,
422: x_returnStatus => l_retStatus);
423: if(fnd_api.to_boolean(nvl(p_endDebug, fnd_api.g_false))) then
420: p_procReturnStatus => x_returnStatus,
421: p_msg => 'unexp error:' || x_errorMsg,
422: x_returnStatus => l_retStatus);
423: if(fnd_api.to_boolean(nvl(p_endDebug, fnd_api.g_false))) then
424: wip_logger.cleanup(l_retStatus);
425: end if;
426: end if;
427: end processWIP;
428:
439: l_numErrRows NUMBER;
440: l_msgCount NUMBER;
441: l_msgData VARCHAR2(2000);
442: l_logLevel NUMBER := fnd_log.g_current_runtime_level;
443: l_params wip_logger.param_tbl_t;
444: type err_tbl_t is table of varchar2(240);
445: type item_tbl_t is table of varchar2(2000);
446: l_errExplTbl err_tbl_t;
447: l_itemNameTbl item_tbl_t;
455: if (l_logLevel <= wip_constants.trace_logging) then
456: l_params(1).paramName := 'p_txnHdrID';
457: l_params(1).paramValue := p_txnHdrID;
458:
459: wip_logger.entryPoint(p_procName => g_pkgName || '.' || l_procName,
460: p_params => l_params,
461: x_returnStatus => x_returnStatus);
462: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
463: raise fnd_api.g_exc_unexpected_error;
477: end if;
478:
479: if(l_numIntRows = 0) then
480: if(l_logLevel <= wip_constants.trace_logging) then
481: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
482: p_procReturnStatus => x_returnStatus,
483: p_msg => 'no rows to backflush',
484: x_returnStatus => l_retStatus);
485: if(fnd_api.to_boolean(l_endDebug)) then
482: p_procReturnStatus => x_returnStatus,
483: p_msg => 'no rows to backflush',
484: x_returnStatus => l_retStatus);
485: if(fnd_api.to_boolean(l_endDebug)) then
486: wip_logger.cleanup(l_retStatus);
487: end if;
488: end if;
489: return;
490: end if;
515: if(fnd_api.to_boolean(nvl(p_initMsgList, fnd_api.g_false))) then
516: fnd_msg_pub.initialize;
517: end if;
518: if(l_logLevel <= wip_constants.trace_logging) then
519: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
520: p_procReturnStatus => x_returnStatus,
521: p_msg => 'normal completion. ' || l_numTempRows || ' rows processed.',
522: x_returnStatus => l_retStatus);
523: if(fnd_api.to_boolean(l_endDebug)) then
520: p_procReturnStatus => x_returnStatus,
521: p_msg => 'normal completion. ' || l_numTempRows || ' rows processed.',
522: x_returnStatus => l_retStatus);
523: if(fnd_api.to_boolean(l_endDebug)) then
524: wip_logger.cleanup(l_retStatus);
525: end if;
526: end if;
527: return;
528: end if;
551: fnd_message.set_name('WIP', 'WIP_TMPINSERT_ERR');
552: fnd_message.set_token('ITEM_NAME', l_itemNameTbl(i));
553: fnd_message.set_token('ERR_MSG', l_errExplTbl(i));
554: if(l_logLevel <= wip_constants.trace_logging) then
555: wip_logger.log('item ' || l_itemNameTbl(i) || ': ' || l_errExplTbl(i), l_retStatus);
556: end if;
557: fnd_msg_pub.add;
558: end loop;
559: end if;
562: rollback to wiptmpvb200;
563: end if;
564:
565: if(l_logLevel <= wip_constants.trace_logging) then
566: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
567: p_procReturnStatus => x_returnStatus,
568: p_msg => to_char(l_numIntRows - l_numTempRows) || ' records errored',
569: x_returnStatus => l_retStatus);
570: if(fnd_api.to_boolean(l_endDebug)) then
567: p_procReturnStatus => x_returnStatus,
568: p_msg => to_char(l_numIntRows - l_numTempRows) || ' records errored',
569: x_returnStatus => l_retStatus);
570: if(fnd_api.to_boolean(l_endDebug)) then
571: wip_logger.cleanup(l_retStatus);
572: end if;
573: end if;
574:
575: exception
599: fnd_message.set_token('MESSAGE', l_msgData);
600: fnd_msg_pub.add;
601: end if;
602: if(l_logLevel <= wip_constants.trace_logging) then
603: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
604: p_procReturnStatus => x_returnStatus,
605: p_msg => 'error:' || l_msgData,
606: x_returnStatus => l_retStatus);
607: if(fnd_api.to_boolean(l_endDebug)) then
604: p_procReturnStatus => x_returnStatus,
605: p_msg => 'error:' || l_msgData,
606: x_returnStatus => l_retStatus);
607: if(fnd_api.to_boolean(l_endDebug)) then
608: wip_logger.cleanup(l_retStatus);
609: end if;
610: end if;
611: when others then
612: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
633: where transaction_header_id = p_txnHdrID;
634: end if;
635:
636: if(l_logLevel <= wip_constants.trace_logging) then
637: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
638: p_procReturnStatus => x_returnStatus,
639: p_msg => 'unexp error:' || l_msgData,
640: x_returnStatus => l_retStatus);
641: if(fnd_api.to_boolean(l_endDebug)) then
638: p_procReturnStatus => x_returnStatus,
639: p_msg => 'unexp error:' || l_msgData,
640: x_returnStatus => l_retStatus);
641: if(fnd_api.to_boolean(l_endDebug)) then
642: wip_logger.cleanup(l_retStatus);
643: end if;
644: end if;
645: end validateInterfaceTxns;
646: