12: x_returnStatus OUT NOCOPY VARCHAR2);
13:
14: /* public procedures */
15: procedure processInterface(p_txnHdrID IN NUMBER,
16: p_commit IN VARCHAR2 := fnd_api.g_false,
17: x_returnStatus OUT NOCOPY VARCHAR2) is
18: l_returnStatus VARCHAR2(1);
19: l_params wip_logger.param_tbl_t;
20: l_errCodeTbl err_tbl_t;
35: end if;
36:
37: fnd_msg_pub.initialize;
38:
39: processInterfaceRows(p_initMsgList => fnd_api.g_true,
40: p_processInv => fnd_api.g_true,
41: p_endDebug => fnd_api.g_false,
42: p_txnHdrID => p_txnHdrID,
43: x_returnStatus => x_returnStatus);
36:
37: fnd_msg_pub.initialize;
38:
39: processInterfaceRows(p_initMsgList => fnd_api.g_true,
40: p_processInv => fnd_api.g_true,
41: p_endDebug => fnd_api.g_false,
42: p_txnHdrID => p_txnHdrID,
43: x_returnStatus => x_returnStatus);
44:
37: fnd_msg_pub.initialize;
38:
39: processInterfaceRows(p_initMsgList => fnd_api.g_true,
40: p_processInv => fnd_api.g_true,
41: p_endDebug => fnd_api.g_false,
42: p_txnHdrID => p_txnHdrID,
43: x_returnStatus => x_returnStatus);
44:
45: --unexpected error occurred, return status gets set to unexpected error
42: p_txnHdrID => p_txnHdrID,
43: x_returnStatus => x_returnStatus);
44:
45: --unexpected error occurred, return status gets set to unexpected error
46: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
47: raise fnd_api.g_exc_unexpected_error;
48: end if;
49:
50: if(fnd_api.to_boolean(p_commit)) then
43: x_returnStatus => x_returnStatus);
44:
45: --unexpected error occurred, return status gets set to unexpected error
46: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
47: raise fnd_api.g_exc_unexpected_error;
48: end if;
49:
50: if(fnd_api.to_boolean(p_commit)) then
51: commit;
46: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
47: raise fnd_api.g_exc_unexpected_error;
48: end if;
49:
50: if(fnd_api.to_boolean(p_commit)) then
51: commit;
52: end if;
53:
54: if (l_logLevel <= wip_constants.trace_logging) then
58: x_returnStatus => l_returnStatus); --discard logging return status
59: wip_logger.cleanUp(x_returnStatus => l_returnStatus); --discard logging return status
60: end if;
61: exception
62: when fnd_api.g_exc_unexpected_error then
63: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
64: wip_utilities.get_message_stack(p_msg => l_errMessage,
65: p_separator => ' ',
66: p_delete_stack => fnd_api.g_false);
59: wip_logger.cleanUp(x_returnStatus => l_returnStatus); --discard logging return status
60: end if;
61: exception
62: when fnd_api.g_exc_unexpected_error then
63: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
64: wip_utilities.get_message_stack(p_msg => l_errMessage,
65: p_separator => ' ',
66: p_delete_stack => fnd_api.g_false);
67: if (l_logLevel <= wip_constants.trace_logging) then
62: when fnd_api.g_exc_unexpected_error then
63: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
64: wip_utilities.get_message_stack(p_msg => l_errMessage,
65: p_separator => ' ',
66: p_delete_stack => fnd_api.g_false);
67: if (l_logLevel <= wip_constants.trace_logging) then
68: wip_logger.exitPoint(p_procName => 'wip_mtlInterfaceProc_pub.processInterface',
69: p_procReturnStatus => x_returnStatus,
70: p_msg => 'proc failure:' || l_errMessage,
91: where transaction_header_id = p_txnHdrID
92: and transaction_interface_id = l_intTbl(i);
93: end loop;
94: when others then --some unhandled exception occurred. rollback everything.
95: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
96: if (l_logLevel <= wip_constants.trace_logging) then
97: wip_logger.exitPoint(p_procName => 'wip_mtlInterfaceProc_pub.processInterface',
98: p_procReturnStatus => x_returnStatus,
99: p_msg => 'exception' || SQLERRM,
106: p_procedure_name => 'processInterface',
107: p_error_text => SQLERRM);
108: wip_utilities.get_message_stack(p_msg => l_errMessage,
109: p_separator => ' ',
110: p_delete_stack => fnd_api.g_false);
111: l_errMessage := substr(l_errMessage,1,240);
112: update mtl_transactions_interface
113: set error_code = 'wip_mtlInterfaceProc_pub.processInterface()',
114: error_explanation = l_errMessage,
116: where transaction_header_id = p_txnHdrID;
117: end processInterface;
118:
119: procedure processInterface(p_txnIntID IN NUMBER,
120: p_commit IN VARCHAR2 := fnd_api.g_false,
121: x_returnStatus OUT NOCOPY VARCHAR2,
122: x_errorMsg OUT NOCOPY VARCHAR2) is
123: l_rowID rowid;
124: l_txnHdrID NUMBER;
140: wip_logger.entryPoint(p_procName => 'wip_mtlInterfaceProc_pub.processInterface',
141: p_params => l_params,
142: x_returnStatus => x_returnStatus);
143:
144: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
145: raise fnd_api.g_exc_error;
146: end if;
147: wip_logger.cleanUp(x_returnStatus=>l_returnStatus);
148: end if;
141: p_params => l_params,
142: x_returnStatus => x_returnStatus);
143:
144: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
145: raise fnd_api.g_exc_error;
146: end if;
147: wip_logger.cleanUp(x_returnStatus=>l_returnStatus);
148: end if;
149:
155: and transaction_source_type_id = 5
156: and process_flag = wip_constants.mti_inventory;
157:
158:
159: processInterfaceRows(p_initMsgList => fnd_api.g_true,
160: p_processInv => fnd_api.g_true,
161: p_endDebug => fnd_api.g_false,
162: p_txnHdrID => l_txnHdrID,
163: x_returnStatus => x_returnStatus);
156: and process_flag = wip_constants.mti_inventory;
157:
158:
159: processInterfaceRows(p_initMsgList => fnd_api.g_true,
160: p_processInv => fnd_api.g_true,
161: p_endDebug => fnd_api.g_false,
162: p_txnHdrID => l_txnHdrID,
163: x_returnStatus => x_returnStatus);
164:
157:
158:
159: processInterfaceRows(p_initMsgList => fnd_api.g_true,
160: p_processInv => fnd_api.g_true,
161: p_endDebug => fnd_api.g_false,
162: p_txnHdrID => l_txnHdrID,
163: x_returnStatus => x_returnStatus);
164:
165:
162: p_txnHdrID => l_txnHdrID,
163: x_returnStatus => x_returnStatus);
164:
165:
166: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
167: l_msg := 'process interface rows failed';
168: raise fnd_api.g_exc_error;
169: end if;
170:
164:
165:
166: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
167: l_msg := 'process interface rows failed';
168: raise fnd_api.g_exc_error;
169: end if;
170:
171:
172: if(fnd_api.to_boolean(p_commit)) then
168: raise fnd_api.g_exc_error;
169: end if;
170:
171:
172: if(fnd_api.to_boolean(p_commit)) then
173: commit;
174: end if;
175:
176: l_msg := 'success';
183: wip_logger.cleanUp(x_returnStatus => l_returnStatus); --discard logging return status
184: end if;
185:
186: exception
187: when fnd_api.g_exc_error then
188: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
189: wip_utilities.get_message_stack(p_msg => x_errorMsg,
190: p_separator => ' ',
191: p_delete_stack => fnd_api.g_false);
184: end if;
185:
186: exception
187: when fnd_api.g_exc_error then
188: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
189: wip_utilities.get_message_stack(p_msg => x_errorMsg,
190: p_separator => ' ',
191: p_delete_stack => fnd_api.g_false);
192: if (l_logLevel <= wip_constants.trace_logging) then
187: when fnd_api.g_exc_error then
188: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
189: wip_utilities.get_message_stack(p_msg => x_errorMsg,
190: p_separator => ' ',
191: p_delete_stack => fnd_api.g_false);
192: if (l_logLevel <= wip_constants.trace_logging) then
193: wip_logger.exitPoint(p_procName => 'wip_mtlInterfaceProc_pub.processInterface',
194: p_procReturnStatus => x_returnStatus,
195: p_msg => 'MTI failure: ' || l_msg,
196: x_returnStatus => l_returnStatus); --discard logging return status
197: wip_logger.cleanUp(x_returnStatus => l_returnStatus); --discard logging return status
198: end if;
199: when TOO_MANY_ROWS then
200: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
201: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_mtlInterfaceProc_pub',
202: p_procedure_name => 'processInterface',
203: p_error_text => SQLERRM);
204: wip_utilities.get_message_stack(p_msg => x_errorMsg,
202: p_procedure_name => 'processInterface',
203: p_error_text => SQLERRM);
204: wip_utilities.get_message_stack(p_msg => x_errorMsg,
205: p_separator => ' ',
206: p_delete_stack => fnd_api.g_false);
207:
208: if (l_logLevel <= wip_constants.trace_logging) then
209: wip_logger.exitPoint(p_procName => 'wip_mtlInterfaceProc_pub.processInterface',
210: p_procReturnStatus => x_returnStatus,
212: x_returnStatus => l_returnStatus); --discard logging return status
213: wip_logger.cleanUp(x_returnStatus => l_returnStatus); --discard logging return status
214: end if;
215: when NO_DATA_FOUND then
216: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
217: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_mtlInterfaceProc_pub',
218: p_procedure_name => 'processInterface',
219: p_error_text => SQLERRM);
220:
219: p_error_text => SQLERRM);
220:
221: wip_utilities.get_message_stack(p_msg => x_errorMsg,
222: p_separator => ' ',
223: p_delete_stack => fnd_api.g_false);
224:
225: if (l_logLevel <= wip_constants.trace_logging) then
226: wip_logger.exitPoint(p_procName => 'wip_mtlInterfaceProc_pub.processInterface',
227: p_procReturnStatus => x_returnStatus,
229: x_returnStatus => l_returnStatus); --discard logging return status
230: wip_logger.cleanUp(x_returnStatus => l_returnStatus); --discard logging return status
231: end if;
232: when others then
233: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
234: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_mtlInterfaceProc_pub',
235: p_procedure_name => 'processInterface',
236: p_error_text => SQLERRM);
237: wip_utilities.get_message_stack(p_msg => x_errorMsg,
235: p_procedure_name => 'processInterface',
236: p_error_text => SQLERRM);
237: wip_utilities.get_message_stack(p_msg => x_errorMsg,
238: p_separator => ' ',
239: p_delete_stack => fnd_api.g_false);
240:
241: if (l_logLevel <= wip_constants.trace_logging) then
242: wip_logger.exitPoint(p_procName => 'wip_mtlInterfaceProc_pub.processInterface',
243: p_procReturnStatus => x_returnStatus,
287: wip_logger.entryPoint(p_procName => 'wip_mtlInterfaceProc_pub.processInterfaceRows',
288: p_params => l_params,
289: x_returnStatus => x_returnStatus);
290:
291: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
292: raise fnd_api.g_exc_unexpected_error;
293: end if;
294: wip_logger.cleanUp(x_returnStatus=>l_returnStatus);
295: end if;
288: p_params => l_params,
289: x_returnStatus => x_returnStatus);
290:
291: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
292: raise fnd_api.g_exc_unexpected_error;
293: end if;
294: wip_logger.cleanUp(x_returnStatus=>l_returnStatus);
295: end if;
296:
293: end if;
294: wip_logger.cleanUp(x_returnStatus=>l_returnStatus);
295: end if;
296:
297: x_returnStatus := fnd_api.g_ret_sts_success;
298:
299: l_msg := 'success';
300:
301: l_retStatus := inv_txn_manager_pub.process_transactions(p_api_version => 1.0,
298:
299: l_msg := 'success';
300:
301: l_retStatus := inv_txn_manager_pub.process_transactions(p_api_version => 1.0,
302: p_init_msg_list => fnd_api.g_true,
303: p_commit => fnd_api.g_false,
304: p_validation_level => fnd_api.g_valid_level_full,
305: p_table => 1,
306: p_header_id => p_txnHdrID,
299: l_msg := 'success';
300:
301: l_retStatus := inv_txn_manager_pub.process_transactions(p_api_version => 1.0,
302: p_init_msg_list => fnd_api.g_true,
303: p_commit => fnd_api.g_false,
304: p_validation_level => fnd_api.g_valid_level_full,
305: p_table => 1,
306: p_header_id => p_txnHdrID,
307: x_return_status => x_returnStatus,
300:
301: l_retStatus := inv_txn_manager_pub.process_transactions(p_api_version => 1.0,
302: p_init_msg_list => fnd_api.g_true,
303: p_commit => fnd_api.g_false,
304: p_validation_level => fnd_api.g_valid_level_full,
305: p_table => 1,
306: p_header_id => p_txnHdrID,
307: x_return_status => x_returnStatus,
308: x_msg_count => l_msgCount,
314: fnd_message.set_token('MESSAGE', l_msgData);
315: fnd_msg_pub.add;
316: end if;
317: l_msg := 'error from INV MTI processor:' || l_msgData;
318: raise fnd_api.g_exc_error;
319: end if;
320:
321: if (l_logLevel <= wip_constants.trace_logging) then
322: wip_logger.exitPoint(p_procName => 'wip_mtlInterfaceProc_pub.processInterfaceRows',
323: p_procReturnStatus => x_returnStatus,
324: p_msg => l_msg,
325: x_returnStatus => l_returnStatus); --discard logging return status
326: end if;
327: if(fnd_api.to_boolean(p_endDebug)) then
328: wip_logger.cleanUp(x_returnStatus => l_returnStatus); --discard logging return status
329: end if;
330: exception
331: when fnd_api.g_exc_unexpected_error then
327: if(fnd_api.to_boolean(p_endDebug)) then
328: wip_logger.cleanUp(x_returnStatus => l_returnStatus); --discard logging return status
329: end if;
330: exception
331: when fnd_api.g_exc_unexpected_error then
332: x_returnStatus := fnd_api.g_ret_sts_error;
333: if (l_logLevel <= wip_constants.trace_logging) then
334: wip_logger.exitPoint(p_procName => 'wip_mtlInterfaceProc_pub.processInterfaceRows',
335: p_procReturnStatus => x_returnStatus,
328: wip_logger.cleanUp(x_returnStatus => l_returnStatus); --discard logging return status
329: end if;
330: exception
331: when fnd_api.g_exc_unexpected_error then
332: x_returnStatus := fnd_api.g_ret_sts_error;
333: if (l_logLevel <= wip_constants.trace_logging) then
334: wip_logger.exitPoint(p_procName => 'wip_mtlInterfaceProc_pub.processInterfaceRows',
335: p_procReturnStatus => x_returnStatus,
336: p_msg => l_msg,
335: p_procReturnStatus => x_returnStatus,
336: p_msg => l_msg,
337: x_returnStatus => l_returnStatus); --discard logging return status
338: end if;
339: if(fnd_api.to_boolean(p_endDebug)) then
340: wip_logger.cleanUp(x_returnStatus => l_returnStatus); --discard logging return status
341: end if;
342: when fnd_api.g_exc_error then
343: x_returnStatus := fnd_api.g_ret_sts_error;
338: end if;
339: if(fnd_api.to_boolean(p_endDebug)) then
340: wip_logger.cleanUp(x_returnStatus => l_returnStatus); --discard logging return status
341: end if;
342: when fnd_api.g_exc_error then
343: x_returnStatus := fnd_api.g_ret_sts_error;
344: if (l_logLevel <= wip_constants.trace_logging) then
345: wip_logger.exitPoint(p_procName => 'wip_mtlInterfaceProc_pub.processInterfaceRows',
346: p_procReturnStatus => x_returnStatus,
339: if(fnd_api.to_boolean(p_endDebug)) then
340: wip_logger.cleanUp(x_returnStatus => l_returnStatus); --discard logging return status
341: end if;
342: when fnd_api.g_exc_error then
343: x_returnStatus := fnd_api.g_ret_sts_error;
344: if (l_logLevel <= wip_constants.trace_logging) then
345: wip_logger.exitPoint(p_procName => 'wip_mtlInterfaceProc_pub.processInterfaceRows',
346: p_procReturnStatus => x_returnStatus,
347: p_msg => l_msg,
346: p_procReturnStatus => x_returnStatus,
347: p_msg => l_msg,
348: x_returnStatus => l_returnStatus); --discard logging return status
349: end if;
350: if(fnd_api.to_boolean(p_endDebug)) then
351: wip_logger.cleanUp(x_returnStatus => l_returnStatus); --discard logging return status
352: end if;
353:
354: when others then
351: wip_logger.cleanUp(x_returnStatus => l_returnStatus); --discard logging return status
352: end if;
353:
354: when others then
355: x_returnStatus := fnd_api.g_ret_sts_error;
356: l_msg := 'unexpected error: ' || SQLERRM;
357: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_mtlInterfaceProc_pub',
358: p_procedure_name => 'processInterfaceRows',
359: p_error_text => SQLERRM);
362: p_procReturnStatus => x_returnStatus,
363: p_msg => l_msg,
364: x_returnStatus => l_returnStatus); --discard logging return status
365: end if;
366: if(fnd_api.to_boolean(p_endDebug)) then
367: wip_logger.cleanUp(x_returnStatus => l_returnStatus); --discard logging return status
368: end if;
369: end processInterfaceRows;
370: