722: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,l_module,' p_calling_api = '|| p_calling_api);
723: END IF;
724:
725: -- Standard call to check for call compatibility
726: IF NOT FND_API.Compatible_API_Call ( l_api_version,
727: p_api_version,
728: l_api_name,
729: G_PKG_NAME )
730: THEN
727: p_api_version,
728: l_api_name,
729: G_PKG_NAME )
730: THEN
731: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
732: END IF;
733:
734: -- Initialize message list if p_init_msg_list is set to TRUE
735: IF FND_API.to_Boolean( p_init_msg_list ) THEN
731: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
732: END IF;
733:
734: -- Initialize message list if p_init_msg_list is set to TRUE
735: IF FND_API.to_Boolean( p_init_msg_list ) THEN
736: FND_MSG_PUB.initialize;
737: END IF;
738:
739: -- Initialize API return status to success
736: FND_MSG_PUB.initialize;
737: END IF;
738:
739: -- Initialize API return status to success
740: x_return_status := FND_API.G_RET_STS_SUCCESS;
741: l_return_status := FND_API.G_RET_STS_SUCCESS;
742:
743: -- Initialize the period end date
744: l_end_date := p_end_date + 0.99999;
737: END IF;
738:
739: -- Initialize API return status to success
740: x_return_status := FND_API.G_RET_STS_SUCCESS;
741: l_return_status := FND_API.G_RET_STS_SUCCESS;
742:
743: -- Initialize the period end date
744: l_end_date := p_end_date + 0.99999;
745:
815: / l_distribution_rec.quantity_ordered;
816: l_stmt_num := 120;
817: Calculate_AccrualAmount(
818: p_api_version => 1.0,
819: p_init_msg_list => FND_API.G_FALSE,
820: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
821: x_return_status => l_return_status,
822: x_msg_count => x_msg_count,
823: x_msg_data => x_msg_data,
816: l_stmt_num := 120;
817: Calculate_AccrualAmount(
818: p_api_version => 1.0,
819: p_init_msg_list => FND_API.G_FALSE,
820: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
821: x_return_status => l_return_status,
822: x_msg_count => x_msg_count,
823: x_msg_data => x_msg_data,
824: p_service_flag => l_distribution_rec.service_flag,
826: p_shipment_qty => l_distribution_rec.shipment_quantity,
827: p_end_date => l_end_date,
828: x_accrual_rec => l_accrual_rec
829: );
830: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
831: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
832: TO_CHAR(l_distribution_rec.line_location_id) ||
833: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
834: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
830: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
831: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
832: TO_CHAR(l_distribution_rec.line_location_id) ||
833: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
834: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
835: END IF;
836:
837: l_stmt_num := 130;
838: IF ((l_accrual_rec.quantity_received > l_accrual_rec.quantity_billed)
889:
890: l_stmt_num := 120;
891: Calculate_AccrualAmount(
892: p_api_version => 1.0,
893: p_init_msg_list => FND_API.G_FALSE,
894: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
895: x_return_status => l_return_status,
896: x_msg_count => x_msg_count,
897: x_msg_data => x_msg_data,
890: l_stmt_num := 120;
891: Calculate_AccrualAmount(
892: p_api_version => 1.0,
893: p_init_msg_list => FND_API.G_FALSE,
894: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
895: x_return_status => l_return_status,
896: x_msg_count => x_msg_count,
897: x_msg_data => x_msg_data,
898: p_service_flag => l_distribution_rec.service_flag,
901: p_end_date => l_end_date,
902: x_accrual_rec => l_accrual_rec
903: );
904:
905: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
906: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
907: TO_CHAR(l_distribution_rec.line_location_id) ||
908: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
909: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
905: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
906: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
907: TO_CHAR(l_distribution_rec.line_location_id) ||
908: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
909: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
910: END IF;
911:
912: l_stmt_num := 130;
913: IF ((l_accrual_rec.quantity_received > l_accrual_rec.quantity_billed)
964:
965: l_stmt_num := 120;
966: Calculate_AccrualAmount(
967: p_api_version => 1.0,
968: p_init_msg_list => FND_API.G_FALSE,
969: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
970: x_return_status => l_return_status,
971: x_msg_count => x_msg_count,
972: x_msg_data => x_msg_data,
965: l_stmt_num := 120;
966: Calculate_AccrualAmount(
967: p_api_version => 1.0,
968: p_init_msg_list => FND_API.G_FALSE,
969: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
970: x_return_status => l_return_status,
971: x_msg_count => x_msg_count,
972: x_msg_data => x_msg_data,
973: p_service_flag => l_distribution_rec.service_flag,
976: p_end_date => l_end_date,
977: x_accrual_rec => l_accrual_rec
978: );
979:
980: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
981: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
982: TO_CHAR(l_distribution_rec.line_location_id) ||
983: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
984: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
980: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
981: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
982: TO_CHAR(l_distribution_rec.line_location_id) ||
983: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
984: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
985: END IF;
986:
987: l_stmt_num := 130;
988: IF ((l_accrual_rec.quantity_received > l_accrual_rec.quantity_billed)
1036: / l_distribution_rec.quantity_ordered;
1037: l_stmt_num := 120;
1038: Calculate_AccrualAmount(
1039: p_api_version => 1.0,
1040: p_init_msg_list => FND_API.G_FALSE,
1041: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1042: x_return_status => l_return_status,
1043: x_msg_count => x_msg_count,
1044: x_msg_data => x_msg_data,
1037: l_stmt_num := 120;
1038: Calculate_AccrualAmount(
1039: p_api_version => 1.0,
1040: p_init_msg_list => FND_API.G_FALSE,
1041: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1042: x_return_status => l_return_status,
1043: x_msg_count => x_msg_count,
1044: x_msg_data => x_msg_data,
1045: p_service_flag => l_distribution_rec.service_flag,
1049: x_accrual_rec => l_accrual_rec
1050: );
1051:
1052: -- If return status is not success, raise unexpected exception
1053: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1054: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
1055: TO_CHAR(l_distribution_rec.line_location_id) ||
1056: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
1057: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1053: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1054: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
1055: TO_CHAR(l_distribution_rec.line_location_id) ||
1056: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
1057: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1058: END IF;
1059:
1060: l_stmt_num := 130;
1061: IF ((l_accrual_rec.quantity_received > l_accrual_rec.quantity_billed)
1109: / l_distribution_rec.quantity_ordered;
1110: l_stmt_num := 120;
1111: Calculate_AccrualAmount(
1112: p_api_version => 1.0,
1113: p_init_msg_list => FND_API.G_FALSE,
1114: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1115: x_return_status => l_return_status,
1116: x_msg_count => x_msg_count,
1117: x_msg_data => x_msg_data,
1110: l_stmt_num := 120;
1111: Calculate_AccrualAmount(
1112: p_api_version => 1.0,
1113: p_init_msg_list => FND_API.G_FALSE,
1114: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1115: x_return_status => l_return_status,
1116: x_msg_count => x_msg_count,
1117: x_msg_data => x_msg_data,
1118: p_service_flag => l_distribution_rec.service_flag,
1121: p_end_date => l_end_date,
1122: x_accrual_rec => l_accrual_rec
1123: );
1124:
1125: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1126: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
1127: TO_CHAR(l_distribution_rec.line_location_id) ||
1128: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
1129: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1125: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1126: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
1127: TO_CHAR(l_distribution_rec.line_location_id) ||
1128: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
1129: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1130: END IF;
1131:
1132: l_stmt_num := 130;
1133: IF ((l_accrual_rec.quantity_received > l_accrual_rec.quantity_billed)
1191: ---------------------------------------------------------------------
1192: l_stmt_num := 120;
1193: Calculate_AccrualAmount(
1194: p_api_version => 1.0,
1195: p_init_msg_list => FND_API.G_FALSE,
1196: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1197: x_return_status => l_return_status,
1198: x_msg_count => x_msg_count,
1199: x_msg_data => x_msg_data,
1192: l_stmt_num := 120;
1193: Calculate_AccrualAmount(
1194: p_api_version => 1.0,
1195: p_init_msg_list => FND_API.G_FALSE,
1196: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1197: x_return_status => l_return_status,
1198: x_msg_count => x_msg_count,
1199: x_msg_data => x_msg_data,
1200: p_service_flag => l_distribution_rec.service_flag,
1204: x_accrual_rec => l_accrual_rec
1205: );
1206:
1207: -- If return status is not success, raise unexpected exception
1208: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1209: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
1210: TO_CHAR(l_distribution_rec.line_location_id) ||
1211: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
1212: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1208: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1209: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
1210: TO_CHAR(l_distribution_rec.line_location_id) ||
1211: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
1212: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1213: END IF;
1214:
1215: ---------------------------------------------------------------------
1216: -- We need only those accrual entries, for which:
1331: p_data => x_msg_data
1332: );
1333:
1334: -- Standard check of p_commit.
1335: IF FND_API.To_Boolean( p_commit ) THEN
1336: COMMIT WORK;
1337: END IF;
1338:
1339: EXCEPTION
1337: END IF;
1338:
1339: EXCEPTION
1340:
1341: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1342: ROLLBACK TO Create_PerEndAccruals_PVT;
1343: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1344:
1345: IF (l_exceptionLog) THEN
1339: EXCEPTION
1340:
1341: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1342: ROLLBACK TO Create_PerEndAccruals_PVT;
1343: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1344:
1345: IF (l_exceptionLog) THEN
1346: FND_LOG.STRING(
1347: FND_LOG.LEVEL_EXCEPTION,
1356: );
1357:
1358: WHEN OTHERS THEN
1359: ROLLBACK TO Create_PerEndAccruals_PVT;
1360: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1361:
1362: -- Unexpected level log message
1363: IF (l_uLog) THEN
1364: FND_LOG.STRING(
1491: );
1492: END IF;
1493:
1494: -- Standard call to check for call compatibility.
1495: IF NOT FND_API.Compatible_API_Call ( l_api_version,
1496: p_api_version,
1497: l_api_name,
1498: G_PKG_NAME )
1499: THEN
1496: p_api_version,
1497: l_api_name,
1498: G_PKG_NAME )
1499: THEN
1500: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1501: END IF;
1502:
1503: -- Initialize message list if p_init_msg_list is set to TRUE.
1504: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1500: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1501: END IF;
1502:
1503: -- Initialize message list if p_init_msg_list is set to TRUE.
1504: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1505: FND_MSG_PUB.initialize;
1506: END IF;
1507:
1508: -- Initialize API return status to success
1505: FND_MSG_PUB.initialize;
1506: END IF;
1507:
1508: -- Initialize API return status to success
1509: x_return_status := FND_API.G_RET_STS_SUCCESS;
1510: l_return_status := FND_API.G_RET_STS_SUCCESS;
1511:
1512: -- Inintialize the variables
1513: x_accrual_rec.quantity_received:= 0;
1506: END IF;
1507:
1508: -- Initialize API return status to success
1509: x_return_status := FND_API.G_RET_STS_SUCCESS;
1510: l_return_status := FND_API.G_RET_STS_SUCCESS;
1511:
1512: -- Inintialize the variables
1513: x_accrual_rec.quantity_received:= 0;
1514: x_accrual_rec.quantity_billed := 0;
1524: 'Shipment Id :' || x_accrual_rec.shipment_id || ',' ||
1525: 'Distribution Id :' || x_accrual_rec.distribution_id || ',' ||
1526: 'Ordered quantity less than or equal to zero'
1527: );
1528: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1529: END IF;
1530:
1531: -------------------------------------------------------------------------
1532: -- If Match to PO cases
1563:
1564: l_stmt_num := 100;
1565: Get_RcvQuantity (
1566: p_api_version => 1.0,
1567: p_init_msg_list => FND_API.G_FALSE,
1568: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1569: x_return_status => l_return_status,
1570: x_msg_count => x_msg_count,
1571: x_msg_data => x_msg_data,
1564: l_stmt_num := 100;
1565: Get_RcvQuantity (
1566: p_api_version => 1.0,
1567: p_init_msg_list => FND_API.G_FALSE,
1568: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1569: x_return_status => l_return_status,
1570: x_msg_count => x_msg_count,
1571: x_msg_data => x_msg_data,
1572: p_line_location_id => x_accrual_rec.shipment_id,
1573: p_service_flag => p_service_flag,
1574: p_end_date => p_end_date
1575: );
1576: -- If return status is not success, raise unexpected exception
1577: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1578: l_msg_data := 'Failed calculating quantity_received and quantity_delivered against the Shipment id :' ||
1579: TO_CHAR(x_accrual_rec.shipment_id);
1580: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1581: END IF;
1576: -- If return status is not success, raise unexpected exception
1577: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1578: l_msg_data := 'Failed calculating quantity_received and quantity_delivered against the Shipment id :' ||
1579: TO_CHAR(x_accrual_rec.shipment_id);
1580: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1581: END IF;
1582: END IF;
1583:
1584: g_shipment_net_qty_received := g_nqr;
1721: ---------------------------------------------------------------------
1722: l_stmt_num := 130;
1723: Get_InvoiceQuantity (
1724: p_api_version => 1.0,
1725: p_init_msg_list => FND_API.G_FALSE,
1726: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1727: x_return_status => l_return_status,
1728: x_msg_count => x_msg_count,
1729: x_msg_data => x_msg_data,
1722: l_stmt_num := 130;
1723: Get_InvoiceQuantity (
1724: p_api_version => 1.0,
1725: p_init_msg_list => FND_API.G_FALSE,
1726: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1727: x_return_status => l_return_status,
1728: x_msg_count => x_msg_count,
1729: x_msg_data => x_msg_data,
1730: p_match_option => x_accrual_rec.match_option,
1733: p_end_date => p_end_date,
1734: x_quantity_invoiced => l_qty_invoiced
1735: );
1736: -- If return status is not success, raise unexpected exception
1737: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1738: l_msg_data := 'Failed calculating Net quantity Invoiced against the Distribution id :'
1739: || TO_CHAR(x_accrual_rec.distribution_id);
1740: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1741: END IF;
1736: -- If return status is not success, raise unexpected exception
1737: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1738: l_msg_data := 'Failed calculating Net quantity Invoiced against the Distribution id :'
1739: || TO_CHAR(x_accrual_rec.distribution_id);
1740: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1741: END IF;
1742:
1743: x_accrual_rec.quantity_received := l_net_qty_received;
1744: x_accrual_rec.quantity_billed := l_qty_invoiced;
1798: -----------------------------------------------------------------
1799: l_stmt_num := 160;
1800: Get_RcvQuantity (
1801: p_api_version => 1.0,
1802: p_init_msg_list => FND_API.G_FALSE,
1803: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1804: x_return_status => l_return_status,
1805: x_msg_count => x_msg_count,
1806: x_msg_data => x_msg_data,
1799: l_stmt_num := 160;
1800: Get_RcvQuantity (
1801: p_api_version => 1.0,
1802: p_init_msg_list => FND_API.G_FALSE,
1803: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1804: x_return_status => l_return_status,
1805: x_msg_count => x_msg_count,
1806: x_msg_data => x_msg_data,
1807: p_line_location_id => x_accrual_rec.shipment_id,
1810: p_service_flag => p_service_flag,
1811: p_end_date => p_end_date
1812: );
1813: -- If return status is not success, raise unexpected exception
1814: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1815: l_msg_data := 'Failed calculating Net quantity received against the Transaction id :'
1816: || TO_CHAR(l_transaction_rec.transaction_id);
1817: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1818: END IF;
1813: -- If return status is not success, raise unexpected exception
1814: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1815: l_msg_data := 'Failed calculating Net quantity received against the Transaction id :'
1816: || TO_CHAR(l_transaction_rec.transaction_id);
1817: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1818: END IF;
1819:
1820: l_txn_net_qty_received := g_nqr;
1821: l_txn_net_qty_delivered:= g_nqd;
1867: -----------------------------------------------------------------
1868: l_stmt_num := 200;
1869: Get_InvoiceQuantity (
1870: p_api_version => 1.0,
1871: p_init_msg_list => FND_API.G_FALSE,
1872: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1873: x_return_status => l_return_status,
1874: x_msg_count => x_msg_count,
1875: x_msg_data => x_msg_data,
1868: l_stmt_num := 200;
1869: Get_InvoiceQuantity (
1870: p_api_version => 1.0,
1871: p_init_msg_list => FND_API.G_FALSE,
1872: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1873: x_return_status => l_return_status,
1874: x_msg_count => x_msg_count,
1875: x_msg_data => x_msg_data,
1876: p_match_option => x_accrual_rec.match_option,
1880: p_end_date => p_end_date,
1881: x_quantity_invoiced => l_qty_invoiced
1882: );
1883: -- If return status is not success, raise unexpected exception
1884: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1885: l_msg_data := 'Failed calculating quantity invoiced against the distribution id :'
1886: || TO_CHAR(x_accrual_rec.distribution_id);
1887: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1888: END IF;
1883: -- If return status is not success, raise unexpected exception
1884: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1885: l_msg_data := 'Failed calculating quantity invoiced against the distribution id :'
1886: || TO_CHAR(x_accrual_rec.distribution_id);
1887: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1888: END IF;
1889:
1890: x_accrual_rec.quantity_billed := l_qty_invoiced;
1891:
2018: );
2019:
2020: EXCEPTION
2021:
2022: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2023:
2024: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2025:
2026: IF (l_exceptionLog) THEN
2020: EXCEPTION
2021:
2022: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2023:
2024: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2025:
2026: IF (l_exceptionLog) THEN
2027: FND_LOG.STRING(
2028: FND_LOG.LEVEL_EXCEPTION,
2037: );
2038:
2039: WHEN OTHERS THEN
2040:
2041: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2042:
2043: IF (l_uLog) THEN
2044: FND_LOG.STRING(
2045: FND_LOG.LEVEL_UNEXPECTED,
2130: );
2131: END IF;
2132:
2133: -- Standard call to check for call compatibility.
2134: IF NOT FND_API.Compatible_API_Call ( l_api_version,
2135: p_api_version,
2136: l_api_name,
2137: G_PKG_NAME )
2138: THEN
2135: p_api_version,
2136: l_api_name,
2137: G_PKG_NAME )
2138: THEN
2139: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2140: END IF;
2141:
2142: -- Initialize message list if p_init_msg_list is set to TRUE.
2143: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2139: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2140: END IF;
2141:
2142: -- Initialize message list if p_init_msg_list is set to TRUE.
2143: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2144: FND_MSG_PUB.initialize;
2145: END IF;
2146:
2147: -- Initialize API return status to success
2144: FND_MSG_PUB.initialize;
2145: END IF;
2146:
2147: -- Initialize API return status to success
2148: x_return_status := FND_API.G_RET_STS_SUCCESS;
2149: l_return_status := FND_API.G_RET_STS_SUCCESS;
2150:
2151: -- Prepairing accrual record to call the Calculate_AccrualAmount procedure
2152: l_accrual_rec.shipment_id := p_shipment_id;
2145: END IF;
2146:
2147: -- Initialize API return status to success
2148: x_return_status := FND_API.G_RET_STS_SUCCESS;
2149: l_return_status := FND_API.G_RET_STS_SUCCESS;
2150:
2151: -- Prepairing accrual record to call the Calculate_AccrualAmount procedure
2152: l_accrual_rec.shipment_id := p_shipment_id;
2153: l_accrual_rec.distribution_id := p_distribution_id;
2163: -----------------------------------------------------------------
2164: l_stmt_num := 10;
2165: Calculate_AccrualAmount(
2166: p_api_version => 1.0,
2167: p_init_msg_list => FND_API.G_FALSE,
2168: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2169: x_return_status => l_return_status,
2170: x_msg_count => x_msg_count,
2171: x_msg_data => x_msg_data,
2164: l_stmt_num := 10;
2165: Calculate_AccrualAmount(
2166: p_api_version => 1.0,
2167: p_init_msg_list => FND_API.G_FALSE,
2168: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2169: x_return_status => l_return_status,
2170: x_msg_count => x_msg_count,
2171: x_msg_data => x_msg_data,
2172: p_service_flag => p_service_flag,
2176: p_transaction_id => p_transaction_id,
2177: x_accrual_rec => l_accrual_rec
2178: );
2179: -- If return status is not success, raise unexpected exception
2180: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
2181: l_msg_data := 'Failed calculating aacrual amount against the Shipment id :' ||
2182: TO_CHAR(p_shipment_id);
2183: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2184: END IF;
2179: -- If return status is not success, raise unexpected exception
2180: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
2181: l_msg_data := 'Failed calculating aacrual amount against the Shipment id :' ||
2182: TO_CHAR(p_shipment_id);
2183: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2184: END IF;
2185:
2186: -- Assign the values returned
2187: x_accrual_qty := l_accrual_rec.accrual_quantity;
2205: );
2206:
2207: EXCEPTION
2208:
2209: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2210:
2211: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2212:
2213: IF (l_exceptionLog) THEN
2207: EXCEPTION
2208:
2209: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2210:
2211: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2212:
2213: IF (l_exceptionLog) THEN
2214: FND_LOG.STRING(
2215: FND_LOG.LEVEL_EXCEPTION,
2224: );
2225:
2226: WHEN OTHERS THEN
2227:
2228: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2229:
2230: IF (l_uLog) THEN
2231: FND_LOG.STRING(
2232: FND_LOG.LEVEL_UNEXPECTED,
2369: );
2370: END IF;
2371:
2372: -- Standard call to check for call compatibility.
2373: IF NOT FND_API.Compatible_API_Call ( l_api_version,
2374: p_api_version,
2375: l_api_name,
2376: G_PKG_NAME )
2377: THEN
2374: p_api_version,
2375: l_api_name,
2376: G_PKG_NAME )
2377: THEN
2378: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2379: END IF;
2380:
2381: -- Initialize message list if p_init_msg_list is set to TRUE.
2382: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2378: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2379: END IF;
2380:
2381: -- Initialize message list if p_init_msg_list is set to TRUE.
2382: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2383: FND_MSG_PUB.initialize;
2384: END IF;
2385:
2386: -- Initialize API return status to success
2383: FND_MSG_PUB.initialize;
2384: END IF;
2385:
2386: -- Initialize API return status to success
2387: x_return_status := FND_API.G_RET_STS_SUCCESS;
2388: l_return_status := FND_API.G_RET_STS_SUCCESS;
2389:
2390: -- initialize the variables
2391: g_nqr := 0;
2384: END IF;
2385:
2386: -- Initialize API return status to success
2387: x_return_status := FND_API.G_RET_STS_SUCCESS;
2388: l_return_status := FND_API.G_RET_STS_SUCCESS;
2389:
2390: -- initialize the variables
2391: g_nqr := 0;
2392: g_nqd := 0;
2598: );
2599:
2600: EXCEPTION
2601:
2602: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2603:
2604: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2605:
2606: FND_MSG_PUB.Count_And_Get
2600: EXCEPTION
2601:
2602: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2603:
2604: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2605:
2606: FND_MSG_PUB.Count_And_Get
2607: ( p_count => x_msg_count,
2608: p_data => x_msg_data
2609: );
2610:
2611: WHEN OTHERS THEN
2612:
2613: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2614:
2615: IF (l_uLog) THEN
2616: FND_LOG.STRING(
2617: FND_LOG.LEVEL_UNEXPECTED,
2692: );
2693: END IF;
2694:
2695: -- Standard call to check for call compatibility.
2696: IF NOT FND_API.Compatible_API_Call ( l_api_version,
2697: p_api_version,
2698: l_api_name,
2699: G_PKG_NAME )
2700: THEN
2697: p_api_version,
2698: l_api_name,
2699: G_PKG_NAME )
2700: THEN
2701: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2702: END IF;
2703:
2704: -- Initialize message list if p_init_msg_list is set to TRUE.
2705: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2701: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2702: END IF;
2703:
2704: -- Initialize message list if p_init_msg_list is set to TRUE.
2705: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2706: FND_MSG_PUB.initialize;
2707: END IF;
2708:
2709: -- Initialize API return status to success
2706: FND_MSG_PUB.initialize;
2707: END IF;
2708:
2709: -- Initialize API return status to success
2710: x_return_status := FND_API.G_RET_STS_SUCCESS;
2711: l_return_status := FND_API.G_RET_STS_SUCCESS;
2712:
2713: -------------------------------------------------------------------------
2714: -- If Match option is Match to PO
2707: END IF;
2708:
2709: -- Initialize API return status to success
2710: x_return_status := FND_API.G_RET_STS_SUCCESS;
2711: l_return_status := FND_API.G_RET_STS_SUCCESS;
2712:
2713: -------------------------------------------------------------------------
2714: -- If Match option is Match to PO
2715: -------------------------------------------------------------------------
2800: );
2801:
2802: EXCEPTION
2803:
2804: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2805:
2806: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2807:
2808: FND_MSG_PUB.Count_And_Get
2802: EXCEPTION
2803:
2804: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2805:
2806: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2807:
2808: FND_MSG_PUB.Count_And_Get
2809: ( p_count => x_msg_count,
2810: p_data => x_msg_data
2810: p_data => x_msg_data
2811: );
2812:
2813: WHEN OTHERS THEN
2814: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2815:
2816: IF (l_uLog) THEN
2817: FND_LOG.STRING(
2818: FND_LOG.LEVEL_UNEXPECTED,