142: l_msg_name VARCHAR2(50);
143: BEGIN
144: debug('Entered procedure','process_mobile_msg');
145:
146: l_msg_count := fnd_msg_pub.count_msg;
147: debug('Msg Count: ' || l_msg_count,'process_mobile_msg');
148:
149: FOR i IN 1..l_msg_count LOOP
150: fnd_msg_pub.get(p_msg_index => i,
146: l_msg_count := fnd_msg_pub.count_msg;
147: debug('Msg Count: ' || l_msg_count,'process_mobile_msg');
148:
149: FOR i IN 1..l_msg_count LOOP
150: fnd_msg_pub.get(p_msg_index => i,
151: p_data => l_msg_data,
152: p_msg_index_out => l_dummy_number);
153:
154: debug('i: ' || i || ' index_out: ' || l_dummy_number || ' encoded_data: ' || l_msg_data,'process_mobile_msg');
159:
160: debug('App_short_name: ' || l_app_short_name || ' Msg_name: ' || l_msg_name,'process_mobile_msg');
161:
162: IF ((l_msg_name <> 'WSH_DET_INV_INT_SUBMITTED')) THEN
163: fnd_msg_pub.delete_msg(p_msg_index=>i);
164: debug('Deleted message at position: ' || i,'process_mobile_msg');
165: END IF;
166: END LOOP;
167: EXCEPTION
591: x_return_Status := fnd_api.g_ret_sts_error;
592: fnd_message.set_name('WMS','WMS_DEL_LOCK_FAILURE');
593: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME',l_del_name);
594: /*Failed to aquire locks on wsh_new_deliveries for
595: fnd_msg_pub.add;
596: fnd_msg_pub.count_and_get( p_count => x_msg_count,
597: p_data => x_msg_data
598: );
599: /*Failed to lock the delivery */
592: fnd_message.set_name('WMS','WMS_DEL_LOCK_FAILURE');
593: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME',l_del_name);
594: /*Failed to aquire locks on wsh_new_deliveries for
595: fnd_msg_pub.add;
596: fnd_msg_pub.count_and_get( p_count => x_msg_count,
597: p_data => x_msg_data
598: );
599: /*Failed to lock the delivery */
600: x_error_code := 5;
621: IF l_return_Status = 'S' AND l_missing_count > 0 then
622: IF (l_debug = 1) THEN
623: debug('There are Missing Items','CHECK_DELIVERY');
624: END IF;
625: fnd_msg_pub.count_and_get( p_count => x_msg_count,
626: p_data => x_msg_data
627: );
628: x_return_Status := fnd_api.g_ret_sts_error;
629: x_error_code := 1; -- not entire delivery is ready
647: fnd_message.set_name('WMS','WMS_NO_ISSUE_TRX');
648: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME',l_del_name);
649: /*Material Status prevents the sales order issue transaction for one
650: or more items in the delivery
651: FND_MSG_PUB.ADD;
652: IF (l_debug = 1) THEN
653: debug('Call to INV_SHIPPING_TRANSACTION_PUB.CHECK_DELIVERY_STATUS ' ||
654: 'returned with Status E '||P_DELIVERY_ID,'Check_Delivery');
655: END IF;
659: fnd_message.set_name('WMS','WMS_NO_ISSUE_TRX');
660: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME',l_del_name);
661: /*Material Status prevents the sales order issue transaction for one or
662: more items in the delivery
663: FND_MSG_PUB.ADD;
664: x_error_code := 2;
665: RAISE fnd_api.g_exc_unexpected_error;
666: END IF;
667: IF (l_debug = 1) THEN
683: ' E- shipset '||l_ship_set,'Check_Delivery');
684: END IF;
685: FND_MESSAGE.SET_NAME('INV', 'WMS_WSH_SHIPSET_FORCED');
686: FND_MESSAGE.SET_TOKEN('SHIP_SET_NAME', l_ship_set);
687: FND_MSG_PUB.ADD;
688: RAISE unspec_ship_set_exists;
689: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
690: FND_MESSAGE.SET_NAME('INV', 'WMS_SHIPSET_FAILED');
691: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME', l_del_name);
689: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
690: FND_MESSAGE.SET_NAME('INV', 'WMS_SHIPSET_FAILED');
691: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME', l_del_name);
692: /*Ship set validation for the delivery
693: FND_MSG_PUB.ADD;
694: IF (l_debug = 1) THEN
695: debug('WMS_SHIPPING_TRANSACTION_PUB.ship_set_check returned with status U','Check_Delivery');
696: END IF;
697: RAISE fnd_api.g_exc_unexpected_error;
714: FND_MESSAGE.SET_NAME('WMS','WMS_LPN_OTHER_DOCK');
715: FND_MESSAGE.SET_TOKEN('LPN_NAME',x_outermost_lpn);
716: FND_MESSAGE.SET_TOKEN('DOCK',l_loaded_dock_door);
717: /* LPN
718: FND_MSG_PUB.ADD;
719: fnd_msg_pub.count_and_get( p_count => x_msg_count,
720: p_data => x_msg_data
721: );
722: l_return_status := fnd_api.g_ret_sts_error;
715: FND_MESSAGE.SET_TOKEN('LPN_NAME',x_outermost_lpn);
716: FND_MESSAGE.SET_TOKEN('DOCK',l_loaded_dock_door);
717: /* LPN
718: FND_MSG_PUB.ADD;
719: fnd_msg_pub.count_and_get( p_count => x_msg_count,
720: p_data => x_msg_data
721: );
722: l_return_status := fnd_api.g_ret_sts_error;
723: x_error_code := 4;
760: debug('In exception unspec_ship_set_exists -Check_Deliveries - errorcode '
761: ||x_error_code,'Check_Delivery');
762: END IF;
763: -- Get message count and data
764: fnd_msg_pub.count_and_get
765: ( p_count => x_msg_count
766: , p_data => x_msg_data);
767:
768: WHEN incomplete_delivery THEN
766: , p_data => x_msg_data);
767:
768: WHEN incomplete_delivery THEN
769: x_return_status := fnd_api.g_ret_sts_error;
770: fnd_msg_pub.count_and_get( p_count => x_msg_count,
771: p_data => x_msg_data
772: );
773: x_error_code := 2;
774: IF (l_debug = 1) THEN
779: x_return_status := fnd_api.g_ret_sts_error;
780: FND_MESSAGE.SET_NAME('WMS','WMS_SHIP_METHOD_CODE');
781: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME', l_del_name);
782: /* No Ship method code provided for the delivery DELIVERY_NAME .This is required */
783: FND_MSG_PUB.ADD;
784: fnd_msg_pub.count_and_get( p_count => x_msg_count,
785: p_data => x_msg_data
786: );
787: IF (l_debug = 1) THEN
780: FND_MESSAGE.SET_NAME('WMS','WMS_SHIP_METHOD_CODE');
781: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME', l_del_name);
782: /* No Ship method code provided for the delivery DELIVERY_NAME .This is required */
783: FND_MSG_PUB.ADD;
784: fnd_msg_pub.count_and_get( p_count => x_msg_count,
785: p_data => x_msg_data
786: );
787: IF (l_debug = 1) THEN
788: debug('In exception no_ship_method_code -Check_Deliveries - errorcode '||x_error_code,'Check_Delivery');
790: x_error_code := 6;
791: WHEN check_ord_line_split THEN
792: x_return_status := fnd_api.g_ret_sts_error;
793: x_error_code := 7;
794: fnd_msg_pub.count_and_get
795: ( p_count => x_msg_count
796: , p_data => x_msg_data
797: );
798: WHEN delivery_lines_mix THEN
800: x_error_code := 8;
801: FND_MESSAGE.SET_NAME('WMS','WMS_DEL_LINES_MIX');
802: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME', l_del_name);
803: /* The Delivery also has lines that were not staged through Direct Ship*/
804: FND_MSG_PUB.ADD;
805: fnd_msg_pub.count_and_get
806: ( p_count => x_msg_count
807: , p_data => x_msg_data
808: );
801: FND_MESSAGE.SET_NAME('WMS','WMS_DEL_LINES_MIX');
802: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME', l_del_name);
803: /* The Delivery also has lines that were not staged through Direct Ship*/
804: FND_MSG_PUB.ADD;
805: fnd_msg_pub.count_and_get
806: ( p_count => x_msg_count
807: , p_data => x_msg_data
808: );
809: WHEN fnd_api.g_exc_unexpected_error THEN
808: );
809: WHEN fnd_api.g_exc_unexpected_error THEN
810: x_return_status := fnd_api.g_ret_sts_unexp_error ;
811: -- Get message count and data
812: fnd_msg_pub.count_and_get
813: ( p_count => x_msg_count
814: , p_data => x_msg_data
815: );
816: IF (l_debug = 1) THEN
818: END IF;
819:
820: WHEN OTHERS THEN
821: x_return_status := fnd_api.g_ret_sts_unexp_error;
822: fnd_msg_pub.count_and_get
823: ( p_count => x_msg_count
824: , p_data => x_msg_data
825: );
826: x_error_code := 5;
947: FND_MESSAGE.SET_NAME('WMS','WMS_CREATE_FREIGHT_FAIL');
948: FND_MESSAGE.SET_TOKEN('OBJ','Delivery');
949: FND_MESSAGE.SET_TOKEN('VAL',l_del_name);
950: /* Creation of freight cost for OBJ VAL has failed */
951: fnd_msg_pub.add;
952: IF (l_debug = 1) THEN
953: debug('Update of Freight Cost for Del is failed ','UPDATE_DELIVERY');
954: END IF;
955: raise FND_API.G_EXC_ERROR;
956: ELSIF (l_return_status = 'U' ) THEN
957: FND_MESSAGE.SET_TOKEN('OBJ','Delivery');
958: FND_MESSAGE.SET_TOKEN('VAL',l_del_name);
959: /* Creation of freight cost for
960: fnd_msg_pub.add;
961: IF (l_debug = 1) THEN
962: debug('Update of Freight Cost for Del is succ ','UPDATE_DELIVERY');
963: END IF;
964: raise fnd_api.g_exc_unexpected_error;
1045: END IF;
1046: FND_MESSAGE.SET_NAME('WMS','WMS_UPDATE_DELIVERY_FAILED');
1047: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME',l_del_name);
1048: /* Updation of delivery
1049: fnd_msg_pub.add;
1050: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1051: ELSIF (l_return_status IN (fnd_api.g_ret_sts_error)) THEN
1052: FND_MESSAGE.SET_NAME('WMS','UPDATE_DELIVERY_FAILED');
1053: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME',l_del_name);
1051: ELSIF (l_return_status IN (fnd_api.g_ret_sts_error)) THEN
1052: FND_MESSAGE.SET_NAME('WMS','UPDATE_DELIVERY_FAILED');
1053: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME',l_del_name);
1054: /* Updation of delivery
1055: fnd_msg_pub.add;
1056: raise FND_API.G_EXC_ERROR;
1057: END IF;
1058: END IF;
1059: IF (l_debug = 1) THEN
1061: END IF;
1062: EXCEPTION
1063: WHEN fnd_api.g_exc_error THEN
1064: x_return_status := fnd_api.g_ret_sts_error;
1065: fnd_msg_pub.count_and_get( p_count => x_msg_count,
1066: p_data => x_msg_data
1067: );
1068: ROLLBACK;
1069:
1072: END IF;
1073:
1074: WHEN fnd_api.g_exc_unexpected_error THEN
1075: x_return_status := fnd_api.g_ret_sts_unexp_error;
1076: fnd_msg_pub.count_and_get( p_count => x_msg_count,
1077: p_data => x_msg_data
1078: );
1079: ROLLBACK;
1080:
1087:
1088: WHEN OTHERS THEN
1089: ROLLBACK;
1090: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1091: fnd_msg_pub.count_and_get( p_count => x_msg_count,
1092: p_data => x_msg_data
1093: );
1094: IF delivery_freight%ISOPEN THEN
1095: CLOSE delivery_freight;
1344: ,p_organization_id => p_org_id
1345: ,p_dock_door_id => p_dock_door_id);
1346: x_error_code := l_error_code;
1347: x_return_status := FND_API.G_RET_STS_ERROR;
1348: fnd_msg_pub.count_and_get( p_count => x_msg_count,
1349: p_data => x_msg_data);
1350: RETURN;
1351: ELSIF (l_error_code in (2,3,4,5,6,7,8) ) THEN
1352: IF (l_debug = 1) THEN
1353: debug(' Ship_Confirm Error. ShipSet, LPN Loaded on different Dock,ship_method_code ','Ship_Confirm');
1354: END IF;
1355: x_error_code := l_error_code;
1356: x_return_status := l_return_status;
1357: fnd_msg_pub.count_and_get( p_count => x_msg_count,
1358: p_data => x_msg_data);
1359: RETURN;
1360: END IF ;
1361:
1427: END IF;
1428: fnd_message.set_name('WMS','WMS_CREATE_TRIP_FAIL');
1429: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME',l_del_name);
1430: /* Failed to create trip for the delivery DELIVERY_NAME */
1431: FND_MSG_PUB.ADD;
1432: RAISE fnd_api.g_exc_error;
1433: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1434: fnd_message.set_name('WMS','WMS_CREATE_TRIP_FAIL');
1435: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME',l_del_name);
1432: RAISE fnd_api.g_exc_error;
1433: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1434: fnd_message.set_name('WMS','WMS_CREATE_TRIP_FAIL');
1435: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME',l_del_name);
1436: FND_MSG_PUB.ADD;
1437: IF (l_debug = 1) THEN
1438: debug(' Ship_Confirm. Create Trip Failed Unexpected Error','Ship_Confirm');
1439: END IF;
1440: RAISE fnd_api.g_exc_unexpected_error;
1543: IF( l_return_status IN (fnd_api.g_ret_sts_error)) THEN
1544: FND_MESSAGE.SET_NAME('WMS','WMS_CONFIRM_DEL_FAIL');
1545: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME',l_del_name);
1546: -- Ship Confirm of delivey
1547: FND_MSG_PUB.ADD;
1548: IF (l_debug = 1) THEN
1549: debug(' Ship_Confirm. Confirm Delivery is failing from WSH_DELIVERY_PUB','Ship_Confirm');
1550: END IF;
1551: raise FND_API.G_EXC_ERROR;
1553: ELSIF (l_return_status = fnd_api.g_ret_sts_unexp_error) THEN
1554: FND_MESSAGE.SET_NAME('WMS','WMS_CONFIRM_DEL_FAIL');
1555: FND_MESSAGE.SET_TOKEN('DELIVERY_NAME',l_del_name);
1556: /* cONFIRM DELIVERY FAILED*/
1557: FND_MSG_PUB.ADD;
1558: IF (l_debug = 1) THEN
1559: debug(' Ship_Confirm. Confirm Delivery is failing from WSH_DELIVERY_PUB, Unexpected error','Ship_Confirm');
1560: END IF;
1561: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1562: END IF;
1563:
1564: --Ship confirm successful. Display only Interface Trip stop message from shipping
1565: process_mobile_msg;
1566: x_msg_count := fnd_msg_pub.count_msg;
1567: EXCEPTION
1568: WHEN fnd_api.g_exc_error THEN
1569: x_return_status := fnd_api.g_ret_sts_error;
1570: IF (l_debug = 1) THEN
1569: x_return_status := fnd_api.g_ret_sts_error;
1570: IF (l_debug = 1) THEN
1571: debug('In Exception (expected error) - E ','Ship_Confirm');
1572: END IF;
1573: fnd_msg_pub.count_and_get
1574: ( p_count => x_msg_count,
1575: p_data => x_msg_data
1576: );
1577: WHEN fnd_api.g_exc_unexpected_error THEN
1578: x_return_status := fnd_api.g_ret_sts_unexp_error;
1579: IF (l_debug = 1) THEN
1580: debug('In Exception (unexpected error) - U ','Ship_Confirm');
1581: END IF;
1582: fnd_msg_pub.count_and_get
1583: ( p_count => x_msg_count,
1584: p_data => x_msg_data
1585: );
1586: WHEN OTHERS THEN
1587: x_return_status := fnd_api.g_ret_sts_unexp_error;
1588: IF (l_debug = 1) THEN
1589: debug('In Exception (others)' ||SQLERRM,'Ship_Confirm');
1590: END IF;
1591: fnd_msg_pub.count_and_get
1592: ( p_count => x_msg_count,
1593: p_data => x_msg_data
1594: );
1595: END; -- SHIP_CONFIRM
1832: END IF ;
1833: IF (l_debug = 1) THEN
1834: debug('In Exception (expected error) - E ','Confirm_All_Deliveries');
1835: END IF;
1836: fnd_msg_pub.count_and_get
1837: ( p_count => x_msg_count,
1838: p_data => x_msg_data
1839: );
1840: WHEN fnd_api.g_exc_unexpected_error THEN
1844: END IF ;
1845: IF (l_debug = 1) THEN
1846: debug('In Exception (unexpected error) - U ','Confirm_All_Deliveries');
1847: END IF;
1848: fnd_msg_pub.count_and_get
1849: ( p_count => x_msg_count,
1850: p_data => x_msg_data
1851: );
1852: WHEN OTHERS THEN
1856: END IF ;
1857: IF (l_debug = 1) THEN
1858: debug('In Exception (others)' ||SQLERRM,'Confirm_All_Deliveries');
1859: END IF;
1860: fnd_msg_pub.count_and_get
1861: ( p_count => x_msg_count,
1862: p_data => x_msg_data
1863: );
1864:
2049: wms_globals.g_ship_confirm_method := NULL;
2050: IF (l_debug = 1) THEN
2051: debug('In Exception (expected error) - E ','CREATE_TRIP');
2052: END IF;
2053: fnd_msg_pub.count_and_get
2054: ( p_count => l_msg_count,
2055: p_data => l_msg_data
2056: );
2057: WHEN fnd_api.g_exc_unexpected_error THEN
2059: wms_globals.g_ship_confirm_method := NULL;
2060: IF (l_debug = 1) THEN
2061: debug('In Exception (unexpected error) - U ','Create_Trip');
2062: END IF;
2063: fnd_msg_pub.count_and_get
2064: ( p_count => l_msg_count,
2065: p_data => l_msg_data
2066: );
2067: WHEN others THEN
2218: FND_MESSAGE.SET_TOKEN('OBJ','Trip');
2219: FND_MESSAGE.SET_TOKEN('VAL',l_name);
2220: /* Creation of freight cost for
2221:
2222: FND_MSG_PUB.ADD;
2223: IF (l_debug = 1) THEN
2224: debug('Create_Update Freight Cost API failed with status E ','Update Trip Stop');
2225: END IF;
2226: RAISE fnd_api.g_exc_error;
2225: END IF;
2226: RAISE fnd_api.g_exc_error;
2227: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2228: FND_MESSAGE.SET_NAME('WMS','CREATE_FREIGHT_FAIL');
2229: FND_MSG_PUB.ADD;
2230: IF (l_debug = 1) THEN
2231: debug('Update Freight Cost failed with status U','Update TripStop');
2232: END IF;
2233: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2279: IF l_return_status IN(fnd_api.g_ret_sts_error) THEN
2280: FND_MESSAGE.SET_NAME('WMS','WMS_UPD_STOP_FAIL');
2281: FND_MESSAGE.SET_TOKEN('TRIP_NAME',l_name);
2282: -- Failed to Create/update Trip Stop for the trip
2283: fnd_msg_pub.ADD;
2284: IF (l_debug = 1) THEN
2285: debug('Create_Update_Stop API failed with status E ','Update Trip Stop');
2286: END IF;
2287: RAISE fnd_api.g_exc_error;
2288: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2289: FND_MESSAGE.SET_NAME('WMS','WMS_UPD_STOP_FAIL');
2290: FND_MESSAGE.SET_TOKEN('TRIP_NAME',l_name);
2291: -- Failed to Create/update Trip Stop for the trip
2292: fnd_msg_pub.ADD;
2293: IF (l_debug = 1) THEN
2294: debug('Create_Update_Stop failed with status U','Update TripStop');
2295: END IF;
2296: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2352: ROLLBACK;
2353: IF trip_freight%ISOPEN THEN
2354: CLOSE trip_freight;
2355: END IF;
2356: fnd_msg_pub.count_and_get
2357: ( p_count => x_msg_count,
2358: p_data => x_msg_data
2359: );
2360:
2366: ROLLBACK;
2367: IF trip_freight%ISOPEN THEN
2368: CLOSE trip_freight;
2369: END IF;
2370: fnd_msg_pub.count_and_get
2371: ( p_count => x_msg_count,
2372: p_data => x_msg_data
2373: );
2374:
2514: END IF;
2515:
2516: l_count1 := 0;
2517: l_count2 := 0;
2518: l_count1 := fnd_msg_pub.count_msg();
2519:
2520: IF (l_debug = 1) THEN
2521: DEBUG('Call WSH_DOCUMENT_SETS.Print_document_Sets for all the deliveries');
2522: DEBUG('Msg table count' || l_count1, 'Print_Shipping_document');
2536: , p_delivery_ids => l_delivery_id
2537: , p_document_param_info => l_document_param_info
2538: , x_return_status => l_return_status
2539: );
2540: l_count2 := fnd_msg_pub.count_msg();
2541:
2542: IF (l_debug = 1) THEN
2543: DEBUG('Msg table count' || l_count2, 'Print_Shipping_document');
2544: END IF;
2546: IF l_count2 > l_count1 THEN
2547: l_count1 := l_count1 + 2;
2548:
2549: FOR i IN REVERSE l_count1 .. l_count2 LOOP
2550: l_dummy := fnd_msg_pub.get(i, fnd_api.g_true);
2551:
2552: IF (l_debug = 1) THEN
2553: DEBUG('Messages are' || l_dummy, 'Print_Shipping_document');
2554: END IF;
2552: IF (l_debug = 1) THEN
2553: DEBUG('Messages are' || l_dummy, 'Print_Shipping_document');
2554: END IF;
2555:
2556: fnd_msg_pub.delete_msg(i);
2557: END LOOP;
2558: END IF;
2559:
2560: IF l_return_status IN(fnd_api.g_ret_sts_error) THEN
2559:
2560: IF l_return_status IN(fnd_api.g_ret_sts_error) THEN
2561: fnd_message.set_name('WMS', 'WMS_PRINT_DOC_SET_FAIL');
2562: /* Failed to print the documents set */
2563: fnd_msg_pub.ADD;
2564:
2565: IF (l_debug = 1) THEN
2566: DEBUG('Print Document_sets API failed with status E ', 'Print_shipping_dcouments');
2567: END IF;
2567: END IF;
2568: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2569: fnd_message.set_name('WMS', 'WMS_PRINT_DOC_SET_FAIL');
2570: /* Failed to print the documents set */
2571: fnd_msg_pub.ADD;
2572:
2573: IF (l_debug = 1) THEN
2574: DEBUG('Print Document_sets API failed with status U ', 'Print_shipping_dcouments');
2575: END IF;
2583: IF (l_debug = 1) THEN
2584: DEBUG('Print Document has failed :Error', 'Print_shipping_dcouments');
2585: END IF;
2586:
2587: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2588: ROLLBACK;
2589: -- Think of some messages here.
2590: WHEN fnd_api.g_exc_unexpected_error THEN
2591: IF (l_debug = 1) THEN
2593: END IF;
2594:
2595: x_return_status := fnd_api.g_ret_sts_unexp_error;
2596: ROLLBACK;
2597: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2598:
2599: -- Think of some messages here.
2600: IF (l_debug = 1) THEN
2601: DEBUG('Print Document has failed :Unexpected Error', 'Print_shipping_dcouments');
2607: IF (l_debug = 1) THEN
2608: DEBUG('Print Document has failed : Unexpected Error', 'Print_shipping_dcouments');
2609: END IF;
2610:
2611: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2612:
2613: IF SQLCODE IS NOT NULL THEN
2614: IF (l_debug = 1) THEN
2615: DEBUG(SQLCODE, 'Print_shipping_dcouments');
2690: DEBUG('p_ship_method_code : ' || p_ship_method_code, 'close_trip');
2691: END IF;
2692:
2693: x_return_status := fnd_api.g_ret_sts_success;
2694: fnd_msg_pub.initialize;
2695:
2696: IF (l_debug = 1) THEN
2697: DEBUG('Begin Close Trip ', 'CLOSE_TRIP');
2698: END IF;
2794: fnd_message.set_token('LPN_NAME', l_outermost_lpn);
2795: fnd_message.set_token('TRIP', l_trip_name);
2796: fnd_message.set_token('DOCK', l_loaded_dock_door);
2797: /*Close Trip failed */
2798: fnd_msg_pub.ADD;
2799: x_return_status := fnd_api.g_ret_sts_error;
2800: CLOSE lpn_in_other_dock;
2801: RETURN;
2802: END IF;
2842: IF l_return_status IN(fnd_api.g_ret_sts_error) THEN
2843: fnd_message.set_name('WMS', 'WMS_CLOSE_TRIP_FAIL');
2844: fnd_message.set_token('TRIP_NAME', l_name);
2845: /*Failed to close the trip TRIP_NAME*/
2846: fnd_msg_pub.ADD;
2847:
2848: IF (l_debug = 1) THEN
2849: DEBUG('Stop_Action API failed with status E ', 'Close_Trip');
2850: END IF;
2853: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2854: fnd_message.set_name('WMS', 'WMS_CLOSE_TRIP_FAIL');
2855: fnd_message.set_token('TRIP_NAME', l_name);
2856: /*Failed to close the trip TRIP_NAME*/
2857: fnd_msg_pub.ADD;
2858:
2859: IF (l_debug = 1) THEN
2860: DEBUG('Stop_Action API failed with status U', 'Close_Trip');
2861: END IF;
2895: IF l_return_status IN(fnd_api.g_ret_sts_error) THEN
2896: fnd_message.set_name('WMS', 'WMS_CLOSE_TRIP_FAIL');
2897: fnd_message.set_token('TRIP_NAME', l_name);
2898: /*Failed to close the trip TRIP_NAME*/
2899: fnd_msg_pub.ADD;
2900:
2901: IF (l_debug = 1) THEN
2902: DEBUG('Stop_Action API failed with status E ', 'Close_Trip');
2903: END IF;
2906: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2907: fnd_message.set_name('WMS', 'WMS_CLOSE_TRIP_FAIL');
2908: fnd_message.set_token('TRIP_NAME', l_name);
2909: /*Failed to close the trip TRIP_NAME*/
2910: fnd_msg_pub.ADD;
2911:
2912: IF (l_debug = 1) THEN
2913: DEBUG('Stop_Action API failed with status U', 'Close_Trip');
2914: END IF;
2935: IF (l_debug = 1) THEN
2936: DEBUG('Label Printing failed ', 'Close Trip');
2937: END IF;
2938:
2939: fnd_msg_pub.ADD;
2940: l_return_status := 'W';
2941: END IF;
2942:
2943: -- Clean up trips which are closed
2958:
2959: IF l_return_status =(fnd_api.g_ret_sts_error) THEN
2960: fnd_message.set_name('WMS', 'WMS_CLOSE_TRIP_FAIL');
2961: /*Failed while running cleanup program */
2962: fnd_msg_pub.ADD;
2963:
2964: IF (l_debug = 1) THEN
2965: DEBUG('CLEANUP_TEMP_RECS API failed with status E ', 'Close_Trip');
2966: END IF;
2968: RAISE fnd_api.g_exc_error;
2969: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2970: fnd_message.set_name('WMS', 'WMS_CLOSE_TRIP_FAIL');
2971: /*Failed while running cleanup program */
2972: fnd_msg_pub.ADD;
2973:
2974: IF (l_debug = 1) THEN
2975: DEBUG('CLEANUP_TEMP_RECS API failed with status U', 'Close_Trip');
2976: END IF;
2986: x_return_status := fnd_api.g_ret_sts_error;
2987: fnd_message.set_name('WMS', 'WMS_SHIP_METHOD_CODE');
2988: fnd_message.set_token('TRIP_NAME', l_name);
2989: /* No Ship method code provided for the Trip .This is required */
2990: fnd_msg_pub.ADD;
2991: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2992: DEBUG('In exception no_ship_method_code - - errorcode ', 'Close Trip');
2993: WHEN fnd_api.g_exc_error THEN
2994: x_return_status := fnd_api.g_ret_sts_error;
2987: fnd_message.set_name('WMS', 'WMS_SHIP_METHOD_CODE');
2988: fnd_message.set_token('TRIP_NAME', l_name);
2989: /* No Ship method code provided for the Trip .This is required */
2990: fnd_msg_pub.ADD;
2991: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2992: DEBUG('In exception no_ship_method_code - - errorcode ', 'Close Trip');
2993: WHEN fnd_api.g_exc_error THEN
2994: x_return_status := fnd_api.g_ret_sts_error;
2995: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2991: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2992: DEBUG('In exception no_ship_method_code - - errorcode ', 'Close Trip');
2993: WHEN fnd_api.g_exc_error THEN
2994: x_return_status := fnd_api.g_ret_sts_error;
2995: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
2996: ROLLBACK;
2997:
2998: -- Think of some messages here.
2999: IF (l_debug = 1) THEN
3007: IF (l_debug = 1) THEN
3008: DEBUG('Close Trip has failed :Unexpected Error', 'Close_Trip');
3009: END IF;
3010:
3011: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3012: WHEN OTHERS THEN
3013: ROLLBACK;
3014: x_return_status := fnd_api.g_ret_sts_unexp_error;
3015:
3016: IF (l_debug = 1) THEN
3017: DEBUG('Close Trip has failed : Unexpected Error', 'Close_Trip');
3018: END IF;
3019:
3020: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3021:
3022: IF SQLCODE IS NOT NULL THEN
3023: IF (l_debug = 1) THEN
3024: DEBUG(SQLCODE, 'Close_Trip');
3396:
3397: IF l_return_status = fnd_api.g_ret_sts_error THEN
3398: fnd_message.set_name('WMS', 'WMS_RET_LINE_TO_STOCK');
3399: /* Failed to unload the delivery line */
3400: fnd_msg_pub.ADD;
3401:
3402: IF (l_debug = 1) THEN
3403: DEBUG('inv_line_return_to_stock API failed with status E ', 'Unload_Truck');
3404: END IF;
3410: END IF;
3411:
3412: fnd_message.set_name('WMS', 'WMS_RET_LINE_TO_STOCK');
3413: /* Failed to unload the delivery line */
3414: fnd_msg_pub.ADD;
3415: RAISE fnd_api.g_exc_unexpected_error;
3416: END IF;
3417:
3418: IF (l_debug = 1) THEN
3487:
3488: IF l_return_status = fnd_api.g_ret_sts_error THEN
3489: fnd_message.set_name('WMS', 'WMS_CLEANUP_TEMP');
3490: /*Failed in cleanup program*/
3491: fnd_msg_pub.ADD;
3492:
3493: IF (l_debug = 1) THEN
3494: DEBUG('CLEANUP_TEMP_RECS API failed with status E ', 'Unload_truck');
3495: END IF;
3497: RAISE fnd_api.g_exc_error;
3498: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
3499: fnd_message.set_name('WMS', 'WMS_CLEANUP_TEMP');
3500: /*Failed in cleanup program*/
3501: fnd_msg_pub.ADD;
3502:
3503: IF (l_debug = 1) THEN
3504: DEBUG('CLEANUP_TEMP_RECS failed with status U', 'Unload_truck');
3505: END IF;
3516: EXCEPTION
3517: WHEN fnd_api.g_exc_error THEN
3518: x_return_status := fnd_api.g_ret_sts_error;
3519: ROLLBACK;
3520: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3521:
3522: IF (l_debug = 1) THEN
3523: DEBUG('Execution Error in Unload_Truck:' || SUBSTR(SQLERRM, 1, 240), 'Unload_Truck');
3524: END IF;
3524: END IF;
3525: WHEN fnd_api.g_exc_unexpected_error THEN
3526: x_return_status := fnd_api.g_ret_sts_unexp_error;
3527: ROLLBACK;
3528: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3529:
3530: IF (l_debug = 1) THEN
3531: DEBUG('Unexpected Error in Unload_Truck:' || SUBSTR(SQLERRM, 1, 240), 'Unload_Truck');
3532: END IF;
3534: --x_error_code := 9999;
3535: x_return_status := fnd_api.g_ret_sts_unexp_error;
3536: ROLLBACK;
3537:
3538: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3539: fnd_msg_pub.add_exc_msg('WMS_DIRECT_SHIP_PVT', 'UNLOAD_TRUCK');
3540: END IF;
3541:
3542: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3535: x_return_status := fnd_api.g_ret_sts_unexp_error;
3536: ROLLBACK;
3537:
3538: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3539: fnd_msg_pub.add_exc_msg('WMS_DIRECT_SHIP_PVT', 'UNLOAD_TRUCK');
3540: END IF;
3541:
3542: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3543:
3538: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3539: fnd_msg_pub.add_exc_msg('WMS_DIRECT_SHIP_PVT', 'UNLOAD_TRUCK');
3540: END IF;
3541:
3542: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3543:
3544: IF (l_debug = 1) THEN
3545: DEBUG('Unexpected Error in Unload_Truck:' || SUBSTR(SQLERRM, 1, 240), 'Unload_Truck');
3546: END IF;
3650: --x_error_code := 9999;
3651: x_return_status := fnd_api.g_ret_sts_unexp_error;
3652: ROLLBACK;
3653:
3654: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3655: fnd_msg_pub.add_exc_msg('WMS_DIRECT_SHIP_PVT', 'CLEANUP_TEMP');
3656: END IF;
3657:
3658: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3651: x_return_status := fnd_api.g_ret_sts_unexp_error;
3652: ROLLBACK;
3653:
3654: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3655: fnd_msg_pub.add_exc_msg('WMS_DIRECT_SHIP_PVT', 'CLEANUP_TEMP');
3656: END IF;
3657:
3658: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3659:
3654: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3655: fnd_msg_pub.add_exc_msg('WMS_DIRECT_SHIP_PVT', 'CLEANUP_TEMP');
3656: END IF;
3657:
3658: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3659:
3660: IF (l_debug = 1) THEN
3661: DEBUG('Unexpected Error in cleanup_temp:' || SUBSTR(SQLERRM, 1, 240), 'CLEANUP_TEMP_RECS');
3662: END IF;
3785: IF lpn_contents%ISOPEN THEN
3786: CLOSE lpn_contents;
3787: END IF;
3788:
3789: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3790: fnd_msg_pub.add_exc_msg('WMS_DIRECT_SHIP_PVT', 'validate_status_lpn_contents');
3791: END IF;
3792:
3793: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3786: CLOSE lpn_contents;
3787: END IF;
3788:
3789: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3790: fnd_msg_pub.add_exc_msg('WMS_DIRECT_SHIP_PVT', 'validate_status_lpn_contents');
3791: END IF;
3792:
3793: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3794: END validate_status_lpn_contents;
3789: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3790: fnd_msg_pub.add_exc_msg('WMS_DIRECT_SHIP_PVT', 'validate_status_lpn_contents');
3791: END IF;
3792:
3793: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3794: END validate_status_lpn_contents;
3795:
3796: PROCEDURE update_freight_cost(
3797: x_return_status OUT NOCOPY VARCHAR2
3900: END IF;
3901:
3902: x_return_status := fnd_api.g_ret_sts_error;
3903: ROLLBACK TO freight_cost;
3904: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3905: WHEN fnd_api.g_exc_unexpected_error THEN
3906: IF lpn_freight%ISOPEN THEN
3907: CLOSE lpn_freight;
3908: END IF;
3917: DEBUG('Update_Freight cost API failed with status (U)', 'update_freight_cost');
3918: END IF;
3919:
3920: ROLLBACK TO freight_cost;
3921: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3922: WHEN OTHERS THEN
3923: IF lpn_freight%ISOPEN THEN
3924: CLOSE lpn_freight;
3925: END IF;
3935: END IF;
3936:
3937: ROLLBACK TO freight_cost;
3938:
3939: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3940: fnd_msg_pub.add_exc_msg('WMS_DIRECT_SHIP_PVT', 'update_freight_cost');
3941: END IF;
3942:
3943: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3936:
3937: ROLLBACK TO freight_cost;
3938:
3939: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3940: fnd_msg_pub.add_exc_msg('WMS_DIRECT_SHIP_PVT', 'update_freight_cost');
3941: END IF;
3942:
3943: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3944: END update_freight_cost;
3939: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3940: fnd_msg_pub.add_exc_msg('WMS_DIRECT_SHIP_PVT', 'update_freight_cost');
3941: END IF;
3942:
3943: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
3944: END update_freight_cost;
3945:
3946: /******************************
3947: * Procedure Associates serial numbers with appropriate
4761: EXCEPTION
4762: WHEN fnd_api.g_exc_error THEN
4763: x_return_status := fnd_api.g_ret_sts_error;
4764: ROLLBACK;
4765: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
4766: WHEN fnd_api.g_exc_unexpected_error THEN
4767: x_return_status := fnd_api.g_ret_sts_unexp_error;
4768: ROLLBACK;
4769: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
4765: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
4766: WHEN fnd_api.g_exc_unexpected_error THEN
4767: x_return_status := fnd_api.g_ret_sts_unexp_error;
4768: ROLLBACK;
4769: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
4770: WHEN OTHERS THEN
4771: x_return_status := wsh_util_core.g_ret_sts_unexp_error;
4772: wsh_util_core.default_handler('WSH_DELIVERY_DETAILS_ACTIONS.EXPLODE_DELIVERY_DETAILS');
4773: END explode_delivery_details;
5067: IF (l_debug = 1) THEN
5068: DEBUG('Error Unassign_Detail_from_Cont'|| l_return_status, 'Overship Staged Lines');
5069: END IF;
5070: FND_MESSAGE.SET_NAME('INV', 'INV_UNASSIGN_DEL_FAILURE');
5071: FND_MSG_PUB.ADD;
5072: RAISE FND_API.G_EXC_ERROR;
5073: END IF;
5074:
5075: /*Now update the new delivery_Detail with correct attributes*/
7554: IF (l_debug = 1) THEN
7555: DEBUG('In exception type E', 'stage_lpns');
7556: END IF;
7557: -- ROLLBACK;
7558: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
7559:
7560: WHEN fnd_api.g_exc_unexpected_error THEN
7561: x_return_status := fnd_api.g_ret_sts_unexp_error;
7562:
7564: DEBUG('In exception type U', 'stage_lpns');
7565: END IF;
7566:
7567: -- ROLLBACK;
7568: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
7569: WHEN OTHERS THEN
7570: x_return_status := wsh_util_core.g_ret_sts_unexp_error;
7571:
7572: IF (l_debug = 1) THEN
7786: x_return_status := fnd_api.g_ret_sts_error;
7787: fnd_message.set_name('WMS', 'WMS_SHIP_METHOD_CODE');
7788: fnd_message.set_token('TRIP_NAME', l_trip_name);
7789: /* No Ship method code provided for the Trip .This is required */
7790: fnd_msg_pub.ADD;
7791: /*fnd_msg_pub.count_and_get( p_count => x_msg_count,
7792: p_data => x_msg_data
7793: );*/
7794: DEBUG('In exception no_ship_method_code ', 'Close Trip');
7787: fnd_message.set_name('WMS', 'WMS_SHIP_METHOD_CODE');
7788: fnd_message.set_token('TRIP_NAME', l_trip_name);
7789: /* No Ship method code provided for the Trip .This is required */
7790: fnd_msg_pub.ADD;
7791: /*fnd_msg_pub.count_and_get( p_count => x_msg_count,
7792: p_data => x_msg_data
7793: );*/
7794: DEBUG('In exception no_ship_method_code ', 'Close Trip');
7795: WHEN fnd_api.g_exc_error THEN
7794: DEBUG('In exception no_ship_method_code ', 'Close Trip');
7795: WHEN fnd_api.g_exc_error THEN
7796: x_return_status := fnd_api.g_ret_sts_error;
7797: ROLLBACK; --TO closetruck;
7798: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
7799: WHEN fnd_api.g_exc_unexpected_error THEN
7800: x_return_status := fnd_api.g_ret_sts_unexp_error;
7801: ROLLBACK; --TO closetruck;
7802: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
7798: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
7799: WHEN fnd_api.g_exc_unexpected_error THEN
7800: x_return_status := fnd_api.g_ret_sts_unexp_error;
7801: ROLLBACK; --TO closetruck;
7802: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
7803: WHEN OTHERS THEN
7804: x_return_status := fnd_api.g_ret_sts_unexp_error;
7805: ROLLBACK; --TO closetruck;
7806: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
7802: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
7803: WHEN OTHERS THEN
7804: x_return_status := fnd_api.g_ret_sts_unexp_error;
7805: ROLLBACK; --TO closetruck;
7806: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
7807: END;
7808:
7809: --CLOSE_TRUCK
7810:
7946: IF (l_debug = 1) THEN
7947: inv_log_util.TRACE('When others Exception in get_available_vmi_quantity', 'GET_LPN_AVAILABLE_QUANTITY', 9);
7948: END IF;
7949:
7950: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
7951: x_return_status := fnd_api.g_ret_sts_unexp_error;
7952: RETURN;
7953: END get_lpn_available_quantity;
7954:
8206: EXCEPTION
8207: WHEN fnd_api.g_exc_error THEN
8208: x_return_status := fnd_api.g_ret_sts_error;
8209: ROLLBACK;
8210: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
8211:
8212: IF (l_debug = 1) THEN
8213: DEBUG('Execution Error in Create_Update_Container:' || SUBSTR(SQLERRM, 1, 240), 9);
8214: END IF;
8213: DEBUG('Execution Error in Create_Update_Container:' || SUBSTR(SQLERRM, 1, 240), 9);
8214: END IF;
8215: WHEN fnd_api.g_exc_unexpected_error THEN
8216: x_return_status := fnd_api.g_ret_sts_unexp_error;
8217: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
8218:
8219: IF (l_debug = 1) THEN
8220: DEBUG('Unexpected Error in Create_Update_Container:' || SUBSTR(SQLERRM, 1, 240), 'create_update_containers');
8221: END IF;
8226: END IF;
8227: x_return_status := fnd_api.g_ret_sts_unexp_error;
8228: ROLLBACK;
8229:
8230: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
8231: fnd_msg_pub.add_exc_msg('WMS_DIRECT_SHIP_PVT', 'create_update_containers');
8232: END IF;
8233:
8234: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
8227: x_return_status := fnd_api.g_ret_sts_unexp_error;
8228: ROLLBACK;
8229:
8230: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
8231: fnd_msg_pub.add_exc_msg('WMS_DIRECT_SHIP_PVT', 'create_update_containers');
8232: END IF;
8233:
8234: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
8235: END create_update_containers;
8230: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
8231: fnd_msg_pub.add_exc_msg('WMS_DIRECT_SHIP_PVT', 'create_update_containers');
8232: END IF;
8233:
8234: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
8235: END create_update_containers;
8236:
8237: PROCEDURE update_shipped_quantity(
8238: x_return_status OUT NOCOPY VARCHAR2
8415: WHEN fnd_api.g_exc_error THEN
8416: x_return_status := fnd_api.g_ret_sts_error;
8417: x_error_code := 10;
8418: ROLLBACK;
8419: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
8420:
8421: IF (l_debug = 1) THEN
8422: DEBUG('Execution Error in Update_shipped_Quantity', 'Update_shipped_Quantity');
8423: DEBUG('Could not update shipping attributes', 'Update_shipped_Quantity');
8424: END IF;
8425: WHEN fnd_api.g_exc_unexpected_error THEN
8426: x_return_status := fnd_api.g_ret_sts_unexp_error;
8427: x_error_code := 20;
8428: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
8429:
8430: IF (l_debug = 1) THEN
8431: DEBUG('Unexpected Error in Update_shipped_Quantity:', 'Update_shipped_Quantity');
8432: DEBUG('Could not update shipping attributes', 'Update_shipped_Quantity');
8434: WHEN OTHERS THEN
8435: x_error_code := 30;
8436: x_return_status := fnd_api.g_ret_sts_unexp_error;
8437: ROLLBACK;
8438: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
8439:
8440: IF (l_debug = 1) THEN
8441: DEBUG('Could not update shipping attributes', 'Update_shipped_Quantity');
8442: END IF;
8838: EXCEPTION
8839: WHEN fnd_api.g_exc_error THEN
8840: x_return_status := fnd_api.g_ret_sts_error;
8841: ROLLBACK;
8842: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
8843:
8844: IF container_details%ISOPEN THEN
8845: CLOSE container_details;
8846: END IF;
8854: END IF;
8855: WHEN fnd_api.g_exc_unexpected_error THEN
8856: x_return_status := fnd_api.g_ret_sts_unexp_error;
8857: ROLLBACK;
8858: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
8859:
8860: IF (l_debug = 1) THEN
8861: DEBUG('Unexpected Error in lpn_hiearchy:' || SUBSTR(SQLERRM, 1, 240) || SQLCODE, 'Container_Nesting');
8862: END IF;
8870: END IF;
8871: WHEN OTHERS THEN
8872: x_return_status := fnd_api.g_ret_sts_unexp_error;
8873: ROLLBACK;
8874: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
8875:
8876: --debug('Unexpected Error in pack_lpns:' || substr(SQLERRM,1,240),9);
8877: IF (l_debug = 1) THEN
8878: DEBUG('When others in lpn_hiearchy:' || SUBSTR(SQLERRM, 1, 240) || SQLCODE, 'Container_Nesting');
8935: WHERE lpn_id = l_lpn_cur.parent_lpn_id;
8936:
8937: fnd_message.set_name('WMS', 'WMS_ORDER_LINE_SPLIT');
8938: fnd_message.set_token('CONTAINER_NAME', lpn_name);
8939: fnd_msg_pub.ADD;
8940: x_error_code := 7;
8941: RAISE fnd_api.g_exc_error;
8942:
8943: --dbms_output.put_line('Contents of the container '||lpn_name||' are split in order management');
8959: IF (l_debug = 1) THEN
8960: DEBUG('In Exception (expected error) - E ', 'CHECK_ORDER_LINE_SPLIT');
8961: END IF;
8962:
8963: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
8964: WHEN fnd_api.g_exc_unexpected_error THEN
8965: x_return_status := fnd_api.g_ret_sts_unexp_error;
8966:
8967: IF lpn_cur%ISOPEN THEN
8971: IF (l_debug = 1) THEN
8972: DEBUG('In UnException (unexpected error) - U ', 'CHECK_ORDER_LINE_SPLIT');
8973: END IF;
8974:
8975: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
8976: WHEN OTHERS THEN
8977: x_return_status := fnd_api.g_ret_sts_unexp_error;
8978:
8979: IF lpn_cur%ISOPEN THEN
8983: IF (l_debug = 1) THEN
8984: DEBUG('In Exception (When others) - U ', 'CHECK_ORDER_LINE_SPLIT');
8985: END IF;
8986:
8987: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
8988: END check_order_line_split;
8989:
8990: PROCEDURE check_missing_item_cur(
8991: p_delivery_id IN NUMBER
9148: END;
9149: EXCEPTION
9150: WHEN fnd_api.g_exc_error THEN
9151: x_return_status := fnd_api.g_ret_sts_error;
9152: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
9153: WHEN fnd_api.g_exc_unexpected_error THEN
9154: x_return_status := fnd_api.g_ret_sts_unexp_error;
9155: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
9156: WHEN OTHERS THEN
9151: x_return_status := fnd_api.g_ret_sts_error;
9152: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
9153: WHEN fnd_api.g_exc_unexpected_error THEN
9154: x_return_status := fnd_api.g_ret_sts_unexp_error;
9155: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
9156: WHEN OTHERS THEN
9157: x_return_status := fnd_api.g_ret_sts_unexp_error;
9158: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
9159: END chk_del_for_direct_ship;
9154: x_return_status := fnd_api.g_ret_sts_unexp_error;
9155: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
9156: WHEN OTHERS THEN
9157: x_return_status := fnd_api.g_ret_sts_unexp_error;
9158: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
9159: END chk_del_for_direct_ship;
9160:
9161:
9162: --Bug#5262108.This is to determine the qty remaining to pick
9478: END IF;
9479:
9480: x_return_status := fnd_api.g_ret_sts_error;
9481: fnd_message.set_name('WMS', 'WMS_SUB_NON_RESERVABLE');
9482: fnd_msg_pub.ADD;
9483: RETURN;
9484: ELSE
9485: IF (l_debug = 1) THEN
9486: DEBUG('Before getting LPN contents ', 'Process_LPN');
9587: END IF;
9588:
9589: x_return_status := fnd_api.g_ret_sts_error;
9590: fnd_message.set_name('WMS', 'WMS_ITEM_NON_RESERVABLE');
9591: fnd_msg_pub.ADD;
9592: RETURN;
9593: END IF;
9594:
9595: l_end_index := l_lpn_contents_cur%ROWCOUNT;
9613: DEBUG('Fulfillment base is S but LPN content record has 0 sec - Invalid sec qty for FB=S so stop further processing', 'Process_LPN');
9614: END IF;
9615: x_return_status := fnd_api.g_ret_sts_error;
9616: fnd_message.set_name('WMS','WMS_INVALID_SEC_QTY');
9617: fnd_msg_pub.ADD;
9618: RETURN;
9619: END IF;
9620:
9621: IF l_lpn_content_cur_rec.serial_control = 'TRUE' THEN
9682:
9683: IF g_lpn_contents_tab.COUNT = 0 THEN
9684: x_return_status := fnd_api.g_ret_sts_error;
9685: fnd_message.set_name('WMS', 'WMS_EMPTY_LPN');
9686: fnd_msg_pub.ADD;
9687:
9688: IF (l_debug = 1) THEN
9689: DEBUG('LPN is empty', 'Process_LPN');
9690: END IF;
9909: IF (l_debug = 1) THEN
9910: DEBUG('Non-Sales Order reservation exists, error out', 'Process_LPN');
9911: END IF;
9912: fnd_message.set_name('WMS', 'WMS_LINE_NOT_BOOKED');
9913: fnd_msg_pub.ADD;
9914: RAISE fnd_api.g_exc_error;
9915: END IF;
9916:
9917: BEGIN
9996: END IF;
9997:
9998: x_return_status := fnd_api.g_ret_sts_error;
9999: fnd_message.set_name('WMS', 'WMS_LINE_NOT_BOOKED');
10000: fnd_msg_pub.ADD;
10001: RETURN;
10002: END;
10003: IF (l_debug = 1) THEN
10004: DEBUG('l_order_line_status: '|| l_order_line_status, 'Process_LPN');
10014: END IF;
10015:
10016: x_return_status := fnd_api.g_ret_sts_error;
10017: fnd_message.set_name('WMS', 'WMS_PJM_VALIDATION_FAILED');
10018: fnd_msg_pub.ADD;
10019: RETURN;
10020: END IF;
10021: END IF;
10022:
10047: END IF;
10048:
10049: x_return_status := fnd_api.g_ret_sts_error;
10050: fnd_message.set_name('WMS', 'WMS_PJM_VALIDATION_FAILED');
10051: fnd_msg_pub.ADD;
10052: RETURN;
10053: END IF;
10054: END IF;
10055: END IF;
10061: END IF;
10062:
10063: x_return_status := fnd_api.g_ret_sts_error;
10064: fnd_message.set_name('WMS', 'WMS_DEL_GRP_FAILED');
10065: fnd_msg_pub.ADD;
10066: RETURN;
10067: END IF;
10068:
10069: -- check delivery for direct ship
10074: END IF;
10075:
10076: x_return_status := fnd_api.g_ret_sts_error;
10077: fnd_message.set_name('WMS', 'WMS_DEL_LINES_MIX');
10078: fnd_msg_pub.ADD;
10079: RETURN;
10080: END IF;
10081:
10082: IF l_num_line_processed = 0 THEN -- needs to be set only once
10109: END IF;
10110:
10111: x_return_status := fnd_api.g_ret_sts_error;
10112: fnd_message.set_name('WMS', 'WMS_HOLD_APPLIED');
10113: fnd_msg_pub.ADD;
10114: RETURN;
10115: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
10116: IF (l_debug = 1) THEN
10117: DEBUG('Check holds Failed :Unexpected', 'Process_LPN');
10118: END IF;
10119:
10120: x_return_status := fnd_api.g_ret_sts_error;
10121: fnd_message.set_name('WMS', 'WMS_HOLD_APPLIED');
10122: fnd_msg_pub.ADD;
10123: RETURN;
10124: ELSE
10125: IF (l_debug = 1) THEN
10126: DEBUG('Check Holds Succeeded', 'Process LPN');
10134: IF (l_debug = 1) THEN
10135: DEBUG('Cannot mix fulfillment modes', 'Process_LPN');
10136: END IF;
10137: fnd_message.set_name('WMS', 'WMS_LPN_FB_COMINGLE');
10138: fnd_msg_pub.ADD;
10139: RAISE fnd_api.g_exc_error;
10140: END IF;
10141:
10142: -- get oe_order_header_id from sales order header id
10407: END IF;
10408:
10409: x_return_status := fnd_api.g_ret_sts_error;
10410: fnd_message.set_name('WMS', 'WMS_PJM_VALIDATION_FAILED');
10411: fnd_msg_pub.ADD;
10412: RETURN;
10413: END IF;
10414:
10415: IF (l_debug = 1) THEN
10486: END IF;
10487:
10488: x_return_status := fnd_api.g_ret_sts_error;
10489: fnd_message.set_name('WMS', 'WMS_INVALID_MAT_STATUS');
10490: fnd_msg_pub.ADD;
10491: RETURN;
10492: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
10493: IF (l_debug = 1) THEN
10494: DEBUG('Validate Status LPN Contents procedure failed with error status U ', 'Process_LPN');
10495: END IF;
10496:
10497: x_return_status := fnd_api.g_ret_sts_error;
10498: fnd_message.set_name('WMS', 'WMS_INVALID_MAT_STATUS');
10499: fnd_msg_pub.ADD;
10500: RETURN;
10501: END IF;
10502: g_matl_stat_checked := TRUE;
10503: END IF;
10573: END IF;
10574:
10575: x_return_status := fnd_api.g_ret_sts_unexp_error;
10576: fnd_message.set_name('WMS', 'WMS_ERROR_LOADING_LPN');
10577: fnd_msg_pub.ADD;
10578: END process_lpn;
10579:
10580: /* This procedure creates reservations for a line if it is not there and
10581: inserts processed line record into WDS.
10745: END IF;
10746:
10747: x_return_status := fnd_api.g_ret_sts_error;
10748: fnd_message.set_name('WMS', 'WMS_ITEM_NOT_AVAILABLE');
10749: fnd_msg_pub.ADD;
10750: RETURN;
10751: END IF;
10752:
10753: --ACTION
10758: END IF;
10759:
10760: x_return_status := fnd_api.g_ret_sts_error;
10761: fnd_message.set_name('WMS', 'WMS_PJM_VALIDATION_FAILED');
10762: fnd_msg_pub.ADD;
10763: RETURN;
10764: END IF;
10765:
10766: -- checkk delivery for irect ship
10770: END IF;
10771:
10772: x_return_status := fnd_api.g_ret_sts_error;
10773: fnd_message.set_name('WMS', 'WMS_DEL_LINES_MIX');
10774: fnd_msg_pub.ADD;
10775: RETURN;
10776: END IF;
10777:
10778: -- check holds
10790: END IF;
10791:
10792: x_return_status := fnd_api.g_ret_sts_error;
10793: fnd_message.set_name('WMS', 'WMS_HOLD_APPLIED');
10794: fnd_msg_pub.ADD;
10795: RETURN;
10796: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
10797: IF (l_debug = 1) THEN
10798: DEBUG('Check Holds Failed', 'Process_Line');
10799: END IF;
10800:
10801: x_return_status := fnd_api.g_ret_sts_error;
10802: fnd_message.set_name('WMS', 'WMS_HOLD_APPLIED');
10803: fnd_msg_pub.ADD;
10804: RETURN;
10805: ELSE
10806: IF (l_debug = 1) THEN
10807: DEBUG('Check Holds Succeeded', 'Process Line');
10853: IF (l_debug = 1) THEN
10854: DEBUG('Cannot mix fulfillment modes', 'Process_Line');
10855: END IF;
10856: fnd_message.set_name('WMS', 'WMS_LPN_FB_COMINGLE');
10857: fnd_msg_pub.ADD;
10858: RAISE fnd_api.g_exc_error;
10859: END IF;
10860:
10861: IF NOT g_matl_stat_checked THEN
10886: END IF;
10887:
10888: x_return_status := fnd_api.g_ret_sts_error;
10889: fnd_message.set_name('WMS', 'WMS_INVALID_MAT_STATUS');
10890: fnd_msg_pub.ADD;
10891: RETURN;
10892: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
10893: IF (l_debug = 1) THEN
10894: DEBUG('Validate Status LPN Contents procedure failed with error status U ', 'Process_Line');
10895: END IF;
10896:
10897: x_return_status := fnd_api.g_ret_sts_error;
10898: fnd_message.set_name('WMS', 'WMS_INVALID_MAT_STATUS');
10899: fnd_msg_pub.ADD;
10900: RETURN;
10901: END IF;
10902: g_matl_stat_checked := TRUE;
10903: END IF;
11995: END IF;
11996:
11997: x_return_status := fnd_api.g_ret_sts_unexp_error;
11998: fnd_message.set_name('WMS', 'WMS_ERROR_LOADING_LINE');
11999: fnd_msg_pub.ADD;
12000: END process_line;
12001:
12002: /* This functions validates the line being packect into LPN for
12003: Delivery grouping rules.
12458: END IF;
12459:
12460: x_return_status := fnd_api.g_ret_sts_unexp_error;
12461: fnd_message.set_name('WMS', 'WMS_ERROR_LOADING_LPN');
12462: fnd_msg_pub.ADD;
12463: END load_lpn;
12464:
12465: /*
12466: This procedure distributes the un-used quantity in the lpn among all the loaded lines.
12664: IF (l_debug = 1) THEN
12665: DEBUG('Non-Sales Order reservation exists, error out', 'Perform_Overship_Distribution');
12666: END IF;
12667: fnd_message.set_name('WMS', 'WMS_LINE_NOT_BOOKED');
12668: fnd_msg_pub.ADD;
12669: RAISE fnd_api.g_exc_error;
12670: END IF;
12671:
12672: l_order_line_id := l_mtl_reservation_tab(l_index_r).demand_source_line_id;
13533: END IF;
13534: END IF;
13535:
13536: fnd_message.set_name('WMS', 'WMS_LPN_NOT_CONSUMED');
13537: fnd_msg_pub.ADD;
13538: RETURN;
13539: END IF;
13540: END IF; --} quantity >0
13541:
13553: END IF;
13554:
13555: x_return_status := fnd_api.g_ret_sts_unexp_error;
13556: fnd_message.set_name('WMS', 'WMS_ERROR_LOADING_LPN');
13557: fnd_msg_pub.ADD;
13558: END perform_overship_distribution;
13559:
13560: /*
13561: This procedure checks any type of hold applied on the order line.
13616: IF (l_debug = 1) THEN
13617: DEBUG('fnd_api.g_exe_error ' || SQLERRM, 'Check_holds');
13618: END IF;
13619:
13620: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
13621: WHEN fnd_api.g_exc_unexpected_error THEN
13622: x_return_status := fnd_api.g_ret_sts_unexp_error;
13623:
13624: IF (l_debug = 1) THEN
13624: IF (l_debug = 1) THEN
13625: DEBUG('FND_API.G_UNEXPECTED_ERR' || SQLERRM, 'check_holds');
13626: END IF;
13627:
13628: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
13629: WHEN OTHERS THEN
13630: x_return_status := fnd_api.g_ret_sts_unexp_error;
13631:
13632: IF (l_debug = 1) THEN
13632: IF (l_debug = 1) THEN
13633: DEBUG('FND_API.G_UNEXPECTED_ERR' || SQLERRM, 'check_holds');
13634: END IF;
13635:
13636: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
13637: END check_holds;
13638:
13639: /* Bug 2994099:This procedure cleanup all the temp data for a backordered delivery for this lpn */
13640: