57: l_errMsg VARCHAR2(240);
58: l_returnStatus VARCHAR2(1);
59: l_item system.wip_component_obj_t;
60: l_lotComp c_lotComp%ROWTYPE;
61: l_params wip_logger.param_tbl_t;
62: l_serialComp c_serialComp%ROWTYPE;
63:
64: BEGIN
65: -- Don't need to check the return status because already check in
84: l_params(8).paramName := 'x_compLot(cur_item).primary_quantity';
85: l_params(8).paramValue := l_item.primary_quantity;
86: l_params(9).paramName := 'x_compLot(cur_item).transaction_action_id';
87: l_params(9).paramValue := l_item.transaction_action_id;
88: wip_logger.entryPoint(
89: p_procName => 'wip_autoSerialProc_priv.deriveSingleItem',
90: p_params => l_params,
91: x_returnStatus => x_returnStatus);
92: END IF;
104:
105: l_derivedQty := l_derivedQty + l_lotComp.lot_qty;
106:
107: IF (l_logLevel <= wip_constants.full_logging) THEN
108: wip_logger.log('Added Lot : ' || l_lotComp.lot, l_returnStatus);
109: wip_logger.log('Added Lot Qty : '|| l_lotComp.lot_qty, l_returnStatus);
110: END IF;
111:
112: -- derive lot/serial genealogy
105: l_derivedQty := l_derivedQty + l_lotComp.lot_qty;
106:
107: IF (l_logLevel <= wip_constants.full_logging) THEN
108: wip_logger.log('Added Lot : ' || l_lotComp.lot, l_returnStatus);
109: wip_logger.log('Added Lot Qty : '|| l_lotComp.lot_qty, l_returnStatus);
110: END IF;
111:
112: -- derive lot/serial genealogy
113: FOR l_serialComp IN c_serialComp
122: p_parentSerial => l_serialComp.parent_serial,
123: p_priQty => 1,
124: p_attributes => null);
125: IF (l_logLevel <= wip_constants.full_logging) THEN
126: wip_logger.log('Added Serial : ' || l_serialComp.serial,
127: l_returnStatus);
128: END IF;
129: END LOOP; -- l_serialComp IN c_serialComp
130: END LOOP; -- l_lotComp IN c_lotComp
132: -- Check whether derived quantity equal to backflush quantity or not
133: -- If not, error out. (for lot and serial control component)
134: IF(l_item.lot_control_code = WIP_CONSTANTS.LOT AND
135: l_item.primary_quantity <> l_derivedQty * -1) THEN
136: wip_logger.log('item : ' || l_item.item_name, l_returnStatus);
137: wip_logger.log('primary_quantity : ' || l_item.primary_quantity,
138: l_returnStatus);
139: wip_logger.log('derived_quantity : ' || l_derivedQty, l_returnStatus);
140: l_errMsg := 'return quantity missmatch';
133: -- If not, error out. (for lot and serial control component)
134: IF(l_item.lot_control_code = WIP_CONSTANTS.LOT AND
135: l_item.primary_quantity <> l_derivedQty * -1) THEN
136: wip_logger.log('item : ' || l_item.item_name, l_returnStatus);
137: wip_logger.log('primary_quantity : ' || l_item.primary_quantity,
138: l_returnStatus);
139: wip_logger.log('derived_quantity : ' || l_derivedQty, l_returnStatus);
140: l_errMsg := 'return quantity missmatch';
141: raise fnd_api.g_exc_unexpected_error;
135: l_item.primary_quantity <> l_derivedQty * -1) THEN
136: wip_logger.log('item : ' || l_item.item_name, l_returnStatus);
137: wip_logger.log('primary_quantity : ' || l_item.primary_quantity,
138: l_returnStatus);
139: wip_logger.log('derived_quantity : ' || l_derivedQty, l_returnStatus);
140: l_errMsg := 'return quantity missmatch';
141: raise fnd_api.g_exc_unexpected_error;
142: END IF;
143:
157:
158: l_derivedQty := l_derivedQty + 1;
159:
160: IF (l_logLevel <= wip_constants.full_logging) THEN
161: wip_logger.log('Added Serial : ' || l_serialComp.serial,
162: l_returnStatus);
163: END IF;
164: END LOOP; -- l_serialComp IN c_serialComp
165:
166: -- Check whether derived quantity equal to backflush quantity or not
167: -- If not, error out. (for serial control only component)
168: IF(l_item.lot_control_code = WIP_CONSTANTS.NO_LOT AND
169: l_item.primary_quantity <> l_derivedQty * -1) THEN
170: wip_logger.log('item : ' || l_item.item_name, l_returnStatus);
171: wip_logger.log('primary_quantity : ' || l_item.primary_quantity,
172: l_returnStatus);
173: wip_logger.log('derived_quantity : ' || l_derivedQty, l_returnStatus);
174: l_errMsg := 'return quantity missmatch : ' || l_item.item_name;
167: -- If not, error out. (for serial control only component)
168: IF(l_item.lot_control_code = WIP_CONSTANTS.NO_LOT AND
169: l_item.primary_quantity <> l_derivedQty * -1) THEN
170: wip_logger.log('item : ' || l_item.item_name, l_returnStatus);
171: wip_logger.log('primary_quantity : ' || l_item.primary_quantity,
172: l_returnStatus);
173: wip_logger.log('derived_quantity : ' || l_derivedQty, l_returnStatus);
174: l_errMsg := 'return quantity missmatch : ' || l_item.item_name;
175: raise fnd_api.g_exc_unexpected_error;
169: l_item.primary_quantity <> l_derivedQty * -1) THEN
170: wip_logger.log('item : ' || l_item.item_name, l_returnStatus);
171: wip_logger.log('primary_quantity : ' || l_item.primary_quantity,
172: l_returnStatus);
173: wip_logger.log('derived_quantity : ' || l_derivedQty, l_returnStatus);
174: l_errMsg := 'return quantity missmatch : ' || l_item.item_name;
175: raise fnd_api.g_exc_unexpected_error;
176: END IF;
177:
175: raise fnd_api.g_exc_unexpected_error;
176: END IF;
177:
178: IF (l_logLevel <= wip_constants.trace_logging) THEN
179: wip_logger.exitPoint(
180: p_procName => 'wip_autoSerialProc_priv.deriveSingleItem',
181: p_procReturnStatus => x_returnStatus,
182: p_msg => 'procedure success',
183: x_returnStatus => l_returnStatus); --discard return status
186: EXCEPTION
187: WHEN fnd_api.g_exc_unexpected_error THEN
188: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
189: IF (l_logLevel <= wip_constants.trace_logging) THEN
190: wip_logger.exitPoint(
191: p_procName => 'wip_autoSerialProc_priv.deriveSingleItem',
192: p_procReturnStatus => x_returnStatus,
193: p_msg => l_errMsg,
194: x_returnStatus => l_returnStatus); --discard return status
200:
201: WHEN others THEN
202: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
203: IF (l_logLevel <= wip_constants.trace_logging) THEN
204: wip_logger.exitPoint(
205: p_procName => 'wip_autoSerialProc_priv.deriveSingleItem',
206: p_procReturnStatus => x_returnStatus,
207: p_msg => 'unexp error:' || SQLERRM,
208: x_returnStatus => l_returnStatus); --discard return status
232:
233: l_errMsg VARCHAR2(240);
234: l_returnStatus VARCHAR2(1);
235: l_logLevel NUMBER := fnd_log.g_current_runtime_level;
236: l_params wip_logger.param_tbl_t;
237: l_revisionComp c_revisionComp%ROWTYPE;
238: BEGIN
239:
240: IF (l_logLevel <= wip_constants.trace_logging) THEN
255: l_params(8).paramName := 'p_item.primary_quantity';
256: l_params(8).paramValue := p_item.primary_quantity;
257: l_params(9).paramName := 'p_item.transaction_action_id';
258: l_params(9).paramValue := p_item.transaction_action_id;
259: wip_logger.entryPoint(
260: p_procName => 'wip_autoSerialProc_priv.setItemRevision',
261: p_params => l_params,
262: x_returnStatus => x_returnStatus);
263: END IF;
273: x_compLots.setRevision(p_revision => l_revisionComp.revision);
274: END IF;
275:
276: IF (l_logLevel <= wip_constants.trace_logging) THEN
277: wip_logger.exitPoint(
278: p_procName => 'wip_autoSerialProc_priv.setItemRevision',
279: p_procReturnStatus => x_returnStatus,
280: p_msg => 'procedure success',
281: x_returnStatus => l_returnStatus); --discard return status
288: END IF;
289:
290: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
291: IF (l_logLevel <= wip_constants.trace_logging) THEN
292: wip_logger.exitPoint(
293: p_procName => 'wip_autoSerialProc_priv.setItemRevision',
294: p_procReturnStatus => x_returnStatus,
295: p_msg => 'unexp error:' || SQLERRM,
296: x_returnStatus => l_returnStatus); --discard return status
328: p_initMsgList IN VARCHAR2,
329: x_returnStatus OUT NOCOPY VARCHAR2) IS
330: l_returnStatus VARCHAR2(1);
331: l_errMsg VARCHAR2(80);
332: l_params wip_logger.param_tbl_t;
333: l_curItem system.wip_component_obj_t;
334: l_logLevel NUMBER := fnd_log.g_current_runtime_level;
335: BEGIN
336: IF (l_logLevel <= wip_constants.trace_logging) THEN
335: BEGIN
336: IF (l_logLevel <= wip_constants.trace_logging) THEN
337: l_params(1).paramName := 'p_objectID';
338: l_params(1).paramValue := p_objectID;
339: wip_logger.entryPoint(
340: p_procName => 'wip_autoSerialProc_priv.deriveSerial',
341: p_params => l_params,
342: x_returnStatus => x_returnStatus);
343: END IF;
395: EXIT WHEN NOT x_compLots.setNextItem;
396: END LOOP;
397:
398: IF (l_logLevel <= wip_constants.trace_logging) THEN
399: wip_logger.exitPoint(
400: p_procName => 'wip_autoSerialProc_priv.deriveSerial',
401: p_procReturnStatus => x_returnStatus,
402: p_msg => 'procedure success',
403: x_returnStatus => l_returnStatus);
406: EXCEPTION
407: WHEN fnd_api.g_exc_unexpected_error THEN
408: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
409: IF (l_logLevel <= wip_constants.trace_logging) THEN
410: wip_logger.exitPoint(
411: p_procName => 'wip_autoSerialProc_priv.deriveSerial',
412: p_procReturnStatus => x_returnStatus,
413: p_msg => l_errMsg,
414: x_returnStatus => l_returnStatus); --discard return status
417:
418: WHEN others THEN
419: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
420: IF (l_logLevel <= wip_constants.trace_logging) THEN
421: wip_logger.exitPoint(
422: p_procName => 'wip_autoSerialProc_priv.deriveSerial',
423: p_procReturnStatus => x_returnStatus,
424: p_msg => 'unexpected error:' || SQLERRM,
425: x_returnStatus => l_returnStatus); --discard return status