212: AND OD.LINE_LOCATION_ID = RT.PO_LINE_LOCATION_ID
213: AND RT.TRANSACTION_ID = l_transaction_id
214: ORDER BY 1 desc;
215: --
216: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
217: --
218: -- MOAC
219: l_access_mode VARCHAR2(1);
220: l_current_org_id NUMBER;
221: l_reset_policy BOOLEAN;
222: BEGIN
223:
224: IF l_debug_level > 0 THEN
225: oe_debug_pub.add('*** Entering Dropshipreceive() in OE_DS_PVT *** ' , 1 ) ;
226: oe_debug_pub.add('Proces Online Mode:'||p_mode , 1 ) ;
227: oe_debug_pub.add('Transaction ID :' || P_RCV_TRANSACTION_ID , 1 ) ;
228: oe_debug_pub.add('Application Short Name :' || P_APPLICATION_SHORT_NAME , 1 ) ;
229: END IF;
222: BEGIN
223:
224: IF l_debug_level > 0 THEN
225: oe_debug_pub.add('*** Entering Dropshipreceive() in OE_DS_PVT *** ' , 1 ) ;
226: oe_debug_pub.add('Proces Online Mode:'||p_mode , 1 ) ;
227: oe_debug_pub.add('Transaction ID :' || P_RCV_TRANSACTION_ID , 1 ) ;
228: oe_debug_pub.add('Application Short Name :' || P_APPLICATION_SHORT_NAME , 1 ) ;
229: END IF;
230:
223:
224: IF l_debug_level > 0 THEN
225: oe_debug_pub.add('*** Entering Dropshipreceive() in OE_DS_PVT *** ' , 1 ) ;
226: oe_debug_pub.add('Proces Online Mode:'||p_mode , 1 ) ;
227: oe_debug_pub.add('Transaction ID :' || P_RCV_TRANSACTION_ID , 1 ) ;
228: oe_debug_pub.add('Application Short Name :' || P_APPLICATION_SHORT_NAME , 1 ) ;
229: END IF;
230:
231: l_access_mode := mo_global.Get_access_mode(); -- MOAC
224: IF l_debug_level > 0 THEN
225: oe_debug_pub.add('*** Entering Dropshipreceive() in OE_DS_PVT *** ' , 1 ) ;
226: oe_debug_pub.add('Proces Online Mode:'||p_mode , 1 ) ;
227: oe_debug_pub.add('Transaction ID :' || P_RCV_TRANSACTION_ID , 1 ) ;
228: oe_debug_pub.add('Application Short Name :' || P_APPLICATION_SHORT_NAME , 1 ) ;
229: END IF;
230:
231: l_access_mode := mo_global.Get_access_mode(); -- MOAC
232: l_current_org_id := mo_global.get_current_org_id();
247: END LOOP;
248:
249: IF l_line_id IS NULL THEN
250: IF l_debug_level > 0 THEN
251: oe_debug_pub.add( 'Unable to find the sales order identifier for this transaction '||sqlerrm , 1 ) ;
252: END IF;
253: IF l_debug_level > 0 THEN
254: oe_debug_pub.add( 'Dropshipreceive(), This may not be a dropship transaction ' , 1 ) ;
255: END IF;
250: IF l_debug_level > 0 THEN
251: oe_debug_pub.add( 'Unable to find the sales order identifier for this transaction '||sqlerrm , 1 ) ;
252: END IF;
253: IF l_debug_level > 0 THEN
254: oe_debug_pub.add( 'Dropshipreceive(), This may not be a dropship transaction ' , 1 ) ;
255: END IF;
256: RETURN TRUE;
257: END IF;
258: -- Bug 2407918}
278: WHEN OTHERS THEN
279: FND_MESSAGE.SET_NAME('OE','OE_VAL_ORDER_CREDIT');
280: OE_MSG_PUB.Add;
281: IF l_debug_level > 0 THEN
282: oe_debug_pub.add( 'Unable to find the sales order identifier in dropshipreceive()'||sqlerrm , 1 ) ;
283: END IF;
284: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
285: END;
286:
310: FROM po_headers_all poh
311: WHERE poh.po_header_id = l_po_header_id;
312:
313: IF l_debug_level > 0 THEN
314: oe_debug_pub.add('SO Org Id: ' ||l_so_ou_id , 1 ) ;
315: oe_debug_pub.add('PO Org Id: ' ||l_po_ou_id , 1 ) ;
316: END IF;
317:
318: IF l_po_ou_id <> l_so_ou_id THEN
311: WHERE poh.po_header_id = l_po_header_id;
312:
313: IF l_debug_level > 0 THEN
314: oe_debug_pub.add('SO Org Id: ' ||l_so_ou_id , 1 ) ;
315: oe_debug_pub.add('PO Org Id: ' ||l_po_ou_id , 1 ) ;
316: END IF;
317:
318: IF l_po_ou_id <> l_so_ou_id THEN
319: -- MOAC
339: END IF;
340:
341:
342: IF l_debug_level > 0 THEN
343: oe_debug_pub.add('Transaction date : ' ||l_transaction_date , 1 ) ;
344: oe_debug_pub.add('Line ID : '||l_line_id||' already received qty => '||TO_CHAR ( l_orig_shipped) , 1 ) ;
345: END IF;
346:
347: l_order_uom := l_line_rec.order_quantity_uom;
340:
341:
342: IF l_debug_level > 0 THEN
343: oe_debug_pub.add('Transaction date : ' ||l_transaction_date , 1 ) ;
344: oe_debug_pub.add('Line ID : '||l_line_id||' already received qty => '||TO_CHAR ( l_orig_shipped) , 1 ) ;
345: END IF;
346:
347: l_order_uom := l_line_rec.order_quantity_uom;
348: l_orig_short_quantity := nvl(l_line_rec.ordered_quantity,0) - nvl(l_line_rec.shipped_quantity,0);
352: l_orig_short_quantity2 := nvl(l_line_rec.ordered_quantity2,0)
353: - nvl(l_line_rec.shipped_quantity2,0);
354:
355: IF l_debug_level > 0 THEN
356: oe_debug_pub.add( 'Open quantity in the sales order => ' || L_ORIG_SHORT_QUANTITY , 1 ) ;
357: END IF;
358: l_short_quantity := l_orig_short_quantity;
359: l_short_quantity2 := l_orig_short_quantity2;
360:
411: AND msinv.organization_id(+) = rt.organization_id
412: AND msinv.secondary_inventory_name(+) = rt.subinventory;
413:
414: IF l_debug_level > 0 THEN
415: oe_debug_pub.add( 'l_revision - '||L_REVISION ) ;
416: END IF;
417:
418:
419: EXCEPTION
418:
419: EXCEPTION
420: WHEN NO_DATA_FOUND THEN
421: IF l_debug_level > 0 THEN
422: oe_debug_pub.add( 'SQL: Fail to retrieve the receiving information '||sqlerrm , 1 ) ;
423: END IF;
424: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
425: WHEN OTHERS THEN
426: IF l_debug_level > 0 THEN
423: END IF;
424: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
425: WHEN OTHERS THEN
426: IF l_debug_level > 0 THEN
427: oe_debug_pub.add( 'Error while retrieving receiving information '||sqlerrm , 1 ) ;
428: END IF;
429: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
430: END;
431:
429: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
430: END;
431:
432: IF l_debug_level > 0 THEN
433: oe_debug_pub.add( 'Ordered uom code => '||L_ORDER_UOM , 5 ) ;
434: END IF;
435: IF l_debug_level > 0 THEN
436: oe_debug_pub.add( 'Received uom code => '||L_RCV_UOM , 5 ) ;
437: END IF;
432: IF l_debug_level > 0 THEN
433: oe_debug_pub.add( 'Ordered uom code => '||L_ORDER_UOM , 5 ) ;
434: END IF;
435: IF l_debug_level > 0 THEN
436: oe_debug_pub.add( 'Received uom code => '||L_RCV_UOM , 5 ) ;
437: END IF;
438:
439: IF l_debug_level > 0 THEN
440: oe_debug_pub.add( 'Receiving the items in the subinventory => '||L_SUBINVENTORY , 1 ) ;
436: oe_debug_pub.add( 'Received uom code => '||L_RCV_UOM , 5 ) ;
437: END IF;
438:
439: IF l_debug_level > 0 THEN
440: oe_debug_pub.add( 'Receiving the items in the subinventory => '||L_SUBINVENTORY , 1 ) ;
441: oe_debug_pub.add( 'Primary Received Qty => '||L_RCV_PRIMARY_QUANTITY , 1 ) ; -- 12794393
442: END IF;
443:
444: l_line_rec.subinventory := l_subinventory;
437: END IF;
438:
439: IF l_debug_level > 0 THEN
440: oe_debug_pub.add( 'Receiving the items in the subinventory => '||L_SUBINVENTORY , 1 ) ;
441: oe_debug_pub.add( 'Primary Received Qty => '||L_RCV_PRIMARY_QUANTITY , 1 ) ; -- 12794393
442: END IF;
443:
444: l_line_rec.subinventory := l_subinventory;
445:
480: END IF;
481:
482:
483: IF l_debug_level > 0 THEN
484: oe_debug_pub.add('Open qty available for receipt => ' || L_SHORT_QUANTITY , 1 ) ;
485: END IF;
486:
487: LOOP
488:
496: FROM dual;
497:
498: IF l_lot_quantity <> -1 THEN
499: IF l_debug_level > 0 THEN
500: oe_debug_pub.add(' Lot number => ' || l_lot , 5 ) ;
501: END IF;
502: IF l_debug_level > 0 THEN
503: oe_debug_pub.add(' Lot quantity => ' || l_lot_quantity , 5 ) ;
504: oe_debug_pub.add(' Lot quantity2 => ' || l_lot_quantity2 , 5 ) ; -- INVCONV
499: IF l_debug_level > 0 THEN
500: oe_debug_pub.add(' Lot number => ' || l_lot , 5 ) ;
501: END IF;
502: IF l_debug_level > 0 THEN
503: oe_debug_pub.add(' Lot quantity => ' || l_lot_quantity , 5 ) ;
504: oe_debug_pub.add(' Lot quantity2 => ' || l_lot_quantity2 , 5 ) ; -- INVCONV
505: oe_debug_pub.add(' Lot transaction id => ' || L_TRANSACTION_ID , 1 ) ; -- 12794393
506: oe_debug_pub.add(' Primary receiving qty => ' || l_primary_quantity , 1 ) ; -- 12794393
507: END IF;
500: oe_debug_pub.add(' Lot number => ' || l_lot , 5 ) ;
501: END IF;
502: IF l_debug_level > 0 THEN
503: oe_debug_pub.add(' Lot quantity => ' || l_lot_quantity , 5 ) ;
504: oe_debug_pub.add(' Lot quantity2 => ' || l_lot_quantity2 , 5 ) ; -- INVCONV
505: oe_debug_pub.add(' Lot transaction id => ' || L_TRANSACTION_ID , 1 ) ; -- 12794393
506: oe_debug_pub.add(' Primary receiving qty => ' || l_primary_quantity , 1 ) ; -- 12794393
507: END IF;
508: END IF;
501: END IF;
502: IF l_debug_level > 0 THEN
503: oe_debug_pub.add(' Lot quantity => ' || l_lot_quantity , 5 ) ;
504: oe_debug_pub.add(' Lot quantity2 => ' || l_lot_quantity2 , 5 ) ; -- INVCONV
505: oe_debug_pub.add(' Lot transaction id => ' || L_TRANSACTION_ID , 1 ) ; -- 12794393
506: oe_debug_pub.add(' Primary receiving qty => ' || l_primary_quantity , 1 ) ; -- 12794393
507: END IF;
508: END IF;
509:
502: IF l_debug_level > 0 THEN
503: oe_debug_pub.add(' Lot quantity => ' || l_lot_quantity , 5 ) ;
504: oe_debug_pub.add(' Lot quantity2 => ' || l_lot_quantity2 , 5 ) ; -- INVCONV
505: oe_debug_pub.add(' Lot transaction id => ' || L_TRANSACTION_ID , 1 ) ; -- 12794393
506: oe_debug_pub.add(' Primary receiving qty => ' || l_primary_quantity , 1 ) ; -- 12794393
507: END IF;
508: END IF;
509:
510: IF (l_lot_quantity <= 0) THEN
518: /* Reserve the quantities in this lot */
519:
520: IF l_order_uom <> l_rcv_uom THEN
521: IF l_debug_level > 0 THEN
522: oe_debug_pub.add( 'Converting the unit of measurement ' , 5 ) ;
523: END IF;
524: --l_converted_qty := OE_ORDER_MISC_UTIL.CONVERT_UOM (l_item_id,l_rcv_uom,l_order_uom,l_lot_quantity);
525: -- Bug 12794393 Added two new IN parameters to handle the lot specific conversion
526:
572: l_short_quantity2 := l_short_quantity2 - nvl(l_lot_quantity2,0);
573: l_add_to_shipped2 := l_add_to_shipped2 + nvl(l_lot_quantity2,0);
574: l_qty2_to_be_reserved := l_lot_quantity2; -- INVCONV
575: IF l_debug_level > 0 THEN
576: oe_debug_pub.add( 'Is subinventory reservable ? '||l_sub_reservable , 1 ) ;
577: END IF;
578:
579: BEGIN
580: SELECT NVL(reservable_type,2)
583: WHERE inventory_item_id = l_line_rec.inventory_item_id
584: AND organization_id = l_line_rec.ship_from_org_id;
585:
586: IF l_debug_level > 0 THEN
587: oe_debug_pub.add( 'Is item reservable ? '||l_item_reservable , 1 ) ;
588: END IF;
589:
590: EXCEPTION WHEN OTHERS THEN
591: IF l_debug_level > 0 THEN
588: END IF;
589:
590: EXCEPTION WHEN OTHERS THEN
591: IF l_debug_level > 0 THEN
592: oe_debug_pub.add( 'Error while checking item reservable ? '||sqlerrm , 1 ) ;
593: END IF;
594: l_item_reservable := 2;
595: END;
596:
616: -- bug 3544019
617:
618: IF l_return_status = FND_API.G_RET_STS_ERROR then
619: IF l_debug_level > 0 THEN
620: oe_debug_pub.add('Call to Create Reservation returned expected error '||sqlerrm,1) ;
621: END IF;
622: RAISE FND_API.G_EXC_ERROR;
623: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
624: IF l_debug_level > 0 THEN
621: END IF;
622: RAISE FND_API.G_EXC_ERROR;
623: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
624: IF l_debug_level > 0 THEN
625: oe_debug_pub.add('Call to Create Reservation returned unexpected error '||sqlerrm , 1 ) ;
626: END IF;
627: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
628: END IF;
629:
628: END IF;
629:
630: ELSE
631: IF l_debug_level > 0 THEN
632: oe_debug_pub.add('Item OR Subinventory Non-reservable ' , 1 ) ;
633: END IF;
634: l_quantity_reserved := l_qty_to_be_reserved;
635: l_quantity2_reserved := l_qty2_to_be_reserved; -- INVCONV
636: END IF;
637:
638: END IF;
639:
640: IF l_debug_level > 0 THEN
641: oe_debug_pub.add( 'After reservation check' , 1 ) ;
642: END IF;
643:
644:
645: -- Decrement Inventory
651: /* forking code for OPM INVCONV NOT NEEDED NOW
652: IF (INV_GMI_RSV_BRANCH.Process_Branch(l_line_rec.ship_from_org_id))
653: THEN
654: IF l_debug_level > 0 THEN
655: oe_debug_pub.add( 'Calling decrement inventory for opm' , 1 ) ;
656: END IF;
657: Decrement_Inventory_for_OPM(
658: p_detail_id => l_rsv_id,
659: p_line_rec => l_line_rec,
673: p_as_alpha_prefix => l_as_alpha_prefix,
674: p_transaction_header_id => l_lot_set_id,
675: x_return_status => l_return_status);
676: IF l_debug_level > 0 THEN
677: oe_debug_pub.add('After calling decrement inventory for opm: ' || l_return_status,1) ;
678: END IF;
679: IF l_return_status = FND_API.G_RET_STS_ERROR then
680: RAISE FND_API.G_EXC_ERROR;
681: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
682: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
683: END IF;
684: ElSE */
685: IF l_debug_level > 0 THEN
686: oe_debug_pub.add( 'Calling decrement inventory()' , 1 ) ;
687: END IF;
688: Decrement_Inventory(
689: p_detail_id => l_rsv_id,
690: p_line_rec => l_line_rec,
706: p_transfer_lpn_id => l_transfer_lpn_id, --3544019
707: x_return_status => l_return_status);
708:
709: IF l_debug_level > 0 THEN
710: oe_debug_pub.add( 'After calling decrement inventory : ' || l_return_status,1) ;
711: END IF;
712:
713: IF l_return_status = FND_API.G_RET_STS_ERROR then
714: IF l_debug_level > 0 THEN
711: END IF;
712:
713: IF l_return_status = FND_API.G_RET_STS_ERROR then
714: IF l_debug_level > 0 THEN
715: oe_debug_pub.add( 'Call to decrementinventory() returned expected error '||sqlerrm,1) ;
716: END IF;
717: RAISE FND_API.G_EXC_ERROR;
718: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
719: IF l_debug_level > 0 THEN
716: END IF;
717: RAISE FND_API.G_EXC_ERROR;
718: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
719: IF l_debug_level > 0 THEN
720: oe_debug_pub.add( 'Call to decrementinventory() returned unexpected error '||sqlerrm , 1 ) ;
721: END IF;
722: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
723: END IF; -- IF l_return_status = FND_API.G_RET_STS_ERROR then -- INVCONV
724: --END IF; -- INVCONV
736: << end_loop >>
737: CLOSE transaction_info;
738:
739: IF l_debug_level > 0 THEN
740: oe_debug_pub.add( 'Final open quantity in the sales order => '||l_short_quantity,1) ;
741: END IF;
742:
743: END;
744:
755: );
756:
757: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
758: IF l_debug_level > 0 THEN
759: oe_debug_pub.add('Call to process order returned unexpected error '||sqlerrm , 1 ) ;
760: END IF;
761: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
762: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
763: IF l_debug_level > 0 THEN
760: END IF;
761: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
762: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
763: IF l_debug_level > 0 THEN
764: oe_debug_pub.add('Call to process order returned expected error '||sqlerrm , 1 ) ;
765: END IF;
766: RAISE FND_API.G_EXC_ERROR;
767: END IF;
768:
781: END IF;
782:
783:
784: IF l_debug_level > 0 THEN
785: oe_debug_pub.add('Exiting dropshipreceive() successfully ' , 1 ) ;
786: END IF;
787:
788: OE_DEBUG_PUB.dumpdebug;
789: OE_DEBUG_PUB.Debug_Off;
784: IF l_debug_level > 0 THEN
785: oe_debug_pub.add('Exiting dropshipreceive() successfully ' , 1 ) ;
786: END IF;
787:
788: OE_DEBUG_PUB.dumpdebug;
789: OE_DEBUG_PUB.Debug_Off;
790:
791: RETURN TRUE;
792:
785: oe_debug_pub.add('Exiting dropshipreceive() successfully ' , 1 ) ;
786: END IF;
787:
788: OE_DEBUG_PUB.dumpdebug;
789: OE_DEBUG_PUB.Debug_Off;
790:
791: RETURN TRUE;
792:
793: EXCEPTION
792:
793: EXCEPTION
794: WHEN FND_API.G_EXC_ERROR THEN
795: IF l_debug_level > 0 THEN
796: oe_debug_pub.add( 'Exiting dropshipreceive with exp. error => '||sqlerrm , 1 ) ;
797: END IF;
798: OE_MSG_PUB.Save_API_Messages(); -- bug 4393738
799: OE_DEBUG_PUB.dumpdebug;
800: OE_DEBUG_PUB.Debug_Off;
795: IF l_debug_level > 0 THEN
796: oe_debug_pub.add( 'Exiting dropshipreceive with exp. error => '||sqlerrm , 1 ) ;
797: END IF;
798: OE_MSG_PUB.Save_API_Messages(); -- bug 4393738
799: OE_DEBUG_PUB.dumpdebug;
800: OE_DEBUG_PUB.Debug_Off;
801: RETURN FALSE;
802: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
803: IF l_debug_level > 0 THEN
796: oe_debug_pub.add( 'Exiting dropshipreceive with exp. error => '||sqlerrm , 1 ) ;
797: END IF;
798: OE_MSG_PUB.Save_API_Messages(); -- bug 4393738
799: OE_DEBUG_PUB.dumpdebug;
800: OE_DEBUG_PUB.Debug_Off;
801: RETURN FALSE;
802: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
803: IF l_debug_level > 0 THEN
804: oe_debug_pub.add( 'Exiting dropshipreceive with unexp. error => '||sqlerrm , 1 ) ;
800: OE_DEBUG_PUB.Debug_Off;
801: RETURN FALSE;
802: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
803: IF l_debug_level > 0 THEN
804: oe_debug_pub.add( 'Exiting dropshipreceive with unexp. error => '||sqlerrm , 1 ) ;
805: END IF;
806: OE_MSG_PUB.Save_API_Messages(); -- bug 4393738
807: OE_DEBUG_PUB.dumpdebug;
808: OE_DEBUG_PUB.Debug_Off;
803: IF l_debug_level > 0 THEN
804: oe_debug_pub.add( 'Exiting dropshipreceive with unexp. error => '||sqlerrm , 1 ) ;
805: END IF;
806: OE_MSG_PUB.Save_API_Messages(); -- bug 4393738
807: OE_DEBUG_PUB.dumpdebug;
808: OE_DEBUG_PUB.Debug_Off;
809: RETURN FALSE;
810: WHEN OTHERS THEN
811: IF l_debug_level > 0 THEN
804: oe_debug_pub.add( 'Exiting dropshipreceive with unexp. error => '||sqlerrm , 1 ) ;
805: END IF;
806: OE_MSG_PUB.Save_API_Messages(); -- bug 4393738
807: OE_DEBUG_PUB.dumpdebug;
808: OE_DEBUG_PUB.Debug_Off;
809: RETURN FALSE;
810: WHEN OTHERS THEN
811: IF l_debug_level > 0 THEN
812: oe_debug_pub.add( 'Exiting dropshipreceive with others error => '||sqlerrm , 1 ) ;
808: OE_DEBUG_PUB.Debug_Off;
809: RETURN FALSE;
810: WHEN OTHERS THEN
811: IF l_debug_level > 0 THEN
812: oe_debug_pub.add( 'Exiting dropshipreceive with others error => '||sqlerrm , 1 ) ;
813: END IF;
814: OE_MSG_PUB.Save_API_Messages(); -- bug 4393738
815: OE_DEBUG_PUB.dumpdebug;
816: OE_DEBUG_PUB.Debug_Off;
811: IF l_debug_level > 0 THEN
812: oe_debug_pub.add( 'Exiting dropshipreceive with others error => '||sqlerrm , 1 ) ;
813: END IF;
814: OE_MSG_PUB.Save_API_Messages(); -- bug 4393738
815: OE_DEBUG_PUB.dumpdebug;
816: OE_DEBUG_PUB.Debug_Off;
817: RETURN FALSE;
818: END DropShipReceive;
819:
812: oe_debug_pub.add( 'Exiting dropshipreceive with others error => '||sqlerrm , 1 ) ;
813: END IF;
814: OE_MSG_PUB.Save_API_Messages(); -- bug 4393738
815: OE_DEBUG_PUB.dumpdebug;
816: OE_DEBUG_PUB.Debug_Off;
817: RETURN FALSE;
818: END DropShipReceive;
819:
820: /* --------------------------------------------------------------------
910: l_transaction_header_id NUMBER := p_transaction_header_id;
911: l_transaction_source_id NUMBER ; /* sales_order_id */
912: l_converted_qty NUMBER; -- Bug-2311061
913: l_primary_uom VARCHAR2(3); -- Bug-2908567
914: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
915: BEGIN
916:
917: IF l_debug_level > 0 THEN
918: oe_debug_pub.add(' Entering decrement inventory() ' ) ;
914: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
915: BEGIN
916:
917: IF l_debug_level > 0 THEN
918: oe_debug_pub.add(' Entering decrement inventory() ' ) ;
919: oe_debug_pub.add(' p_lot_number : ' || p_lot_number , 1 ) ;
920: oe_debug_pub.add(' p_revision : ' || p_revision , 1 ) ;
921: oe_debug_pub.add(' p_secondary_inventory : ' || p_secondary_inventory , 1 ) ;
922: oe_debug_pub.add(' p_inventory_item_id : ' || p_inventory_item_id , 1 ) ;
915: BEGIN
916:
917: IF l_debug_level > 0 THEN
918: oe_debug_pub.add(' Entering decrement inventory() ' ) ;
919: oe_debug_pub.add(' p_lot_number : ' || p_lot_number , 1 ) ;
920: oe_debug_pub.add(' p_revision : ' || p_revision , 1 ) ;
921: oe_debug_pub.add(' p_secondary_inventory : ' || p_secondary_inventory , 1 ) ;
922: oe_debug_pub.add(' p_inventory_item_id : ' || p_inventory_item_id , 1 ) ;
923: oe_debug_pub.add(' p_trx_uom : ' || p_trx_uom , 1 ) ;
916:
917: IF l_debug_level > 0 THEN
918: oe_debug_pub.add(' Entering decrement inventory() ' ) ;
919: oe_debug_pub.add(' p_lot_number : ' || p_lot_number , 1 ) ;
920: oe_debug_pub.add(' p_revision : ' || p_revision , 1 ) ;
921: oe_debug_pub.add(' p_secondary_inventory : ' || p_secondary_inventory , 1 ) ;
922: oe_debug_pub.add(' p_inventory_item_id : ' || p_inventory_item_id , 1 ) ;
923: oe_debug_pub.add(' p_trx_uom : ' || p_trx_uom , 1 ) ;
924: oe_debug_pub.add(' p_chart_of_accts : ' || p_chart_of_accts , 1 ) ;
917: IF l_debug_level > 0 THEN
918: oe_debug_pub.add(' Entering decrement inventory() ' ) ;
919: oe_debug_pub.add(' p_lot_number : ' || p_lot_number , 1 ) ;
920: oe_debug_pub.add(' p_revision : ' || p_revision , 1 ) ;
921: oe_debug_pub.add(' p_secondary_inventory : ' || p_secondary_inventory , 1 ) ;
922: oe_debug_pub.add(' p_inventory_item_id : ' || p_inventory_item_id , 1 ) ;
923: oe_debug_pub.add(' p_trx_uom : ' || p_trx_uom , 1 ) ;
924: oe_debug_pub.add(' p_chart_of_accts : ' || p_chart_of_accts , 1 ) ;
925: oe_debug_pub.add(' p_warehouse_id : ' || p_warehouse_id , 1 ) ;
918: oe_debug_pub.add(' Entering decrement inventory() ' ) ;
919: oe_debug_pub.add(' p_lot_number : ' || p_lot_number , 1 ) ;
920: oe_debug_pub.add(' p_revision : ' || p_revision , 1 ) ;
921: oe_debug_pub.add(' p_secondary_inventory : ' || p_secondary_inventory , 1 ) ;
922: oe_debug_pub.add(' p_inventory_item_id : ' || p_inventory_item_id , 1 ) ;
923: oe_debug_pub.add(' p_trx_uom : ' || p_trx_uom , 1 ) ;
924: oe_debug_pub.add(' p_chart_of_accts : ' || p_chart_of_accts , 1 ) ;
925: oe_debug_pub.add(' p_warehouse_id : ' || p_warehouse_id , 1 ) ;
926: oe_debug_pub.add(' p_as_alpha_prefix : ' || p_as_alpha_prefix , 1 ) ;
919: oe_debug_pub.add(' p_lot_number : ' || p_lot_number , 1 ) ;
920: oe_debug_pub.add(' p_revision : ' || p_revision , 1 ) ;
921: oe_debug_pub.add(' p_secondary_inventory : ' || p_secondary_inventory , 1 ) ;
922: oe_debug_pub.add(' p_inventory_item_id : ' || p_inventory_item_id , 1 ) ;
923: oe_debug_pub.add(' p_trx_uom : ' || p_trx_uom , 1 ) ;
924: oe_debug_pub.add(' p_chart_of_accts : ' || p_chart_of_accts , 1 ) ;
925: oe_debug_pub.add(' p_warehouse_id : ' || p_warehouse_id , 1 ) ;
926: oe_debug_pub.add(' p_as_alpha_prefix : ' || p_as_alpha_prefix , 1 ) ;
927: oe_debug_pub.add(' p_sn_control_code : ' || p_sn_control_code , 1 ) ;
920: oe_debug_pub.add(' p_revision : ' || p_revision , 1 ) ;
921: oe_debug_pub.add(' p_secondary_inventory : ' || p_secondary_inventory , 1 ) ;
922: oe_debug_pub.add(' p_inventory_item_id : ' || p_inventory_item_id , 1 ) ;
923: oe_debug_pub.add(' p_trx_uom : ' || p_trx_uom , 1 ) ;
924: oe_debug_pub.add(' p_chart_of_accts : ' || p_chart_of_accts , 1 ) ;
925: oe_debug_pub.add(' p_warehouse_id : ' || p_warehouse_id , 1 ) ;
926: oe_debug_pub.add(' p_as_alpha_prefix : ' || p_as_alpha_prefix , 1 ) ;
927: oe_debug_pub.add(' p_sn_control_code : ' || p_sn_control_code , 1 ) ;
928: oe_debug_pub.add(' p_transaction_id : ' || p_transaction_id , 1 ) ;
921: oe_debug_pub.add(' p_secondary_inventory : ' || p_secondary_inventory , 1 ) ;
922: oe_debug_pub.add(' p_inventory_item_id : ' || p_inventory_item_id , 1 ) ;
923: oe_debug_pub.add(' p_trx_uom : ' || p_trx_uom , 1 ) ;
924: oe_debug_pub.add(' p_chart_of_accts : ' || p_chart_of_accts , 1 ) ;
925: oe_debug_pub.add(' p_warehouse_id : ' || p_warehouse_id , 1 ) ;
926: oe_debug_pub.add(' p_as_alpha_prefix : ' || p_as_alpha_prefix , 1 ) ;
927: oe_debug_pub.add(' p_sn_control_code : ' || p_sn_control_code , 1 ) ;
928: oe_debug_pub.add(' p_transaction_id : ' || p_transaction_id , 1 ) ;
929: END IF;
922: oe_debug_pub.add(' p_inventory_item_id : ' || p_inventory_item_id , 1 ) ;
923: oe_debug_pub.add(' p_trx_uom : ' || p_trx_uom , 1 ) ;
924: oe_debug_pub.add(' p_chart_of_accts : ' || p_chart_of_accts , 1 ) ;
925: oe_debug_pub.add(' p_warehouse_id : ' || p_warehouse_id , 1 ) ;
926: oe_debug_pub.add(' p_as_alpha_prefix : ' || p_as_alpha_prefix , 1 ) ;
927: oe_debug_pub.add(' p_sn_control_code : ' || p_sn_control_code , 1 ) ;
928: oe_debug_pub.add(' p_transaction_id : ' || p_transaction_id , 1 ) ;
929: END IF;
930:
923: oe_debug_pub.add(' p_trx_uom : ' || p_trx_uom , 1 ) ;
924: oe_debug_pub.add(' p_chart_of_accts : ' || p_chart_of_accts , 1 ) ;
925: oe_debug_pub.add(' p_warehouse_id : ' || p_warehouse_id , 1 ) ;
926: oe_debug_pub.add(' p_as_alpha_prefix : ' || p_as_alpha_prefix , 1 ) ;
927: oe_debug_pub.add(' p_sn_control_code : ' || p_sn_control_code , 1 ) ;
928: oe_debug_pub.add(' p_transaction_id : ' || p_transaction_id , 1 ) ;
929: END IF;
930:
931: -- bug 5357879
924: oe_debug_pub.add(' p_chart_of_accts : ' || p_chart_of_accts , 1 ) ;
925: oe_debug_pub.add(' p_warehouse_id : ' || p_warehouse_id , 1 ) ;
926: oe_debug_pub.add(' p_as_alpha_prefix : ' || p_as_alpha_prefix , 1 ) ;
927: oe_debug_pub.add(' p_sn_control_code : ' || p_sn_control_code , 1 ) ;
928: oe_debug_pub.add(' p_transaction_id : ' || p_transaction_id , 1 ) ;
929: END IF;
930:
931: -- bug 5357879
932: SAVEPOINT DECREMENT_INV;
972: END IF;
973:
974:
975: IF l_debug_level > 0 THEN
976: oe_debug_pub.add( 'Transaction account id : ' ||l_trans_acc,1 ) ;
977: END IF;
978:
979:
980:
988: -- Change for #2736818
989: l_source_line_id := p_line_rec.line_id; -- Sales Order Line ID
990: l_lot_set_id := p_transaction_header_id;
991: IF l_debug_level > 0 THEN
992: oe_debug_pub.add( 'Source line id => ' || l_source_line_id , 1 ) ;
993: oe_debug_pub.add( 'Selecting unique id for this transaction' , 1 ) ;
994: oe_debug_pub.add( 'Transaction header ID :' || l_lot_set_id, 1 ) ;
995: END IF;
996:
989: l_source_line_id := p_line_rec.line_id; -- Sales Order Line ID
990: l_lot_set_id := p_transaction_header_id;
991: IF l_debug_level > 0 THEN
992: oe_debug_pub.add( 'Source line id => ' || l_source_line_id , 1 ) ;
993: oe_debug_pub.add( 'Selecting unique id for this transaction' , 1 ) ;
994: oe_debug_pub.add( 'Transaction header ID :' || l_lot_set_id, 1 ) ;
995: END IF;
996:
997: IF (p_lot_number is not null) THEN
990: l_lot_set_id := p_transaction_header_id;
991: IF l_debug_level > 0 THEN
992: oe_debug_pub.add( 'Source line id => ' || l_source_line_id , 1 ) ;
993: oe_debug_pub.add( 'Selecting unique id for this transaction' , 1 ) ;
994: oe_debug_pub.add( 'Transaction header ID :' || l_lot_set_id, 1 ) ;
995: END IF;
996:
997: IF (p_lot_number is not null) THEN
998:
998:
999: /* Insert lot transaction interface table */
1000:
1001: IF l_debug_level > 0 THEN
1002: oe_debug_pub.add( 'Inserting lots' ) ;
1003: END IF;
1004: INSERT INTO MTL_TRANSACTION_LOTS_INTERFACE
1005: (
1006: SOURCE_CODE,
1075: and rt.transaction_id = p_transaction_id
1076: and rt.transaction_id = mmt.rcv_transaction_id
1077: and msn.last_txn_source_id = rt.po_header_id);
1078:
1079: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1080: BEGIN
1081:
1082: IF l_debug_level > 0 THEN
1083: oe_debug_pub.add( 'Inserting serial numbers after serial numbers fix' , 1 ) ;
1079: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1080: BEGIN
1081:
1082: IF l_debug_level > 0 THEN
1083: oe_debug_pub.add( 'Inserting serial numbers after serial numbers fix' , 1 ) ;
1084: END IF;
1085:
1086: IF (p_sn_control_code = 2 OR p_sn_control_code = 5) THEN
1087: IF l_debug_level > 0 THEN
1084: END IF;
1085:
1086: IF (p_sn_control_code = 2 OR p_sn_control_code = 5) THEN
1087: IF l_debug_level > 0 THEN
1088: oe_debug_pub.add( 'Serial control code = 2 or 5' , 1 ) ;
1089: END IF;
1090: OPEN get_received_serial_number;
1091: ELSIF (p_sn_control_code = 6) THEN
1092: IF l_debug_level > 0 THEN
1089: END IF;
1090: OPEN get_received_serial_number;
1091: ELSIF (p_sn_control_code = 6) THEN
1092: IF l_debug_level > 0 THEN
1093: oe_debug_pub.add( 'Serial control code = 6' , 1 ) ;
1094: END IF;
1095: END IF;
1096:
1097: serial_counter := 0;
1113: END ;
1114:
1115: IF l_primary_uom <> p_trx_uom THEN
1116: IF l_debug_level > 0 THEN
1117: oe_debug_pub.add('Converting the unit of measurement ' , 1 ) ;
1118: oe_debug_pub.add('Primary UOM:'||l_primary_uom , 1 ) ;
1119: oe_debug_pub.add('Transaction UOM:'||p_trx_uom , 1 ) ;
1120: END IF;
1121: l_converted_qty := OE_ORDER_MISC_UTIL.CONVERT_UOM (
1114:
1115: IF l_primary_uom <> p_trx_uom THEN
1116: IF l_debug_level > 0 THEN
1117: oe_debug_pub.add('Converting the unit of measurement ' , 1 ) ;
1118: oe_debug_pub.add('Primary UOM:'||l_primary_uom , 1 ) ;
1119: oe_debug_pub.add('Transaction UOM:'||p_trx_uom , 1 ) ;
1120: END IF;
1121: l_converted_qty := OE_ORDER_MISC_UTIL.CONVERT_UOM (
1122: p_line_rec.inventory_item_id,
1115: IF l_primary_uom <> p_trx_uom THEN
1116: IF l_debug_level > 0 THEN
1117: oe_debug_pub.add('Converting the unit of measurement ' , 1 ) ;
1118: oe_debug_pub.add('Primary UOM:'||l_primary_uom , 1 ) ;
1119: oe_debug_pub.add('Transaction UOM:'||p_trx_uom , 1 ) ;
1120: END IF;
1121: l_converted_qty := OE_ORDER_MISC_UTIL.CONVERT_UOM (
1122: p_line_rec.inventory_item_id,
1123: p_trx_uom,
1130: while serial_counter < l_converted_qty LOOP
1131:
1132: IF (p_sn_control_code = 6) THEN
1133: IF l_debug_level > 0 THEN
1134: oe_debug_pub.add( 'in for loop s.n control code = 6' , 1 ) ;
1135: END IF;
1136: SELECT to_char(oe_mtl_sn_interface_s.nextval)
1137: INTO v_serial_number_temp
1138: FROM dual ;
1141: ELSE
1142: v_serial_number := v_serial_number_temp;
1143: END IF;
1144: IF l_debug_level > 0 THEN
1145: oe_debug_pub.add( 'Final serial number is ' || V_SERIAL_NUMBER , 1 ) ;
1146: END IF;
1147: ELSIF (p_sn_control_code = 2 OR p_sn_control_code = 5) THEN
1148: IF l_debug_level > 0 THEN
1149: oe_debug_pub.add( 'Logic for s.n control code = 2 or 5 ' , 1 ) ;
1145: oe_debug_pub.add( 'Final serial number is ' || V_SERIAL_NUMBER , 1 ) ;
1146: END IF;
1147: ELSIF (p_sn_control_code = 2 OR p_sn_control_code = 5) THEN
1148: IF l_debug_level > 0 THEN
1149: oe_debug_pub.add( 'Logic for s.n control code = 2 or 5 ' , 1 ) ;
1150: END IF;
1151: FETCH get_received_serial_number INTO v_serial_number;
1152: IF l_debug_level > 0 THEN
1153: oe_debug_pub.add( 'Serial number fetched is => ' || v_serial_number , 1 ) ;
1149: oe_debug_pub.add( 'Logic for s.n control code = 2 or 5 ' , 1 ) ;
1150: END IF;
1151: FETCH get_received_serial_number INTO v_serial_number;
1152: IF l_debug_level > 0 THEN
1153: oe_debug_pub.add( 'Serial number fetched is => ' || v_serial_number , 1 ) ;
1154: END IF;
1155: END IF;
1156:
1157: BEGIN
1156:
1157: BEGIN
1158:
1159: IF l_debug_level > 0 THEN
1160: oe_debug_pub.add( 'Inserting into mtl_serial_numbers_interface table ' , 1 ) ;
1161: END IF;
1162:
1163: insert into mtl_serial_numbers_interface
1164: (transaction_interface_id,
1204:
1205: EXCEPTION
1206: WHEN OTHERS THEN
1207: IF l_debug_level > 0 THEN
1208: oe_debug_pub.add( 'Failed inserting into mtl_serial_numbers_interface' , 1 ) ;
1209: END IF;
1210: -- bug 5357879
1211: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1212: ROLLBACK TO DECREMENT_INV;
1230: and nvl(current_locator_id,0) = nvl(p_locator_id,0)
1231: and serial_number = v_serial_number;
1232:
1233: IF l_debug_level > 0 THEN
1234: oe_debug_pub.add( 'Serial number updated is :' || v_serial_number , 1 ) ;
1235: END IF;
1236: EXCEPTION
1237: WHEN OTHERS THEN
1238: IF l_debug_level > 0 THEN
1235: END IF;
1236: EXCEPTION
1237: WHEN OTHERS THEN
1238: IF l_debug_level > 0 THEN
1239: oe_debug_pub.add( 'Updating serial numbers failed '||sqlerrm , 1 ) ;
1240: END IF;
1241:
1242: -- bug 5357879
1243: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1257: p_sn_control_code = 5 OR
1258: p_sn_control_code = 6)
1259: THEN
1260: IF l_debug_level > 0 THEN
1261: oe_debug_pub.add( 'This is serial+lot controlled item' , 1 ) ;
1262: END IF;
1263:
1264: BEGIN
1265:
1269:
1270: EXCEPTION
1271: WHEN OTHERS THEN
1272: IF l_debug_level > 0 THEN
1273: oe_debug_pub.add( 'Updating serial_transaction_temp_id failed '||sqlerrm , 1 ) ;
1274: END IF;
1275:
1276: -- bug 5357879
1277: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1290: l_transaction_interface_id := l_lot_set_id;
1291: end if;
1292:
1293: IF l_debug_level > 0 THEN
1294: oe_debug_pub.add( 'Populating transaction_interface_id in mti as '||L_TRANSACTION_INTERFACE_ID , 1 ) ;
1295: END IF;
1296:
1297: BEGIN
1298: SELECT RT.TRANSACTION_DATE
1322: l_transaction_date := sysdate;
1323: END; */
1324:
1325: IF l_debug_level > 0 THEN
1326: oe_debug_pub.add('Inserting header record' ) ;
1327: oe_debug_pub.add('Source_code : ' || fnd_profile.value ( 'ont_source_code' ) , 1 ) ;
1328: oe_debug_pub.add('Source_line_id : ' || l_source_line_id , 1 ) ;
1329: oe_debug_pub.add('Source_header_id : ' || l_transaction_reference , 1 ) ;
1330: oe_debug_pub.add('Process_flag : ' || 1 , 1 ) ;
1323: END; */
1324:
1325: IF l_debug_level > 0 THEN
1326: oe_debug_pub.add('Inserting header record' ) ;
1327: oe_debug_pub.add('Source_code : ' || fnd_profile.value ( 'ont_source_code' ) , 1 ) ;
1328: oe_debug_pub.add('Source_line_id : ' || l_source_line_id , 1 ) ;
1329: oe_debug_pub.add('Source_header_id : ' || l_transaction_reference , 1 ) ;
1330: oe_debug_pub.add('Process_flag : ' || 1 , 1 ) ;
1331: oe_debug_pub.add('Transaction_mode : ' || 1 , 1 ) ;
1324:
1325: IF l_debug_level > 0 THEN
1326: oe_debug_pub.add('Inserting header record' ) ;
1327: oe_debug_pub.add('Source_code : ' || fnd_profile.value ( 'ont_source_code' ) , 1 ) ;
1328: oe_debug_pub.add('Source_line_id : ' || l_source_line_id , 1 ) ;
1329: oe_debug_pub.add('Source_header_id : ' || l_transaction_reference , 1 ) ;
1330: oe_debug_pub.add('Process_flag : ' || 1 , 1 ) ;
1331: oe_debug_pub.add('Transaction_mode : ' || 1 , 1 ) ;
1332: oe_debug_pub.add('Lock_flag : ' || 2 , 1 ) ;
1325: IF l_debug_level > 0 THEN
1326: oe_debug_pub.add('Inserting header record' ) ;
1327: oe_debug_pub.add('Source_code : ' || fnd_profile.value ( 'ont_source_code' ) , 1 ) ;
1328: oe_debug_pub.add('Source_line_id : ' || l_source_line_id , 1 ) ;
1329: oe_debug_pub.add('Source_header_id : ' || l_transaction_reference , 1 ) ;
1330: oe_debug_pub.add('Process_flag : ' || 1 , 1 ) ;
1331: oe_debug_pub.add('Transaction_mode : ' || 1 , 1 ) ;
1332: oe_debug_pub.add('Lock_flag : ' || 2 , 1 ) ;
1333: oe_debug_pub.add('Transaction_header_id : ' || l_transaction_header_id , 1 ) ;
1326: oe_debug_pub.add('Inserting header record' ) ;
1327: oe_debug_pub.add('Source_code : ' || fnd_profile.value ( 'ont_source_code' ) , 1 ) ;
1328: oe_debug_pub.add('Source_line_id : ' || l_source_line_id , 1 ) ;
1329: oe_debug_pub.add('Source_header_id : ' || l_transaction_reference , 1 ) ;
1330: oe_debug_pub.add('Process_flag : ' || 1 , 1 ) ;
1331: oe_debug_pub.add('Transaction_mode : ' || 1 , 1 ) ;
1332: oe_debug_pub.add('Lock_flag : ' || 2 , 1 ) ;
1333: oe_debug_pub.add('Transaction_header_id : ' || l_transaction_header_id , 1 ) ;
1334: oe_debug_pub.add('Inventory_item_id : ' || p_inventory_item_id , 1 ) ;
1327: oe_debug_pub.add('Source_code : ' || fnd_profile.value ( 'ont_source_code' ) , 1 ) ;
1328: oe_debug_pub.add('Source_line_id : ' || l_source_line_id , 1 ) ;
1329: oe_debug_pub.add('Source_header_id : ' || l_transaction_reference , 1 ) ;
1330: oe_debug_pub.add('Process_flag : ' || 1 , 1 ) ;
1331: oe_debug_pub.add('Transaction_mode : ' || 1 , 1 ) ;
1332: oe_debug_pub.add('Lock_flag : ' || 2 , 1 ) ;
1333: oe_debug_pub.add('Transaction_header_id : ' || l_transaction_header_id , 1 ) ;
1334: oe_debug_pub.add('Inventory_item_id : ' || p_inventory_item_id , 1 ) ;
1335: oe_debug_pub.add('Subinventory_code : ' || p_secondary_inventory , 1 ) ;
1328: oe_debug_pub.add('Source_line_id : ' || l_source_line_id , 1 ) ;
1329: oe_debug_pub.add('Source_header_id : ' || l_transaction_reference , 1 ) ;
1330: oe_debug_pub.add('Process_flag : ' || 1 , 1 ) ;
1331: oe_debug_pub.add('Transaction_mode : ' || 1 , 1 ) ;
1332: oe_debug_pub.add('Lock_flag : ' || 2 , 1 ) ;
1333: oe_debug_pub.add('Transaction_header_id : ' || l_transaction_header_id , 1 ) ;
1334: oe_debug_pub.add('Inventory_item_id : ' || p_inventory_item_id , 1 ) ;
1335: oe_debug_pub.add('Subinventory_code : ' || p_secondary_inventory , 1 ) ;
1336: oe_debug_pub.add('Transaction_quantity : ' || ( -1 * p_transaction_detail_qty ) , 1 ) ;
1329: oe_debug_pub.add('Source_header_id : ' || l_transaction_reference , 1 ) ;
1330: oe_debug_pub.add('Process_flag : ' || 1 , 1 ) ;
1331: oe_debug_pub.add('Transaction_mode : ' || 1 , 1 ) ;
1332: oe_debug_pub.add('Lock_flag : ' || 2 , 1 ) ;
1333: oe_debug_pub.add('Transaction_header_id : ' || l_transaction_header_id , 1 ) ;
1334: oe_debug_pub.add('Inventory_item_id : ' || p_inventory_item_id , 1 ) ;
1335: oe_debug_pub.add('Subinventory_code : ' || p_secondary_inventory , 1 ) ;
1336: oe_debug_pub.add('Transaction_quantity : ' || ( -1 * p_transaction_detail_qty ) , 1 ) ;
1337: oe_debug_pub.add('Transaction_quantity2 : ' || ( -1 * p_trans_qty2 ) , 1 ) ; -- INVCONV
1330: oe_debug_pub.add('Process_flag : ' || 1 , 1 ) ;
1331: oe_debug_pub.add('Transaction_mode : ' || 1 , 1 ) ;
1332: oe_debug_pub.add('Lock_flag : ' || 2 , 1 ) ;
1333: oe_debug_pub.add('Transaction_header_id : ' || l_transaction_header_id , 1 ) ;
1334: oe_debug_pub.add('Inventory_item_id : ' || p_inventory_item_id , 1 ) ;
1335: oe_debug_pub.add('Subinventory_code : ' || p_secondary_inventory , 1 ) ;
1336: oe_debug_pub.add('Transaction_quantity : ' || ( -1 * p_transaction_detail_qty ) , 1 ) ;
1337: oe_debug_pub.add('Transaction_quantity2 : ' || ( -1 * p_trans_qty2 ) , 1 ) ; -- INVCONV
1338: oe_debug_pub.add('Transaction_date : ' || l_transaction_date , 1 ) ;
1331: oe_debug_pub.add('Transaction_mode : ' || 1 , 1 ) ;
1332: oe_debug_pub.add('Lock_flag : ' || 2 , 1 ) ;
1333: oe_debug_pub.add('Transaction_header_id : ' || l_transaction_header_id , 1 ) ;
1334: oe_debug_pub.add('Inventory_item_id : ' || p_inventory_item_id , 1 ) ;
1335: oe_debug_pub.add('Subinventory_code : ' || p_secondary_inventory , 1 ) ;
1336: oe_debug_pub.add('Transaction_quantity : ' || ( -1 * p_transaction_detail_qty ) , 1 ) ;
1337: oe_debug_pub.add('Transaction_quantity2 : ' || ( -1 * p_trans_qty2 ) , 1 ) ; -- INVCONV
1338: oe_debug_pub.add('Transaction_date : ' || l_transaction_date , 1 ) ;
1339: oe_debug_pub.add('Organization_id : ' || p_warehouse_id , 1 ) ;
1332: oe_debug_pub.add('Lock_flag : ' || 2 , 1 ) ;
1333: oe_debug_pub.add('Transaction_header_id : ' || l_transaction_header_id , 1 ) ;
1334: oe_debug_pub.add('Inventory_item_id : ' || p_inventory_item_id , 1 ) ;
1335: oe_debug_pub.add('Subinventory_code : ' || p_secondary_inventory , 1 ) ;
1336: oe_debug_pub.add('Transaction_quantity : ' || ( -1 * p_transaction_detail_qty ) , 1 ) ;
1337: oe_debug_pub.add('Transaction_quantity2 : ' || ( -1 * p_trans_qty2 ) , 1 ) ; -- INVCONV
1338: oe_debug_pub.add('Transaction_date : ' || l_transaction_date , 1 ) ;
1339: oe_debug_pub.add('Organization_id : ' || p_warehouse_id , 1 ) ;
1340: oe_debug_pub.add('Transfer_lpn_id : ' || p_transfer_lpn_id,1) ; -- 3544019
1333: oe_debug_pub.add('Transaction_header_id : ' || l_transaction_header_id , 1 ) ;
1334: oe_debug_pub.add('Inventory_item_id : ' || p_inventory_item_id , 1 ) ;
1335: oe_debug_pub.add('Subinventory_code : ' || p_secondary_inventory , 1 ) ;
1336: oe_debug_pub.add('Transaction_quantity : ' || ( -1 * p_transaction_detail_qty ) , 1 ) ;
1337: oe_debug_pub.add('Transaction_quantity2 : ' || ( -1 * p_trans_qty2 ) , 1 ) ; -- INVCONV
1338: oe_debug_pub.add('Transaction_date : ' || l_transaction_date , 1 ) ;
1339: oe_debug_pub.add('Organization_id : ' || p_warehouse_id , 1 ) ;
1340: oe_debug_pub.add('Transfer_lpn_id : ' || p_transfer_lpn_id,1) ; -- 3544019
1341: oe_debug_pub.add('Acct_period_id : ' || null , 1 ) ;
1334: oe_debug_pub.add('Inventory_item_id : ' || p_inventory_item_id , 1 ) ;
1335: oe_debug_pub.add('Subinventory_code : ' || p_secondary_inventory , 1 ) ;
1336: oe_debug_pub.add('Transaction_quantity : ' || ( -1 * p_transaction_detail_qty ) , 1 ) ;
1337: oe_debug_pub.add('Transaction_quantity2 : ' || ( -1 * p_trans_qty2 ) , 1 ) ; -- INVCONV
1338: oe_debug_pub.add('Transaction_date : ' || l_transaction_date , 1 ) ;
1339: oe_debug_pub.add('Organization_id : ' || p_warehouse_id , 1 ) ;
1340: oe_debug_pub.add('Transfer_lpn_id : ' || p_transfer_lpn_id,1) ; -- 3544019
1341: oe_debug_pub.add('Acct_period_id : ' || null , 1 ) ;
1342: oe_debug_pub.add('Last_update_date : ' || sysdate , 1 ) ;
1335: oe_debug_pub.add('Subinventory_code : ' || p_secondary_inventory , 1 ) ;
1336: oe_debug_pub.add('Transaction_quantity : ' || ( -1 * p_transaction_detail_qty ) , 1 ) ;
1337: oe_debug_pub.add('Transaction_quantity2 : ' || ( -1 * p_trans_qty2 ) , 1 ) ; -- INVCONV
1338: oe_debug_pub.add('Transaction_date : ' || l_transaction_date , 1 ) ;
1339: oe_debug_pub.add('Organization_id : ' || p_warehouse_id , 1 ) ;
1340: oe_debug_pub.add('Transfer_lpn_id : ' || p_transfer_lpn_id,1) ; -- 3544019
1341: oe_debug_pub.add('Acct_period_id : ' || null , 1 ) ;
1342: oe_debug_pub.add('Last_update_date : ' || sysdate , 1 ) ;
1343: oe_debug_pub.add('Last_updated_by : ' || fnd_global.user_id , 1 ) ;
1336: oe_debug_pub.add('Transaction_quantity : ' || ( -1 * p_transaction_detail_qty ) , 1 ) ;
1337: oe_debug_pub.add('Transaction_quantity2 : ' || ( -1 * p_trans_qty2 ) , 1 ) ; -- INVCONV
1338: oe_debug_pub.add('Transaction_date : ' || l_transaction_date , 1 ) ;
1339: oe_debug_pub.add('Organization_id : ' || p_warehouse_id , 1 ) ;
1340: oe_debug_pub.add('Transfer_lpn_id : ' || p_transfer_lpn_id,1) ; -- 3544019
1341: oe_debug_pub.add('Acct_period_id : ' || null , 1 ) ;
1342: oe_debug_pub.add('Last_update_date : ' || sysdate , 1 ) ;
1343: oe_debug_pub.add('Last_updated_by : ' || fnd_global.user_id , 1 ) ;
1344: oe_debug_pub.add('Creation_date : ' || sysdate , 1 ) ;
1337: oe_debug_pub.add('Transaction_quantity2 : ' || ( -1 * p_trans_qty2 ) , 1 ) ; -- INVCONV
1338: oe_debug_pub.add('Transaction_date : ' || l_transaction_date , 1 ) ;
1339: oe_debug_pub.add('Organization_id : ' || p_warehouse_id , 1 ) ;
1340: oe_debug_pub.add('Transfer_lpn_id : ' || p_transfer_lpn_id,1) ; -- 3544019
1341: oe_debug_pub.add('Acct_period_id : ' || null , 1 ) ;
1342: oe_debug_pub.add('Last_update_date : ' || sysdate , 1 ) ;
1343: oe_debug_pub.add('Last_updated_by : ' || fnd_global.user_id , 1 ) ;
1344: oe_debug_pub.add('Creation_date : ' || sysdate , 1 ) ;
1345: oe_debug_pub.add('Created_by : ' || fnd_global.user_id , 1 ) ;
1338: oe_debug_pub.add('Transaction_date : ' || l_transaction_date , 1 ) ;
1339: oe_debug_pub.add('Organization_id : ' || p_warehouse_id , 1 ) ;
1340: oe_debug_pub.add('Transfer_lpn_id : ' || p_transfer_lpn_id,1) ; -- 3544019
1341: oe_debug_pub.add('Acct_period_id : ' || null , 1 ) ;
1342: oe_debug_pub.add('Last_update_date : ' || sysdate , 1 ) ;
1343: oe_debug_pub.add('Last_updated_by : ' || fnd_global.user_id , 1 ) ;
1344: oe_debug_pub.add('Creation_date : ' || sysdate , 1 ) ;
1345: oe_debug_pub.add('Created_by : ' || fnd_global.user_id , 1 ) ;
1346: oe_debug_pub.add('Transaction_source_id : ' || l_transaction_source_id , 1 ) ;
1339: oe_debug_pub.add('Organization_id : ' || p_warehouse_id , 1 ) ;
1340: oe_debug_pub.add('Transfer_lpn_id : ' || p_transfer_lpn_id,1) ; -- 3544019
1341: oe_debug_pub.add('Acct_period_id : ' || null , 1 ) ;
1342: oe_debug_pub.add('Last_update_date : ' || sysdate , 1 ) ;
1343: oe_debug_pub.add('Last_updated_by : ' || fnd_global.user_id , 1 ) ;
1344: oe_debug_pub.add('Creation_date : ' || sysdate , 1 ) ;
1345: oe_debug_pub.add('Created_by : ' || fnd_global.user_id , 1 ) ;
1346: oe_debug_pub.add('Transaction_source_id : ' || l_transaction_source_id , 1 ) ;
1347: -- oe_debug_pub.add('Dsp_segment1 : ' || l_order_number , 1 ) ; bug 4456817
1340: oe_debug_pub.add('Transfer_lpn_id : ' || p_transfer_lpn_id,1) ; -- 3544019
1341: oe_debug_pub.add('Acct_period_id : ' || null , 1 ) ;
1342: oe_debug_pub.add('Last_update_date : ' || sysdate , 1 ) ;
1343: oe_debug_pub.add('Last_updated_by : ' || fnd_global.user_id , 1 ) ;
1344: oe_debug_pub.add('Creation_date : ' || sysdate , 1 ) ;
1345: oe_debug_pub.add('Created_by : ' || fnd_global.user_id , 1 ) ;
1346: oe_debug_pub.add('Transaction_source_id : ' || l_transaction_source_id , 1 ) ;
1347: -- oe_debug_pub.add('Dsp_segment1 : ' || l_order_number , 1 ) ; bug 4456817
1348: -- oe_debug_pub.add('Dsp_segment2 : ' || l_order_type_name , 1 ) ;
1341: oe_debug_pub.add('Acct_period_id : ' || null , 1 ) ;
1342: oe_debug_pub.add('Last_update_date : ' || sysdate , 1 ) ;
1343: oe_debug_pub.add('Last_updated_by : ' || fnd_global.user_id , 1 ) ;
1344: oe_debug_pub.add('Creation_date : ' || sysdate , 1 ) ;
1345: oe_debug_pub.add('Created_by : ' || fnd_global.user_id , 1 ) ;
1346: oe_debug_pub.add('Transaction_source_id : ' || l_transaction_source_id , 1 ) ;
1347: -- oe_debug_pub.add('Dsp_segment1 : ' || l_order_number , 1 ) ; bug 4456817
1348: -- oe_debug_pub.add('Dsp_segment2 : ' || l_order_type_name , 1 ) ;
1349: -- oe_debug_pub.add('Dsp_segment3 : ' || fnd_profile.value ( 'ont_source_code' ) , 1 ) ;
1342: oe_debug_pub.add('Last_update_date : ' || sysdate , 1 ) ;
1343: oe_debug_pub.add('Last_updated_by : ' || fnd_global.user_id , 1 ) ;
1344: oe_debug_pub.add('Creation_date : ' || sysdate , 1 ) ;
1345: oe_debug_pub.add('Created_by : ' || fnd_global.user_id , 1 ) ;
1346: oe_debug_pub.add('Transaction_source_id : ' || l_transaction_source_id , 1 ) ;
1347: -- oe_debug_pub.add('Dsp_segment1 : ' || l_order_number , 1 ) ; bug 4456817
1348: -- oe_debug_pub.add('Dsp_segment2 : ' || l_order_type_name , 1 ) ;
1349: -- oe_debug_pub.add('Dsp_segment3 : ' || fnd_profile.value ( 'ont_source_code' ) , 1 ) ;
1350: oe_debug_pub.add('Transaction_source_type_id : ' || l_trx_source_type_id , 1 ) ;
1343: oe_debug_pub.add('Last_updated_by : ' || fnd_global.user_id , 1 ) ;
1344: oe_debug_pub.add('Creation_date : ' || sysdate , 1 ) ;
1345: oe_debug_pub.add('Created_by : ' || fnd_global.user_id , 1 ) ;
1346: oe_debug_pub.add('Transaction_source_id : ' || l_transaction_source_id , 1 ) ;
1347: -- oe_debug_pub.add('Dsp_segment1 : ' || l_order_number , 1 ) ; bug 4456817
1348: -- oe_debug_pub.add('Dsp_segment2 : ' || l_order_type_name , 1 ) ;
1349: -- oe_debug_pub.add('Dsp_segment3 : ' || fnd_profile.value ( 'ont_source_code' ) , 1 ) ;
1350: oe_debug_pub.add('Transaction_source_type_id : ' || l_trx_source_type_id , 1 ) ;
1351: oe_debug_pub.add('Transaction_action_id : ' || l_trx_action_id , 1 ) ;
1344: oe_debug_pub.add('Creation_date : ' || sysdate , 1 ) ;
1345: oe_debug_pub.add('Created_by : ' || fnd_global.user_id , 1 ) ;
1346: oe_debug_pub.add('Transaction_source_id : ' || l_transaction_source_id , 1 ) ;
1347: -- oe_debug_pub.add('Dsp_segment1 : ' || l_order_number , 1 ) ; bug 4456817
1348: -- oe_debug_pub.add('Dsp_segment2 : ' || l_order_type_name , 1 ) ;
1349: -- oe_debug_pub.add('Dsp_segment3 : ' || fnd_profile.value ( 'ont_source_code' ) , 1 ) ;
1350: oe_debug_pub.add('Transaction_source_type_id : ' || l_trx_source_type_id , 1 ) ;
1351: oe_debug_pub.add('Transaction_action_id : ' || l_trx_action_id , 1 ) ;
1352: oe_debug_pub.add('Transaction_type_id : ' || l_trx_type_code , 1 ) ;
1345: oe_debug_pub.add('Created_by : ' || fnd_global.user_id , 1 ) ;
1346: oe_debug_pub.add('Transaction_source_id : ' || l_transaction_source_id , 1 ) ;
1347: -- oe_debug_pub.add('Dsp_segment1 : ' || l_order_number , 1 ) ; bug 4456817
1348: -- oe_debug_pub.add('Dsp_segment2 : ' || l_order_type_name , 1 ) ;
1349: -- oe_debug_pub.add('Dsp_segment3 : ' || fnd_profile.value ( 'ont_source_code' ) , 1 ) ;
1350: oe_debug_pub.add('Transaction_source_type_id : ' || l_trx_source_type_id , 1 ) ;
1351: oe_debug_pub.add('Transaction_action_id : ' || l_trx_action_id , 1 ) ;
1352: oe_debug_pub.add('Transaction_type_id : ' || l_trx_type_code , 1 ) ;
1353: oe_debug_pub.add('Distribution_account_id : ' || l_trans_acc , 1 ) ;
1346: oe_debug_pub.add('Transaction_source_id : ' || l_transaction_source_id , 1 ) ;
1347: -- oe_debug_pub.add('Dsp_segment1 : ' || l_order_number , 1 ) ; bug 4456817
1348: -- oe_debug_pub.add('Dsp_segment2 : ' || l_order_type_name , 1 ) ;
1349: -- oe_debug_pub.add('Dsp_segment3 : ' || fnd_profile.value ( 'ont_source_code' ) , 1 ) ;
1350: oe_debug_pub.add('Transaction_source_type_id : ' || l_trx_source_type_id , 1 ) ;
1351: oe_debug_pub.add('Transaction_action_id : ' || l_trx_action_id , 1 ) ;
1352: oe_debug_pub.add('Transaction_type_id : ' || l_trx_type_code , 1 ) ;
1353: oe_debug_pub.add('Distribution_account_id : ' || l_trans_acc , 1 ) ;
1354: oe_debug_pub.add('Transaction_reference : ' || l_transaction_reference , 1 ) ;
1347: -- oe_debug_pub.add('Dsp_segment1 : ' || l_order_number , 1 ) ; bug 4456817
1348: -- oe_debug_pub.add('Dsp_segment2 : ' || l_order_type_name , 1 ) ;
1349: -- oe_debug_pub.add('Dsp_segment3 : ' || fnd_profile.value ( 'ont_source_code' ) , 1 ) ;
1350: oe_debug_pub.add('Transaction_source_type_id : ' || l_trx_source_type_id , 1 ) ;
1351: oe_debug_pub.add('Transaction_action_id : ' || l_trx_action_id , 1 ) ;
1352: oe_debug_pub.add('Transaction_type_id : ' || l_trx_type_code , 1 ) ;
1353: oe_debug_pub.add('Distribution_account_id : ' || l_trans_acc , 1 ) ;
1354: oe_debug_pub.add('Transaction_reference : ' || l_transaction_reference , 1 ) ;
1355: oe_debug_pub.add('Trx_source_line_id : ' || l_line_id , 1 ) ;
1348: -- oe_debug_pub.add('Dsp_segment2 : ' || l_order_type_name , 1 ) ;
1349: -- oe_debug_pub.add('Dsp_segment3 : ' || fnd_profile.value ( 'ont_source_code' ) , 1 ) ;
1350: oe_debug_pub.add('Transaction_source_type_id : ' || l_trx_source_type_id , 1 ) ;
1351: oe_debug_pub.add('Transaction_action_id : ' || l_trx_action_id , 1 ) ;
1352: oe_debug_pub.add('Transaction_type_id : ' || l_trx_type_code , 1 ) ;
1353: oe_debug_pub.add('Distribution_account_id : ' || l_trans_acc , 1 ) ;
1354: oe_debug_pub.add('Transaction_reference : ' || l_transaction_reference , 1 ) ;
1355: oe_debug_pub.add('Trx_source_line_id : ' || l_line_id , 1 ) ;
1356: oe_debug_pub.add('Trx_source_delivery_id : ' || l_delivery , 1 ) ;
1349: -- oe_debug_pub.add('Dsp_segment3 : ' || fnd_profile.value ( 'ont_source_code' ) , 1 ) ;
1350: oe_debug_pub.add('Transaction_source_type_id : ' || l_trx_source_type_id , 1 ) ;
1351: oe_debug_pub.add('Transaction_action_id : ' || l_trx_action_id , 1 ) ;
1352: oe_debug_pub.add('Transaction_type_id : ' || l_trx_type_code , 1 ) ;
1353: oe_debug_pub.add('Distribution_account_id : ' || l_trans_acc , 1 ) ;
1354: oe_debug_pub.add('Transaction_reference : ' || l_transaction_reference , 1 ) ;
1355: oe_debug_pub.add('Trx_source_line_id : ' || l_line_id , 1 ) ;
1356: oe_debug_pub.add('Trx_source_delivery_id : ' || l_delivery , 1 ) ;
1357: oe_debug_pub.add('Revision : ' || p_revision , 1 ) ;
1350: oe_debug_pub.add('Transaction_source_type_id : ' || l_trx_source_type_id , 1 ) ;
1351: oe_debug_pub.add('Transaction_action_id : ' || l_trx_action_id , 1 ) ;
1352: oe_debug_pub.add('Transaction_type_id : ' || l_trx_type_code , 1 ) ;
1353: oe_debug_pub.add('Distribution_account_id : ' || l_trans_acc , 1 ) ;
1354: oe_debug_pub.add('Transaction_reference : ' || l_transaction_reference , 1 ) ;
1355: oe_debug_pub.add('Trx_source_line_id : ' || l_line_id , 1 ) ;
1356: oe_debug_pub.add('Trx_source_delivery_id : ' || l_delivery , 1 ) ;
1357: oe_debug_pub.add('Revision : ' || p_revision , 1 ) ;
1358: oe_debug_pub.add('Locator_id : ' || p_locator_id , 1 ) ;
1351: oe_debug_pub.add('Transaction_action_id : ' || l_trx_action_id , 1 ) ;
1352: oe_debug_pub.add('Transaction_type_id : ' || l_trx_type_code , 1 ) ;
1353: oe_debug_pub.add('Distribution_account_id : ' || l_trans_acc , 1 ) ;
1354: oe_debug_pub.add('Transaction_reference : ' || l_transaction_reference , 1 ) ;
1355: oe_debug_pub.add('Trx_source_line_id : ' || l_line_id , 1 ) ;
1356: oe_debug_pub.add('Trx_source_delivery_id : ' || l_delivery , 1 ) ;
1357: oe_debug_pub.add('Revision : ' || p_revision , 1 ) ;
1358: oe_debug_pub.add('Locator_id : ' || p_locator_id , 1 ) ;
1359: oe_debug_pub.add('Loc_segment1 : ' || null , 1 ) ;
1352: oe_debug_pub.add('Transaction_type_id : ' || l_trx_type_code , 1 ) ;
1353: oe_debug_pub.add('Distribution_account_id : ' || l_trans_acc , 1 ) ;
1354: oe_debug_pub.add('Transaction_reference : ' || l_transaction_reference , 1 ) ;
1355: oe_debug_pub.add('Trx_source_line_id : ' || l_line_id , 1 ) ;
1356: oe_debug_pub.add('Trx_source_delivery_id : ' || l_delivery , 1 ) ;
1357: oe_debug_pub.add('Revision : ' || p_revision , 1 ) ;
1358: oe_debug_pub.add('Locator_id : ' || p_locator_id , 1 ) ;
1359: oe_debug_pub.add('Loc_segment1 : ' || null , 1 ) ;
1360: oe_debug_pub.add('Loc_segment2 : ' || null , 1 ) ;
1353: oe_debug_pub.add('Distribution_account_id : ' || l_trans_acc , 1 ) ;
1354: oe_debug_pub.add('Transaction_reference : ' || l_transaction_reference , 1 ) ;
1355: oe_debug_pub.add('Trx_source_line_id : ' || l_line_id , 1 ) ;
1356: oe_debug_pub.add('Trx_source_delivery_id : ' || l_delivery , 1 ) ;
1357: oe_debug_pub.add('Revision : ' || p_revision , 1 ) ;
1358: oe_debug_pub.add('Locator_id : ' || p_locator_id , 1 ) ;
1359: oe_debug_pub.add('Loc_segment1 : ' || null , 1 ) ;
1360: oe_debug_pub.add('Loc_segment2 : ' || null , 1 ) ;
1361: oe_debug_pub.add('Loc_segment3 : ' || null , 1 ) ;
1354: oe_debug_pub.add('Transaction_reference : ' || l_transaction_reference , 1 ) ;
1355: oe_debug_pub.add('Trx_source_line_id : ' || l_line_id , 1 ) ;
1356: oe_debug_pub.add('Trx_source_delivery_id : ' || l_delivery , 1 ) ;
1357: oe_debug_pub.add('Revision : ' || p_revision , 1 ) ;
1358: oe_debug_pub.add('Locator_id : ' || p_locator_id , 1 ) ;
1359: oe_debug_pub.add('Loc_segment1 : ' || null , 1 ) ;
1360: oe_debug_pub.add('Loc_segment2 : ' || null , 1 ) ;
1361: oe_debug_pub.add('Loc_segment3 : ' || null , 1 ) ;
1362: oe_debug_pub.add('Loc_segment4 : ' || null , 1 ) ;
1355: oe_debug_pub.add('Trx_source_line_id : ' || l_line_id , 1 ) ;
1356: oe_debug_pub.add('Trx_source_delivery_id : ' || l_delivery , 1 ) ;
1357: oe_debug_pub.add('Revision : ' || p_revision , 1 ) ;
1358: oe_debug_pub.add('Locator_id : ' || p_locator_id , 1 ) ;
1359: oe_debug_pub.add('Loc_segment1 : ' || null , 1 ) ;
1360: oe_debug_pub.add('Loc_segment2 : ' || null , 1 ) ;
1361: oe_debug_pub.add('Loc_segment3 : ' || null , 1 ) ;
1362: oe_debug_pub.add('Loc_segment4 : ' || null , 1 ) ;
1363: oe_debug_pub.add('Required_flag : ' || null , 1 ) ;
1356: oe_debug_pub.add('Trx_source_delivery_id : ' || l_delivery , 1 ) ;
1357: oe_debug_pub.add('Revision : ' || p_revision , 1 ) ;
1358: oe_debug_pub.add('Locator_id : ' || p_locator_id , 1 ) ;
1359: oe_debug_pub.add('Loc_segment1 : ' || null , 1 ) ;
1360: oe_debug_pub.add('Loc_segment2 : ' || null , 1 ) ;
1361: oe_debug_pub.add('Loc_segment3 : ' || null , 1 ) ;
1362: oe_debug_pub.add('Loc_segment4 : ' || null , 1 ) ;
1363: oe_debug_pub.add('Required_flag : ' || null , 1 ) ;
1364: oe_debug_pub.add('Picking_line_id : ' || l_shipment_line_id , 1 ) ;
1357: oe_debug_pub.add('Revision : ' || p_revision , 1 ) ;
1358: oe_debug_pub.add('Locator_id : ' || p_locator_id , 1 ) ;
1359: oe_debug_pub.add('Loc_segment1 : ' || null , 1 ) ;
1360: oe_debug_pub.add('Loc_segment2 : ' || null , 1 ) ;
1361: oe_debug_pub.add('Loc_segment3 : ' || null , 1 ) ;
1362: oe_debug_pub.add('Loc_segment4 : ' || null , 1 ) ;
1363: oe_debug_pub.add('Required_flag : ' || null , 1 ) ;
1364: oe_debug_pub.add('Picking_line_id : ' || l_shipment_line_id , 1 ) ;
1365: oe_debug_pub.add('Transfer_subinventory : ' || l_dest_subinv , 1 ) ;
1358: oe_debug_pub.add('Locator_id : ' || p_locator_id , 1 ) ;
1359: oe_debug_pub.add('Loc_segment1 : ' || null , 1 ) ;
1360: oe_debug_pub.add('Loc_segment2 : ' || null , 1 ) ;
1361: oe_debug_pub.add('Loc_segment3 : ' || null , 1 ) ;
1362: oe_debug_pub.add('Loc_segment4 : ' || null , 1 ) ;
1363: oe_debug_pub.add('Required_flag : ' || null , 1 ) ;
1364: oe_debug_pub.add('Picking_line_id : ' || l_shipment_line_id , 1 ) ;
1365: oe_debug_pub.add('Transfer_subinventory : ' || l_dest_subinv , 1 ) ;
1366: oe_debug_pub.add('Transfer_organization : ' || l_to_org_id , 1 ) ;
1359: oe_debug_pub.add('Loc_segment1 : ' || null , 1 ) ;
1360: oe_debug_pub.add('Loc_segment2 : ' || null , 1 ) ;
1361: oe_debug_pub.add('Loc_segment3 : ' || null , 1 ) ;
1362: oe_debug_pub.add('Loc_segment4 : ' || null , 1 ) ;
1363: oe_debug_pub.add('Required_flag : ' || null , 1 ) ;
1364: oe_debug_pub.add('Picking_line_id : ' || l_shipment_line_id , 1 ) ;
1365: oe_debug_pub.add('Transfer_subinventory : ' || l_dest_subinv , 1 ) ;
1366: oe_debug_pub.add('Transfer_organization : ' || l_to_org_id , 1 ) ;
1367: oe_debug_pub.add('Ship_to_location_id : ' || l_location_id , 1 ) ;
1360: oe_debug_pub.add('Loc_segment2 : ' || null , 1 ) ;
1361: oe_debug_pub.add('Loc_segment3 : ' || null , 1 ) ;
1362: oe_debug_pub.add('Loc_segment4 : ' || null , 1 ) ;
1363: oe_debug_pub.add('Required_flag : ' || null , 1 ) ;
1364: oe_debug_pub.add('Picking_line_id : ' || l_shipment_line_id , 1 ) ;
1365: oe_debug_pub.add('Transfer_subinventory : ' || l_dest_subinv , 1 ) ;
1366: oe_debug_pub.add('Transfer_organization : ' || l_to_org_id , 1 ) ;
1367: oe_debug_pub.add('Ship_to_location_id : ' || l_location_id , 1 ) ;
1368: oe_debug_pub.add('Requisition_line_id : ' || l_req_line_id , 1 ) ;
1361: oe_debug_pub.add('Loc_segment3 : ' || null , 1 ) ;
1362: oe_debug_pub.add('Loc_segment4 : ' || null , 1 ) ;
1363: oe_debug_pub.add('Required_flag : ' || null , 1 ) ;
1364: oe_debug_pub.add('Picking_line_id : ' || l_shipment_line_id , 1 ) ;
1365: oe_debug_pub.add('Transfer_subinventory : ' || l_dest_subinv , 1 ) ;
1366: oe_debug_pub.add('Transfer_organization : ' || l_to_org_id , 1 ) ;
1367: oe_debug_pub.add('Ship_to_location_id : ' || l_location_id , 1 ) ;
1368: oe_debug_pub.add('Requisition_line_id : ' || l_req_line_id , 1 ) ;
1369: oe_debug_pub.add('Transaction_uom : ' || p_trx_uom , 1 ) ;
1362: oe_debug_pub.add('Loc_segment4 : ' || null , 1 ) ;
1363: oe_debug_pub.add('Required_flag : ' || null , 1 ) ;
1364: oe_debug_pub.add('Picking_line_id : ' || l_shipment_line_id , 1 ) ;
1365: oe_debug_pub.add('Transfer_subinventory : ' || l_dest_subinv , 1 ) ;
1366: oe_debug_pub.add('Transfer_organization : ' || l_to_org_id , 1 ) ;
1367: oe_debug_pub.add('Ship_to_location_id : ' || l_location_id , 1 ) ;
1368: oe_debug_pub.add('Requisition_line_id : ' || l_req_line_id , 1 ) ;
1369: oe_debug_pub.add('Transaction_uom : ' || p_trx_uom , 1 ) ;
1370: oe_debug_pub.add('Transaction interface_id : ' || l_transaction_interface_id , 1 ) ;
1363: oe_debug_pub.add('Required_flag : ' || null , 1 ) ;
1364: oe_debug_pub.add('Picking_line_id : ' || l_shipment_line_id , 1 ) ;
1365: oe_debug_pub.add('Transfer_subinventory : ' || l_dest_subinv , 1 ) ;
1366: oe_debug_pub.add('Transfer_organization : ' || l_to_org_id , 1 ) ;
1367: oe_debug_pub.add('Ship_to_location_id : ' || l_location_id , 1 ) ;
1368: oe_debug_pub.add('Requisition_line_id : ' || l_req_line_id , 1 ) ;
1369: oe_debug_pub.add('Transaction_uom : ' || p_trx_uom , 1 ) ;
1370: oe_debug_pub.add('Transaction interface_id : ' || l_transaction_interface_id , 1 ) ;
1371: oe_debug_pub.add('Demand_id : ' || null , 1 ) ;
1364: oe_debug_pub.add('Picking_line_id : ' || l_shipment_line_id , 1 ) ;
1365: oe_debug_pub.add('Transfer_subinventory : ' || l_dest_subinv , 1 ) ;
1366: oe_debug_pub.add('Transfer_organization : ' || l_to_org_id , 1 ) ;
1367: oe_debug_pub.add('Ship_to_location_id : ' || l_location_id , 1 ) ;
1368: oe_debug_pub.add('Requisition_line_id : ' || l_req_line_id , 1 ) ;
1369: oe_debug_pub.add('Transaction_uom : ' || p_trx_uom , 1 ) ;
1370: oe_debug_pub.add('Transaction interface_id : ' || l_transaction_interface_id , 1 ) ;
1371: oe_debug_pub.add('Demand_id : ' || null , 1 ) ;
1372: oe_debug_pub.add('Shipment_number : ' || null , 1 ) ;
1365: oe_debug_pub.add('Transfer_subinventory : ' || l_dest_subinv , 1 ) ;
1366: oe_debug_pub.add('Transfer_organization : ' || l_to_org_id , 1 ) ;
1367: oe_debug_pub.add('Ship_to_location_id : ' || l_location_id , 1 ) ;
1368: oe_debug_pub.add('Requisition_line_id : ' || l_req_line_id , 1 ) ;
1369: oe_debug_pub.add('Transaction_uom : ' || p_trx_uom , 1 ) ;
1370: oe_debug_pub.add('Transaction interface_id : ' || l_transaction_interface_id , 1 ) ;
1371: oe_debug_pub.add('Demand_id : ' || null , 1 ) ;
1372: oe_debug_pub.add('Shipment_number : ' || null , 1 ) ;
1373: oe_debug_pub.add('Currency_code : ' || null , 1 ) ;
1366: oe_debug_pub.add('Transfer_organization : ' || l_to_org_id , 1 ) ;
1367: oe_debug_pub.add('Ship_to_location_id : ' || l_location_id , 1 ) ;
1368: oe_debug_pub.add('Requisition_line_id : ' || l_req_line_id , 1 ) ;
1369: oe_debug_pub.add('Transaction_uom : ' || p_trx_uom , 1 ) ;
1370: oe_debug_pub.add('Transaction interface_id : ' || l_transaction_interface_id , 1 ) ;
1371: oe_debug_pub.add('Demand_id : ' || null , 1 ) ;
1372: oe_debug_pub.add('Shipment_number : ' || null , 1 ) ;
1373: oe_debug_pub.add('Currency_code : ' || null , 1 ) ;
1374: oe_debug_pub.add('Currency_conversion_type : ' || null , 1 ) ;
1367: oe_debug_pub.add('Ship_to_location_id : ' || l_location_id , 1 ) ;
1368: oe_debug_pub.add('Requisition_line_id : ' || l_req_line_id , 1 ) ;
1369: oe_debug_pub.add('Transaction_uom : ' || p_trx_uom , 1 ) ;
1370: oe_debug_pub.add('Transaction interface_id : ' || l_transaction_interface_id , 1 ) ;
1371: oe_debug_pub.add('Demand_id : ' || null , 1 ) ;
1372: oe_debug_pub.add('Shipment_number : ' || null , 1 ) ;
1373: oe_debug_pub.add('Currency_code : ' || null , 1 ) ;
1374: oe_debug_pub.add('Currency_conversion_type : ' || null , 1 ) ;
1375: oe_debug_pub.add('Currency_conversion_date : ' || null , 1 ) ;
1368: oe_debug_pub.add('Requisition_line_id : ' || l_req_line_id , 1 ) ;
1369: oe_debug_pub.add('Transaction_uom : ' || p_trx_uom , 1 ) ;
1370: oe_debug_pub.add('Transaction interface_id : ' || l_transaction_interface_id , 1 ) ;
1371: oe_debug_pub.add('Demand_id : ' || null , 1 ) ;
1372: oe_debug_pub.add('Shipment_number : ' || null , 1 ) ;
1373: oe_debug_pub.add('Currency_code : ' || null , 1 ) ;
1374: oe_debug_pub.add('Currency_conversion_type : ' || null , 1 ) ;
1375: oe_debug_pub.add('Currency_conversion_date : ' || null , 1 ) ;
1376: oe_debug_pub.add('Currency_conversion_rate : ' || null , 1 ) ;
1369: oe_debug_pub.add('Transaction_uom : ' || p_trx_uom , 1 ) ;
1370: oe_debug_pub.add('Transaction interface_id : ' || l_transaction_interface_id , 1 ) ;
1371: oe_debug_pub.add('Demand_id : ' || null , 1 ) ;
1372: oe_debug_pub.add('Shipment_number : ' || null , 1 ) ;
1373: oe_debug_pub.add('Currency_code : ' || null , 1 ) ;
1374: oe_debug_pub.add('Currency_conversion_type : ' || null , 1 ) ;
1375: oe_debug_pub.add('Currency_conversion_date : ' || null , 1 ) ;
1376: oe_debug_pub.add('Currency_conversion_rate : ' || null , 1 ) ;
1377: oe_debug_pub.add('Encumbrance_account : ' || l_budget_acct_id , 1 ) ;
1370: oe_debug_pub.add('Transaction interface_id : ' || l_transaction_interface_id , 1 ) ;
1371: oe_debug_pub.add('Demand_id : ' || null , 1 ) ;
1372: oe_debug_pub.add('Shipment_number : ' || null , 1 ) ;
1373: oe_debug_pub.add('Currency_code : ' || null , 1 ) ;
1374: oe_debug_pub.add('Currency_conversion_type : ' || null , 1 ) ;
1375: oe_debug_pub.add('Currency_conversion_date : ' || null , 1 ) ;
1376: oe_debug_pub.add('Currency_conversion_rate : ' || null , 1 ) ;
1377: oe_debug_pub.add('Encumbrance_account : ' || l_budget_acct_id , 1 ) ;
1378: oe_debug_pub.add('Encumbrance_amount : ' || l_unit_price * p_transaction_detail_qty , 1 ) ;
1371: oe_debug_pub.add('Demand_id : ' || null , 1 ) ;
1372: oe_debug_pub.add('Shipment_number : ' || null , 1 ) ;
1373: oe_debug_pub.add('Currency_code : ' || null , 1 ) ;
1374: oe_debug_pub.add('Currency_conversion_type : ' || null , 1 ) ;
1375: oe_debug_pub.add('Currency_conversion_date : ' || null , 1 ) ;
1376: oe_debug_pub.add('Currency_conversion_rate : ' || null , 1 ) ;
1377: oe_debug_pub.add('Encumbrance_account : ' || l_budget_acct_id , 1 ) ;
1378: oe_debug_pub.add('Encumbrance_amount : ' || l_unit_price * p_transaction_detail_qty , 1 ) ;
1379: oe_debug_pub.add('Project_id : ' || l_project_id , 1 ) ;
1372: oe_debug_pub.add('Shipment_number : ' || null , 1 ) ;
1373: oe_debug_pub.add('Currency_code : ' || null , 1 ) ;
1374: oe_debug_pub.add('Currency_conversion_type : ' || null , 1 ) ;
1375: oe_debug_pub.add('Currency_conversion_date : ' || null , 1 ) ;
1376: oe_debug_pub.add('Currency_conversion_rate : ' || null , 1 ) ;
1377: oe_debug_pub.add('Encumbrance_account : ' || l_budget_acct_id , 1 ) ;
1378: oe_debug_pub.add('Encumbrance_amount : ' || l_unit_price * p_transaction_detail_qty , 1 ) ;
1379: oe_debug_pub.add('Project_id : ' || l_project_id , 1 ) ;
1380: oe_debug_pub.add('Task_id : ' || l_task_id , 1 ) ;
1373: oe_debug_pub.add('Currency_code : ' || null , 1 ) ;
1374: oe_debug_pub.add('Currency_conversion_type : ' || null , 1 ) ;
1375: oe_debug_pub.add('Currency_conversion_date : ' || null , 1 ) ;
1376: oe_debug_pub.add('Currency_conversion_rate : ' || null , 1 ) ;
1377: oe_debug_pub.add('Encumbrance_account : ' || l_budget_acct_id , 1 ) ;
1378: oe_debug_pub.add('Encumbrance_amount : ' || l_unit_price * p_transaction_detail_qty , 1 ) ;
1379: oe_debug_pub.add('Project_id : ' || l_project_id , 1 ) ;
1380: oe_debug_pub.add('Task_id : ' || l_task_id , 1 ) ;
1381: oe_debug_pub.add('Before inserting records into mtl interface table..' , 1 ) ;
1374: oe_debug_pub.add('Currency_conversion_type : ' || null , 1 ) ;
1375: oe_debug_pub.add('Currency_conversion_date : ' || null , 1 ) ;
1376: oe_debug_pub.add('Currency_conversion_rate : ' || null , 1 ) ;
1377: oe_debug_pub.add('Encumbrance_account : ' || l_budget_acct_id , 1 ) ;
1378: oe_debug_pub.add('Encumbrance_amount : ' || l_unit_price * p_transaction_detail_qty , 1 ) ;
1379: oe_debug_pub.add('Project_id : ' || l_project_id , 1 ) ;
1380: oe_debug_pub.add('Task_id : ' || l_task_id , 1 ) ;
1381: oe_debug_pub.add('Before inserting records into mtl interface table..' , 1 ) ;
1382: END IF;
1375: oe_debug_pub.add('Currency_conversion_date : ' || null , 1 ) ;
1376: oe_debug_pub.add('Currency_conversion_rate : ' || null , 1 ) ;
1377: oe_debug_pub.add('Encumbrance_account : ' || l_budget_acct_id , 1 ) ;
1378: oe_debug_pub.add('Encumbrance_amount : ' || l_unit_price * p_transaction_detail_qty , 1 ) ;
1379: oe_debug_pub.add('Project_id : ' || l_project_id , 1 ) ;
1380: oe_debug_pub.add('Task_id : ' || l_task_id , 1 ) ;
1381: oe_debug_pub.add('Before inserting records into mtl interface table..' , 1 ) ;
1382: END IF;
1383:
1376: oe_debug_pub.add('Currency_conversion_rate : ' || null , 1 ) ;
1377: oe_debug_pub.add('Encumbrance_account : ' || l_budget_acct_id , 1 ) ;
1378: oe_debug_pub.add('Encumbrance_amount : ' || l_unit_price * p_transaction_detail_qty , 1 ) ;
1379: oe_debug_pub.add('Project_id : ' || l_project_id , 1 ) ;
1380: oe_debug_pub.add('Task_id : ' || l_task_id , 1 ) ;
1381: oe_debug_pub.add('Before inserting records into mtl interface table..' , 1 ) ;
1382: END IF;
1383:
1384: -- 1517431 populate distribution account
1377: oe_debug_pub.add('Encumbrance_account : ' || l_budget_acct_id , 1 ) ;
1378: oe_debug_pub.add('Encumbrance_amount : ' || l_unit_price * p_transaction_detail_qty , 1 ) ;
1379: oe_debug_pub.add('Project_id : ' || l_project_id , 1 ) ;
1380: oe_debug_pub.add('Task_id : ' || l_task_id , 1 ) ;
1381: oe_debug_pub.add('Before inserting records into mtl interface table..' , 1 ) ;
1382: END IF;
1383:
1384: -- 1517431 populate distribution account
1385:
1655: decode(l_task_id, 0, null, l_task_id),
1656: p_transfer_lpn_id); -- 3544019
1657:
1658: IF l_debug_level > 0 THEN
1659: oe_debug_pub.add( 'Successfully inserted records in mtl interface table ' , 5 ) ;
1660: x_return_status := FND_API.G_RET_STS_SUCCESS; -- bug 5357879
1661: END IF;
1662: EXCEPTION WHEN OTHERS THEN
1663: IF l_debug_level > 0 THEN
1660: x_return_status := FND_API.G_RET_STS_SUCCESS; -- bug 5357879
1661: END IF;
1662: EXCEPTION WHEN OTHERS THEN
1663: IF l_debug_level > 0 THEN
1664: oe_debug_pub.add( 'Failed while inserting records in mtl_transactions_interface '||sqlerrm , 1 ) ;
1665: oe_debug_pub.add( 'Sales order issue transaction will not occur ' , 1 ) ;
1666: END IF;
1667:
1668: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR; -- bug 5357879
1661: END IF;
1662: EXCEPTION WHEN OTHERS THEN
1663: IF l_debug_level > 0 THEN
1664: oe_debug_pub.add( 'Failed while inserting records in mtl_transactions_interface '||sqlerrm , 1 ) ;
1665: oe_debug_pub.add( 'Sales order issue transaction will not occur ' , 1 ) ;
1666: END IF;
1667:
1668: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR; -- bug 5357879
1669: ROLLBACK TO DECREMENT_INV;
1672:
1673: -- Calling this API for immediate decrement of inventory
1674:
1675: IF l_debug_level > 0 THEN
1676: oe_debug_pub.add( 'Return from decrementinventory()',5 ) ;
1677: END IF;
1678:
1679: END Decrement_Inventory;
1680:
1686: RETURN NUMBER
1687: IS
1688: l_chart_of_accs NUMBER;
1689: --
1690: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1691: --
1692: BEGIN
1693: -- SQL Performance ID 14882944, replacing org_organization_definitions with relevant base tables
1694: /*
1730: l_sales_order_id NUMBER := 0;
1731: l_order_type_name VARCHAR2(80);
1732: l_order_type_id NUMBER;
1733: --
1734: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1735: --
1736: BEGIN
1737:
1738: IF l_debug_level > 0 THEN
1735: --
1736: BEGIN
1737:
1738: IF l_debug_level > 0 THEN
1739: oe_debug_pub.add( 'ENTERING GET_MTL_SALES_ORDER_ID IN DROPSHIPRECECEIVE ( ) ' , 3 ) ;
1740: END IF;
1741:
1742: BEGIN
1743: SELECT order_type_id
1749: RAISE;
1750: END;
1751:
1752: IF l_debug_level > 0 THEN
1753: oe_debug_pub.add( 'ORDER TYPE ID :' || L_ORDER_TYPE_ID , 3 ) ;
1754: END IF;
1755:
1756: BEGIN
1757: SELECT NAME
1763: where installed_flag = 'B');
1764: EXCEPTION
1765: WHEN NO_DATA_FOUND THEN
1766: IF l_debug_level > 0 THEN
1767: oe_debug_pub.add( 'UNABLE TO LOCATE ORDER TYPE ID IN DROPSHIPRECEIVE ( ) '||sqlerrm , 1 ) ;
1768: END IF;
1769: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1770: END;
1771:
1769: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1770: END;
1771:
1772: IF l_debug_level > 0 THEN
1773: oe_debug_pub.add( 'ORDER TYPE: ' || L_ORDER_TYPE_NAME , 2 ) ;
1774: oe_debug_pub.add( 'SOURCE CODE: ' || L_SOURCE_CODE , 2 ) ;
1775: END IF;
1776:
1777: SELECT S.SALES_ORDER_ID
1770: END;
1771:
1772: IF l_debug_level > 0 THEN
1773: oe_debug_pub.add( 'ORDER TYPE: ' || L_ORDER_TYPE_NAME , 2 ) ;
1774: oe_debug_pub.add( 'SOURCE CODE: ' || L_SOURCE_CODE , 2 ) ;
1775: END IF;
1776:
1777: SELECT S.SALES_ORDER_ID
1778: INTO l_sales_order_id
1783: AND S.SEGMENT3 = l_source_code
1784: AND H.HEADER_ID = p_header_id;
1785:
1786: IF l_debug_level > 0 THEN
1787: oe_debug_pub.add( 'EXISTING GET_MTL_SALES_ORDER_ID ( ) WITH SALES ORDER ID => ' || L_SALES_ORDER_ID , 1 ) ;
1788: END IF;
1789:
1790: RETURN l_sales_order_id;
1791:
1791:
1792: EXCEPTION
1793: WHEN NO_DATA_FOUND THEN
1794: IF l_debug_level > 0 THEN
1795: oe_debug_pub.add( '2. L_SALES_ORDER_ID IS 0' , 5 ) ;
1796: END IF;
1797: RETURN 0;
1798: WHEN OTHERS THEN
1799: IF l_debug_level > 0 THEN
1796: END IF;
1797: RETURN 0;
1798: WHEN OTHERS THEN
1799: IF l_debug_level > 0 THEN
1800: oe_debug_pub.add( '2. L_SALES_ORDER_ID IS 0' , 5 ) ;
1801: END IF;
1802: RETURN 0;
1803: END Get_mtl_sales_order_id;
1804:
1834: WHERE line_id = l_new_line_id
1835: AND line_location_id = G_LINE_LOCATION_ID; -- bug 4402566
1836:
1837: --
1838: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1839: --
1840: BEGIN
1841:
1842: OPEN old_drop_ship_line;
2018: And delete_mark = 0
2019: And completed_ind = 0;
2020:
2021: --
2022: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
2023: --
2024: BEGIN
2025:
2026: IF l_debug_level > 0 THEN
2023: --
2024: BEGIN
2025:
2026: IF l_debug_level > 0 THEN
2027: oe_debug_pub.add( 'ENTERING DECREMENT INVENTORY FOR OPM' ) ;
2028: oe_debug_pub.add( ' P_LOT_NUMBER : ' || P_LOT_NUMBER , 1 ) ;
2029: oe_debug_pub.add( ' P_INVENTORY_ITEM_ID : ' || P_INVENTORY_ITEM_ID , 1 ) ;
2030: oe_debug_pub.add( ' P_ORGANIZATION_ID : ' || P_WAREHOUSE_ID , 1 ) ;
2031: oe_debug_pub.add( ' P_TRX_UOM : ' || P_TRX_UOM , 1 ) ;
2024: BEGIN
2025:
2026: IF l_debug_level > 0 THEN
2027: oe_debug_pub.add( 'ENTERING DECREMENT INVENTORY FOR OPM' ) ;
2028: oe_debug_pub.add( ' P_LOT_NUMBER : ' || P_LOT_NUMBER , 1 ) ;
2029: oe_debug_pub.add( ' P_INVENTORY_ITEM_ID : ' || P_INVENTORY_ITEM_ID , 1 ) ;
2030: oe_debug_pub.add( ' P_ORGANIZATION_ID : ' || P_WAREHOUSE_ID , 1 ) ;
2031: oe_debug_pub.add( ' P_TRX_UOM : ' || P_TRX_UOM , 1 ) ;
2032: oe_debug_pub.add( ' P_CHART_OF_ACCTS : ' || P_CHART_OF_ACCTS , 1 ) ;
2025:
2026: IF l_debug_level > 0 THEN
2027: oe_debug_pub.add( 'ENTERING DECREMENT INVENTORY FOR OPM' ) ;
2028: oe_debug_pub.add( ' P_LOT_NUMBER : ' || P_LOT_NUMBER , 1 ) ;
2029: oe_debug_pub.add( ' P_INVENTORY_ITEM_ID : ' || P_INVENTORY_ITEM_ID , 1 ) ;
2030: oe_debug_pub.add( ' P_ORGANIZATION_ID : ' || P_WAREHOUSE_ID , 1 ) ;
2031: oe_debug_pub.add( ' P_TRX_UOM : ' || P_TRX_UOM , 1 ) ;
2032: oe_debug_pub.add( ' P_CHART_OF_ACCTS : ' || P_CHART_OF_ACCTS , 1 ) ;
2033: oe_debug_pub.add( ' P_AS_ALPHA_PREFIX : ' || P_AS_ALPHA_PREFIX , 1 ) ;
2026: IF l_debug_level > 0 THEN
2027: oe_debug_pub.add( 'ENTERING DECREMENT INVENTORY FOR OPM' ) ;
2028: oe_debug_pub.add( ' P_LOT_NUMBER : ' || P_LOT_NUMBER , 1 ) ;
2029: oe_debug_pub.add( ' P_INVENTORY_ITEM_ID : ' || P_INVENTORY_ITEM_ID , 1 ) ;
2030: oe_debug_pub.add( ' P_ORGANIZATION_ID : ' || P_WAREHOUSE_ID , 1 ) ;
2031: oe_debug_pub.add( ' P_TRX_UOM : ' || P_TRX_UOM , 1 ) ;
2032: oe_debug_pub.add( ' P_CHART_OF_ACCTS : ' || P_CHART_OF_ACCTS , 1 ) ;
2033: oe_debug_pub.add( ' P_AS_ALPHA_PREFIX : ' || P_AS_ALPHA_PREFIX , 1 ) ;
2034: oe_debug_pub.add( ' P_SN_CONTROL_CODE : ' || P_SN_CONTROL_CODE , 1 ) ;
2027: oe_debug_pub.add( 'ENTERING DECREMENT INVENTORY FOR OPM' ) ;
2028: oe_debug_pub.add( ' P_LOT_NUMBER : ' || P_LOT_NUMBER , 1 ) ;
2029: oe_debug_pub.add( ' P_INVENTORY_ITEM_ID : ' || P_INVENTORY_ITEM_ID , 1 ) ;
2030: oe_debug_pub.add( ' P_ORGANIZATION_ID : ' || P_WAREHOUSE_ID , 1 ) ;
2031: oe_debug_pub.add( ' P_TRX_UOM : ' || P_TRX_UOM , 1 ) ;
2032: oe_debug_pub.add( ' P_CHART_OF_ACCTS : ' || P_CHART_OF_ACCTS , 1 ) ;
2033: oe_debug_pub.add( ' P_AS_ALPHA_PREFIX : ' || P_AS_ALPHA_PREFIX , 1 ) ;
2034: oe_debug_pub.add( ' P_SN_CONTROL_CODE : ' || P_SN_CONTROL_CODE , 1 ) ;
2035: oe_debug_pub.add( ' P_TRANSACTION_ID : ' || P_TRANSACTION_ID , 1 ) ;
2028: oe_debug_pub.add( ' P_LOT_NUMBER : ' || P_LOT_NUMBER , 1 ) ;
2029: oe_debug_pub.add( ' P_INVENTORY_ITEM_ID : ' || P_INVENTORY_ITEM_ID , 1 ) ;
2030: oe_debug_pub.add( ' P_ORGANIZATION_ID : ' || P_WAREHOUSE_ID , 1 ) ;
2031: oe_debug_pub.add( ' P_TRX_UOM : ' || P_TRX_UOM , 1 ) ;
2032: oe_debug_pub.add( ' P_CHART_OF_ACCTS : ' || P_CHART_OF_ACCTS , 1 ) ;
2033: oe_debug_pub.add( ' P_AS_ALPHA_PREFIX : ' || P_AS_ALPHA_PREFIX , 1 ) ;
2034: oe_debug_pub.add( ' P_SN_CONTROL_CODE : ' || P_SN_CONTROL_CODE , 1 ) ;
2035: oe_debug_pub.add( ' P_TRANSACTION_ID : ' || P_TRANSACTION_ID , 1 ) ;
2036: END IF;
2029: oe_debug_pub.add( ' P_INVENTORY_ITEM_ID : ' || P_INVENTORY_ITEM_ID , 1 ) ;
2030: oe_debug_pub.add( ' P_ORGANIZATION_ID : ' || P_WAREHOUSE_ID , 1 ) ;
2031: oe_debug_pub.add( ' P_TRX_UOM : ' || P_TRX_UOM , 1 ) ;
2032: oe_debug_pub.add( ' P_CHART_OF_ACCTS : ' || P_CHART_OF_ACCTS , 1 ) ;
2033: oe_debug_pub.add( ' P_AS_ALPHA_PREFIX : ' || P_AS_ALPHA_PREFIX , 1 ) ;
2034: oe_debug_pub.add( ' P_SN_CONTROL_CODE : ' || P_SN_CONTROL_CODE , 1 ) ;
2035: oe_debug_pub.add( ' P_TRANSACTION_ID : ' || P_TRANSACTION_ID , 1 ) ;
2036: END IF;
2037:
2030: oe_debug_pub.add( ' P_ORGANIZATION_ID : ' || P_WAREHOUSE_ID , 1 ) ;
2031: oe_debug_pub.add( ' P_TRX_UOM : ' || P_TRX_UOM , 1 ) ;
2032: oe_debug_pub.add( ' P_CHART_OF_ACCTS : ' || P_CHART_OF_ACCTS , 1 ) ;
2033: oe_debug_pub.add( ' P_AS_ALPHA_PREFIX : ' || P_AS_ALPHA_PREFIX , 1 ) ;
2034: oe_debug_pub.add( ' P_SN_CONTROL_CODE : ' || P_SN_CONTROL_CODE , 1 ) ;
2035: oe_debug_pub.add( ' P_TRANSACTION_ID : ' || P_TRANSACTION_ID , 1 ) ;
2036: END IF;
2037:
2038: profile_values.oe_source_code := FND_PROFILE.VALUE('ONT_SOURCE_CODE');
2031: oe_debug_pub.add( ' P_TRX_UOM : ' || P_TRX_UOM , 1 ) ;
2032: oe_debug_pub.add( ' P_CHART_OF_ACCTS : ' || P_CHART_OF_ACCTS , 1 ) ;
2033: oe_debug_pub.add( ' P_AS_ALPHA_PREFIX : ' || P_AS_ALPHA_PREFIX , 1 ) ;
2034: oe_debug_pub.add( ' P_SN_CONTROL_CODE : ' || P_SN_CONTROL_CODE , 1 ) ;
2035: oe_debug_pub.add( ' P_TRANSACTION_ID : ' || P_TRANSACTION_ID , 1 ) ;
2036: END IF;
2037:
2038: profile_values.oe_source_code := FND_PROFILE.VALUE('ONT_SOURCE_CODE');
2039:
2057: /* l_trans_acc := NULL;
2058: END IF;
2059:
2060: IF l_debug_level > 0 THEN
2061: oe_debug_pub.add( 'TRANSACTION ACCOUNT ID ID : ' || L_TRANS_ACC , 1 ) ;
2062: END IF;
2063:
2064: l_trans_qty := p_trans_qty;
2065: /*OPM transactions in ic_tran_pnd
2067: Open get_opm_item_no;
2068: Fetch get_opm_item_no INTO l_opm_item_no;
2069: Close get_opm_item_no;
2070: IF l_debug_level > 0 THEN
2071: oe_debug_pub.add( ' P_OPM_ITEM_NO : ' || L_OPM_ITEM_NO , 1 ) ;
2072: END IF;
2073:
2074: Open get_opm_item_id;
2075: Fetch get_opm_item_id INTO l_opm_item_id, l_opm_item_um;
2074: Open get_opm_item_id;
2075: Fetch get_opm_item_id INTO l_opm_item_id, l_opm_item_um;
2076: Close get_opm_item_id;
2077: IF l_debug_level > 0 THEN
2078: oe_debug_pub.add( ' P_OPM_ITEM_ID : ' || L_OPM_ITEM_ID , 1 ) ;
2079: END IF;
2080: IF l_debug_level > 0 THEN
2081: oe_debug_pub.add( ' P_OPM_ITEM_UM : ' || L_OPM_ITEM_UM , 1 ) ;
2082: END IF;
2077: IF l_debug_level > 0 THEN
2078: oe_debug_pub.add( ' P_OPM_ITEM_ID : ' || L_OPM_ITEM_ID , 1 ) ;
2079: END IF;
2080: IF l_debug_level > 0 THEN
2081: oe_debug_pub.add( ' P_OPM_ITEM_UM : ' || L_OPM_ITEM_UM , 1 ) ;
2082: END IF;
2083:
2084: Open get_opm_whse;
2085: Fetch get_opm_whse INTO l_opm_whse;
2084: Open get_opm_whse;
2085: Fetch get_opm_whse INTO l_opm_whse;
2086: Close get_opm_whse;
2087: IF l_debug_level > 0 THEN
2088: oe_debug_pub.add( ' P_WAREHOUSE_ID : ' || L_OPM_WHSE , 1 ) ;
2089: END IF;
2090:
2091: l_opm_location := null;
2092: IF NVL(p_locator_id,0) <>0 THEN
2094: Fetch get_opm_location INTO l_opm_location;
2095: Close get_opm_location;
2096: END IF;
2097: IF l_debug_level > 0 THEN
2098: oe_debug_pub.add( ' OPM_LOCATION : ' || L_OPM_LOCATION , 1 ) ;
2099: END IF;
2100: l_opm_lot_id := 0;
2101: IF (p_lot_number is not null) AND (p_sublot_no is not null) THEN
2102: Open get_opm_lot_id_sublot;
2107: Fetch get_opm_lot_id_no_sublot INTO l_opm_lot_id;
2108: Close get_opm_lot_id_no_sublot;
2109: END IF;
2110: IF l_debug_level > 0 THEN
2111: oe_debug_pub.add( ' OPM_LOT_ID : ' || L_OPM_LOT_ID , 1 ) ;
2112: END IF;
2113:
2114: IF (p_lot_number is not null) THEN
2115: OPEN check_opm_inv ;
2120: Fetch check_opm_inv_default INTO l_exist;
2121: CLOSE check_opm_inv_default;
2122: END IF;
2123: IF l_debug_level > 0 THEN
2124: oe_debug_pub.add( ' L_EXIST : ' || L_EXIST , 1 ) ;
2125: END IF;
2126:
2127: GMI_RESERVATION_UTIL.Get_OPMUOM_from_AppsUOM(
2128: p_Apps_UOM => p_trx_uom
2137: FND_MSG_PUB.Add;
2138: RAISE FND_API.G_EXC_ERROR;
2139: ELSE
2140: IF l_debug_level > 0 THEN
2141: oe_debug_pub.add( ' OPM TRX UOM='||L_OPM_TRX_UOM||'.' , 1 ) ;
2142: END IF;
2143: END IF;
2144: IF l_opm_trx_uom <> l_opm_item_um THEN
2145: GMICUOM.icuomcv(pitem_id => l_opm_item_id,
2177: raise FND_API.G_EXC_ERROR;
2178: END IF;
2179:
2180: IF l_debug_level > 0 THEN
2181: oe_debug_pub.add( 'EXITING DECREMENT INVENTORY' ) ;
2182: END IF;
2183:
2184: END Decrement_Inventory_for_OPM; */
2185:
2218:
2219: l_msg_count NUMBER;
2220: l_msg_data VARCHAR2(20000);
2221:
2222: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
2223: l_return_status VARCHAR2(1);
2224:
2225: BEGIN
2226:
2224:
2225: BEGIN
2226:
2227: IF l_debug_level > 0 THEN
2228: oe_debug_pub.add( 'Populating inventory record before calling reservation ' , 1 ) ;
2229: END IF;
2230:
2231: -- Populate inventory record structure before calling reservation
2232:
2241:
2242: l_sales_order_id := Get_mtl_sales_order_id(p_line_rec.header_id);
2243:
2244: IF l_debug_level > 0 THEN
2245: oe_debug_pub.add( 'Sales Order ID '||l_sales_order_id, 1 ) ;
2246: END IF;
2247: IF p_qty2_to_be_reserved = 0 then -- INVCONV
2248: l_qty2_to_be_reserved := NULL;
2249: else
2299:
2300: -- Call INV with action = RESERVE
2301:
2302: IF l_debug_level > 0 THEN
2303: oe_debug_pub.add( 'Calling clear cache' , 1 ) ;
2304: END IF;
2305:
2306: -- Inv_quantity_tree_grp.clear_quantity_cache;
2307: Inv_quantity_tree_pvt.mark_all_for_refresh
2316: l_msg_count:=OE_MSG_PUB.COUNT_MSG;
2317: for I in 1..l_msg_count loop
2318: l_msg_data := OE_MSG_PUB.Get(I,'F');
2319: IF l_debug_level > 0 THEN
2320: oe_debug_pub.add( L_MSG_DATA , 1 ) ;
2321: END IF;
2322: end loop;
2323: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2324: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2326: l_msg_count:=OE_MSG_PUB.COUNT_MSG;
2327: for I in 1..l_msg_count loop
2328: l_msg_data := OE_MSG_PUB.Get(I,'F');
2329: IF l_debug_level > 0 THEN
2330: oe_debug_pub.add( L_MSG_DATA , 1 ) ;
2331: END IF;
2332: end loop;
2333: RAISE FND_API.G_EXC_ERROR;
2334: END IF;
2334: END IF;
2335:
2336: --16429262
2337: IF l_debug_level > 0 THEN
2338: oe_debug_pub.add( 'Before calling Create Reservation, Setting G_DS_SOissue_Flag to : ' || G_DS_SOISSUE_FLAG , 1 ) ;
2339: END IF;
2340: G_DS_SOISSUE_FLAG := 'Y';
2341: --16429262
2342:
2340: G_DS_SOISSUE_FLAG := 'Y';
2341: --16429262
2342:
2343: IF l_debug_level > 0 THEN
2344: oe_debug_pub.add( 'Calling inv to reserve quantity : ' || p_qty_to_be_reserved , 1 ) ;
2345: oe_debug_pub.add( 'Calling inv to reserve quantity2 : ' || p_qty2_to_be_reserved , 1 ) ;
2346: END IF;
2347:
2348: Inv_reservation_pub.create_reservation
2341: --16429262
2342:
2343: IF l_debug_level > 0 THEN
2344: oe_debug_pub.add( 'Calling inv to reserve quantity : ' || p_qty_to_be_reserved , 1 ) ;
2345: oe_debug_pub.add( 'Calling inv to reserve quantity2 : ' || p_qty2_to_be_reserved , 1 ) ;
2346: END IF;
2347:
2348: Inv_reservation_pub.create_reservation
2349: ( p_api_version_number => 1.0
2363: , x_reservation_id => l_rsv_id
2364: );
2365:
2366: IF l_debug_level > 0 THEN
2367: oe_debug_pub.add( 'Create reservation returns : ' || l_return_status , 1 ) ;
2368: oe_debug_pub.add( l_msg_data , 1 ) ;
2369: END IF;
2370:
2371: --16429262
2364: );
2365:
2366: IF l_debug_level > 0 THEN
2367: oe_debug_pub.add( 'Create reservation returns : ' || l_return_status , 1 ) ;
2368: oe_debug_pub.add( l_msg_data , 1 ) ;
2369: END IF;
2370:
2371: --16429262
2372: IF l_debug_level > 0 THEN
2369: END IF;
2370:
2371: --16429262
2372: IF l_debug_level > 0 THEN
2373: oe_debug_pub.add( 'After Returning from Create Reservation, Resetting G_DS_SOissue_Flag back to : ' || G_DS_SOISSUE_FLAG , 1 ) ;
2374: END IF;
2375: G_DS_SOISSUE_FLAG := 'N';
2376: --16429262
2377:
2376: --16429262
2377:
2378: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2379: IF l_debug_level > 0 THEN
2380: oe_debug_pub.add( 'Reservation fails with unexpected error in dropshipreceive() : '||sqlerrm , 1 ) ;
2381: oe_debug_pub.add( 'Try receipt after setting sub/item non reservable' , 1 ) ;
2382: END IF;
2383:
2384: oe_msg_pub.transfer_msg_stack;
2377:
2378: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2379: IF l_debug_level > 0 THEN
2380: oe_debug_pub.add( 'Reservation fails with unexpected error in dropshipreceive() : '||sqlerrm , 1 ) ;
2381: oe_debug_pub.add( 'Try receipt after setting sub/item non reservable' , 1 ) ;
2382: END IF;
2383:
2384: oe_msg_pub.transfer_msg_stack;
2385: l_msg_count:=OE_MSG_PUB.COUNT_MSG;
2385: l_msg_count:=OE_MSG_PUB.COUNT_MSG;
2386: for I in 1..l_msg_count loop
2387: l_msg_data := OE_MSG_PUB.Get(I,'F');
2388: IF l_debug_level > 0 THEN
2389: oe_debug_pub.add(l_msg_data,1) ;
2390: END IF;
2391: end loop;
2392: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2393:
2392: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2393:
2394: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2395: IF l_debug_level > 0 THEN
2396: oe_debug_pub.add('reservation fails with expected error in dropshipreceive() : '||sqlerrm,1) ;
2397: oe_debug_pub.add( 'Try receipt after setting sub/item non reservable' , 1 ) ;
2398: END IF;
2399: oe_msg_pub.transfer_msg_stack;
2400: l_msg_count:=OE_MSG_PUB.COUNT_MSG;
2393:
2394: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2395: IF l_debug_level > 0 THEN
2396: oe_debug_pub.add('reservation fails with expected error in dropshipreceive() : '||sqlerrm,1) ;
2397: oe_debug_pub.add( 'Try receipt after setting sub/item non reservable' , 1 ) ;
2398: END IF;
2399: oe_msg_pub.transfer_msg_stack;
2400: l_msg_count:=OE_MSG_PUB.COUNT_MSG;
2401: for I in 1..l_msg_count loop
2400: l_msg_count:=OE_MSG_PUB.COUNT_MSG;
2401: for I in 1..l_msg_count loop
2402: l_msg_data := OE_MSG_PUB.Get(I,'F');
2403: IF l_debug_level > 0 THEN
2404: oe_debug_pub.add(l_msg_data,1) ;
2405: END IF;
2406: end loop;
2407: RAISE FND_API.G_EXC_ERROR;
2408: END IF;
2407: RAISE FND_API.G_EXC_ERROR;
2408: END IF;
2409:
2410: IF l_debug_level > 0 THEN
2411: oe_debug_pub.add( 'Successfully reserved quantity => '||l_quantity_reserved,1) ;
2412: oe_debug_pub.add( 'Successfully reserved quantity2 => '||l_quantity2_reserved,1) ; -- INVCONV
2413:
2414: END IF;
2415:
2408: END IF;
2409:
2410: IF l_debug_level > 0 THEN
2411: oe_debug_pub.add( 'Successfully reserved quantity => '||l_quantity_reserved,1) ;
2412: oe_debug_pub.add( 'Successfully reserved quantity2 => '||l_quantity2_reserved,1) ; -- INVCONV
2413:
2414: END IF;
2415:
2416: x_qty_reserved := l_quantity_reserved;
2417: x_qty2_reserved := l_quantity2_reserved; -- INVCONV
2418: x_rsv_id := l_rsv_id;
2419:
2420: IF l_debug_level > 0 THEN
2421: OE_DEBUG_PUB.Add('Exiting Create_Reservation ...',4);
2422: END IF;
2423: EXCEPTION
2424:
2425: WHEN FND_API.G_EXC_ERROR THEN
2423: EXCEPTION
2424:
2425: WHEN FND_API.G_EXC_ERROR THEN
2426: IF l_debug_level > 0 THEN
2427: OE_DEBUG_PUB.Add('Expected Error in Create Reservation...',4);
2428: END IF;
2429:
2430: x_return_status := FND_API.G_RET_STS_ERROR;
2431: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2429:
2430: x_return_status := FND_API.G_RET_STS_ERROR;
2431: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2432: IF l_debug_level > 0 THEN
2433: OE_DEBUG_PUB.Add('UnExpected Error in Create Reservation...'||sqlerrm,4);
2434: END IF;
2435:
2436: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2437: WHEN OTHERS THEN
2435:
2436: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2437: WHEN OTHERS THEN
2438: IF l_debug_level > 0 THEN
2439: OE_DEBUG_PUB.Add('When Others in Create Reservation...'||sqlerrm,4);
2440: END IF;
2441:
2442: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2443:
2472: l_proportion_broken_flag varchar2(1);
2473: l_cal_tolr_return_status varchar2(1);
2474: l_msg_count number;
2475: l_msg_data VARCHAR2(20000);
2476: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
2477: l_return_status VARCHAR2(1);
2478: BEGIN
2479: IF l_debug_level > 0 THEN
2480: oe_debug_pub.add('OEXVDSRB.pls: Inside Call_Ship_Confirm_New API',3);
2476: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
2477: l_return_status VARCHAR2(1);
2478: BEGIN
2479: IF l_debug_level > 0 THEN
2480: oe_debug_pub.add('OEXVDSRB.pls: Inside Call_Ship_Confirm_New API',3);
2481: END IF;
2482: -- Extending the l_non_bulk_ship_line
2483: l_non_bulk_ship_line.fulfilled_flag.extend;
2484: l_non_bulk_ship_line.actual_shipment_date.extend;
2519: l_cal_tolerance_tbl(1).line_id := p_line_rec.line_id;
2520: l_cal_tolerance_tbl(1).quantity_to_be_shipped := p_add_to_shipped;
2521: l_cal_tolerance_tbl(1).shipping_uom := p_line_rec.order_quantity_uom;
2522: IF l_debug_level > 0 THEN
2523: oe_debug_pub.add('Calling OE_Shipping_Integration_PUB.Get_Tolerance to check the tolerances' ,3);
2524: END IF;
2525:
2526: OE_Shipping_Integration_PUB.Get_Tolerance(
2527: p_api_version_number => 1.0,
2536: x_msg_data => l_msg_data);
2537:
2538: IF l_cal_tolr_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2539: IF l_debug_level > 0 THEN
2540: oe_debug_pub.add('OE_Shipping_Integration_PUB.Get_Tolerance returned Error', 1 ) ;
2541: END IF;
2542: x_return_status := FND_API.G_RET_STS_ERROR;
2543: return;
2544: END IF;
2601: x_msg_data => l_msg_data,
2602: x_return_status => l_return_status);
2603:
2604: IF l_debug_level > 0 THEN
2605: oe_debug_pub.add('OEXVDSRB.pls: OE_Ship_Confirmation_Pub.Ship_Confirm_New return_status='||l_return_status,3);
2606: END IF;
2607:
2608: x_return_status := l_return_status;
2609: x_msg_data := l_msg_data;
2664: l_req_qty_tbl OE_Ship_Confirmation_Pub.Req_Quantity_Tbl_Type;
2665:
2666: l_new_line_id NUMBER;
2667: l_return_status VARCHAR2(1);
2668: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
2669: --serla begin
2670: l_x_Header_Payment_tbl OE_Order_PUB.Header_Payment_Tbl_Type;
2671: l_x_Line_Payment_tbl OE_Order_PUB.Line_Payment_Tbl_Type;
2672: --serla end
2680:
2681: IF (p_orig_shipped <> 0) --one receipt already exists
2682: THEN
2683: IF l_debug_level > 0 THEN
2684: oe_debug_pub.add('Receiving has already been done once. no processing in om' ) ;
2685: END IF;
2686: ELSE --first receipt against this line
2687:
2688: IF l_debug_level > 0 THEN
2685: END IF;
2686: ELSE --first receipt against this line
2687:
2688: IF l_debug_level > 0 THEN
2689: oe_debug_pub.add('Calling Call_Ship_Confirm_New API' , 1 ) ;
2690: END IF;
2691:
2692: -- Calling this new API, bug 4393738
2693: Call_Ship_Confirm_New
2701: ,x_msg_data => l_msg_data);
2702:
2703: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2704: IF l_debug_level > 0 THEN
2705: oe_debug_pub.add('OEXVDSRB.pls: Call_Ship_Confirm_New returned unexpected error '||sqlerrm , 1 ) ;
2706: END IF;
2707: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2708: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2709: IF l_debug_level > 0 THEN
2706: END IF;
2707: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2708: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2709: IF l_debug_level > 0 THEN
2710: oe_debug_pub.add('OEXVDSRB.pls: Call_Ship_Confirm_New returned expected error '||sqlerrm , 1 ) ;
2711: END IF;
2712: RAISE FND_API.G_EXC_ERROR;
2713: END IF;
2714:
2712: RAISE FND_API.G_EXC_ERROR;
2713: END IF;
2714:
2715: IF l_debug_level > 0 THEN
2716: oe_debug_pub.add('OEXVDSRB.pls: After Call_Ship_Confirm_New, return_status='|| l_return_status,1) ;
2717: END IF;
2718:
2719: IF l_debug_level > 0 THEN
2720: oe_debug_pub.add('OEXVDSRB.pls: Calling OE_CONFIG_TSO_PVT.Is_Part_Of_Container_Model...' , 5 ) ;
2716: oe_debug_pub.add('OEXVDSRB.pls: After Call_Ship_Confirm_New, return_status='|| l_return_status,1) ;
2717: END IF;
2718:
2719: IF l_debug_level > 0 THEN
2720: oe_debug_pub.add('OEXVDSRB.pls: Calling OE_CONFIG_TSO_PVT.Is_Part_Of_Container_Model...' , 5 ) ;
2721: END IF;
2722:
2723: -- TSO with Equipment, the non-shippable lines should have NULL shipped_quantity
2724: OE_CONFIG_TSO_PVT.Is_Part_Of_Container_Model
2738: AND shipped_quantity is not NULL;
2739:
2740: IF l_debug_level > 0 AND
2741: SQL%FOUND THEN
2742: oe_debug_pub.add('Updated non-shippable lines of TSO ...',5);
2743: END IF;
2744: END IF;
2745: -- TSO with equipment ends
2746:
2745: -- TSO with equipment ends
2746:
2747: IF ( p_short_quantity > 0 ) THEN
2748: IF l_debug_level > 0 THEN
2749: oe_debug_pub.add('After call from process order api check if split has happened ' , 5 ) ;
2750: END IF;
2751: BEGIN
2752: SELECT max(line_id)
2753: INTO l_new_line_id
2757: AND split_by = 'SYSTEM'; -- Bug-2437391
2758: EXCEPTION
2759: WHEN NO_DATA_FOUND THEN
2760: IF l_debug_level > 0 THEN
2761: oe_debug_pub.add( 'Split line not found '||sqlerrm , 1 ) ;
2762: END IF;
2763: WHEN OTHERS THEN
2764: IF l_debug_level > 0 THEN
2765: oe_debug_pub.add( 'Unexpected: line not found '||sqlerrm , 1 ) ;
2761: oe_debug_pub.add( 'Split line not found '||sqlerrm , 1 ) ;
2762: END IF;
2763: WHEN OTHERS THEN
2764: IF l_debug_level > 0 THEN
2765: oe_debug_pub.add( 'Unexpected: line not found '||sqlerrm , 1 ) ;
2766: END IF;
2767: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2768: END;
2769: -- Bug2344242 added following if condition
2768: END;
2769: -- Bug2344242 added following if condition
2770: IF l_new_line_id is NOT NULL THEN
2771: IF l_debug_level > 0 THEN
2772: oe_debug_pub.add( 'Updating existing dropship record with new line '||l_new_line_id , 1 ) ;
2773: END IF;
2774:
2775: update oe_drop_ship_sources
2776: set line_id = l_new_line_id
2778:
2779: insert_oe_drop_ship_source(p_line_rec.line_id, l_new_line_id);
2780:
2781: IF l_debug_level > 0 THEN
2782: oe_debug_pub.add( 'After inserting drop ship source record ' , 5 ) ;
2783: END IF;
2784: END IF;
2785: END IF;
2786:
2786:
2787: END IF; --one receipt already exists
2788:
2789: IF l_debug_level > 0 THEN
2790: OE_DEBUG_PUB.Add('Exiting Call Process Order...',4);
2791: END IF;
2792: EXCEPTION
2793: WHEN FND_API.G_EXC_ERROR THEN
2794: IF l_debug_level > 0 THEN
2791: END IF;
2792: EXCEPTION
2793: WHEN FND_API.G_EXC_ERROR THEN
2794: IF l_debug_level > 0 THEN
2795: OE_DEBUG_PUB.Add('Expected Error in Call Process Order...',4);
2796: END IF;
2797:
2798: x_return_status := FND_API.G_RET_STS_ERROR;
2799: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2797:
2798: x_return_status := FND_API.G_RET_STS_ERROR;
2799: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2800: IF l_debug_level > 0 THEN
2801: OE_DEBUG_PUB.Add('UnExpected Error in Call Process Order...'||sqlerrm,4);
2802: END IF;
2803:
2804: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2805: WHEN OTHERS THEN
2803:
2804: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2805: WHEN OTHERS THEN
2806: IF l_debug_level > 0 THEN
2807: OE_DEBUG_PUB.Add('When Others in Call Process Order...'||sqlerrm,4);
2808: END IF;
2809:
2810: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2811:
2842: l_po_status_rec PO_STATUS_REC_TYPE;
2843: l_return_status VARCHAR2(1);
2844: l_cancel_flag VARCHAR2(1);
2845: l_closed_code VARCHAR2(30);
2846: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
2847: l_po_release_id NUMBER; -- bug 5328526
2848:
2849: BEGIN
2850:
2848:
2849: BEGIN
2850:
2851: IF l_debug_level > 0 THEN
2852: OE_DEBUG_PUB.Add('Entering Check_Req_PO_Cancelled.. ',1);
2853: END IF;
2854:
2855: SELECT requisition_header_id, po_header_id, po_release_id
2856: INTO l_req_header_id,l_po_header_id, l_po_release_id --bug 5328526
2858: WHERE line_id = p_line_id
2859: AND header_id = p_header_id;
2860:
2861: IF l_debug_level > 0 THEN
2862: OE_DEBUG_PUB.Add('Requisition:'||l_req_header_id||
2863: ' PO:'||l_po_header_id||
2864: ' PO Release:'||l_po_release_id,1);
2865: END IF;
2866:
2869: l_req_status := PO_RELEASES_SV2.Get_Release_Status
2870: ( x_po_release_id => l_req_header_id
2871: );
2872: IF l_debug_level > 0 THEN
2873: OE_DEBUG_PUB.Add('Requisition Status - '|| l_req_status, 3);
2874: END IF;
2875:
2876: IF l_req_status is null THEN
2877: PO_REQS_SV2.Get_Reqs_Auth_Status
2884: l_req_status := UPPER(l_req_status);
2885: END IF;
2886:
2887: IF l_debug_level > 0 THEN
2888: OE_DEBUG_PUB.Add('After Requisition Auth Status - '|| l_req_status, 3);
2889: END IF;
2890:
2891: END IF;
2892:
2898: (x_po_header_id => l_po_header_id
2899: ));
2900:
2901: IF l_debug_level > 0 THEN
2902: OE_DEBUG_PUB.Add('PO Status : '|| l_po_status, 2);
2903: END IF;
2904: */
2905: PO_DOCUMENT_CHECKS_GRP.po_status_check
2906: (p_api_version => 1.0
2912: IF(l_return_status = FND_API.G_RET_STS_SUCCESS) THEN
2913: l_cancel_flag := l_po_status_rec.cancel_flag(1);
2914: l_closed_code := l_po_status_rec.closed_code(1);
2915: IF l_debug_level > 0 THEN
2916: OE_DEBUG_PUB.Add('Sucess call from PO_DOCUMENT_CHECKS_GRP.po_status_check',2);
2917: OE_DEBUG_PUB.Add('Cancel_flag : '|| l_cancel_flag, 2);
2918: OE_DEBUG_PUB.Add('Closed_code : '|| l_closed_code,2);
2919: END IF;
2920: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2913: l_cancel_flag := l_po_status_rec.cancel_flag(1);
2914: l_closed_code := l_po_status_rec.closed_code(1);
2915: IF l_debug_level > 0 THEN
2916: OE_DEBUG_PUB.Add('Sucess call from PO_DOCUMENT_CHECKS_GRP.po_status_check',2);
2917: OE_DEBUG_PUB.Add('Cancel_flag : '|| l_cancel_flag, 2);
2918: OE_DEBUG_PUB.Add('Closed_code : '|| l_closed_code,2);
2919: END IF;
2920: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2921: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2914: l_closed_code := l_po_status_rec.closed_code(1);
2915: IF l_debug_level > 0 THEN
2916: OE_DEBUG_PUB.Add('Sucess call from PO_DOCUMENT_CHECKS_GRP.po_status_check',2);
2917: OE_DEBUG_PUB.Add('Cancel_flag : '|| l_cancel_flag, 2);
2918: OE_DEBUG_PUB.Add('Closed_code : '|| l_closed_code,2);
2919: END IF;
2920: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2921: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2922: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2935: (nvl(l_cancel_flag,'z')='Y' AND
2936: nvl(l_closed_code, 'z')= 'FINALLY CLOSED' ) THEN
2937:
2938: IF l_debug_level > 0 THEN
2939: OE_DEBUG_PUB.Add('Requisition or PO is cancelled',1);
2940: END IF;
2941:
2942: RETURN TRUE;
2943: ELSE
2950:
2951: EXCEPTION
2952: WHEN NO_DATA_FOUND THEN
2953: IF l_debug_level > 0 THEN
2954: OE_DEBUG_PUB.Add('No Data Found in Check_Req_PO_Cancelled', 4);
2955: END IF;
2956: RETURN FALSE;
2957: WHEN OTHERS THEN
2958: IF l_debug_level > 0 THEN
2955: END IF;
2956: RETURN FALSE;
2957: WHEN OTHERS THEN
2958: IF l_debug_level > 0 THEN
2959: OE_DEBUG_PUB.Add('When Others in Check_Req_PO_Cancelled'|| sqlerrm, 3);
2960: END IF;
2961: RETURN FALSE;
2962: END Check_Req_PO_Cancelled;
2963:
2989: l_item_type_code VARCHAR2(30) := oe_line_security.g_record.item_type_code;
2990: l_source_type_code VARCHAR2(30) := oe_line_security.g_record.source_type_code;
2991: l_operation VARCHAR2(30) := oe_line_security.g_record.operation;
2992:
2993: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
2994:
2995: l_po_header_id NUMBER;
2996: --bug 4411054
2997: --l_po_status VARCHAR2(4100);
3018: NOT (l_item_type_code in('OPTION','STANDARD','INCLUDED') AND --9775352
3019: l_ato_line_id = l_line_id ) THEN
3020:
3021: IF l_debug_level > 0 THEN
3022: OE_DEBUG_PUB.Add('Line part of a ATO Model: '||l_ato_line_id, 2);
3023: END IF;
3024:
3025: SELECT po_header_id, po_release_id
3026: INTO l_po_header_id, l_po_release_id --bug 5328526
3052: (x_po_header_id => l_po_header_id
3053: ));
3054:
3055: IF l_debug_level > 0 THEN
3056: OE_DEBUG_PUB.Add('Check PO Status : '|| l_po_status, 2);
3057: END IF;
3058: */
3059:
3060: PO_DOCUMENT_CHECKS_GRP.po_status_check
3068: IF(l_return_status = FND_API.G_RET_STS_SUCCESS) THEN
3069: l_autorization_status := l_po_status_rec.authorization_status(1);
3070:
3071: IF l_debug_level > 0 THEN
3072: OE_DEBUG_PUB.Add('Sucess call from PO_DOCUMENT_CHECKS_GRP.po_status_check',2);
3073: OE_DEBUG_PUB.Add('Check PO Status : '|| l_autorization_status, 2);
3074: END IF;
3075: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3076: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3069: l_autorization_status := l_po_status_rec.authorization_status(1);
3070:
3071: IF l_debug_level > 0 THEN
3072: OE_DEBUG_PUB.Add('Sucess call from PO_DOCUMENT_CHECKS_GRP.po_status_check',2);
3073: OE_DEBUG_PUB.Add('Check PO Status : '|| l_autorization_status, 2);
3074: END IF;
3075: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3076: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3077: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
3094: WHEN NO_DATA_FOUND THEN
3095: p_result := 0;
3096:
3097: IF l_debug_level > 0 THEN
3098: OE_DEBUG_PUB.Add('No Data Found in Check_PO_Approved', 4);
3099: END IF;
3100: WHEN OTHERS THEN
3101: p_result := 1;
3102:
3100: WHEN OTHERS THEN
3101: p_result := 1;
3102:
3103: IF l_debug_level > 0 THEN
3104: OE_DEBUG_PUB.Add('When Others in Check_PO_Approved', 4);
3105: END IF;
3106:
3107: End Check_PO_Approved;
3108:
3128: l_header_id NUMBER := oe_line_security.g_record.header_id;
3129: l_drop_ship_flag VARCHAR2(1);
3130: l_source_type_code VARCHAR2(10) := oe_line_security.g_record.source_type_code;
3131:
3132: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
3133:
3134: BEGIN
3135:
3136: p_result := 0;
3156:
3157: p_result := 0;
3158:
3159: IF l_debug_level > 0 THEN
3160: OE_DEBUG_PUB.Add('OM PO Discrepancy Exists', 4);
3161: END IF;
3162: ELSE
3163: p_result := 1;
3164:
3162: ELSE
3163: p_result := 1;
3164:
3165: IF l_debug_level > 0 THEN
3166: OE_DEBUG_PUB.Add('No Discrepancy Exisits', 4);
3167: END IF;
3168: END IF;
3169:
3170: EXCEPTION
3171: WHEN NO_DATA_FOUND THEN
3172: p_result := 0;
3173:
3174: IF l_debug_level > 0 THEN
3175: OE_DEBUG_PUB.Add('No Data Found in OM_PO_Discrepancy_Exists', 4);
3176: END IF;
3177: WHEN OTHERS THEN
3178: p_result := 1;
3179:
3177: WHEN OTHERS THEN
3178: p_result := 1;
3179:
3180: IF l_debug_level > 0 THEN
3181: OE_DEBUG_PUB.Add('When Others in OM_PO_Discrepancy_Exists', 4);
3182: END IF;
3183: END OM_PO_Discrepancy_Exists;
3184:
3185: END OE_DS_PVT;