310: END IF ;
311:
312: inv_quantity_tree_pub.query_quantities
313: ( p_api_version_number => 1.0
314: , p_init_msg_lst => fnd_api.g_false
315: , x_return_status => x_return_status
316: , x_msg_count => l_msg_count
317: , x_msg_data => l_msg_data
318: , p_organization_id => p_organization_id
464: ELSE l_tree_mode := p_tree_mode;
465: END IF ;
466: inv_quantity_tree_pub.query_quantities(
467: p_api_version_number => 1.0
468: , p_init_msg_lst => fnd_api.g_false
469: , x_return_status => x_return_status
470: , x_msg_count => l_msg_count
471: , x_msg_data => l_msg_data
472: , p_organization_id => p_organization_id
624: END IF ;
625:
626: inv_quantity_tree_pub.query_quantities(
627: p_api_version_number => 1.0 ,
628: p_init_msg_lst => fnd_api.g_false ,
629: x_return_status => x_return_status ,
630: x_msg_count => l_msg_count ,
631: x_msg_data => l_msg_data ,
632: p_organization_id => p_organization_id ,
774: l_is_serial_control BOOLEAN := FALSE;
775: l_tree_mode NUMBER;
776: l_api_version_number CONSTANT NUMBER := 1.0;
777: l_api_name CONSTANT VARCHAR2(30) := 'Get_Avaliable_Quantity';
778: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
779: l_tree_id INTEGER;
780: l_rqoh NUMBER;
781: l_qr NUMBER;
782: l_qs NUMBER;
816: END IF ;
817:
818:
819: -- Initialize message list.
820: IF fnd_api.to_boolean(p_init_msg_lst) THEN
821: fnd_msg_pub.initialize;
822: END IF;
823:
824: INV_QUANTITY_TREE_PVT.create_tree
822: END IF;
823:
824: INV_QUANTITY_TREE_PVT.create_tree
825: ( p_api_version_number => 1.0
826: , p_init_msg_lst => fnd_api.g_false
827: , x_return_status => l_return_status
828: , x_msg_count => x_msg_count
829: , x_msg_data => x_msg_data
830: , p_organization_id => p_organization_id
848: , p_pick_release => 0 --g_pick_release_no
849: ) ;
850:
851:
852: IF l_return_status = fnd_api.g_ret_sts_error THEN
853: RAISE fnd_api.g_exc_error;
854: END IF ;
855:
856: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
849: ) ;
850:
851:
852: IF l_return_status = fnd_api.g_ret_sts_error THEN
853: RAISE fnd_api.g_exc_error;
854: END IF ;
855:
856: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
857: RAISE fnd_api.g_exc_unexpected_error;
852: IF l_return_status = fnd_api.g_ret_sts_error THEN
853: RAISE fnd_api.g_exc_error;
854: END IF ;
855:
856: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
857: RAISE fnd_api.g_exc_unexpected_error;
858: END IF;
859:
860: INV_QUANTITY_TREE_PVT.query_tree
853: RAISE fnd_api.g_exc_error;
854: END IF ;
855:
856: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
857: RAISE fnd_api.g_exc_unexpected_error;
858: END IF;
859:
860: INV_QUANTITY_TREE_PVT.query_tree
861: ( p_api_version_number => 1.0
858: END IF;
859:
860: INV_QUANTITY_TREE_PVT.query_tree
861: ( p_api_version_number => 1.0
862: , p_init_msg_lst => fnd_api.g_false
863: , x_return_status => l_return_status
864: , x_msg_count => x_msg_count
865: , x_msg_data => x_msg_data
866: , p_tree_id => l_tree_id
885: , x_satr => l_satr
886: );
887:
888:
889: IF l_return_status = fnd_api.g_ret_sts_error THEN
890: RAISE fnd_api.g_exc_error;
891: END IF ;
892:
893: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
886: );
887:
888:
889: IF l_return_status = fnd_api.g_ret_sts_error THEN
890: RAISE fnd_api.g_exc_error;
891: END IF ;
892:
893: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
894: RAISE fnd_api.g_exc_unexpected_error;
889: IF l_return_status = fnd_api.g_ret_sts_error THEN
890: RAISE fnd_api.g_exc_error;
891: END IF ;
892:
893: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
894: RAISE fnd_api.g_exc_unexpected_error;
895: END IF;
896:
897: -- This query_tree quaries qoh and att at Item level,
890: RAISE fnd_api.g_exc_error;
891: END IF ;
892:
893: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
894: RAISE fnd_api.g_exc_unexpected_error;
895: END IF;
896:
897: -- This query_tree quaries qoh and att at Item level,
898: -- so we are passing null for p_subinventory_code and p_locator_id
898: -- so we are passing null for p_subinventory_code and p_locator_id
899:
900: INV_QUANTITY_TREE_PVT.query_tree
901: ( p_api_version_number => 1.0
902: , p_init_msg_lst => fnd_api.g_false
903: , x_return_status => l_return_status
904: , x_msg_count => x_msg_count
905: , x_msg_data => x_msg_data
906: , p_tree_id => l_tree_id
925: , x_satr => l_satr
926: );
927:
928:
929: IF l_return_status = fnd_api.g_ret_sts_error THEN
930: RAISE fnd_api.g_exc_error;
931: END IF ;
932:
933: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
926: );
927:
928:
929: IF l_return_status = fnd_api.g_ret_sts_error THEN
930: RAISE fnd_api.g_exc_error;
931: END IF ;
932:
933: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
934: RAISE fnd_api.g_exc_unexpected_error;
929: IF l_return_status = fnd_api.g_ret_sts_error THEN
930: RAISE fnd_api.g_exc_error;
931: END IF ;
932:
933: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
934: RAISE fnd_api.g_exc_unexpected_error;
935: END IF;
936:
937: INV_QUANTITY_TREE_PVT.get_total_qoh
930: RAISE fnd_api.g_exc_error;
931: END IF ;
932:
933: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
934: RAISE fnd_api.g_exc_unexpected_error;
935: END IF;
936:
937: INV_QUANTITY_TREE_PVT.get_total_qoh
938: ( x_return_status => l_return_status
949: , x_stqoh => x_stqoh
950: );
951:
952:
953: IF l_return_status = fnd_api.g_ret_sts_error THEN
954: RAISE fnd_api.g_exc_error;
955: END IF ;
956:
957: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
950: );
951:
952:
953: IF l_return_status = fnd_api.g_ret_sts_error THEN
954: RAISE fnd_api.g_exc_error;
955: END IF ;
956:
957: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
958: RAISE fnd_api.g_exc_unexpected_error;
953: IF l_return_status = fnd_api.g_ret_sts_error THEN
954: RAISE fnd_api.g_exc_error;
955: END IF ;
956:
957: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
958: RAISE fnd_api.g_exc_unexpected_error;
959: END IF;
960:
961: x_return_status := l_return_status;
954: RAISE fnd_api.g_exc_error;
955: END IF ;
956:
957: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
958: RAISE fnd_api.g_exc_unexpected_error;
959: END IF;
960:
961: x_return_status := l_return_status;
962:
961: x_return_status := l_return_status;
962:
963: EXCEPTION
964:
965: WHEN fnd_api.g_exc_error THEN
966: x_return_status := fnd_api.g_ret_sts_error;
967:
968: -- Get message count and data
969: fnd_msg_pub.count_and_get
962:
963: EXCEPTION
964:
965: WHEN fnd_api.g_exc_error THEN
966: x_return_status := fnd_api.g_ret_sts_error;
967:
968: -- Get message count and data
969: fnd_msg_pub.count_and_get
970: ( p_count => x_msg_count
970: ( p_count => x_msg_count
971: , p_data => x_msg_data
972: );
973:
974: WHEN fnd_api.g_exc_unexpected_error THEN
975: x_return_status := fnd_api.g_ret_sts_unexp_error ;
976:
977: -- Get message count and data
978: fnd_msg_pub.count_and_get
971: , p_data => x_msg_data
972: );
973:
974: WHEN fnd_api.g_exc_unexpected_error THEN
975: x_return_status := fnd_api.g_ret_sts_unexp_error ;
976:
977: -- Get message count and data
978: fnd_msg_pub.count_and_get
979: ( p_count => x_msg_count
980: , p_data => x_msg_data
981: );
982:
983: WHEN OTHERS THEN
984: x_return_status := fnd_api.g_ret_sts_unexp_error ;
985:
986: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
987: THEN
988:
1117: l_is_serial_control BOOLEAN := FALSE;
1118: l_tree_mode NUMBER;
1119: l_api_version_number CONSTANT NUMBER := 1.0;
1120: l_api_name CONSTANT VARCHAR2(30) := 'Get_Avaliable_Quantity';
1121: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
1122: l_tree_id INTEGER;
1123: l_rqoh NUMBER;
1124: l_qr NUMBER;
1125: l_qs NUMBER;
1159: END IF ;
1160:
1161:
1162: -- Initialize message list.
1163: IF fnd_api.to_boolean(p_init_msg_lst) THEN
1164: fnd_msg_pub.initialize;
1165: END IF;
1166:
1167: INV_QUANTITY_TREE_PVT.create_tree
1165: END IF;
1166:
1167: INV_QUANTITY_TREE_PVT.create_tree
1168: ( p_api_version_number => 1.0
1169: , p_init_msg_lst => fnd_api.g_false
1170: , x_return_status => l_return_status
1171: , x_msg_count => x_msg_count
1172: , x_msg_data => x_msg_data
1173: , p_organization_id => p_organization_id
1191: , p_pick_release => 0 --g_pick_release_no
1192: ) ;
1193:
1194:
1195: IF l_return_status = fnd_api.g_ret_sts_error THEN
1196: RAISE fnd_api.g_exc_error;
1197: END IF ;
1198:
1199: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1192: ) ;
1193:
1194:
1195: IF l_return_status = fnd_api.g_ret_sts_error THEN
1196: RAISE fnd_api.g_exc_error;
1197: END IF ;
1198:
1199: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1200: RAISE fnd_api.g_exc_unexpected_error;
1195: IF l_return_status = fnd_api.g_ret_sts_error THEN
1196: RAISE fnd_api.g_exc_error;
1197: END IF ;
1198:
1199: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1200: RAISE fnd_api.g_exc_unexpected_error;
1201: END IF;
1202:
1203: INV_QUANTITY_TREE_PVT.query_tree
1196: RAISE fnd_api.g_exc_error;
1197: END IF ;
1198:
1199: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1200: RAISE fnd_api.g_exc_unexpected_error;
1201: END IF;
1202:
1203: INV_QUANTITY_TREE_PVT.query_tree
1204: ( p_api_version_number => 1.0
1201: END IF;
1202:
1203: INV_QUANTITY_TREE_PVT.query_tree
1204: ( p_api_version_number => 1.0
1205: , p_init_msg_lst => fnd_api.g_false
1206: , x_return_status => l_return_status
1207: , x_msg_count => x_msg_count
1208: , x_msg_data => x_msg_data
1209: , p_tree_id => l_tree_id
1228: , p_cost_group_id => p_cost_group_id
1229: , p_transfer_subinventory_code=> p_transfer_subinventory);
1230:
1231:
1232: IF l_return_status = fnd_api.g_ret_sts_error THEN
1233: RAISE fnd_api.g_exc_error;
1234: END IF ;
1235:
1236: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1229: , p_transfer_subinventory_code=> p_transfer_subinventory);
1230:
1231:
1232: IF l_return_status = fnd_api.g_ret_sts_error THEN
1233: RAISE fnd_api.g_exc_error;
1234: END IF ;
1235:
1236: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1237: RAISE fnd_api.g_exc_unexpected_error;
1232: IF l_return_status = fnd_api.g_ret_sts_error THEN
1233: RAISE fnd_api.g_exc_error;
1234: END IF ;
1235:
1236: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1237: RAISE fnd_api.g_exc_unexpected_error;
1238: END IF;
1239:
1240: -- This query_tree quaries qoh and att at Item level,
1233: RAISE fnd_api.g_exc_error;
1234: END IF ;
1235:
1236: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1237: RAISE fnd_api.g_exc_unexpected_error;
1238: END IF;
1239:
1240: -- This query_tree quaries qoh and att at Item level,
1241: -- so we are passing null for p_subinventory_code and p_locator_id
1241: -- so we are passing null for p_subinventory_code and p_locator_id
1242:
1243: INV_QUANTITY_TREE_PVT.query_tree
1244: ( p_api_version_number => 1.0
1245: , p_init_msg_lst => fnd_api.g_false
1246: , x_return_status => l_return_status
1247: , x_msg_count => x_msg_count
1248: , x_msg_data => x_msg_data
1249: , p_tree_id => l_tree_id
1268: , x_satr => l_satr
1269: , p_cost_group_id => p_cost_group_id);
1270:
1271:
1272: IF l_return_status = fnd_api.g_ret_sts_error THEN
1273: RAISE fnd_api.g_exc_error;
1274: END IF ;
1275:
1276: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1269: , p_cost_group_id => p_cost_group_id);
1270:
1271:
1272: IF l_return_status = fnd_api.g_ret_sts_error THEN
1273: RAISE fnd_api.g_exc_error;
1274: END IF ;
1275:
1276: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1277: RAISE fnd_api.g_exc_unexpected_error;
1272: IF l_return_status = fnd_api.g_ret_sts_error THEN
1273: RAISE fnd_api.g_exc_error;
1274: END IF ;
1275:
1276: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1277: RAISE fnd_api.g_exc_unexpected_error;
1278: END IF;
1279:
1280: INV_QUANTITY_TREE_PVT.get_total_qoh
1273: RAISE fnd_api.g_exc_error;
1274: END IF ;
1275:
1276: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1277: RAISE fnd_api.g_exc_unexpected_error;
1278: END IF;
1279:
1280: INV_QUANTITY_TREE_PVT.get_total_qoh
1281: ( x_return_status => l_return_status
1292: , x_stqoh => x_stqoh
1293: );
1294:
1295:
1296: IF l_return_status = fnd_api.g_ret_sts_error THEN
1297: RAISE fnd_api.g_exc_error;
1298: END IF ;
1299:
1300: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1293: );
1294:
1295:
1296: IF l_return_status = fnd_api.g_ret_sts_error THEN
1297: RAISE fnd_api.g_exc_error;
1298: END IF ;
1299:
1300: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1301: RAISE fnd_api.g_exc_unexpected_error;
1296: IF l_return_status = fnd_api.g_ret_sts_error THEN
1297: RAISE fnd_api.g_exc_error;
1298: END IF ;
1299:
1300: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1301: RAISE fnd_api.g_exc_unexpected_error;
1302: END IF;
1303:
1304: x_return_status := l_return_status;
1297: RAISE fnd_api.g_exc_error;
1298: END IF ;
1299:
1300: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1301: RAISE fnd_api.g_exc_unexpected_error;
1302: END IF;
1303:
1304: x_return_status := l_return_status;
1305:
1304: x_return_status := l_return_status;
1305:
1306: EXCEPTION
1307:
1308: WHEN fnd_api.g_exc_error THEN
1309: x_return_status := fnd_api.g_ret_sts_error;
1310:
1311: -- Get message count and data
1312: fnd_msg_pub.count_and_get
1305:
1306: EXCEPTION
1307:
1308: WHEN fnd_api.g_exc_error THEN
1309: x_return_status := fnd_api.g_ret_sts_error;
1310:
1311: -- Get message count and data
1312: fnd_msg_pub.count_and_get
1313: ( p_count => x_msg_count
1313: ( p_count => x_msg_count
1314: , p_data => x_msg_data
1315: );
1316:
1317: WHEN fnd_api.g_exc_unexpected_error THEN
1318: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1319:
1320: -- Get message count and data
1321: fnd_msg_pub.count_and_get
1314: , p_data => x_msg_data
1315: );
1316:
1317: WHEN fnd_api.g_exc_unexpected_error THEN
1318: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1319:
1320: -- Get message count and data
1321: fnd_msg_pub.count_and_get
1322: ( p_count => x_msg_count
1323: , p_data => x_msg_data
1324: );
1325:
1326: WHEN OTHERS THEN
1327: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1328:
1329: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
1330: THEN
1331:
1351: to complete the transaction, 'false' otherwise. */
1352:
1353: PROCEDURE CHECK_LOOSE_QUANTITY(
1354: p_api_version_number IN NUMBER
1355: , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
1356: , x_return_status OUT NOCOPY VARCHAR2
1357: , x_msg_count OUT NOCOPY NUMBER
1358: , x_msg_data OUT NOCOPY VARCHAR2
1359: , p_organization_id IN NUMBER
1395: l_inv_rcpt_code mtl_parameters.negative_inv_receipt_code%type;
1396:
1397: l_api_version_number CONSTANT NUMBER := 1.0;
1398: l_api_name CONSTANT VARCHAR2(30) := 'Check_Looose_Quantity';
1399: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
1400:
1401: l_transaction_source_type_id NUMBER;
1402: l_new_qoh NUMBER;
1403: l_new_att NUMBER;
1454:
1455: inv_quantity_tree_pub.clear_quantity_cache;
1456:
1457: -- Standard call to check for call compatibility
1458: IF NOT fnd_api.compatible_api_call(l_api_version_number
1459: , p_api_version_number
1460: , l_api_name
1461: , G_PKG_NAME
1462: ) THEN
1459: , p_api_version_number
1460: , l_api_name
1461: , G_PKG_NAME
1462: ) THEN
1463: RAISE fnd_api.g_exc_unexpected_error;
1464: END IF;
1465: IF (l_debug = 1) THEN
1466: mdebug ('Done checking if compatible api call.');
1467: END IF;
1466: mdebug ('Done checking if compatible api call.');
1467: END IF;
1468:
1469: -- Initialize message list.
1470: IF fnd_api.to_boolean(p_init_msg_lst) THEN
1471: fnd_msg_pub.initialize;
1472: END IF;
1473:
1474: p_ok_to_process := 'false';
1706:
1707: x_return_status := l_return_status;
1708:
1709: EXCEPTION
1710: WHEN fnd_api.g_exc_error THEN
1711: x_return_status := fnd_api.g_ret_sts_error;
1712:
1713: -- Get message count and data
1714: fnd_msg_pub.count_and_get
1707: x_return_status := l_return_status;
1708:
1709: EXCEPTION
1710: WHEN fnd_api.g_exc_error THEN
1711: x_return_status := fnd_api.g_ret_sts_error;
1712:
1713: -- Get message count and data
1714: fnd_msg_pub.count_and_get
1715: ( p_count => x_msg_count
1718: IF (l_debug = 1) THEN
1719: mdebug ('@'||x_msg_data||'@');
1720: END IF;
1721:
1722: WHEN fnd_api.g_exc_unexpected_error THEN
1723: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1724:
1725: -- Get message count and data
1726: fnd_msg_pub.count_and_get
1719: mdebug ('@'||x_msg_data||'@');
1720: END IF;
1721:
1722: WHEN fnd_api.g_exc_unexpected_error THEN
1723: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1724:
1725: -- Get message count and data
1726: fnd_msg_pub.count_and_get
1727: ( p_count => x_msg_count
1731: mdebug ('@'||x_msg_data||'@');
1732: END IF;
1733:
1734: WHEN OTHERS THEN
1735: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1736:
1737: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
1738: THEN
1739: fnd_msg_pub.add_exc_msg
2437: END IF;
2438:
2439: inv_quantity_tree_pub.query_quantities
2440: ( p_api_version_number => 1.0
2441: , p_init_msg_lst => fnd_api.g_false
2442: , x_return_status => l_return_status
2443: , x_msg_count => l_msg_count
2444: , x_msg_data => l_msg_data
2445: , p_organization_id => p_organization_id
2483: l_updt_qoh := - l_qoh;
2484: /*need to update qty tree */
2485: inv_quantity_tree_pub.update_quantities
2486: ( p_api_version_number => 1.0
2487: , p_init_msg_lst => fnd_api.g_false
2488: , x_return_status => l_return_status
2489: , x_msg_count => l_msg_count
2490: , x_msg_data => l_msg_data
2491: , p_organization_id => p_organization_id
2676: END IF;
2677:
2678: inv_quantity_tree_pub.query_quantities
2679: ( p_api_version_number => 1.0
2680: , p_init_msg_lst => fnd_api.g_false
2681: , x_return_status => l_return_status
2682: , x_msg_count => l_msg_count
2683: , x_msg_data => l_msg_data
2684: , p_organization_id => p_organization_id
2730:
2731: /*need to update qty tree */
2732: inv_quantity_tree_pub.update_quantities
2733: ( p_api_version_number => 1.0
2734: , p_init_msg_lst => fnd_api.g_false
2735: , x_return_status => l_return_status
2736: , x_msg_count => l_msg_count
2737: , x_msg_data => l_msg_data
2738: , p_organization_id => p_organization_id
2877: *with user defined shelf life the build_query does not return FALSE
2878: */
2879: inv_quantity_tree_pub.query_quantities
2880: (p_api_version_number => 1.0
2881: , p_init_msg_lst => fnd_api.g_false
2882: , x_return_status => l_return_status
2883: , x_msg_count => l_msg_count
2884: , x_msg_data => l_msg_data
2885: , p_organization_id => p_organization_id
3057: *with user defined shelf life the build_query does not return FALSE
3058: */
3059: inv_quantity_tree_pub.query_quantities
3060: (p_api_version_number => 1.0
3061: , p_init_msg_lst => fnd_api.g_false
3062: , x_return_status => l_return_status
3063: , x_msg_count => l_msg_count
3064: , x_msg_data => l_msg_data
3065: , p_organization_id => p_organization_id
3222: END IF;
3223:
3224: inv_quantity_tree_pub.query_quantities
3225: (p_api_version_number => 1.0
3226: , p_init_msg_lst => fnd_api.g_false
3227: , x_return_status => l_return_status
3228: , x_msg_count => l_msg_count
3229: , x_msg_data => l_msg_data
3230: , p_organization_id => p_organization_id
3781:
3782: -- Query the quantity tree for available to transact quantity
3783: inv_quantity_tree_pub.query_quantities
3784: (p_api_version_number => 1.0,
3785: p_init_msg_lst => fnd_api.g_false,
3786: x_return_status => x_return_status,
3787: x_msg_count => l_msg_count,
3788: x_msg_data => l_msg_data,
3789: p_organization_id => p_organization_id,
3804: x_qs => l_qs,
3805: x_att => l_att,
3806: x_atr => l_atr);
3807:
3808: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3809: FND_MESSAGE.set_name('INV', 'INV_ERR_CREATETREE');
3810: FND_MESSAGE.set_token('ROUTINE','INV_QUANTITY_TREE_PUB.QUERY_QUANTITIES');
3811: x_return_msg := fnd_message.get;
3812: RETURN;
3836: -- Update the quantity tree so that the serial transaction is
3837: -- reflected in the available quantity
3838: inv_quantity_tree_pub.update_quantities
3839: (p_api_version_number => 1.0,
3840: p_init_msg_lst => fnd_api.g_false,
3841: x_return_status => x_return_status,
3842: x_msg_count => l_msg_count,
3843: x_msg_data => l_msg_data,
3844: p_organization_id => p_organization_id,
3861: x_qs => l_qs,
3862: x_att => l_att,
3863: x_atr => l_atr);
3864:
3865: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3866: FND_MESSAGE.set_name('INV', 'INV_ERR_CREATETREE');
3867: FND_MESSAGE.set_token('ROUTINE','INV_QUANTITY_TREE_PUB.UPDATE_QUANTITIES');
3868: x_return_msg := fnd_message.get;
3869: RETURN;
3873: END IF;
3874:
3875: inv_quantity_tree_pub.update_quantities
3876: (p_api_version_number => 1.0,
3877: p_init_msg_lst => fnd_api.g_false,
3878: x_return_status => x_return_status,
3879: x_msg_count => l_msg_count,
3880: x_msg_data => l_msg_data,
3881: p_organization_id => p_organization_id,
3898: x_qs => l_qs,
3899: x_att => l_att,
3900: x_atr => l_atr);
3901:
3902: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3903: FND_MESSAGE.set_name('INV', 'INV_ERR_CREATETREE');
3904: FND_MESSAGE.set_token('ROUTINE','INV_QUANTITY_TREE_PUB.UPDATE_QUANTITIES');
3905: x_return_msg := fnd_message.get;
3906: RETURN;
3981: inv_log_util.trace('Temp ID = ' || l_transaction_temp_id, 'process_serial_subxfr');
3982: inv_log_util.trace('Header ID = ' || x_transaction_header_id, 'process_serial_subxfr');
3983: END IF;
3984: ELSE
3985: x_return_status := fnd_api.g_ret_sts_unexp_error;
3986: IF (l_debug = 1) THEN
3987: inv_log_util.trace(l_proc_msg, 'process_serial_subxfr');
3988: END IF;
3989: RETURN;
4008: inv_log_util.trace('Serial Temp ID = ' || l_serial_transaction_temp_id, 'process_serial_subxfr');
4009: inv_log_util.trace('Serial Temp ID = ' || l_transaction_temp_id, 'process_serial_subxfr');
4010: END IF;
4011: ELSE
4012: x_return_status := fnd_api.g_ret_sts_unexp_error;
4013: IF (l_debug = 1) THEN
4014: inv_log_util.trace(l_proc_msg, 'process_serial_subxfr');
4015: END IF;
4016: RETURN;
4032: inv_log_util.trace('Inserted MSNT record', 'process_serial_subxfr');
4033: inv_log_util.trace('Serial Temp ID = ' || l_transaction_temp_id, 'process_serial_subxfr');
4034: END IF;
4035: ELSE
4036: x_return_status := fnd_api.g_ret_sts_unexp_error;
4037: IF (l_debug = 1) THEN
4038: inv_log_util.trace(l_proc_msg, 'process_serial_subxfr');
4039: END IF;
4040: RETURN;
4056:
4057:
4058: PROCEDURE check_loose_and_packed_qty
4059: (p_api_version_number IN NUMBER
4060: , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
4061: , x_return_status OUT NOCOPY VARCHAR2
4062: , x_msg_count OUT NOCOPY NUMBER
4063: , x_msg_data OUT NOCOPY VARCHAR2
4064: , p_organization_id IN NUMBER
4100: l_inv_rcpt_code mtl_parameters.negative_inv_receipt_code%type;
4101:
4102: l_api_version_number CONSTANT NUMBER := 1.0;
4103: l_api_name CONSTANT VARCHAR2(30) := 'Check_Looose_and_packed_Qty';
4104: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
4105:
4106: l_transaction_source_type_id NUMBER;
4107: l_new_qoh NUMBER;
4108: l_new_att NUMBER;
4146:
4147: inv_quantity_tree_pub.clear_quantity_cache;
4148:
4149: -- Standard call to check for call compatibility
4150: IF NOT fnd_api.compatible_api_call(l_api_version_number
4151: , p_api_version_number
4152: , l_api_name
4153: , G_PKG_NAME
4154: ) THEN
4151: , p_api_version_number
4152: , l_api_name
4153: , G_PKG_NAME
4154: ) THEN
4155: RAISE fnd_api.g_exc_unexpected_error;
4156: END IF;
4157: IF (l_debug = 1) THEN
4158: mdebug ('Done checking if compatible api call.');
4159: END IF;
4158: mdebug ('Done checking if compatible api call.');
4159: END IF;
4160:
4161: -- Initialize message list.
4162: IF fnd_api.to_boolean(p_init_msg_lst) THEN
4163: fnd_msg_pub.initialize;
4164: END IF;
4165:
4166: p_ok_to_process := 'false';
4412: l_atr NUMBER := 0 ;
4413: l_is_revision_control BOOLEAN := FALSE;
4414: l_is_lot_control BOOLEAN := FALSE;
4415: l_is_serial_control BOOLEAN := FALSE;
4416: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
4417: p_init_msg_lst VARCHAR2(30);
4418: l_api_name CONSTANT VARCHAR2(30) := 'Get_Avbl_To_Transact_Qty';
4419: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
4420: BEGIN
4435: l_is_serial_control := TRUE;
4436: END IF;
4437:
4438: -- Initialize message list.
4439: IF fnd_api.to_boolean(p_init_msg_lst) THEN
4440: fnd_msg_pub.initialize;
4441: END IF;
4442:
4443: -- Clearing any cache if existent
4445:
4446: -- this call will provide reserved quantity for all but the demand source specified
4447: inv_quantity_tree_pub.query_quantities
4448: ( p_api_version_number => 1.0
4449: , p_init_msg_lst => fnd_api.g_false
4450: , x_return_status => l_return_status
4451: , x_msg_count => l_msg_count
4452: , x_msg_data => l_msg_data
4453: , p_organization_id => p_organization_id
4471: , x_att => l_att
4472: , x_atr => l_atr
4473: );
4474:
4475: IF l_return_status = fnd_api.g_ret_sts_error THEN
4476: RAISE fnd_api.g_exc_error;
4477: END IF ;
4478:
4479: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
4472: , x_atr => l_atr
4473: );
4474:
4475: IF l_return_status = fnd_api.g_ret_sts_error THEN
4476: RAISE fnd_api.g_exc_error;
4477: END IF ;
4478:
4479: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
4480: RAISE fnd_api.g_exc_unexpected_error;
4475: IF l_return_status = fnd_api.g_ret_sts_error THEN
4476: RAISE fnd_api.g_exc_error;
4477: END IF ;
4478:
4479: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
4480: RAISE fnd_api.g_exc_unexpected_error;
4481: END IF;
4482:
4483: x_att := l_att ;
4476: RAISE fnd_api.g_exc_error;
4477: END IF ;
4478:
4479: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
4480: RAISE fnd_api.g_exc_unexpected_error;
4481: END IF;
4482:
4483: x_att := l_att ;
4484:
4491: x_return_status := l_return_status;
4492:
4493: EXCEPTION
4494:
4495: WHEN fnd_api.g_exc_error THEN
4496: x_return_status := fnd_api.g_ret_sts_error;
4497:
4498: -- Get message count and data
4499: fnd_msg_pub.count_and_get
4492:
4493: EXCEPTION
4494:
4495: WHEN fnd_api.g_exc_error THEN
4496: x_return_status := fnd_api.g_ret_sts_error;
4497:
4498: -- Get message count and data
4499: fnd_msg_pub.count_and_get
4500: ( p_count => l_msg_count
4500: ( p_count => l_msg_count
4501: , p_data => l_msg_data
4502: );
4503:
4504: WHEN fnd_api.g_exc_unexpected_error THEN
4505: x_return_status := fnd_api.g_ret_sts_unexp_error ;
4506:
4507: -- Get message count and data
4508: fnd_msg_pub.count_and_get
4501: , p_data => l_msg_data
4502: );
4503:
4504: WHEN fnd_api.g_exc_unexpected_error THEN
4505: x_return_status := fnd_api.g_ret_sts_unexp_error ;
4506:
4507: -- Get message count and data
4508: fnd_msg_pub.count_and_get
4509: ( p_count => l_msg_count
4510: , p_data => l_msg_data
4511: );
4512:
4513: WHEN OTHERS THEN
4514: x_return_status := fnd_api.g_ret_sts_unexp_error ;
4515:
4516: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
4517: THEN
4518: