DBA Data[Home] [Help]

APPS.WIP_AUTOLOTPROC_PRIV dependencies on WIP_CONSTANTS

Line 136: if (l_logLevel <= wip_constants.trace_logging) then

132: l_entryType NUMBER;
133: l_logLevel NUMBER := to_number(fnd_log.g_current_runtime_level);
134: begin
135: x_returnStatus := fnd_api.g_ret_sts_success;
136: if (l_logLevel <= wip_constants.trace_logging) then
137: l_params(1).paramName := 'p_orgID';
138: l_params(1).paramValue := p_orgID;
139: l_params(2).paramName := 'p_wipEntityID';
140: l_params(2).paramValue := p_wipEntityID;

Line 160: if(l_curItem.wip_supply_type not in (wip_constants.push, wip_constants.op_pull, wip_constants.assy_pull)) then

156: x_compLots.reset;
157: x_returnStatus := fnd_api.g_ret_sts_success; --assume we will be able to derive everything
158: loop
159: if(x_compLots.getCurrentItem(l_curItem)) then
160: if(l_curItem.wip_supply_type not in (wip_constants.push, wip_constants.op_pull, wip_constants.assy_pull)) then
161: goto END_OF_LOOP;
162: end if;
163:
164: if(l_treeID is not null

Line 213: if (l_logLevel <= wip_constants.trace_logging) then

209: x_msg_data => l_msgData);
210: l_treeID := null;
211: end if;
212:
213: if (l_logLevel <= wip_constants.trace_logging) then
214: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveLots',
215: p_procReturnStatus => x_returnStatus,
216: p_msg => 'procedure success',
217: x_returnStatus => l_returnStatus); --discard logging return status

Line 225: if (l_logLevel <= wip_constants.trace_logging) then

221: end if;
222: exception
223: when fnd_api.g_exc_unexpected_error then
224: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
225: if (l_logLevel <= wip_constants.trace_logging) then
226: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveLots',
227: p_procReturnStatus => x_returnStatus,
228: p_msg => l_errMsg,
229: x_returnStatus => l_returnStatus); --discard logging return status

Line 236: if (l_logLevel <= wip_constants.trace_logging) then

232: wip_logger.cleanup(x_returnStatus => l_returnStatus);
233: end if;
234: when others then
235: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
236: if (l_logLevel <= wip_constants.trace_logging) then
237: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveLots',
238: p_procReturnStatus => x_returnStatus,
239: p_msg => 'unexpected error:' || SQLERRM,
240: x_returnStatus => l_returnStatus); --discard logging return status

Line 291: and mmtt.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action,

287: from mtl_material_transactions_temp mmtt,
288: mtl_system_items_kfv msi,
289: mtl_transaction_lots_temp mtlt
290: where mmtt.completion_transaction_id = p_cplTxnID
291: and mmtt.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action,
292: wip_constants.issnegc_action, wip_constants.retnegc_action)
293: and mmtt.inventory_item_id = msi.inventory_item_id
294: and mmtt.organization_id = msi.organization_id
295: and mmtt.transaction_temp_id = mtlt.transaction_temp_id (+)

Line 292: wip_constants.issnegc_action, wip_constants.retnegc_action)

288: mtl_system_items_kfv msi,
289: mtl_transaction_lots_temp mtlt
290: where mmtt.completion_transaction_id = p_cplTxnID
291: and mmtt.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action,
292: wip_constants.issnegc_action, wip_constants.retnegc_action)
293: and mmtt.inventory_item_id = msi.inventory_item_id
294: and mmtt.organization_id = msi.organization_id
295: and mmtt.transaction_temp_id = mtlt.transaction_temp_id (+)
296: group by mmtt.transaction_temp_id,

Line 334: and mmtt.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action,

330: from mtl_material_transactions_temp mmtt,
331: mtl_system_items_kfv msi,
332: mtl_transaction_lots_temp mtlt
333: where mmtt.move_transaction_id = p_movTxnID
334: and mmtt.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action,
335: wip_constants.issnegc_action, wip_constants.retnegc_action)
336: and mmtt.inventory_item_id = msi.inventory_item_id
337: and mmtt.organization_id = msi.organization_id
338: and mmtt.transaction_temp_id = mtlt.transaction_temp_id (+)

Line 335: wip_constants.issnegc_action, wip_constants.retnegc_action)

331: mtl_system_items_kfv msi,
332: mtl_transaction_lots_temp mtlt
333: where mmtt.move_transaction_id = p_movTxnID
334: and mmtt.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action,
335: wip_constants.issnegc_action, wip_constants.retnegc_action)
336: and mmtt.inventory_item_id = msi.inventory_item_id
337: and mmtt.organization_id = msi.organization_id
338: and mmtt.transaction_temp_id = mtlt.transaction_temp_id (+)
339: group by mmtt.transaction_temp_id,

Line 359: if (l_logLevel <= wip_constants.trace_logging) then

355: begin
356: savepoint wiplotpb_10;
357: x_returnStatus := fnd_api.g_ret_sts_success;
358:
359: if (l_logLevel <= wip_constants.trace_logging) then
360: l_params(1).paramName := 'p_cplTxnID';
361: l_params(1).paramValue := p_cplTxnID;
362: l_params(2).paramName := 'p_movTxnID';
363: l_params(2).paramValue := p_movTxnID;

Line 399: if (l_logLevel <= wip_constants.full_logging) then

395: exit;
396: end if;
397: end if;
398:
399: if (l_logLevel <= wip_constants.full_logging) then
400: wip_logger.log('priQty:' || l_itemRec.priQty || '; lot quantity:' || l_itemRec.lotPriQty, l_returnStatus);
401: end if;
402: if(abs(l_itemRec.priQty) > nvl(l_itemRec.lotPriQty, 0)) then
403: if (l_logLevel <= wip_constants.full_logging) then

Line 403: if (l_logLevel <= wip_constants.full_logging) then

399: if (l_logLevel <= wip_constants.full_logging) then
400: wip_logger.log('priQty:' || l_itemRec.priQty || '; lot quantity:' || l_itemRec.lotPriQty, l_returnStatus);
401: end if;
402: if(abs(l_itemRec.priQty) > nvl(l_itemRec.lotPriQty, 0)) then
403: if (l_logLevel <= wip_constants.full_logging) then
404: wip_logger.log('at item ' || l_itemRec.itemName,l_returnStatus);
405: end if;
406: if(l_itemRec.lotControlCode = wip_constants.lot) then
407: if (l_logLevel <= wip_constants.full_logging) then

Line 406: if(l_itemRec.lotControlCode = wip_constants.lot) then

402: if(abs(l_itemRec.priQty) > nvl(l_itemRec.lotPriQty, 0)) then
403: if (l_logLevel <= wip_constants.full_logging) then
404: wip_logger.log('at item ' || l_itemRec.itemName,l_returnStatus);
405: end if;
406: if(l_itemRec.lotControlCode = wip_constants.lot) then
407: if (l_logLevel <= wip_constants.full_logging) then
408: wip_logger.log('adding item ' || l_itemRec.itemName || ';' || l_itemRec.itemID, l_returnStatus);
409: end if;
410: l_compObj.addItem(p_opSeqNum => l_itemRec.opSeqNum,

Line 407: if (l_logLevel <= wip_constants.full_logging) then

403: if (l_logLevel <= wip_constants.full_logging) then
404: wip_logger.log('at item ' || l_itemRec.itemName,l_returnStatus);
405: end if;
406: if(l_itemRec.lotControlCode = wip_constants.lot) then
407: if (l_logLevel <= wip_constants.full_logging) then
408: wip_logger.log('adding item ' || l_itemRec.itemName || ';' || l_itemRec.itemID, l_returnStatus);
409: end if;
410: l_compObj.addItem(p_opSeqNum => l_itemRec.opSeqNum,
411: p_itemID => l_itemRec.itemID,

Line 424: elsif(l_itemRec.serialControlCode in (wip_constants.full_sn, wip_constants.dyn_rcv_sn)) then

420: p_txnActionID => l_itemRec.txnActionID,
421: p_lotControlCode => l_itemRec.lotControlCode,
422: p_serialControlCode => l_itemRec.serialControlCode,
423: p_genericID => l_itemRec.txnID);
424: elsif(l_itemRec.serialControlCode in (wip_constants.full_sn, wip_constants.dyn_rcv_sn)) then
425: --see if we've derived the entire serial quantity
426: checkSerial(p_txnTmpID => l_itemRec.txnID,
427: p_txnIntID => null, --since using temp table
428: p_qty => abs(l_itemRec.priQty),

Line 488: if (l_logLevel <= wip_constants.full_logging) then

484: exit;
485: end if;
486: end if;
487:
488: if (l_logLevel <= wip_constants.full_logging) then
489: wip_logger.log('start outer loop for item' || l_itemRec.itemID, l_returnStatus);
490: end if;
491:
492: if(l_itemRec.lotControlCode <> wip_constants.lot) then

Line 492: if(l_itemRec.lotControlCode <> wip_constants.lot) then

488: if (l_logLevel <= wip_constants.full_logging) then
489: wip_logger.log('start outer loop for item' || l_itemRec.itemID, l_returnStatus);
490: end if;
491:
492: if(l_itemRec.lotControlCode <> wip_constants.lot) then
493: goto START_OF_OUTER_LOOP; --skip this item if it's not lot controlled
494: end if;
495:
496: loop

Line 497: if (l_logLevel <= wip_constants.full_logging) then

493: goto START_OF_OUTER_LOOP; --skip this item if it's not lot controlled
494: end if;
495:
496: loop
497: if (l_logLevel <= wip_constants.full_logging) then
498: wip_logger.log('start inner loop1',l_returnStatus);
499: end if;
500: if(l_compObj.setNextItem) then
501: if(not l_compObj.getCurrentItem(l_item)) then

Line 505: if (l_logLevel <= wip_constants.full_logging) then

501: if(not l_compObj.getCurrentItem(l_item)) then
502: l_errMsg := 'object error';
503: raise fnd_api.g_exc_unexpected_error;
504: end if;
505: if (l_logLevel <= wip_constants.full_logging) then
506: wip_logger.log('found item: ' || l_item.inventory_item_id, l_returnStatus);
507: end if;
508:
509: if(l_item.inventory_item_id = l_itemRec.itemID and

Line 514: if (l_logLevel <= wip_constants.full_logging) then

510: l_item.supply_subinventory = l_itemRec.supplySubinv and
511: nvl(l_item.supply_locator_id, -1) = nvl(l_itemRec.supplyLocID, -1) and
512: l_item.operation_seq_num = l_itemRec.opSeqNum and
513: l_item.primary_quantity = l_itemRec.priQty) then
514: if (l_logLevel <= wip_constants.full_logging) then
515: wip_logger.log('item: ' || l_item.inventory_item_id || ' matches cursor item', l_returnStatus);
516: end if;
517: exit; --found an item to match the cursor
518: end if;

Line 520: if (l_logLevel <= wip_constants.full_logging) then

516: end if;
517: exit; --found an item to match the cursor
518: end if;
519: else
520: if (l_logLevel <= wip_constants.full_logging) then
521: wip_logger.log('ran out of items', l_returnStatus);
522: end if;
523: goto END_OF_OUTER_LOOP; --must exit inner and outer loop!
524: end if;

Line 529: if (l_logLevel <= wip_constants.full_logging) then

525: end loop;
526:
527:
528: while(l_compObj.getNextLot(l_lot)) loop
529: if (l_logLevel <= wip_constants.full_logging) then
530: wip_logger.log('start inner loop2', l_returnStatus);
531: end if;
532: insert into mtl_transaction_lots_temp
533: (transaction_temp_id,

Line 558: l_itemRec.priQty), wip_constants.inv_max_precision)),

554: fnd_global.prog_appl_id,
555: fnd_global.conc_program_id,
556: sysdate,
557: abs(round(l_lot.primary_quantity * (l_itemRec.txnQty/
558: l_itemRec.priQty), wip_constants.inv_max_precision)),
559: abs(round(l_lot.primary_quantity, wip_constants.inv_max_precision)),
560: l_lot.lot_number);
561: end loop;
562: if (l_logLevel <= wip_constants.full_logging) then

Line 559: abs(round(l_lot.primary_quantity, wip_constants.inv_max_precision)),

555: fnd_global.conc_program_id,
556: sysdate,
557: abs(round(l_lot.primary_quantity * (l_itemRec.txnQty/
558: l_itemRec.priQty), wip_constants.inv_max_precision)),
559: abs(round(l_lot.primary_quantity, wip_constants.inv_max_precision)),
560: l_lot.lot_number);
561: end loop;
562: if (l_logLevel <= wip_constants.full_logging) then
563: wip_logger.log('end outer loop', l_returnStatus);

Line 562: if (l_logLevel <= wip_constants.full_logging) then

558: l_itemRec.priQty), wip_constants.inv_max_precision)),
559: abs(round(l_lot.primary_quantity, wip_constants.inv_max_precision)),
560: l_lot.lot_number);
561: end loop;
562: if (l_logLevel <= wip_constants.full_logging) then
563: wip_logger.log('end outer loop', l_returnStatus);
564: end if;
565: end loop;
566: <>

Line 574: if (l_logLevel <= wip_constants.trace_logging) then

570: close c_movItems;
571: end if;
572:
573: --return status has already been set at this point
574: if (l_logLevel <= wip_constants.trace_logging) then
575: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveLotsFromMMTT',
576: p_procReturnStatus => x_returnStatus,
577: p_msg => 'procedure success',
578: x_returnStatus => l_returnStatus); --discard logging return status

Line 587: if (l_logLevel <= wip_constants.trace_logging) then

583: exception
584: when fnd_api.g_exc_unexpected_error then
585: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
586: rollback to wiplotpb_10;
587: if (l_logLevel <= wip_constants.trace_logging) then
588: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveLotsFromMMTT',
589: p_procReturnStatus => x_returnStatus,
590: p_msg => l_errMsg,
591: x_returnStatus => l_returnStatus); --discard logging return status

Line 602: if (l_logLevel <= wip_constants.trace_logging) then

598: rollback to wiplotpb_10;
599: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_autoLotProc_priv',
600: p_procedure_name => 'deriveLotsFromMMTT',
601: p_error_text => SQLERRM);
602: if (l_logLevel <= wip_constants.trace_logging) then
603: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveLotsFromMMTT',
604: p_procReturnStatus => x_returnStatus,
605: p_msg => 'unexpected error:' || SQLERRM,
606: x_returnStatus => l_returnStatus); --discard logging return status

Line 662: and mti.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action,

658: from mtl_transactions_interface mti,
659: mtl_system_items_kfv msi,
660: mtl_transaction_lots_interface mtli
661: where mti.transaction_header_id = p_txnHdrID
662: and mti.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action,
663: wip_constants.issnegc_action, wip_constants.retnegc_action)
664: and mti.inventory_item_id = msi.inventory_item_id
665: and mti.organization_id = msi.organization_id
666: and mti.transaction_interface_id = mtli.transaction_interface_id (+)

Line 663: wip_constants.issnegc_action, wip_constants.retnegc_action)

659: mtl_system_items_kfv msi,
660: mtl_transaction_lots_interface mtli
661: where mti.transaction_header_id = p_txnHdrID
662: and mti.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action,
663: wip_constants.issnegc_action, wip_constants.retnegc_action)
664: and mti.inventory_item_id = msi.inventory_item_id
665: and mti.organization_id = msi.organization_id
666: and mti.transaction_interface_id = mtli.transaction_interface_id (+)
667: group by mti.transaction_interface_id,

Line 712: and mti.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action,

708: mtl_transaction_lots_interface mtli
709: where mti.transaction_header_id = p_txnHdrID
710: and ( mti.completion_transaction_id = p_cplTxnID
711: or mti.move_transaction_id in (p_movTxnID, p_childMovTxnID))
712: and mti.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action,
713: wip_constants.issnegc_action, wip_constants.retnegc_action)
714: and mti.inventory_item_id = msi.inventory_item_id
715: and mti.organization_id = msi.organization_id
716: and mti.transaction_interface_id = mtli.transaction_interface_id (+)

Line 713: wip_constants.issnegc_action, wip_constants.retnegc_action)

709: where mti.transaction_header_id = p_txnHdrID
710: and ( mti.completion_transaction_id = p_cplTxnID
711: or mti.move_transaction_id in (p_movTxnID, p_childMovTxnID))
712: and mti.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action,
713: wip_constants.issnegc_action, wip_constants.retnegc_action)
714: and mti.inventory_item_id = msi.inventory_item_id
715: and mti.organization_id = msi.organization_id
716: and mti.transaction_interface_id = mtli.transaction_interface_id (+)
717: group by mti.transaction_interface_id,

Line 757: and mti.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action,

753: from mtl_material_transactions_temp mti,
754: mtl_system_items_kfv msi,
755: mtl_transaction_lots_temp mtlt
756: where mti.move_transaction_id = p_movTxnID
757: and mti.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action,
758: wip_constants.issnegc_action, wip_constants.retnegc_action)
759: and mti.inventory_item_id = msi.inventory_item_id
760: and mti.organization_id = msi.organization_id
761: and mti.transaction_interface_id = mtlt.transaction_interface_id (+)

Line 758: wip_constants.issnegc_action, wip_constants.retnegc_action)

754: mtl_system_items_kfv msi,
755: mtl_transaction_lots_temp mtlt
756: where mti.move_transaction_id = p_movTxnID
757: and mti.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action,
758: wip_constants.issnegc_action, wip_constants.retnegc_action)
759: and mti.inventory_item_id = msi.inventory_item_id
760: and mti.organization_id = msi.organization_id
761: and mti.transaction_interface_id = mtlt.transaction_interface_id (+)
762: group by mti.transaction_temp_id,

Line 782: if (l_logLevel <= wip_constants.trace_logging) then

778: begin
779: x_returnStatus := fnd_api.g_ret_sts_success;
780: savepoint wiplotpb_10;
781:
782: if (l_logLevel <= wip_constants.trace_logging) then
783: l_params(1).paramName := 'p_txnHdrID';
784: l_params(1).paramValue := p_txnHdrID;
785: l_params(2).paramName := 'p_cplTxnID';
786: l_params(2).paramValue := p_cplTxnID;

Line 855: if (l_logLevel <= wip_constants.full_logging) then

851: end if;
852:
853: for i in 1..l_itemRecTbl.itemID.count loop
854: <>
855: if (l_logLevel <= wip_constants.full_logging) then
856: wip_logger.log('priQty:' || l_itemRecTbl.priQty(i) || '; lot quantity:' || l_itemRecTbl.lotPriQty(i), l_returnStatus);
857: end if;
858:
859: if(abs(l_itemRecTbl.priQty(i)) > abs(nvl(l_itemRecTbl.lotPriQty(i), 0))) then

Line 860: if (l_logLevel <= wip_constants.full_logging) then

856: wip_logger.log('priQty:' || l_itemRecTbl.priQty(i) || '; lot quantity:' || l_itemRecTbl.lotPriQty(i), l_returnStatus);
857: end if;
858:
859: if(abs(l_itemRecTbl.priQty(i)) > abs(nvl(l_itemRecTbl.lotPriQty(i), 0))) then
860: if (l_logLevel <= wip_constants.full_logging) then
861: wip_logger.log('adding item ' || l_itemRecTbl.itemName(i) || ';' || l_itemRecTbl.itemID(i), l_returnStatus);
862: end if;
863:
864: l_serialTaggedCode := inv_cache.get_serial_tagged(p_orgID, l_itemRecTbl.itemID(i), getTxnType(l_itemRecTbl.txnActionID(i)));

Line 866: if(l_itemRecTbl.lotControlCode(i) = wip_constants.lot) then

862: end if;
863:
864: l_serialTaggedCode := inv_cache.get_serial_tagged(p_orgID, l_itemRecTbl.itemID(i), getTxnType(l_itemRecTbl.txnActionID(i)));
865:
866: if(l_itemRecTbl.lotControlCode(i) = wip_constants.lot) then
867: if(l_itemRecTbl.movTxnID(i) is not null) then
868: l_supType := wip_constants.op_pull;
869: elsif(l_itemRecTbl.cplTxnID(i) is not null) then
870: l_supType := wip_constants.assy_pull;

Line 868: l_supType := wip_constants.op_pull;

864: l_serialTaggedCode := inv_cache.get_serial_tagged(p_orgID, l_itemRecTbl.itemID(i), getTxnType(l_itemRecTbl.txnActionID(i)));
865:
866: if(l_itemRecTbl.lotControlCode(i) = wip_constants.lot) then
867: if(l_itemRecTbl.movTxnID(i) is not null) then
868: l_supType := wip_constants.op_pull;
869: elsif(l_itemRecTbl.cplTxnID(i) is not null) then
870: l_supType := wip_constants.assy_pull;
871: else
872: l_supType := wip_constants.push;

Line 870: l_supType := wip_constants.assy_pull;

866: if(l_itemRecTbl.lotControlCode(i) = wip_constants.lot) then
867: if(l_itemRecTbl.movTxnID(i) is not null) then
868: l_supType := wip_constants.op_pull;
869: elsif(l_itemRecTbl.cplTxnID(i) is not null) then
870: l_supType := wip_constants.assy_pull;
871: else
872: l_supType := wip_constants.push;
873: end if;
874:

Line 872: l_supType := wip_constants.push;

868: l_supType := wip_constants.op_pull;
869: elsif(l_itemRecTbl.cplTxnID(i) is not null) then
870: l_supType := wip_constants.assy_pull;
871: else
872: l_supType := wip_constants.push;
873: end if;
874:
875: l_compObj.addItem(p_opSeqNum => l_itemRecTbl.opSeqNum(i),
876: p_itemID => l_itemRecTbl.itemID(i),

Line 889: elsif(l_itemRecTbl.serialControlCode(i) in (wip_constants.full_sn, wip_constants.dyn_rcv_sn)) then

885: p_revision => l_itemRecTbl.revision(i),
886: p_lotControlCode => l_itemRecTbl.lotControlCode(i),
887: p_serialControlCode => l_itemRecTbl.serialControlCode(i),
888: p_genericID => l_itemRecTbl.txnID(i));
889: elsif(l_itemRecTbl.serialControlCode(i) in (wip_constants.full_sn, wip_constants.dyn_rcv_sn)) then
890: --see if we've derived the entire serial quantity
891: checkSerial(p_txnTmpID => null, --since using interface table
892: p_txnIntID => l_itemRecTbl.txnID(i),
893: p_qty => abs(l_itemRecTbl.priQty(i)),

Line 909: elsif (l_serialTaggedCode = WIP_CONSTANTS.SER_TAGGED) then -- bug fix 10053619

905: l_errMsg := 'check serial failed';
906: raise fnd_api.g_exc_unexpected_error;
907: end if;
908: l_serialReturnStatus := worstReturnStatus(l_serialReturnStatus, l_tempReturnStatus);
909: elsif (l_serialTaggedCode = WIP_CONSTANTS.SER_TAGGED) then -- bug fix 10053619
910: l_errMsg := 'item under serial control';
911: l_serialReturnStatus := fnd_api.g_ret_sts_error;
912: end if;
913: end if;

Line 936: if (l_logLevel <= wip_constants.full_logging) then

932: --otherwise we at least derived some lot info
933: l_compObj.reset;
934: --2nd pass: update all the mti rows with lot info
935: for i in 1..l_itemRecTbl.txnID.count loop
936: if (l_logLevel <= wip_constants.full_logging) then
937: wip_logger.log('start outer loop for item' || l_itemRecTbl.itemID(i), l_returnStatus);
938: end if;
939:
940: if(l_itemRecTbl.lotControlCode(i) <> wip_constants.lot) then

Line 940: if(l_itemRecTbl.lotControlCode(i) <> wip_constants.lot) then

936: if (l_logLevel <= wip_constants.full_logging) then
937: wip_logger.log('start outer loop for item' || l_itemRecTbl.itemID(i), l_returnStatus);
938: end if;
939:
940: if(l_itemRecTbl.lotControlCode(i) <> wip_constants.lot) then
941: goto END_OF_OUTER_LOOP;
942: end if;
943:
944: loop

Line 945: if (l_logLevel <= wip_constants.full_logging) then

941: goto END_OF_OUTER_LOOP;
942: end if;
943:
944: loop
945: if (l_logLevel <= wip_constants.full_logging) then
946: wip_logger.log('start inner loop1', l_returnStatus);
947: end if;
948: if(l_compObj.setNextItem) then
949: if(not l_compObj.getCurrentItem(l_item)) then

Line 953: if (l_logLevel <= wip_constants.full_logging) then

949: if(not l_compObj.getCurrentItem(l_item)) then
950: l_errMsg := 'object error';
951: raise fnd_api.g_exc_unexpected_error;
952: end if;
953: if (l_logLevel <= wip_constants.full_logging) then
954: wip_logger.log('found item: ' || l_item.inventory_item_id, l_returnStatus);
955: end if;
956:
957: if(l_item.inventory_item_id = l_itemRecTbl.itemID(i) and

Line 962: if (l_logLevel <= wip_constants.full_logging) then

958: l_item.supply_subinventory = l_itemRecTbl.supplySubinv(i) and
959: nvl(l_item.supply_locator_id, -1) = nvl(l_itemRecTbl.supplyLocID(i), -1) and
960: l_item.operation_seq_num = l_itemRecTbl.opSeqNum(i) and
961: l_item.primary_quantity = l_itemRecTbl.priQty(i)) then
962: if (l_logLevel <= wip_constants.full_logging) then
963: wip_logger.log('item: ' || l_item.inventory_item_id || ' matches cursor item', l_returnStatus);
964: end if;
965: exit; --found an item to match the cursor
966: end if;

Line 968: if (l_logLevel <= wip_constants.full_logging) then

964: end if;
965: exit; --found an item to match the cursor
966: end if;
967: else
968: if (l_logLevel <= wip_constants.full_logging) then
969: wip_logger.log('ran out of items', l_returnStatus);
970: end if;
971: goto END_OF_OUTER_LOOP; --must exit inner and outer loop!
972: end if;

Line 977: if (l_logLevel <= wip_constants.full_logging) then

973: end loop;
974:
975:
976: while(l_compObj.getNextLot(l_lot)) loop
977: if (l_logLevel <= wip_constants.full_logging) then
978: wip_logger.log('start inner loop2', l_returnStatus);
979: end if;
980: insert into mtl_transaction_lots_interface
981: (transaction_interface_id,

Line 1006: l_itemRecTbl.priQty(i)), wip_constants.inv_max_precision)),

1002: fnd_global.prog_appl_id,
1003: fnd_global.conc_program_id,
1004: sysdate,
1005: abs(round(l_lot.primary_quantity * (l_itemRecTbl.txnQty(i)/
1006: l_itemRecTbl.priQty(i)), wip_constants.inv_max_precision)),
1007: abs(round(l_lot.primary_quantity, wip_constants.inv_max_precision)),
1008: l_lot.lot_number);
1009: end loop;
1010: <>

Line 1007: abs(round(l_lot.primary_quantity, wip_constants.inv_max_precision)),

1003: fnd_global.conc_program_id,
1004: sysdate,
1005: abs(round(l_lot.primary_quantity * (l_itemRecTbl.txnQty(i)/
1006: l_itemRecTbl.priQty(i)), wip_constants.inv_max_precision)),
1007: abs(round(l_lot.primary_quantity, wip_constants.inv_max_precision)),
1008: l_lot.lot_number);
1009: end loop;
1010: <>
1011: if (l_logLevel <= wip_constants.full_logging) then

Line 1011: if (l_logLevel <= wip_constants.full_logging) then

1007: abs(round(l_lot.primary_quantity, wip_constants.inv_max_precision)),
1008: l_lot.lot_number);
1009: end loop;
1010: <>
1011: if (l_logLevel <= wip_constants.full_logging) then
1012: wip_logger.log('end outer loop', l_returnStatus);
1013: end if;
1014: end loop;
1015:

Line 1017: if (l_logLevel <= wip_constants.trace_logging) then

1013: end if;
1014: end loop;
1015:
1016: --return status has already been set at this point
1017: if (l_logLevel <= wip_constants.trace_logging) then
1018: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveLotsFromMTI',
1019: p_procReturnStatus => x_returnStatus,
1020: p_msg => 'procedure success',
1021: x_returnStatus => l_returnStatus); --discard logging return status

Line 1030: if (l_logLevel <= wip_constants.trace_logging) then

1026: exception
1027: when fnd_api.g_exc_unexpected_error then
1028: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1029: rollback to wiplotpb_10;
1030: if (l_logLevel <= wip_constants.trace_logging) then
1031: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveLotsFromMTI',
1032: p_procReturnStatus => x_returnStatus,
1033: p_msg => l_errMsg,
1034: x_returnStatus => l_returnStatus); --discard logging return status

Line 1045: if (l_logLevel <= wip_constants.trace_logging) then

1041: rollback to wiplotpb_10;
1042: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_autoLotProc_priv',
1043: p_procedure_name => 'deriveLotsFromMTI',
1044: p_error_text => SQLERRM);
1045: if (l_logLevel <= wip_constants.trace_logging) then
1046: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveLotsFromMTI',
1047: p_procReturnStatus => x_returnStatus,
1048: p_msg => 'unexpected error:' || SQLERRM,
1049: x_returnStatus => l_returnStatus); --discard logging return status

Line 1068: abs(round(sum(tln.primary_quantity), wip_constants.max_displayed_precision))

1064:
1065: cursor c_retTxnBasedLots(v_itemID NUMBER) is
1066: select tln.lot_number,
1067: max(mln.expiration_date),
1068: abs(round(sum(tln.primary_quantity), wip_constants.max_displayed_precision))
1069: from mtl_transaction_lot_numbers tln,
1070: mtl_material_transactions mmt,
1071: mtl_lot_numbers mln
1072: where tln.organization_id = p_orgID

Line 1081: and mmt.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action)

1077: and tln.inventory_item_id = mln.inventory_item_id
1078: and tln.lot_number = mln.lot_number
1079: and nvl(mln.expiration_date, sysdate + 1) > sysdate
1080: and mmt.transaction_id = tln.transaction_id
1081: and mmt.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action)
1082: group by tln.lot_number
1083: having sign(round(sum(tln.primary_quantity), wip_constants.max_displayed_precision)) < 0 --more issued quantity than returned
1084: order by max(sign(round(tln.primary_quantity, wip_constants.max_displayed_precision))), --give priority to lots that have ret txns
1085: max(tln.transaction_date) desc, --then sort by most recent txn date

Line 1083: having sign(round(sum(tln.primary_quantity), wip_constants.max_displayed_precision)) < 0 --more issued quantity than returned

1079: and nvl(mln.expiration_date, sysdate + 1) > sysdate
1080: and mmt.transaction_id = tln.transaction_id
1081: and mmt.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action)
1082: group by tln.lot_number
1083: having sign(round(sum(tln.primary_quantity), wip_constants.max_displayed_precision)) < 0 --more issued quantity than returned
1084: order by max(sign(round(tln.primary_quantity, wip_constants.max_displayed_precision))), --give priority to lots that have ret txns
1085: max(tln.transaction_date) desc, --then sort by most recent txn date
1086: tln.lot_number desc; --finally sort by lot number, descending b/c issues are ascending
1087:

Line 1084: order by max(sign(round(tln.primary_quantity, wip_constants.max_displayed_precision))), --give priority to lots that have ret txns

1080: and mmt.transaction_id = tln.transaction_id
1081: and mmt.transaction_action_id in (wip_constants.isscomp_action, wip_constants.retcomp_action)
1082: group by tln.lot_number
1083: having sign(round(sum(tln.primary_quantity), wip_constants.max_displayed_precision)) < 0 --more issued quantity than returned
1084: order by max(sign(round(tln.primary_quantity, wip_constants.max_displayed_precision))), --give priority to lots that have ret txns
1085: max(tln.transaction_date) desc, --then sort by most recent txn date
1086: tln.lot_number desc; --finally sort by lot number, descending b/c issues are ascending
1087:
1088: cursor c_negRetTxnBasedLots(v_itemID NUMBER) is

Line 1091: abs(round(sum(tln.primary_quantity), wip_constants.max_displayed_precision))

1087:
1088: cursor c_negRetTxnBasedLots(v_itemID NUMBER) is
1089: select tln.lot_number,
1090: max(mln.expiration_date),
1091: abs(round(sum(tln.primary_quantity), wip_constants.max_displayed_precision))
1092: from mtl_transaction_lot_numbers tln,
1093: mtl_material_transactions mmt,
1094: mtl_lot_numbers mln
1095: where tln.organization_id = p_orgID

Line 1104: and mmt.transaction_action_id in (wip_constants.issnegc_action, wip_constants.retnegc_action)

1100: and tln.inventory_item_id = mln.inventory_item_id
1101: and tln.lot_number = mln.lot_number
1102: and nvl(mln.expiration_date, sysdate + 1) > sysdate
1103: and mmt.transaction_id = tln.transaction_id
1104: and mmt.transaction_action_id in (wip_constants.issnegc_action, wip_constants.retnegc_action)
1105: group by tln.lot_number
1106: having sign(round(sum(tln.primary_quantity), wip_constants.max_displayed_precision)) > 0 --more neg issues than neg returns
1107: order by max(sign(round(tln.primary_quantity, wip_constants.max_displayed_precision))), --give priority to lots that have ret txns
1108: max(tln.transaction_date) desc, --then sort by most recent txn date

Line 1106: having sign(round(sum(tln.primary_quantity), wip_constants.max_displayed_precision)) > 0 --more neg issues than neg returns

1102: and nvl(mln.expiration_date, sysdate + 1) > sysdate
1103: and mmt.transaction_id = tln.transaction_id
1104: and mmt.transaction_action_id in (wip_constants.issnegc_action, wip_constants.retnegc_action)
1105: group by tln.lot_number
1106: having sign(round(sum(tln.primary_quantity), wip_constants.max_displayed_precision)) > 0 --more neg issues than neg returns
1107: order by max(sign(round(tln.primary_quantity, wip_constants.max_displayed_precision))), --give priority to lots that have ret txns
1108: max(tln.transaction_date) desc, --then sort by most recent txn date
1109: tln.lot_number desc; --finally sort by lot number, descending b/c issues are ascending
1110:

Line 1107: order by max(sign(round(tln.primary_quantity, wip_constants.max_displayed_precision))), --give priority to lots that have ret txns

1103: and mmt.transaction_id = tln.transaction_id
1104: and mmt.transaction_action_id in (wip_constants.issnegc_action, wip_constants.retnegc_action)
1105: group by tln.lot_number
1106: having sign(round(sum(tln.primary_quantity), wip_constants.max_displayed_precision)) > 0 --more neg issues than neg returns
1107: order by max(sign(round(tln.primary_quantity, wip_constants.max_displayed_precision))), --give priority to lots that have ret txns
1108: max(tln.transaction_date) desc, --then sort by most recent txn date
1109: tln.lot_number desc; --finally sort by lot number, descending b/c issues are ascending
1110:
1111: l_item system.wip_component_obj_t;

Line 1127: if (l_logLevel <= wip_constants.trace_logging) then

1123: begin
1124: x_returnStatus := fnd_api.g_ret_sts_success;
1125: l_cond := x_compLots.getCurrentItem(l_item);
1126:
1127: if (l_logLevel <= wip_constants.trace_logging) then
1128: l_params(1).paramName := 'p_orgID';
1129: l_params(1).paramValue := p_orgID;
1130: l_params(2).paramName := 'p_wipEntityID';
1131: l_params(2).paramValue := p_wipEntityID;

Line 1158: if(p_txnActionID = wip_constants.retcomp_action) then

1154: end if;
1155:
1156: l_rmnQty := abs(l_item.primary_quantity);
1157:
1158: if(p_txnActionID = wip_constants.retcomp_action) then
1159: open c_retTxnBasedLots(v_itemID => l_item.inventory_item_id);
1160: else
1161: open c_negRetTxnBasedLots(v_itemID => l_item.inventory_item_id);
1162: end if;

Line 1165: if(p_txnActionID = wip_constants.retcomp_action) then

1161: open c_negRetTxnBasedLots(v_itemID => l_item.inventory_item_id);
1162: end if;
1163:
1164: loop
1165: if(p_txnActionID = wip_constants.retcomp_action) then
1166: fetch c_retTxnBasedLots into l_lotNumber, l_expDate, l_lotQty;
1167: exit when c_retTxnBasedLots%NOTFOUND;
1168: else
1169: fetch c_negRetTxnBasedLots into l_lotNumber, l_expDate, l_lotQty;

Line 1173: if (l_logLevel <= wip_constants.full_logging) then

1169: fetch c_negRetTxnBasedLots into l_lotNumber, l_expDate, l_lotQty;
1170: exit when c_negRetTxnBasedLots%NOTFOUND;
1171: end if;
1172:
1173: if (l_logLevel <= wip_constants.full_logging) then
1174: wip_logger.log('lot: ' || l_lotNumber || '; qty: ' || l_lotQty, l_returnStatus);
1175: end if;
1176: l_enabled := wip_utilities.is_status_applicable(p_trx_type_id => getTxnType(l_item.transaction_action_id),
1177: p_organization_id => p_orgID,

Line 1184: if (l_logLevel <= wip_constants.full_logging) then

1180: p_locator_id => l_item.supply_locator_id,
1181: p_lot_number => l_lotNumber,
1182: p_object_type => 'O');
1183: if(l_enabled <> 'Y') then
1184: if (l_logLevel <= wip_constants.full_logging) then
1185: wip_logger.log('lot is not enabled', l_returnStatus);
1186: end if;
1187: goto END_OF_LOOP;
1188: end if;

Line 1217: if (l_logLevel <= wip_constants.trace_logging) then

1213: l_errMsg := 'could not derive all qty. ' || l_rmnQty || ' remaining.';
1214: raise fnd_api.g_exc_error;
1215: end if;
1216:
1217: if (l_logLevel <= wip_constants.trace_logging) then
1218: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveTxnLots',
1219: p_procReturnStatus => x_returnStatus,
1220: p_msg => 'procedure success',
1221: x_returnStatus => l_returnStatus); --discard logging return status

Line 1227: if (l_logLevel <= wip_constants.trace_logging) then

1223:
1224: exception
1225: when fnd_api.g_exc_error then
1226: x_returnStatus:= fnd_api.g_ret_sts_error; --let caller know item was not fully derived
1227: if (l_logLevel <= wip_constants.trace_logging) then
1228: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveTxnLots',
1229: p_procReturnStatus => x_returnStatus,
1230: p_msg => l_errMsg,
1231: x_returnStatus => l_returnStatus); --discard logging return status

Line 1235: if (l_logLevel <= wip_constants.trace_logging) then

1231: x_returnStatus => l_returnStatus); --discard logging return status
1232: end if;
1233: when fnd_api.g_exc_unexpected_error then
1234: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1235: if (l_logLevel <= wip_constants.trace_logging) then
1236: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveTxnLots',
1237: p_procReturnStatus => x_returnStatus,
1238: p_msg => 'error: ' || l_errMsg,
1239: x_returnStatus => l_returnStatus); --discard logging return status

Line 1251: if (l_logLevel <= wip_constants.trace_logging) then

1247: end if;
1248: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_autoLotProc_priv',
1249: p_procedure_name => 'deriveTxnLots',
1250: p_error_text => SQLERRM);
1251: if (l_logLevel <= wip_constants.trace_logging) then
1252: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveTxnLots',
1253: p_procReturnStatus => x_returnStatus,
1254: p_msg => 'error: ' || SQLERRM,
1255: x_returnStatus => l_returnStatus); --discard logging return status

Line 1378: if (l_logLevel <= wip_constants.trace_logging) then

1374: begin
1375: x_returnStatus := fnd_api.g_ret_sts_success;
1376: l_cond := x_compLots.getCurrentItem(l_item);
1377:
1378: if (l_logLevel <= wip_constants.trace_logging) then
1379: l_params(1).paramName := 'p_orgID';
1380: l_params(1).paramValue := p_orgID;
1381: l_params(2).paramName := 'p_treeMode';
1382: l_params(2).paramValue := p_treeMode;

Line 1422: if (l_logLevel <= wip_constants.full_logging) then

1418: return_message => l_custom_returnMessage);
1419: --Lot Hook can return 3 cases.
1420: if(l_custom_returnStatus = 'S' and l_custom_lot_number is not null) then
1421: --Case 1: Success and a Lot Number. Carry out the transaction with value provided by the hook
1422: if (l_logLevel <= wip_constants.full_logging) then
1423: wip_logger.log('Custom Hook returned Lot Number: ' || l_custom_lot_number, l_returnStatus );
1424: wip_logger.log('adding lot ' || l_custom_lot_number || 'w/qty ' || l_item.primary_quantity, l_returnStatus);
1425: end if;
1426:

Line 1434: if (l_logLevel <= wip_constants.full_logging) then

1430: x_returnStatus := l_returnStatus;
1431: return;
1432: elsif(l_custom_returnStatus <> 'S') then
1433: --Case 2: Error. In this case we fail the transaction
1434: if (l_logLevel <= wip_constants.full_logging) then
1435: wip_logger.log('Custom Hook errored out and hence no value is stamped for lot number. If express move it will eventually fail since required lot number not provided.', l_returnStatus);
1436: end if;
1437: return;
1438: else

Line 1440: if (l_logLevel <= wip_constants.full_logging) then

1436: end if;
1437: return;
1438: else
1439: --Case 3: Success and no Lot number. In this case proceed with Lot Derivation logic
1440: if (l_logLevel <= wip_constants.full_logging) then
1441: wip_logger.log('Custom Hook successfully returned, but NO value returned. This means hook has nothing to return in this case. Thus lot derivation logic will proceed to derive the lot', l_returnStatus);
1442: end if;
1443: end if;
1444:

Line 1492: if(p_entryType in (wip_constants.recdate_full, wip_constants.recdate_exc)) then

1488: l_errMsg := 'tree creation failed';
1489: raise fnd_api.g_exc_unexpected_error;
1490: end if;
1491:
1492: if(p_entryType in (wip_constants.recdate_full, wip_constants.recdate_exc)) then
1493: open c_receiptOrderedLots(v_itemID => l_item.inventory_item_id,
1494: v_supplySubinv => l_item.supply_subinventory,
1495: v_supplyLociD => l_item.supply_locator_id,
1496: v_revision => l_item.revision);

Line 1497: elsif(p_entryType in (wip_constants.expdate_full, wip_constants.expdate_exc)) then

1493: open c_receiptOrderedLots(v_itemID => l_item.inventory_item_id,
1494: v_supplySubinv => l_item.supply_subinventory,
1495: v_supplyLociD => l_item.supply_locator_id,
1496: v_revision => l_item.revision);
1497: elsif(p_entryType in (wip_constants.expdate_full, wip_constants.expdate_exc)) then
1498: open c_expDateOrderedLots(v_itemID => l_item.inventory_item_id,
1499: v_supplySubinv => l_item.supply_subinventory,
1500: v_supplyLociD => l_item.supply_locator_id,
1501: v_revision => l_item.revision);

Line 1503: elsif(p_entryType in (wip_constants.txnHistory_full, wip_constants.txnHistory_exc)) then

1499: v_supplySubinv => l_item.supply_subinventory,
1500: v_supplyLociD => l_item.supply_locator_id,
1501: v_revision => l_item.revision);
1502: /* Added for Wilson Greatbatch Enhancement */
1503: elsif(p_entryType in (wip_constants.txnHistory_full, wip_constants.txnHistory_exc)) then
1504: open c_TxnHistoryOrderedLots(v_itemID => l_item.inventory_item_id,
1505: v_supplySubinv => l_item.supply_subinventory,
1506: v_supplyLociD => l_item.supply_locator_id,
1507: v_revision => l_item.revision);

Line 1513: if (l_alt_lot_selection_method in (wip_constants.recdate_full,wip_constants.recdate_exc)) then

1509: into l_alt_lot_selection_method
1510: from wip_parameters
1511: where organization_id = p_orgID ;
1512: l_flag := 0 ;
1513: if (l_alt_lot_selection_method in (wip_constants.recdate_full,wip_constants.recdate_exc)) then
1514: open c_receiptOrderedLots(v_itemID => l_item.inventory_item_id,
1515: v_supplySubinv => l_item.supply_subinventory,
1516: v_supplyLociD => l_item.supply_locator_id,
1517: v_revision => l_item.revision);

Line 1518: elsif (l_alt_lot_selection_method in (wip_constants.expdate_full,wip_constants.expdate_exc)) then

1514: open c_receiptOrderedLots(v_itemID => l_item.inventory_item_id,
1515: v_supplySubinv => l_item.supply_subinventory,
1516: v_supplyLociD => l_item.supply_locator_id,
1517: v_revision => l_item.revision);
1518: elsif (l_alt_lot_selection_method in (wip_constants.expdate_full,wip_constants.expdate_exc)) then
1519: open c_expDateOrderedLots(v_itemID => l_item.inventory_item_id,
1520: v_supplySubinv => l_item.supply_subinventory,
1521: v_supplyLociD => l_item.supply_locator_id,
1522: v_revision => l_item.revision);

Line 1531: if(p_entryType in (wip_constants.recdate_full, wip_constants.recdate_exc)) then

1527: raise fnd_api.g_exc_error; --manual selection.
1528: end if;
1529:
1530: loop
1531: if(p_entryType in (wip_constants.recdate_full, wip_constants.recdate_exc)) then
1532: fetch c_receiptOrderedLots into l_lotNumber, l_expDate;
1533: exit when c_receiptOrderedLots%NOTFOUND;
1534: elsif(p_entryType in (wip_constants.expdate_full, wip_constants.expdate_exc)) then
1535: fetch c_expDateOrderedLots into l_lotNumber, l_expDate;

Line 1534: elsif(p_entryType in (wip_constants.expdate_full, wip_constants.expdate_exc)) then

1530: loop
1531: if(p_entryType in (wip_constants.recdate_full, wip_constants.recdate_exc)) then
1532: fetch c_receiptOrderedLots into l_lotNumber, l_expDate;
1533: exit when c_receiptOrderedLots%NOTFOUND;
1534: elsif(p_entryType in (wip_constants.expdate_full, wip_constants.expdate_exc)) then
1535: fetch c_expDateOrderedLots into l_lotNumber, l_expDate;
1536: exit when c_expDateOrderedLots%NOTFOUND;
1537: /* Added for Wilson Greatbatch Enhancement */
1538: elsif(p_entryType in (wip_constants.txnHistory_full, wip_constants.txnHistory_exc)) then

Line 1538: elsif(p_entryType in (wip_constants.txnHistory_full, wip_constants.txnHistory_exc)) then

1534: elsif(p_entryType in (wip_constants.expdate_full, wip_constants.expdate_exc)) then
1535: fetch c_expDateOrderedLots into l_lotNumber, l_expDate;
1536: exit when c_expDateOrderedLots%NOTFOUND;
1537: /* Added for Wilson Greatbatch Enhancement */
1538: elsif(p_entryType in (wip_constants.txnHistory_full, wip_constants.txnHistory_exc)) then
1539: if ( l_flag = 0 ) then
1540: fetch c_txnHistoryOrderedLots into l_lotNumber;
1541: end if ;
1542: if ( (c_txnHistoryOrderedLots%ROWCOUNT = 0) OR ( c_txnHistoryOrderedLots%NOTFOUND AND ( l_rmnQty <> 0)) ) then

Line 1544: if(l_alt_lot_selection_method in (wip_constants.recdate_full, wip_constants.recdate_exc)) then

1540: fetch c_txnHistoryOrderedLots into l_lotNumber;
1541: end if ;
1542: if ( (c_txnHistoryOrderedLots%ROWCOUNT = 0) OR ( c_txnHistoryOrderedLots%NOTFOUND AND ( l_rmnQty <> 0)) ) then
1543: l_flag := 1;
1544: if(l_alt_lot_selection_method in (wip_constants.recdate_full, wip_constants.recdate_exc)) then
1545: fetch c_receiptOrderedLots into l_lotNumber, l_expDate;
1546: exit when c_receiptOrderedLots%NOTFOUND;
1547: elsif(l_alt_lot_selection_method in (wip_constants.expdate_full, wip_constants.expdate_exc)) then
1548: fetch c_expDateOrderedLots into l_lotNumber, l_expDate;

Line 1547: elsif(l_alt_lot_selection_method in (wip_constants.expdate_full, wip_constants.expdate_exc)) then

1543: l_flag := 1;
1544: if(l_alt_lot_selection_method in (wip_constants.recdate_full, wip_constants.recdate_exc)) then
1545: fetch c_receiptOrderedLots into l_lotNumber, l_expDate;
1546: exit when c_receiptOrderedLots%NOTFOUND;
1547: elsif(l_alt_lot_selection_method in (wip_constants.expdate_full, wip_constants.expdate_exc)) then
1548: fetch c_expDateOrderedLots into l_lotNumber, l_expDate;
1549: exit when c_expDateOrderedLots%NOTFOUND;
1550: /*Fix for bug 4090078 */
1551: else

Line 1622: if (l_logLevel <= wip_constants.full_logging) then

1618: end if ;
1619:
1620: /* End Bug#4956543 */
1621:
1622: if (l_logLevel <= wip_constants.full_logging) then
1623: wip_logger.log('adding lot ' || l_lotNumber || 'w/qty ' || least(l_rmnQty, l_qtyAvailToTxt), l_returnStatus);
1624: wip_logger.log('qty avail to txt:' || l_qtyAvailToTxt, l_returnStatus);
1625: wip_logger.log('l_rmnQty:' || l_rmnQty, l_returnStatus);
1626: end if;

Line 1661: if (l_logLevel <= wip_constants.full_logging) then

1657: l_errMsg := 'qty tree update failed';
1658: raise fnd_api.g_exc_unexpected_error;
1659: end if;
1660:
1661: if (l_logLevel <= wip_constants.full_logging) then
1662: wip_logger.log('updating treeID' || x_treeID, l_returnStatus);
1663: wip_logger.log(' item=' || l_item.inventory_item_id, l_returnStatus);
1664: wip_logger.log(' lot=' || l_lotNumber, l_returnStatus);
1665: wip_logger.log(' qty=' || -1 * least(l_rmnQty, l_qtyAvailToTxt), l_returnStatus);

Line 1692: if (l_logLevel <= wip_constants.trace_logging) then

1688: l_errMsg := 'could not derive all qty. ' || l_rmnQty || ' remaining.';
1689: raise fnd_api.g_exc_error;
1690: end if;
1691:
1692: if (l_logLevel <= wip_constants.trace_logging) then
1693: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveIssueLots',
1694: p_procReturnStatus => x_returnStatus,
1695: p_msg => 'procedure success',
1696: x_returnStatus => l_returnStatus); --discard logging return status

Line 1702: if (l_logLevel <= wip_constants.trace_logging) then

1698:
1699: exception
1700: when fnd_api.g_exc_error then
1701: x_returnStatus:= fnd_api.g_ret_sts_error; --let caller know item was not fully derived
1702: if (l_logLevel <= wip_constants.trace_logging) then
1703: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveIssueLots',
1704: p_procReturnStatus => x_returnStatus,
1705: p_msg => l_errMsg,
1706: x_returnStatus => l_returnStatus); --discard logging return status

Line 1715: if (l_logLevel <= wip_constants.trace_logging) then

1711: close c_receiptOrderedLots;
1712: elsif(c_expDateOrderedLots%ISOPEN) then
1713: close c_expDateOrderedLots;
1714: end if;
1715: if (l_logLevel <= wip_constants.trace_logging) then
1716: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveIssueLots',
1717: p_procReturnStatus => x_returnStatus,
1718: p_msg => 'error: ' || l_errMsg,
1719: x_returnStatus => l_returnStatus); --discard logging return status

Line 1731: if (l_logLevel <= wip_constants.trace_logging) then

1727: end if;
1728: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_autoLotProc_priv',
1729: p_procedure_name => 'deriveIssueLots',
1730: p_error_text => SQLERRM);
1731: if (l_logLevel <= wip_constants.trace_logging) then
1732: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveIssueLots',
1733: p_procReturnStatus => x_returnStatus,
1734: p_msg => 'error: ' || SQLERRM,
1735: x_returnStatus => l_returnStatus); --discard logging return status

Line 1760: if (l_logLevel <= wip_constants.trace_logging) then

1756: l_logLevel NUMBER := fnd_log.g_current_runtime_level;
1757: begin
1758:
1759: x_returnStatus := fnd_api.g_ret_sts_success;
1760: if (l_logLevel <= wip_constants.trace_logging) then
1761: l_params(1).paramName := 'p_orgID';
1762: l_params(1).paramValue := p_orgID;
1763: l_params(2).paramName := 'p_wipEntityID';
1764: l_params(2).paramValue := p_wipEntityID;

Line 1795: if(l_serialControlCode in (wip_constants.full_sn, wip_constants.dyn_rcv_sn)) then

1791: where inventory_item_id = l_item.inventory_item_id
1792: and organization_id = p_orgID;
1793:
1794: --if under serial control, we can not derive lots
1795: if(l_serialControlCode in (wip_constants.full_sn, wip_constants.dyn_rcv_sn)) then
1796: checkSerialQuantity(p_itemID => l_item.inventory_item_id,
1797: p_itemName => l_item.item_name,
1798: p_orgID => p_orgID,
1799: p_qty => abs(l_item.primary_quantity),

Line 1810: elsif (l_serialTaggedCode = WIP_CONSTANTS.SER_TAGGED) then -- Bug 9907143: added for serial tagging enhancement for SUN

1806: else
1807: l_errMsg := 'item under serial control';
1808: raise fnd_api.g_exc_error;
1809: end if;
1810: elsif (l_serialTaggedCode = WIP_CONSTANTS.SER_TAGGED) then -- Bug 9907143: added for serial tagging enhancement for SUN
1811: l_errMsg := 'item under serial control';
1812: raise fnd_api.g_exc_error;
1813: end if;
1814:

Line 1816: if(l_lotControlCode = wip_constants.no_lot) then

1812: raise fnd_api.g_exc_error;
1813: end if;
1814:
1815: --if uncontrolled, return success (no derivation necessary)
1816: if(l_lotControlCode = wip_constants.no_lot) then
1817: x_returnStatus := fnd_api.g_ret_sts_success;
1818: if (l_logLevel <= wip_constants.trace_logging) then
1819: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveSingleItem',
1820: p_procReturnStatus => x_returnStatus,

Line 1818: if (l_logLevel <= wip_constants.trace_logging) then

1814:
1815: --if uncontrolled, return success (no derivation necessary)
1816: if(l_lotControlCode = wip_constants.no_lot) then
1817: x_returnStatus := fnd_api.g_ret_sts_success;
1818: if (l_logLevel <= wip_constants.trace_logging) then
1819: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveSingleItem',
1820: p_procReturnStatus => x_returnStatus,
1821: p_msg => 'procedure success (no derivation necessary)',
1822: x_returnStatus => l_returnStatus); --discard logging return status

Line 1831: if(l_item.transaction_action_id not in (wip_constants.isscomp_action,

1827:
1828: --else under lot control only
1829:
1830: --cannot derive lots for any other statuses besides these 3
1831: if(l_item.transaction_action_id not in (wip_constants.isscomp_action,
1832: wip_constants.retcomp_action,
1833: wip_constants.retnegc_action)) then
1834: l_errMsg := 'non-derivable txn action:' || l_item.transaction_action_id;
1835: raise fnd_api.g_exc_error;

Line 1832: wip_constants.retcomp_action,

1828: --else under lot control only
1829:
1830: --cannot derive lots for any other statuses besides these 3
1831: if(l_item.transaction_action_id not in (wip_constants.isscomp_action,
1832: wip_constants.retcomp_action,
1833: wip_constants.retnegc_action)) then
1834: l_errMsg := 'non-derivable txn action:' || l_item.transaction_action_id;
1835: raise fnd_api.g_exc_error;
1836: end if;

Line 1833: wip_constants.retnegc_action)) then

1829:
1830: --cannot derive lots for any other statuses besides these 3
1831: if(l_item.transaction_action_id not in (wip_constants.isscomp_action,
1832: wip_constants.retcomp_action,
1833: wip_constants.retnegc_action)) then
1834: l_errMsg := 'non-derivable txn action:' || l_item.transaction_action_id;
1835: raise fnd_api.g_exc_error;
1836: end if;
1837:

Line 1840: if(l_item.transaction_action_id = wip_constants.isscomp_action) then

1836: end if;
1837:
1838:
1839: --for issues, check out all the lots in the specified location
1840: if(l_item.transaction_action_id = wip_constants.isscomp_action) then
1841: deriveIssueLots(p_orgID => p_orgID,
1842: p_wipEntityID => p_wipEntityID,
1843: p_entryType => p_entryType,
1844: p_treeMode => p_treeMode,

Line 1863: if (l_logLevel <= wip_constants.trace_logging) then

1859: if(x_returnStatus = fnd_api.g_ret_sts_unexp_error) then
1860: raise fnd_api.g_exc_unexpected_error;
1861: end if;
1862:
1863: if (l_logLevel <= wip_constants.trace_logging) then
1864: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveSingleItem',
1865: p_procReturnStatus => x_returnStatus,
1866: p_msg => 'procedure success',
1867: x_returnStatus => l_returnStatus); --discard logging return status

Line 1873: if (l_logLevel <= wip_constants.trace_logging) then

1869:
1870: exception
1871: when fnd_api.g_exc_error then
1872: x_returnStatus := fnd_api.g_ret_sts_error;
1873: if (l_logLevel <= wip_constants.trace_logging) then
1874: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveSingleItem',
1875: p_procReturnStatus => x_returnStatus,
1876: p_msg => 'error' || l_errMsg,
1877: x_returnStatus => l_returnStatus); --discard logging return status

Line 1882: if (l_logLevel <= wip_constants.trace_logging) then

1878: end if;
1879: rollback to wipbflpb40;
1880: when fnd_api.g_exc_unexpected_error then
1881: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1882: if (l_logLevel <= wip_constants.trace_logging) then
1883: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveSingleItem',
1884: p_procReturnStatus => x_returnStatus,
1885: p_msg => 'unexp error raised:',
1886: x_returnStatus => l_returnStatus); --discard logging return status

Line 1894: if (l_logLevel <= wip_constants.trace_logging) then

1890: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1891: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_autoLotProc_priv',
1892: p_procedure_name => 'deriveSingleItem',
1893: p_error_text => SQLERRM);
1894: if (l_logLevel <= wip_constants.trace_logging) then
1895: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.deriveSingleItem',
1896: p_procReturnStatus => x_returnStatus,
1897: p_msg => 'unexp error:' || SQLERRM,
1898: x_returnStatus => l_returnStatus); --discard logging return status

Line 1909: return wip_constants.isscomp_action;

1905: p_qty in NUMBER) return number is
1906: begin
1907: if(fnd_api.to_boolean(p_isForwardTxn)) then
1908: if(p_qty > 0) then
1909: return wip_constants.isscomp_action;
1910: else
1911: return wip_constants.issnegc_action;
1912: end if;
1913: else

Line 1911: return wip_constants.issnegc_action;

1907: if(fnd_api.to_boolean(p_isForwardTxn)) then
1908: if(p_qty > 0) then
1909: return wip_constants.isscomp_action;
1910: else
1911: return wip_constants.issnegc_action;
1912: end if;
1913: else
1914: if(p_qty < 0) then
1915: return wip_constants.retcomp_action;

Line 1915: return wip_constants.retcomp_action;

1911: return wip_constants.issnegc_action;
1912: end if;
1913: else
1914: if(p_qty < 0) then
1915: return wip_constants.retcomp_action;
1916: else
1917: return wip_constants.retnegc_action;
1918: end if;
1919: end if;

Line 1917: return wip_constants.retnegc_action;

1913: else
1914: if(p_qty < 0) then
1915: return wip_constants.retcomp_action;
1916: else
1917: return wip_constants.retnegc_action;
1918: end if;
1919: end if;
1920: end findTxnAction;
1921:

Line 1938: if (l_logLevel <= wip_constants.trace_logging) then

1934: l_logLevel NUMBER := fnd_log.g_current_runtime_level;
1935: begin
1936:
1937: x_returnStatus := fnd_api.g_ret_sts_success;
1938: if (l_logLevel <= wip_constants.trace_logging) then
1939: l_params(1).paramName := 'p_itemID';
1940: l_params(1).paramValue := p_itemID;
1941: l_params(2).paramName := 'p_orgID';
1942: l_params(2).paramValue := p_orgID;

Line 1952: if (l_logLevel <= wip_constants.full_logging) then

1948: p_params => l_params,
1949: x_returnStatus => x_returnStatus);
1950: end if;
1951:
1952: if (l_logLevel <= wip_constants.full_logging) then
1953: wip_logger.log('qty:' || p_qty, l_returnStatus);
1954: wip_logger.log('round(qty)' || round(p_qty), l_returnStatus);
1955: end if;
1956: if(p_qty <> round(p_qty)) then --serial requirements must be whole numbers

Line 1966: if(p_txnActionID in (wip_constants.isscomp_action, wip_constants.retnegc_action)) then

1962: end if;
1963:
1964: l_txnTypeID := getTxnType(p_txnActionID);
1965:
1966: if(p_txnActionID in (wip_constants.isscomp_action, wip_constants.retnegc_action)) then
1967: select nvl(max(count(*)), 0)
1968: into l_serCount
1969: from mtl_serial_numbers
1970: where current_organization_id = p_orgID

Line 1988: elsif(p_txnActionID = wip_constants.retcomp_action) then

1984: /*p_serial_number => */ serial_number,
1985: /*p_object_type => */ 'S') = 'Y')
1986: group by current_subinventory_code, current_locator_id, revision;
1987:
1988: elsif(p_txnActionID = wip_constants.retcomp_action) then
1989: select nvl(max(count(*)), 0)
1990: into l_serCount
1991: from mtl_serial_numbers
1992: where current_organization_id = p_orgID

Line 2009: elsif(p_txnActionID = wip_constants.issnegc_action) then

2005: /*p_serial_number => */ serial_number,
2006: /*p_object_type => */ 'S') = 'Y')
2007: group by revision;
2008:
2009: elsif(p_txnActionID = wip_constants.issnegc_action) then
2010: if(p_serControlCode = wip_constants.dyn_rcv_sn) then
2011: x_returnStatus := fnd_api.g_ret_sts_success;
2012: if (l_logLevel <= wip_constants.trace_logging) then
2013: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.checkSerialQuantity',

Line 2010: if(p_serControlCode = wip_constants.dyn_rcv_sn) then

2006: /*p_object_type => */ 'S') = 'Y')
2007: group by revision;
2008:
2009: elsif(p_txnActionID = wip_constants.issnegc_action) then
2010: if(p_serControlCode = wip_constants.dyn_rcv_sn) then
2011: x_returnStatus := fnd_api.g_ret_sts_success;
2012: if (l_logLevel <= wip_constants.trace_logging) then
2013: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.checkSerialQuantity',
2014: p_procReturnStatus => x_returnStatus,

Line 2012: if (l_logLevel <= wip_constants.trace_logging) then

2008:
2009: elsif(p_txnActionID = wip_constants.issnegc_action) then
2010: if(p_serControlCode = wip_constants.dyn_rcv_sn) then
2011: x_returnStatus := fnd_api.g_ret_sts_success;
2012: if (l_logLevel <= wip_constants.trace_logging) then
2013: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.checkSerialQuantity',
2014: p_procReturnStatus => x_returnStatus,
2015: p_msg => 'procedure success (neg issue and serial is dyn at recpt)',
2016: x_returnStatus => l_returnStatus);

Line 2041: if (l_logLevel <= wip_constants.full_logging) then

2037: /*p_object_type => */ 'S') = 'Y');
2038:
2039: end if;
2040: end if;
2041: if (l_logLevel <= wip_constants.full_logging) then
2042: wip_logger.log('serial count is ' || l_serCount, l_returnStatus);
2043: end if;
2044: if(l_serCount < p_qty) then
2045: fnd_message.set_name('WIP', 'NO_COMP_SERIAL_NUMBERS');

Line 2053: if (l_logLevel <= wip_constants.trace_logging) then

2049: raise fnd_api.g_exc_unexpected_error;
2050: else
2051: x_returnStatus := fnd_api.g_ret_sts_success;
2052: end if;
2053: if (l_logLevel <= wip_constants.trace_logging) then
2054: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.checkSerialQuantity',
2055: p_procReturnStatus => x_returnStatus,
2056: p_msg => 'procedure success',
2057: x_returnStatus => l_returnStatus);

Line 2062: if (l_logLevel <= wip_constants.trace_logging) then

2058: end if;
2059: exception
2060: when fnd_api.g_exc_unexpected_error then
2061: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
2062: if (l_logLevel <= wip_constants.trace_logging) then
2063: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.checkSerialQuantity',
2064: p_procReturnStatus => x_returnStatus,
2065: p_msg => l_errMsg,
2066: x_returnStatus => l_returnStatus);

Line 2073: if (l_logLevel <= wip_constants.trace_logging) then

2069: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_autoLotProc_priv',
2070: p_procedure_name => 'checkSerialQuantity',
2071: p_error_text => SQLERRM);
2072: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
2073: if (l_logLevel <= wip_constants.trace_logging) then
2074: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.checkSerialQuantity',
2075: p_procReturnStatus => x_returnStatus,
2076: p_msg => 'unexp error ' || SQLERRM,
2077: x_returnStatus => l_returnStatus);

Line 2120: if (l_logLevel <= wip_constants.trace_logging) then

2116: from mtl_serial_numbers_interface
2117: where transaction_interface_id = p_txnIntID;
2118: begin
2119: x_returnStatus := fnd_api.g_ret_sts_success;
2120: if (l_logLevel <= wip_constants.trace_logging) then
2121: l_params(1).paramName := 'p_txnTmpID';
2122: l_params(1).paramValue := p_txnTmpID;
2123: l_params(2).paramName := 'p_txnIntID';
2124: l_params(2).paramValue := p_txnIntID;

Line 2201: if (l_logLevel <= wip_constants.trace_logging) then

2197: end if;
2198:
2199: end if;
2200:
2201: if (l_logLevel <= wip_constants.trace_logging) then
2202: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.checkSerial',
2203: p_procReturnStatus => x_returnStatus,
2204: p_msg => 'procedure success',
2205: x_returnStatus => l_returnStatus);

Line 2211: if (l_logLevel <= wip_constants.trace_logging) then

2207: exception
2208: when fnd_api.g_exc_error then
2209: x_serialReturnStatus := fnd_api.g_ret_sts_error;
2210: x_returnStatus := fnd_api.g_ret_sts_success;
2211: if (l_logLevel <= wip_constants.trace_logging) then
2212: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.checkSerial',
2213: p_procReturnStatus => x_returnStatus,
2214: p_msg => 'insufficient serial qty. only found ' || l_totalQty,
2215: x_returnStatus => l_returnStatus);

Line 2225: if (l_logLevel <= wip_constants.trace_logging) then

2221: close c_tmpSerials;
2222: elsif(c_intSerials%ISOPEN) then
2223: close c_intSerials;
2224: end if;
2225: if (l_logLevel <= wip_constants.trace_logging) then
2226: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.checkSerial',
2227: p_procReturnStatus => x_returnStatus,
2228: p_msg => l_errMsg,
2229: x_returnStatus => l_returnStatus);

Line 2242: if (l_logLevel <= wip_constants.trace_logging) then

2238: end if;
2239: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_autoLotProc_priv',
2240: p_procedure_name => 'checkSerial',
2241: p_error_text => SQLERRM);
2242: if (l_logLevel <= wip_constants.trace_logging) then
2243: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.checkSerial',
2244: p_procReturnStatus => x_returnStatus,
2245: p_msg => 'unexp error ' || SQLERRM,
2246: x_returnStatus => l_returnStatus);

Line 2265: if(p_txnActionID = wip_constants.isscomp_action) then

2261: end worstReturnStatus;
2262:
2263: function getTxnType(p_txnActionID IN NUMBER) return NUMBER is
2264: begin
2265: if(p_txnActionID = wip_constants.isscomp_action) then
2266: return wip_constants.isscomp_type;
2267: elsif(p_txnActionID = wip_constants.retnegc_action) then
2268: return wip_constants.retnegc_type;
2269: elsif(p_txnActionID = wip_constants.retcomp_action) then

Line 2266: return wip_constants.isscomp_type;

2262:
2263: function getTxnType(p_txnActionID IN NUMBER) return NUMBER is
2264: begin
2265: if(p_txnActionID = wip_constants.isscomp_action) then
2266: return wip_constants.isscomp_type;
2267: elsif(p_txnActionID = wip_constants.retnegc_action) then
2268: return wip_constants.retnegc_type;
2269: elsif(p_txnActionID = wip_constants.retcomp_action) then
2270: return wip_constants.retcomp_type;

Line 2267: elsif(p_txnActionID = wip_constants.retnegc_action) then

2263: function getTxnType(p_txnActionID IN NUMBER) return NUMBER is
2264: begin
2265: if(p_txnActionID = wip_constants.isscomp_action) then
2266: return wip_constants.isscomp_type;
2267: elsif(p_txnActionID = wip_constants.retnegc_action) then
2268: return wip_constants.retnegc_type;
2269: elsif(p_txnActionID = wip_constants.retcomp_action) then
2270: return wip_constants.retcomp_type;
2271: elsif(p_txnActionID = wip_constants.issnegc_action) then

Line 2268: return wip_constants.retnegc_type;

2264: begin
2265: if(p_txnActionID = wip_constants.isscomp_action) then
2266: return wip_constants.isscomp_type;
2267: elsif(p_txnActionID = wip_constants.retnegc_action) then
2268: return wip_constants.retnegc_type;
2269: elsif(p_txnActionID = wip_constants.retcomp_action) then
2270: return wip_constants.retcomp_type;
2271: elsif(p_txnActionID = wip_constants.issnegc_action) then
2272: return wip_constants.issnegc_type;

Line 2269: elsif(p_txnActionID = wip_constants.retcomp_action) then

2265: if(p_txnActionID = wip_constants.isscomp_action) then
2266: return wip_constants.isscomp_type;
2267: elsif(p_txnActionID = wip_constants.retnegc_action) then
2268: return wip_constants.retnegc_type;
2269: elsif(p_txnActionID = wip_constants.retcomp_action) then
2270: return wip_constants.retcomp_type;
2271: elsif(p_txnActionID = wip_constants.issnegc_action) then
2272: return wip_constants.issnegc_type;
2273: end if;

Line 2270: return wip_constants.retcomp_type;

2266: return wip_constants.isscomp_type;
2267: elsif(p_txnActionID = wip_constants.retnegc_action) then
2268: return wip_constants.retnegc_type;
2269: elsif(p_txnActionID = wip_constants.retcomp_action) then
2270: return wip_constants.retcomp_type;
2271: elsif(p_txnActionID = wip_constants.issnegc_action) then
2272: return wip_constants.issnegc_type;
2273: end if;
2274: return -1; --this procedure only works for component txn types

Line 2271: elsif(p_txnActionID = wip_constants.issnegc_action) then

2267: elsif(p_txnActionID = wip_constants.retnegc_action) then
2268: return wip_constants.retnegc_type;
2269: elsif(p_txnActionID = wip_constants.retcomp_action) then
2270: return wip_constants.retcomp_type;
2271: elsif(p_txnActionID = wip_constants.issnegc_action) then
2272: return wip_constants.issnegc_type;
2273: end if;
2274: return -1; --this procedure only works for component txn types
2275: end getTxnType;

Line 2272: return wip_constants.issnegc_type;

2268: return wip_constants.retnegc_type;
2269: elsif(p_txnActionID = wip_constants.retcomp_action) then
2270: return wip_constants.retcomp_type;
2271: elsif(p_txnActionID = wip_constants.issnegc_action) then
2272: return wip_constants.issnegc_type;
2273: end if;
2274: return -1; --this procedure only works for component txn types
2275: end getTxnType;
2276:

Line 2297: if (l_logLevel <= wip_constants.trace_logging) then

2293: l_qty := 0 ;
2294:
2295: x_returnStatus := fnd_api.g_ret_sts_success;
2296:
2297: if (l_logLevel <= wip_constants.trace_logging) then
2298: l_params(1).paramName := 'p_organization_id';
2299: l_params(1).paramValue := p_organization_id;
2300: l_params(2).paramName := 'p_inventory_item_id';
2301: l_params(2).paramValue := p_inventory_item_id;

Line 2338: if (l_logLevel <= wip_constants.trace_logging) then

2334: p_lot_qty_selected := nvl(l_qty, 0) ;
2335:
2336: wip_logger.log( 'Lot Qty Selected ' || p_lot_qty_selected || ' for Lot ' || p_lot_number, l_returnStatus) ;
2337:
2338: if (l_logLevel <= wip_constants.trace_logging) then
2339: wip_logger.exitPoint(p_procName => 'wip_autoLotProc_priv.lot_selected',
2340: p_procReturnStatus => x_returnStatus,
2341: p_msg => 'procedure success',
2342: x_returnStatus => l_returnStatus); --discard logging return status

Line 2373: AND mmt.transaction_action_id IN (WIP_CONSTANTS.ISSCOMP_ACTION,

2369: AND mtln.lot_number = mln.lot_number
2370: AND nvl(mln.expiration_date, sysdate + 1) > sysdate
2371: AND mmt.transaction_id = mog.origin_txn_id
2372: AND mmt.transaction_id = mtln.transaction_id
2373: AND mmt.transaction_action_id IN (WIP_CONSTANTS.ISSCOMP_ACTION,
2374: WIP_CONSTANTS.RETCOMP_ACTION)
2375: AND mmt.operation_seq_num = p_item.operation_seq_num;
2376:
2377: l_derivedQty NUMBER := 0;

Line 2374: WIP_CONSTANTS.RETCOMP_ACTION)

2370: AND nvl(mln.expiration_date, sysdate + 1) > sysdate
2371: AND mmt.transaction_id = mog.origin_txn_id
2372: AND mmt.transaction_id = mtln.transaction_id
2373: AND mmt.transaction_action_id IN (WIP_CONSTANTS.ISSCOMP_ACTION,
2374: WIP_CONSTANTS.RETCOMP_ACTION)
2375: AND mmt.operation_seq_num = p_item.operation_seq_num;
2376:
2377: l_derivedQty NUMBER := 0;
2378: l_logLevel NUMBER := fnd_log.g_current_runtime_level;

Line 2388: IF (l_logLevel <= wip_constants.trace_logging) THEN

2384: BEGIN
2385: -- Don't need to check the return status because already check in
2386: -- deriveSerial()
2387:
2388: IF (l_logLevel <= wip_constants.trace_logging) THEN
2389: l_params(1).paramName := 'p_parentObjID';
2390: l_params(1).paramValue := p_parentObjID;
2391: l_params(2).paramName := 'p_orgID';
2392: l_params(2).paramValue := p_orgID;

Line 2421: IF (l_logLevel <= wip_constants.full_logging) THEN

2417: p_attributes => null);
2418:
2419: l_derivedQty := l_derivedQty + l_lotComp.lot_qty;
2420:
2421: IF (l_logLevel <= wip_constants.full_logging) THEN
2422: wip_logger.log('Added Lot : ' || l_lotComp.lot, l_returnStatus);
2423: wip_logger.log('Added Lot Qty : '|| l_lotComp.lot_qty, l_returnStatus);
2424: END IF;
2425: END LOOP; -- l_lotComp IN c_lotComp

Line 2428: IF(p_item.lot_control_code = WIP_CONSTANTS.LOT AND

2424: END IF;
2425: END LOOP; -- l_lotComp IN c_lotComp
2426: -- Check whether derived quantity equal to backflush quantity or not
2427: -- If not, error out.
2428: IF(p_item.lot_control_code = WIP_CONSTANTS.LOT AND
2429: p_item.primary_quantity <> l_derivedQty * -1) THEN
2430: wip_logger.log('item : ' || p_item.item_name, l_returnStatus);
2431: wip_logger.log('primary_quantity : ' || p_item.primary_quantity,
2432: l_returnStatus);

Line 2438: IF (l_logLevel <= wip_constants.trace_logging) THEN

2434: l_errMsg := 'return quantity missmatch';
2435: raise fnd_api.g_exc_unexpected_error;
2436: END IF;
2437:
2438: IF (l_logLevel <= wip_constants.trace_logging) THEN
2439: wip_logger.exitPoint(
2440: p_procName => 'wip_autoLotProc_priv.deriveSingleItemFromMOG',
2441: p_procReturnStatus => x_returnStatus,
2442: p_msg => 'procedure success',

Line 2449: IF (l_logLevel <= wip_constants.trace_logging) THEN

2445:
2446: EXCEPTION
2447: WHEN fnd_api.g_exc_unexpected_error THEN
2448: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
2449: IF (l_logLevel <= wip_constants.trace_logging) THEN
2450: wip_logger.exitPoint(
2451: p_procName => 'wip_autoLotProc_priv.deriveSingleItemFromMOG',
2452: p_procReturnStatus => x_returnStatus,
2453: p_msg => l_errMsg,

Line 2463: IF (l_logLevel <= wip_constants.trace_logging) THEN

2459: fnd_msg_pub.add;
2460:
2461: WHEN others THEN
2462: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
2463: IF (l_logLevel <= wip_constants.trace_logging) THEN
2464: wip_logger.exitPoint(
2465: p_procName => 'wip_autoLotProc_priv.deriveSingleItemFromMOG',
2466: p_procReturnStatus => x_returnStatus,
2467: p_msg => 'unexp error:' || SQLERRM,

Line 2497: AND mmt.transaction_action_id IN (WIP_CONSTANTS.ISSCOMP_ACTION,

2493: AND mtln.lot_number = mln.lot_number
2494: AND nvl(mln.expiration_date, sysdate + 1) > sysdate
2495: AND mmt.transaction_id = mog.origin_txn_id
2496: AND mmt.transaction_id = mtln.transaction_id
2497: AND mmt.transaction_action_id IN (WIP_CONSTANTS.ISSCOMP_ACTION,
2498: WIP_CONSTANTS.RETCOMP_ACTION)
2499: AND mmt.operation_seq_num = p_item.operation_seq_num;
2500:
2501: l_errMsg VARCHAR2(240);

Line 2498: WIP_CONSTANTS.RETCOMP_ACTION)

2494: AND nvl(mln.expiration_date, sysdate + 1) > sysdate
2495: AND mmt.transaction_id = mog.origin_txn_id
2496: AND mmt.transaction_id = mtln.transaction_id
2497: AND mmt.transaction_action_id IN (WIP_CONSTANTS.ISSCOMP_ACTION,
2498: WIP_CONSTANTS.RETCOMP_ACTION)
2499: AND mmt.operation_seq_num = p_item.operation_seq_num;
2500:
2501: l_errMsg VARCHAR2(240);
2502: l_returnStatus VARCHAR2(1);

Line 2508: IF (l_logLevel <= wip_constants.trace_logging) THEN

2504: l_params wip_logger.param_tbl_t;
2505: l_revisionComp c_revisionComp%ROWTYPE;
2506: BEGIN
2507:
2508: IF (l_logLevel <= wip_constants.trace_logging) THEN
2509: l_params(1).paramName := 'p_parentObjID';
2510: l_params(1).paramValue := p_parentObjID;
2511: l_params(2).paramName := 'p_orgID';
2512: l_params(2).paramValue := p_orgID;

Line 2543: IF (l_logLevel <= wip_constants.trace_logging) THEN

2539: l_revisionComp.revision IS NOT NULL) THEN
2540: x_compLots.setRevision(p_revision => l_revisionComp.revision);
2541: END IF;
2542:
2543: IF (l_logLevel <= wip_constants.trace_logging) THEN
2544: wip_logger.exitPoint(
2545: p_procName => 'wip_autoLotProc_priv.setItemRevision',
2546: p_procReturnStatus => x_returnStatus,
2547: p_msg => 'procedure success',

Line 2558: IF (l_logLevel <= wip_constants.trace_logging) THEN

2554: CLOSE c_revisionComp;
2555: END IF;
2556:
2557: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
2558: IF (l_logLevel <= wip_constants.trace_logging) THEN
2559: wip_logger.exitPoint(
2560: p_procName => 'wip_autoLotProc_priv.setItemRevision',
2561: p_procReturnStatus => x_returnStatus,
2562: p_msg => 'unexp error:' || SQLERRM,

Line 2581: IF (l_logLevel <= wip_constants.trace_logging) THEN

2577: l_params wip_logger.param_tbl_t;
2578: l_curItem system.wip_component_obj_t;
2579: l_logLevel NUMBER := fnd_log.g_current_runtime_level;
2580: BEGIN
2581: IF (l_logLevel <= wip_constants.trace_logging) THEN
2582: l_params(1).paramName := 'p_orgID';
2583: l_params(1).paramValue := p_orgID;
2584: l_params(2).paramName := 'p_objectID';
2585: l_params(2).paramValue := p_objectID;

Line 2605: IF(l_curItem.wip_supply_type NOT IN (WIP_CONSTANTS.PUSH,

2601: x_returnStatus := fnd_api.g_ret_sts_success;
2602:
2603: LOOP
2604: IF(x_compLots.getCurrentItem(l_curItem)) THEN
2605: IF(l_curItem.wip_supply_type NOT IN (WIP_CONSTANTS.PUSH,
2606: WIP_CONSTANTS.OP_PULL,
2607: WIP_CONSTANTS.ASSY_PULL)
2608: OR
2609: l_curItem.lot_control_code = WIP_CONSTANTS.NO_LOT

Line 2606: WIP_CONSTANTS.OP_PULL,

2602:
2603: LOOP
2604: IF(x_compLots.getCurrentItem(l_curItem)) THEN
2605: IF(l_curItem.wip_supply_type NOT IN (WIP_CONSTANTS.PUSH,
2606: WIP_CONSTANTS.OP_PULL,
2607: WIP_CONSTANTS.ASSY_PULL)
2608: OR
2609: l_curItem.lot_control_code = WIP_CONSTANTS.NO_LOT
2610: OR

Line 2607: WIP_CONSTANTS.ASSY_PULL)

2603: LOOP
2604: IF(x_compLots.getCurrentItem(l_curItem)) THEN
2605: IF(l_curItem.wip_supply_type NOT IN (WIP_CONSTANTS.PUSH,
2606: WIP_CONSTANTS.OP_PULL,
2607: WIP_CONSTANTS.ASSY_PULL)
2608: OR
2609: l_curItem.lot_control_code = WIP_CONSTANTS.NO_LOT
2610: OR
2611: l_curItem.serial_number_control_code IN(WIP_CONSTANTS.FULL_SN,

Line 2609: l_curItem.lot_control_code = WIP_CONSTANTS.NO_LOT

2605: IF(l_curItem.wip_supply_type NOT IN (WIP_CONSTANTS.PUSH,
2606: WIP_CONSTANTS.OP_PULL,
2607: WIP_CONSTANTS.ASSY_PULL)
2608: OR
2609: l_curItem.lot_control_code = WIP_CONSTANTS.NO_LOT
2610: OR
2611: l_curItem.serial_number_control_code IN(WIP_CONSTANTS.FULL_SN,
2612: WIP_CONSTANTS.DYN_RCV_SN)
2613: OR

Line 2611: l_curItem.serial_number_control_code IN(WIP_CONSTANTS.FULL_SN,

2607: WIP_CONSTANTS.ASSY_PULL)
2608: OR
2609: l_curItem.lot_control_code = WIP_CONSTANTS.NO_LOT
2610: OR
2611: l_curItem.serial_number_control_code IN(WIP_CONSTANTS.FULL_SN,
2612: WIP_CONSTANTS.DYN_RCV_SN)
2613: OR
2614: l_curItem.transaction_action_id <> WIP_CONSTANTS.RETCOMP_ACTION
2615: ) THEN

Line 2612: WIP_CONSTANTS.DYN_RCV_SN)

2608: OR
2609: l_curItem.lot_control_code = WIP_CONSTANTS.NO_LOT
2610: OR
2611: l_curItem.serial_number_control_code IN(WIP_CONSTANTS.FULL_SN,
2612: WIP_CONSTANTS.DYN_RCV_SN)
2613: OR
2614: l_curItem.transaction_action_id <> WIP_CONSTANTS.RETCOMP_ACTION
2615: ) THEN
2616: GOTO END_OF_LOOP;

Line 2614: l_curItem.transaction_action_id <> WIP_CONSTANTS.RETCOMP_ACTION

2610: OR
2611: l_curItem.serial_number_control_code IN(WIP_CONSTANTS.FULL_SN,
2612: WIP_CONSTANTS.DYN_RCV_SN)
2613: OR
2614: l_curItem.transaction_action_id <> WIP_CONSTANTS.RETCOMP_ACTION
2615: ) THEN
2616: GOTO END_OF_LOOP;
2617: ELSE
2618: -- Instead of defaulting revision to the current revision, we should

Line 2649: IF (l_logLevel <= wip_constants.trace_logging) THEN

2645:
2646: EXIT WHEN NOT x_compLots.setNextItem;
2647: END LOOP;
2648:
2649: IF (l_logLevel <= wip_constants.trace_logging) THEN
2650: wip_logger.exitPoint(
2651: p_procName => 'wip_autoLotProc_priv.deriveLotsFromMOG',
2652: p_procReturnStatus => x_returnStatus,
2653: p_msg => 'procedure success',

Line 2660: IF (l_logLevel <= wip_constants.trace_logging) THEN

2656:
2657: EXCEPTION
2658: WHEN fnd_api.g_exc_unexpected_error THEN
2659: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
2660: IF (l_logLevel <= wip_constants.trace_logging) THEN
2661: wip_logger.exitPoint(
2662: p_procName => 'wip_autoLotProc_priv.deriveLotsFromMOG',
2663: p_procReturnStatus => x_returnStatus,
2664: p_msg => l_errMsg,

Line 2671: IF (l_logLevel <= wip_constants.trace_logging) THEN

2667: ROLLBACK TO s_deriveLotsFromMOG;
2668:
2669: WHEN others THEN
2670: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
2671: IF (l_logLevel <= wip_constants.trace_logging) THEN
2672: wip_logger.exitPoint(
2673: p_procName => 'wip_autoLotProc_priv.deriveLotsFromMOG',
2674: p_procReturnStatus => x_returnStatus,
2675: p_msg => 'unexpected error:' || SQLERRM,