704: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,l_module,' p_calling_api = '|| p_calling_api);
705: END IF;
706:
707: -- Standard call to check for call compatibility
708: IF NOT FND_API.Compatible_API_Call ( l_api_version,
709: p_api_version,
710: l_api_name,
711: G_PKG_NAME )
712: THEN
709: p_api_version,
710: l_api_name,
711: G_PKG_NAME )
712: THEN
713: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
714: END IF;
715:
716: -- Initialize message list if p_init_msg_list is set to TRUE
717: IF FND_API.to_Boolean( p_init_msg_list ) THEN
713: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
714: END IF;
715:
716: -- Initialize message list if p_init_msg_list is set to TRUE
717: IF FND_API.to_Boolean( p_init_msg_list ) THEN
718: FND_MSG_PUB.initialize;
719: END IF;
720:
721: -- Initialize API return status to success
718: FND_MSG_PUB.initialize;
719: END IF;
720:
721: -- Initialize API return status to success
722: x_return_status := FND_API.G_RET_STS_SUCCESS;
723: l_return_status := FND_API.G_RET_STS_SUCCESS;
724:
725: -- Initialize the period end date
726: l_end_date := p_end_date + 0.99999;
719: END IF;
720:
721: -- Initialize API return status to success
722: x_return_status := FND_API.G_RET_STS_SUCCESS;
723: l_return_status := FND_API.G_RET_STS_SUCCESS;
724:
725: -- Initialize the period end date
726: l_end_date := p_end_date + 0.99999;
727:
797: / l_distribution_rec.quantity_ordered;
798: l_stmt_num := 120;
799: Calculate_AccrualAmount(
800: p_api_version => 1.0,
801: p_init_msg_list => FND_API.G_FALSE,
802: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
803: x_return_status => l_return_status,
804: x_msg_count => x_msg_count,
805: x_msg_data => x_msg_data,
798: l_stmt_num := 120;
799: Calculate_AccrualAmount(
800: p_api_version => 1.0,
801: p_init_msg_list => FND_API.G_FALSE,
802: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
803: x_return_status => l_return_status,
804: x_msg_count => x_msg_count,
805: x_msg_data => x_msg_data,
806: p_service_flag => l_distribution_rec.service_flag,
808: p_shipment_qty => l_distribution_rec.shipment_quantity,
809: p_end_date => l_end_date,
810: x_accrual_rec => l_accrual_rec
811: );
812: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
813: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
814: TO_CHAR(l_distribution_rec.line_location_id) ||
815: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
816: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
812: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
813: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
814: TO_CHAR(l_distribution_rec.line_location_id) ||
815: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
816: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
817: END IF;
818:
819: l_stmt_num := 130;
820: IF ((l_accrual_rec.quantity_received > l_accrual_rec.quantity_billed)
871:
872: l_stmt_num := 120;
873: Calculate_AccrualAmount(
874: p_api_version => 1.0,
875: p_init_msg_list => FND_API.G_FALSE,
876: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
877: x_return_status => l_return_status,
878: x_msg_count => x_msg_count,
879: x_msg_data => x_msg_data,
872: l_stmt_num := 120;
873: Calculate_AccrualAmount(
874: p_api_version => 1.0,
875: p_init_msg_list => FND_API.G_FALSE,
876: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
877: x_return_status => l_return_status,
878: x_msg_count => x_msg_count,
879: x_msg_data => x_msg_data,
880: p_service_flag => l_distribution_rec.service_flag,
883: p_end_date => l_end_date,
884: x_accrual_rec => l_accrual_rec
885: );
886:
887: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
888: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
889: TO_CHAR(l_distribution_rec.line_location_id) ||
890: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
891: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
887: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
888: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
889: TO_CHAR(l_distribution_rec.line_location_id) ||
890: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
891: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
892: END IF;
893:
894: l_stmt_num := 130;
895: IF ((l_accrual_rec.quantity_received > l_accrual_rec.quantity_billed)
946:
947: l_stmt_num := 120;
948: Calculate_AccrualAmount(
949: p_api_version => 1.0,
950: p_init_msg_list => FND_API.G_FALSE,
951: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
952: x_return_status => l_return_status,
953: x_msg_count => x_msg_count,
954: x_msg_data => x_msg_data,
947: l_stmt_num := 120;
948: Calculate_AccrualAmount(
949: p_api_version => 1.0,
950: p_init_msg_list => FND_API.G_FALSE,
951: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
952: x_return_status => l_return_status,
953: x_msg_count => x_msg_count,
954: x_msg_data => x_msg_data,
955: p_service_flag => l_distribution_rec.service_flag,
958: p_end_date => l_end_date,
959: x_accrual_rec => l_accrual_rec
960: );
961:
962: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
963: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
964: TO_CHAR(l_distribution_rec.line_location_id) ||
965: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
966: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
962: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
963: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
964: TO_CHAR(l_distribution_rec.line_location_id) ||
965: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
966: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
967: END IF;
968:
969: l_stmt_num := 130;
970: IF ((l_accrual_rec.quantity_received > l_accrual_rec.quantity_billed)
1018: / l_distribution_rec.quantity_ordered;
1019: l_stmt_num := 120;
1020: Calculate_AccrualAmount(
1021: p_api_version => 1.0,
1022: p_init_msg_list => FND_API.G_FALSE,
1023: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1024: x_return_status => l_return_status,
1025: x_msg_count => x_msg_count,
1026: x_msg_data => x_msg_data,
1019: l_stmt_num := 120;
1020: Calculate_AccrualAmount(
1021: p_api_version => 1.0,
1022: p_init_msg_list => FND_API.G_FALSE,
1023: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1024: x_return_status => l_return_status,
1025: x_msg_count => x_msg_count,
1026: x_msg_data => x_msg_data,
1027: p_service_flag => l_distribution_rec.service_flag,
1031: x_accrual_rec => l_accrual_rec
1032: );
1033:
1034: -- If return status is not success, raise unexpected exception
1035: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1036: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
1037: TO_CHAR(l_distribution_rec.line_location_id) ||
1038: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
1039: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1035: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1036: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
1037: TO_CHAR(l_distribution_rec.line_location_id) ||
1038: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
1039: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1040: END IF;
1041:
1042: l_stmt_num := 130;
1043: IF ((l_accrual_rec.quantity_received > l_accrual_rec.quantity_billed)
1091: / l_distribution_rec.quantity_ordered;
1092: l_stmt_num := 120;
1093: Calculate_AccrualAmount(
1094: p_api_version => 1.0,
1095: p_init_msg_list => FND_API.G_FALSE,
1096: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1097: x_return_status => l_return_status,
1098: x_msg_count => x_msg_count,
1099: x_msg_data => x_msg_data,
1092: l_stmt_num := 120;
1093: Calculate_AccrualAmount(
1094: p_api_version => 1.0,
1095: p_init_msg_list => FND_API.G_FALSE,
1096: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1097: x_return_status => l_return_status,
1098: x_msg_count => x_msg_count,
1099: x_msg_data => x_msg_data,
1100: p_service_flag => l_distribution_rec.service_flag,
1103: p_end_date => l_end_date,
1104: x_accrual_rec => l_accrual_rec
1105: );
1106:
1107: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1108: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
1109: TO_CHAR(l_distribution_rec.line_location_id) ||
1110: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
1111: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1107: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1108: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
1109: TO_CHAR(l_distribution_rec.line_location_id) ||
1110: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
1111: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1112: END IF;
1113:
1114: l_stmt_num := 130;
1115: IF ((l_accrual_rec.quantity_received > l_accrual_rec.quantity_billed)
1173: ---------------------------------------------------------------------
1174: l_stmt_num := 120;
1175: Calculate_AccrualAmount(
1176: p_api_version => 1.0,
1177: p_init_msg_list => FND_API.G_FALSE,
1178: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1179: x_return_status => l_return_status,
1180: x_msg_count => x_msg_count,
1181: x_msg_data => x_msg_data,
1174: l_stmt_num := 120;
1175: Calculate_AccrualAmount(
1176: p_api_version => 1.0,
1177: p_init_msg_list => FND_API.G_FALSE,
1178: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1179: x_return_status => l_return_status,
1180: x_msg_count => x_msg_count,
1181: x_msg_data => x_msg_data,
1182: p_service_flag => l_distribution_rec.service_flag,
1186: x_accrual_rec => l_accrual_rec
1187: );
1188:
1189: -- If return status is not success, raise unexpected exception
1190: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1191: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
1192: TO_CHAR(l_distribution_rec.line_location_id) ||
1193: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
1194: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1190: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1191: l_msg_data := 'Error Occured while calculating acrual amount against the Shipment id :' ||
1192: TO_CHAR(l_distribution_rec.line_location_id) ||
1193: ' ,Distribution Id :' || TO_CHAR(l_distribution_rec.po_distribution_id);
1194: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1195: END IF;
1196:
1197: ---------------------------------------------------------------------
1198: -- We need only those accrual entries, for which:
1313: p_data => x_msg_data
1314: );
1315:
1316: -- Standard check of p_commit.
1317: IF FND_API.To_Boolean( p_commit ) THEN
1318: COMMIT WORK;
1319: END IF;
1320:
1321: EXCEPTION
1319: END IF;
1320:
1321: EXCEPTION
1322:
1323: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1324: ROLLBACK TO Create_PerEndAccruals_PVT;
1325: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1326:
1327: IF (l_exceptionLog) THEN
1321: EXCEPTION
1322:
1323: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1324: ROLLBACK TO Create_PerEndAccruals_PVT;
1325: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1326:
1327: IF (l_exceptionLog) THEN
1328: FND_LOG.STRING(
1329: FND_LOG.LEVEL_EXCEPTION,
1338: );
1339:
1340: WHEN OTHERS THEN
1341: ROLLBACK TO Create_PerEndAccruals_PVT;
1342: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1343:
1344: -- Unexpected level log message
1345: IF (l_uLog) THEN
1346: FND_LOG.STRING(
1472: );
1473: END IF;
1474:
1475: -- Standard call to check for call compatibility.
1476: IF NOT FND_API.Compatible_API_Call ( l_api_version,
1477: p_api_version,
1478: l_api_name,
1479: G_PKG_NAME )
1480: THEN
1477: p_api_version,
1478: l_api_name,
1479: G_PKG_NAME )
1480: THEN
1481: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1482: END IF;
1483:
1484: -- Initialize message list if p_init_msg_list is set to TRUE.
1485: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1481: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1482: END IF;
1483:
1484: -- Initialize message list if p_init_msg_list is set to TRUE.
1485: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1486: FND_MSG_PUB.initialize;
1487: END IF;
1488:
1489: -- Initialize API return status to success
1486: FND_MSG_PUB.initialize;
1487: END IF;
1488:
1489: -- Initialize API return status to success
1490: x_return_status := FND_API.G_RET_STS_SUCCESS;
1491: l_return_status := FND_API.G_RET_STS_SUCCESS;
1492:
1493: -- Inintialize the variables
1494: x_accrual_rec.quantity_received:= 0;
1487: END IF;
1488:
1489: -- Initialize API return status to success
1490: x_return_status := FND_API.G_RET_STS_SUCCESS;
1491: l_return_status := FND_API.G_RET_STS_SUCCESS;
1492:
1493: -- Inintialize the variables
1494: x_accrual_rec.quantity_received:= 0;
1495: x_accrual_rec.quantity_billed := 0;
1505: 'Shipment Id :' || x_accrual_rec.shipment_id || ',' ||
1506: 'Distribution Id :' || x_accrual_rec.distribution_id || ',' ||
1507: 'Ordered quantity less than or equal to zero'
1508: );
1509: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1510: END IF;
1511:
1512: -------------------------------------------------------------------------
1513: -- If Match to PO cases
1529:
1530: l_stmt_num := 100;
1531: Get_RcvQuantity (
1532: p_api_version => 1.0,
1533: p_init_msg_list => FND_API.G_FALSE,
1534: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1535: x_return_status => l_return_status,
1536: x_msg_count => x_msg_count,
1537: x_msg_data => x_msg_data,
1530: l_stmt_num := 100;
1531: Get_RcvQuantity (
1532: p_api_version => 1.0,
1533: p_init_msg_list => FND_API.G_FALSE,
1534: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1535: x_return_status => l_return_status,
1536: x_msg_count => x_msg_count,
1537: x_msg_data => x_msg_data,
1538: p_line_location_id => x_accrual_rec.shipment_id,
1539: p_service_flag => p_service_flag,
1540: p_end_date => p_end_date
1541: );
1542: -- If return status is not success, raise unexpected exception
1543: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1544: l_msg_data := 'Failed calculating quantity_received and quantity_delivered against the Shipment id :' ||
1545: TO_CHAR(x_accrual_rec.shipment_id);
1546: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1547: END IF;
1542: -- If return status is not success, raise unexpected exception
1543: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1544: l_msg_data := 'Failed calculating quantity_received and quantity_delivered against the Shipment id :' ||
1545: TO_CHAR(x_accrual_rec.shipment_id);
1546: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1547: END IF;
1548: END IF;
1549:
1550: g_shipment_net_qty_received := g_nqr;
1625: ---------------------------------------------------------------------
1626: l_stmt_num := 130;
1627: Get_InvoiceQuantity (
1628: p_api_version => 1.0,
1629: p_init_msg_list => FND_API.G_FALSE,
1630: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1631: x_return_status => l_return_status,
1632: x_msg_count => x_msg_count,
1633: x_msg_data => x_msg_data,
1626: l_stmt_num := 130;
1627: Get_InvoiceQuantity (
1628: p_api_version => 1.0,
1629: p_init_msg_list => FND_API.G_FALSE,
1630: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1631: x_return_status => l_return_status,
1632: x_msg_count => x_msg_count,
1633: x_msg_data => x_msg_data,
1634: p_match_option => x_accrual_rec.match_option,
1637: p_end_date => p_end_date,
1638: x_quantity_invoiced => l_qty_invoiced
1639: );
1640: -- If return status is not success, raise unexpected exception
1641: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1642: l_msg_data := 'Failed calculating Net quantity Invoiced against the Distribution id :'
1643: || TO_CHAR(x_accrual_rec.distribution_id);
1644: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1645: END IF;
1640: -- If return status is not success, raise unexpected exception
1641: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1642: l_msg_data := 'Failed calculating Net quantity Invoiced against the Distribution id :'
1643: || TO_CHAR(x_accrual_rec.distribution_id);
1644: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1645: END IF;
1646:
1647: x_accrual_rec.quantity_received := l_net_qty_received;
1648: x_accrual_rec.quantity_billed := l_qty_invoiced;
1694: -----------------------------------------------------------------
1695: l_stmt_num := 160;
1696: Get_RcvQuantity (
1697: p_api_version => 1.0,
1698: p_init_msg_list => FND_API.G_FALSE,
1699: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1700: x_return_status => l_return_status,
1701: x_msg_count => x_msg_count,
1702: x_msg_data => x_msg_data,
1695: l_stmt_num := 160;
1696: Get_RcvQuantity (
1697: p_api_version => 1.0,
1698: p_init_msg_list => FND_API.G_FALSE,
1699: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1700: x_return_status => l_return_status,
1701: x_msg_count => x_msg_count,
1702: x_msg_data => x_msg_data,
1703: p_line_location_id => x_accrual_rec.shipment_id,
1706: p_service_flag => p_service_flag,
1707: p_end_date => p_end_date
1708: );
1709: -- If return status is not success, raise unexpected exception
1710: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1711: l_msg_data := 'Failed calculating Net quantity received against the Transaction id :'
1712: || TO_CHAR(l_transaction_rec.transaction_id);
1713: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1714: END IF;
1709: -- If return status is not success, raise unexpected exception
1710: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1711: l_msg_data := 'Failed calculating Net quantity received against the Transaction id :'
1712: || TO_CHAR(l_transaction_rec.transaction_id);
1713: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1714: END IF;
1715:
1716: l_txn_net_qty_received := g_nqr;
1717: l_txn_net_qty_delivered:= g_nqd;
1818: -----------------------------------------------------------------
1819: l_stmt_num := 200;
1820: Get_InvoiceQuantity (
1821: p_api_version => 1.0,
1822: p_init_msg_list => FND_API.G_FALSE,
1823: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1824: x_return_status => l_return_status,
1825: x_msg_count => x_msg_count,
1826: x_msg_data => x_msg_data,
1819: l_stmt_num := 200;
1820: Get_InvoiceQuantity (
1821: p_api_version => 1.0,
1822: p_init_msg_list => FND_API.G_FALSE,
1823: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1824: x_return_status => l_return_status,
1825: x_msg_count => x_msg_count,
1826: x_msg_data => x_msg_data,
1827: p_match_option => x_accrual_rec.match_option,
1831: p_end_date => p_end_date,
1832: x_quantity_invoiced => l_qty_invoiced
1833: );
1834: -- If return status is not success, raise unexpected exception
1835: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1836: l_msg_data := 'Failed calculating quantity invoiced against the distribution id :'
1837: || TO_CHAR(x_accrual_rec.distribution_id);
1838: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1839: END IF;
1834: -- If return status is not success, raise unexpected exception
1835: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1836: l_msg_data := 'Failed calculating quantity invoiced against the distribution id :'
1837: || TO_CHAR(x_accrual_rec.distribution_id);
1838: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1839: END IF;
1840:
1841: ---------------------------------------------------------------------
1842: -- For PAC per end accrual calculation, for match to PO cases, prorate
1913: );
1914:
1915: EXCEPTION
1916:
1917: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1918:
1919: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1920:
1921: IF (l_exceptionLog) THEN
1915: EXCEPTION
1916:
1917: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1918:
1919: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1920:
1921: IF (l_exceptionLog) THEN
1922: FND_LOG.STRING(
1923: FND_LOG.LEVEL_EXCEPTION,
1932: );
1933:
1934: WHEN OTHERS THEN
1935:
1936: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1937:
1938: IF (l_uLog) THEN
1939: FND_LOG.STRING(
1940: FND_LOG.LEVEL_UNEXPECTED,
2025: );
2026: END IF;
2027:
2028: -- Standard call to check for call compatibility.
2029: IF NOT FND_API.Compatible_API_Call ( l_api_version,
2030: p_api_version,
2031: l_api_name,
2032: G_PKG_NAME )
2033: THEN
2030: p_api_version,
2031: l_api_name,
2032: G_PKG_NAME )
2033: THEN
2034: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2035: END IF;
2036:
2037: -- Initialize message list if p_init_msg_list is set to TRUE.
2038: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2034: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2035: END IF;
2036:
2037: -- Initialize message list if p_init_msg_list is set to TRUE.
2038: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2039: FND_MSG_PUB.initialize;
2040: END IF;
2041:
2042: -- Initialize API return status to success
2039: FND_MSG_PUB.initialize;
2040: END IF;
2041:
2042: -- Initialize API return status to success
2043: x_return_status := FND_API.G_RET_STS_SUCCESS;
2044: l_return_status := FND_API.G_RET_STS_SUCCESS;
2045:
2046: -- Prepairing accrual record to call the Calculate_AccrualAmount procedure
2047: l_accrual_rec.shipment_id := p_shipment_id;
2040: END IF;
2041:
2042: -- Initialize API return status to success
2043: x_return_status := FND_API.G_RET_STS_SUCCESS;
2044: l_return_status := FND_API.G_RET_STS_SUCCESS;
2045:
2046: -- Prepairing accrual record to call the Calculate_AccrualAmount procedure
2047: l_accrual_rec.shipment_id := p_shipment_id;
2048: l_accrual_rec.distribution_id := p_distribution_id;
2058: -----------------------------------------------------------------
2059: l_stmt_num := 10;
2060: Calculate_AccrualAmount(
2061: p_api_version => 1.0,
2062: p_init_msg_list => FND_API.G_FALSE,
2063: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2064: x_return_status => l_return_status,
2065: x_msg_count => x_msg_count,
2066: x_msg_data => x_msg_data,
2059: l_stmt_num := 10;
2060: Calculate_AccrualAmount(
2061: p_api_version => 1.0,
2062: p_init_msg_list => FND_API.G_FALSE,
2063: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2064: x_return_status => l_return_status,
2065: x_msg_count => x_msg_count,
2066: x_msg_data => x_msg_data,
2067: p_service_flag => p_service_flag,
2071: p_transaction_id => p_transaction_id,
2072: x_accrual_rec => l_accrual_rec
2073: );
2074: -- If return status is not success, raise unexpected exception
2075: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
2076: l_msg_data := 'Failed calculating aacrual amount against the Shipment id :' ||
2077: TO_CHAR(p_shipment_id);
2078: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2079: END IF;
2074: -- If return status is not success, raise unexpected exception
2075: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
2076: l_msg_data := 'Failed calculating aacrual amount against the Shipment id :' ||
2077: TO_CHAR(p_shipment_id);
2078: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2079: END IF;
2080:
2081: -- Assign the values returned
2082: x_accrual_qty := l_accrual_rec.accrual_quantity;
2100: );
2101:
2102: EXCEPTION
2103:
2104: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2105:
2106: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2107:
2108: IF (l_exceptionLog) THEN
2102: EXCEPTION
2103:
2104: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2105:
2106: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2107:
2108: IF (l_exceptionLog) THEN
2109: FND_LOG.STRING(
2110: FND_LOG.LEVEL_EXCEPTION,
2119: );
2120:
2121: WHEN OTHERS THEN
2122:
2123: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2124:
2125: IF (l_uLog) THEN
2126: FND_LOG.STRING(
2127: FND_LOG.LEVEL_UNEXPECTED,
2259: );
2260: END IF;
2261:
2262: -- Standard call to check for call compatibility.
2263: IF NOT FND_API.Compatible_API_Call ( l_api_version,
2264: p_api_version,
2265: l_api_name,
2266: G_PKG_NAME )
2267: THEN
2264: p_api_version,
2265: l_api_name,
2266: G_PKG_NAME )
2267: THEN
2268: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2269: END IF;
2270:
2271: -- Initialize message list if p_init_msg_list is set to TRUE.
2272: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2268: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2269: END IF;
2270:
2271: -- Initialize message list if p_init_msg_list is set to TRUE.
2272: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2273: FND_MSG_PUB.initialize;
2274: END IF;
2275:
2276: -- Initialize API return status to success
2273: FND_MSG_PUB.initialize;
2274: END IF;
2275:
2276: -- Initialize API return status to success
2277: x_return_status := FND_API.G_RET_STS_SUCCESS;
2278: l_return_status := FND_API.G_RET_STS_SUCCESS;
2279:
2280: -- initialize the variables
2281: g_nqr := 0;
2274: END IF;
2275:
2276: -- Initialize API return status to success
2277: x_return_status := FND_API.G_RET_STS_SUCCESS;
2278: l_return_status := FND_API.G_RET_STS_SUCCESS;
2279:
2280: -- initialize the variables
2281: g_nqr := 0;
2282: g_nqd := 0;
2488: );
2489:
2490: EXCEPTION
2491:
2492: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2493:
2494: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2495:
2496: FND_MSG_PUB.Count_And_Get
2490: EXCEPTION
2491:
2492: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2493:
2494: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2495:
2496: FND_MSG_PUB.Count_And_Get
2497: ( p_count => x_msg_count,
2498: p_data => x_msg_data
2499: );
2500:
2501: WHEN OTHERS THEN
2502:
2503: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2504:
2505: IF (l_uLog) THEN
2506: FND_LOG.STRING(
2507: FND_LOG.LEVEL_UNEXPECTED,
2582: );
2583: END IF;
2584:
2585: -- Standard call to check for call compatibility.
2586: IF NOT FND_API.Compatible_API_Call ( l_api_version,
2587: p_api_version,
2588: l_api_name,
2589: G_PKG_NAME )
2590: THEN
2587: p_api_version,
2588: l_api_name,
2589: G_PKG_NAME )
2590: THEN
2591: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2592: END IF;
2593:
2594: -- Initialize message list if p_init_msg_list is set to TRUE.
2595: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2591: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2592: END IF;
2593:
2594: -- Initialize message list if p_init_msg_list is set to TRUE.
2595: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2596: FND_MSG_PUB.initialize;
2597: END IF;
2598:
2599: -- Initialize API return status to success
2596: FND_MSG_PUB.initialize;
2597: END IF;
2598:
2599: -- Initialize API return status to success
2600: x_return_status := FND_API.G_RET_STS_SUCCESS;
2601: l_return_status := FND_API.G_RET_STS_SUCCESS;
2602:
2603: -------------------------------------------------------------------------
2604: -- If Match option is Match to PO
2597: END IF;
2598:
2599: -- Initialize API return status to success
2600: x_return_status := FND_API.G_RET_STS_SUCCESS;
2601: l_return_status := FND_API.G_RET_STS_SUCCESS;
2602:
2603: -------------------------------------------------------------------------
2604: -- If Match option is Match to PO
2605: -------------------------------------------------------------------------
2685: );
2686:
2687: EXCEPTION
2688:
2689: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2690:
2691: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2692:
2693: FND_MSG_PUB.Count_And_Get
2687: EXCEPTION
2688:
2689: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2690:
2691: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2692:
2693: FND_MSG_PUB.Count_And_Get
2694: ( p_count => x_msg_count,
2695: p_data => x_msg_data
2695: p_data => x_msg_data
2696: );
2697:
2698: WHEN OTHERS THEN
2699: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2700:
2701: IF (l_uLog) THEN
2702: FND_LOG.STRING(
2703: FND_LOG.LEVEL_UNEXPECTED,