52: if (periodID = -1 or periodID = 0) then
53: fnd_message.set_name(
54: application => 'INV',
55: name => 'INV_NO_OPEN_PERIOD');
56: x_returnStatus := fnd_api.g_ret_sts_error;
57: x_errMessage := fnd_message.get;
58: return;
59: end if;
60:
112: l_periodID Number;
113: l_temp Number;
114: l_openperiod boolean := false;
115: begin
116: x_returnStatus := fnd_api.g_ret_sts_success;
117: l_totalNum := 0;
118: l_logLevel := to_number(fnd_log.g_current_runtime_level);
119: savepoint dsmove1;
120:
135:
136: if (l_periodID = -1 or l_periodID = 0) then
137: fnd_message.set_name('INV','INV_NO_OPEN_PERIOD');
138: fnd_msg_pub.add;
139: raise fnd_api.g_exc_unexpected_error;
140: end if;
141:
142: begin
143: SELECT 1 into l_temp
148: exception
149: when others then
150: fnd_message.set_name('WIP', 'WIP_NO_BALANCE');
151: fnd_msg_pub.add;
152: raise fnd_api.g_exc_unexpected_error;
153: end;
154:
155: qaCollectionID := moveData.qaCollectionID;
156: if ( moveData.qaCollectionID is not null ) then
277: -- process online move transactions
278: if ( moveData.compHeaderID is not null ) then
279: wip_mtlTempProc_priv.validateInterfaceTxns(
280: p_txnHdrID => moveData.compHeaderID,
281: p_addMsgToStack => fnd_api.g_true,
282: p_rollbackOnErr => fnd_api.g_true,
283: x_returnStatus => l_returnStatus);
284: end if;
285:
278: if ( moveData.compHeaderID is not null ) then
279: wip_mtlTempProc_priv.validateInterfaceTxns(
280: p_txnHdrID => moveData.compHeaderID,
281: p_addMsgToStack => fnd_api.g_true,
282: p_rollbackOnErr => fnd_api.g_true,
283: x_returnStatus => l_returnStatus);
284: end if;
285:
286: if ( l_returnStatus <> fnd_api.g_ret_sts_success) then
282: p_rollbackOnErr => fnd_api.g_true,
283: x_returnStatus => l_returnStatus);
284: end if;
285:
286: if ( l_returnStatus <> fnd_api.g_ret_sts_success) then
287: x_returnStatus := fnd_api.g_ret_sts_error;
288: wip_utilities.get_message_stack(p_msg => x_errMessage);
289: return;
290: end if;
283: x_returnStatus => l_returnStatus);
284: end if;
285:
286: if ( l_returnStatus <> fnd_api.g_ret_sts_success) then
287: x_returnStatus := fnd_api.g_ret_sts_error;
288: wip_utilities.get_message_stack(p_msg => x_errMessage);
289: return;
290: end if;
291:
291:
292: if ( moveData.assyHeaderID is not null AND moveData.assyHeaderID <> moveData.compHeaderID ) then
293: wip_mtlTempProc_priv.validateInterfaceTxns(
294: p_txnHdrID => moveData.assyHeaderID,
295: p_addMsgToStack => fnd_api.g_true,
296: p_rollbackOnErr => fnd_api.g_true,
297: x_returnStatus => l_returnStatus);
298: if ( l_returnStatus <> fnd_api.g_ret_sts_success) then
299: x_returnStatus := fnd_api.g_ret_sts_error;
292: if ( moveData.assyHeaderID is not null AND moveData.assyHeaderID <> moveData.compHeaderID ) then
293: wip_mtlTempProc_priv.validateInterfaceTxns(
294: p_txnHdrID => moveData.assyHeaderID,
295: p_addMsgToStack => fnd_api.g_true,
296: p_rollbackOnErr => fnd_api.g_true,
297: x_returnStatus => l_returnStatus);
298: if ( l_returnStatus <> fnd_api.g_ret_sts_success) then
299: x_returnStatus := fnd_api.g_ret_sts_error;
300: wip_utilities.get_message_stack(p_msg => x_errMessage);
294: p_txnHdrID => moveData.assyHeaderID,
295: p_addMsgToStack => fnd_api.g_true,
296: p_rollbackOnErr => fnd_api.g_true,
297: x_returnStatus => l_returnStatus);
298: if ( l_returnStatus <> fnd_api.g_ret_sts_success) then
299: x_returnStatus := fnd_api.g_ret_sts_error;
300: wip_utilities.get_message_stack(p_msg => x_errMessage);
301: return;
302: end if;
295: p_addMsgToStack => fnd_api.g_true,
296: p_rollbackOnErr => fnd_api.g_true,
297: x_returnStatus => l_returnStatus);
298: if ( l_returnStatus <> fnd_api.g_ret_sts_success) then
299: x_returnStatus := fnd_api.g_ret_sts_error;
300: wip_utilities.get_message_stack(p_msg => x_errMessage);
301: return;
302: end if;
303: end if;
308: p_time_out => 0,
309: p_move_mode => WIP_CONSTANTS.ONLINE,
310: p_bf_mode => WIP_CONSTANTS.ONLINE,
311: p_mtl_mode => moveData.mtlMode,
312: p_endDebug => fnd_api.g_true,
313: p_initMsgList => fnd_api.g_true,
314: p_insertAssy => fnd_api.g_false,
315: p_do_backflush => fnd_api.g_false,
316: p_assy_header_id => moveData.assyHeaderID,
309: p_move_mode => WIP_CONSTANTS.ONLINE,
310: p_bf_mode => WIP_CONSTANTS.ONLINE,
311: p_mtl_mode => moveData.mtlMode,
312: p_endDebug => fnd_api.g_true,
313: p_initMsgList => fnd_api.g_true,
314: p_insertAssy => fnd_api.g_false,
315: p_do_backflush => fnd_api.g_false,
316: p_assy_header_id => moveData.assyHeaderID,
317: p_mtl_header_id => moveData.compHeaderID,
310: p_bf_mode => WIP_CONSTANTS.ONLINE,
311: p_mtl_mode => moveData.mtlMode,
312: p_endDebug => fnd_api.g_true,
313: p_initMsgList => fnd_api.g_true,
314: p_insertAssy => fnd_api.g_false,
315: p_do_backflush => fnd_api.g_false,
316: p_assy_header_id => moveData.assyHeaderID,
317: p_mtl_header_id => moveData.compHeaderID,
318: x_returnStatus => x_returnStatus);
311: p_mtl_mode => moveData.mtlMode,
312: p_endDebug => fnd_api.g_true,
313: p_initMsgList => fnd_api.g_true,
314: p_insertAssy => fnd_api.g_false,
315: p_do_backflush => fnd_api.g_false,
316: p_assy_header_id => moveData.assyHeaderID,
317: p_mtl_header_id => moveData.compHeaderID,
318: x_returnStatus => x_returnStatus);
319: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
315: p_do_backflush => fnd_api.g_false,
316: p_assy_header_id => moveData.assyHeaderID,
317: p_mtl_header_id => moveData.compHeaderID,
318: x_returnStatus => x_returnStatus);
319: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
320: wip_utilities.get_message_stack(p_msg => x_errMessage);
321: rollback to dsmove1;
322: end if;
323:
321: rollback to dsmove1;
322: end if;
323:
324: exception
325: when fnd_api.g_exc_unexpected_error THEN
326: rollback to dsmove1;
327: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
328: wip_utilities.get_message_stack(p_msg => x_errMessage);
329: if (l_logLevel <= wip_constants.trace_logging) then
323:
324: exception
325: when fnd_api.g_exc_unexpected_error THEN
326: rollback to dsmove1;
327: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
328: wip_utilities.get_message_stack(p_msg => x_errMessage);
329: if (l_logLevel <= wip_constants.trace_logging) then
330: wip_logger.exitPoint(p_procName => 'wip_discrete_ws_move.insertMoveRecord',
331: p_procReturnStatus => x_returnStatus,
334: end if;
335:
336: when others then
337: rollback to dsmove1;
338: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
339: fnd_message.set_name ('WIP', 'GENERIC_ERROR');
340: fnd_message.set_token ('PROCEDURE', 'wip_discrete_ws_move.processMove');
341: fnd_message.set_token ('ERROR', SQLCODE || ' ' || SQLERRM);
342: x_errMessage := fnd_message.get;
405:
406: l_max_rem_primary_qty number;
407: l_inv_primary_rsv_quantity number;
408: begin
409: x_returnStatus := fnd_api.g_ret_sts_success;
410: l_wsh_minmax_in_rec.api_version_number := 1.0;
411: l_wsh_minmax_in_rec.source_code := 'OE';--Fix for Bug 4635597
412: l_wsh_minmax_in_rec.line_id := p_orderLineID;
413:
418: x_return_status => x_returnStatus,
419: x_msg_count => l_msg_count,
420: x_msg_data => l_msg_data);
421:
422: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
423: fnd_message.set_name(application => 'WIP',
424: name => 'WIP_WSH_MINMAX_API_FAILURE');
425: fnd_message.set_token(token => 'ENTITY1',
426: value => substr(l_msg_data, 1, 250),
445: and organization_id = p_orgID
446: and supply_source_type_id = 13;
447:
448: if ( p_primaryQty > l_max_rem_primary_qty - l_inv_primary_rsv_quantity ) then
449: x_returnStatus := fnd_api.g_ret_sts_error;
450: fnd_message.set_name('WIP', 'WIP_OSHP_TOLERANCE_FAIL');
451: x_errMessage := fnd_message.get;
452: end if;
453: