214: FND_MESSAGE.SET_NAME('AR', 'HZ_GEO_NO_RECORD');
215: FND_MESSAGE.SET_TOKEN('TOKEN1', 'geography_element_column');
216: FND_MESSAGE.SET_TOKEN('TOKEN2', 'geography_type :'||l_get_all_parents.parent_object_type||', country_code :'||l_country_code);
217: FND_MSG_PUB.ADD;
218: x_return_status := fnd_api.g_ret_sts_error;
219: RAISE FND_API.G_EXC_ERROR;
220: END;
221:
222: -- get geography_name
215: FND_MESSAGE.SET_TOKEN('TOKEN1', 'geography_element_column');
216: FND_MESSAGE.SET_TOKEN('TOKEN2', 'geography_type :'||l_get_all_parents.parent_object_type||', country_code :'||l_country_code);
217: FND_MSG_PUB.ADD;
218: x_return_status := fnd_api.g_ret_sts_error;
219: RAISE FND_API.G_EXC_ERROR;
220: END;
221:
222: -- get geography_name
223: SELECT geography_name,geography_code INTO l_geography_name,l_geography_code
358: FND_MESSAGE.SET_TOKEN('TOKEN1', 'geography_element_column');
359: FND_MESSAGE.SET_TOKEN('TOKEN2', 'geography_type :'||l_parent_object_type||'and for country_code of geography_id:'||p_geography_id);
360: FND_MSG_PUB.ADD;
361:
362: RAISE FND_API.G_EXC_ERROR;
363: END;
364: END IF;
365: --dbms_output.put_line ('geo_element_column is '||l_geo_element_col);
366:
514: FND_MESSAGE.SET_TOKEN('VALUE', p_child_name);
515: FND_MESSAGE.SET_TOKEN('GEO_ID', p_child_id);
516: FND_MESSAGE.SET_TOKEN('PARENT_GEO_ID', p_parent_id);
517: FND_MSG_PUB.ADD;
518: x_return_status := fnd_api.g_ret_sts_error;
519:
520: END IF;
521:
522: END check_duplicate_name;
558: FND_MESSAGE.SET_TOKEN('VALUE', p_child_code);
559: FND_MESSAGE.SET_TOKEN('GEO_ID', p_child_id);
560: FND_MESSAGE.SET_TOKEN('PARENT_GEO_ID', p_parent_id);
561: FND_MSG_PUB.ADD;
562: x_return_status := fnd_api.g_ret_sts_error;
563:
564: END IF;
565:
566: END check_duplicate_code;
636: x_return_status => x_return_status
637: );
638:
639: --dbms_output.put_line('After validate relation '||x_return_status);
640: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
641: RAISE FND_API.G_EXC_ERROR;
642: END IF;
643:
644:
637: );
638:
639: --dbms_output.put_line('After validate relation '||x_return_status);
640: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
641: RAISE FND_API.G_EXC_ERROR;
642: END IF;
643:
644:
645: -- get geography types for geography_id and parent_geography_id
647: /*l_geography_type := HZ_GEOGRAPHY_VALIDATE_PVT.get_geography_type(p_geography_id =>p_master_relation_rec.geography_id,
648: x_return_status => x_return_status);
649:
650: --dbms_output.put_line('geography_type in do_create_master_relation:'||l_geography_type);
651: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
652: RAISE FND_API.G_EXC_ERROR;
653: END IF;*/
654:
655: l_parent_geography_type := HZ_GEOGRAPHY_VALIDATE_PVT.get_geography_type(p_geography_id => p_master_relation_rec.parent_geography_id,
648: x_return_status => x_return_status);
649:
650: --dbms_output.put_line('geography_type in do_create_master_relation:'||l_geography_type);
651: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
652: RAISE FND_API.G_EXC_ERROR;
653: END IF;*/
654:
655: l_parent_geography_type := HZ_GEOGRAPHY_VALIDATE_PVT.get_geography_type(p_geography_id => p_master_relation_rec.parent_geography_id,
656: x_return_status => x_return_status);
654:
655: l_parent_geography_type := HZ_GEOGRAPHY_VALIDATE_PVT.get_geography_type(p_geography_id => p_master_relation_rec.parent_geography_id,
656: x_return_status => x_return_status);
657:
658: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
659: RAISE FND_API.G_EXC_ERROR;
660: END IF;
661:
662: BEGIN
655: l_parent_geography_type := HZ_GEOGRAPHY_VALIDATE_PVT.get_geography_type(p_geography_id => p_master_relation_rec.parent_geography_id,
656: x_return_status => x_return_status);
657:
658: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
659: RAISE FND_API.G_EXC_ERROR;
660: END IF;
661:
662: BEGIN
663: -- check for the duplicate name/code with in the parent geography
703: -- The geography identifiers are not yet created
704: NULL;
705: END;
706:
707: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
708: RAISE FND_API.G_EXC_ERROR;
709: END IF;
710: END IF;
711:
704: NULL;
705: END;
706:
707: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
708: RAISE FND_API.G_EXC_ERROR;
709: END IF;
710: END IF;
711:
712: IF l_geography_code IS NOT NULL THEN
739: -- The geography identifiers are not yet created.
740: NULL;
741: END;
742:
743: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
744: RAISE FND_API.G_EXC_ERROR;
745: END IF;
746: END IF;
747:
740: NULL;
741: END;
742:
743: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
744: RAISE FND_API.G_EXC_ERROR;
745: END IF;
746: END IF;
747:
748: -- End of added section (Neeraj Shinde Bug# 5393825)
751: fnd_message.set_name('AR', 'HZ_GEO_NO_RECORD');
752: fnd_message.set_token('TOKEN1','Geography record');
753: fnd_message.set_token('TOKEN2','geography_id '||p_master_relation_rec.geography_id);
754: fnd_msg_pub.add;
755: RAISE FND_API.G_EXC_ERROR;
756: END;
757: -- a geography can not have two countries as its parents
758: IF l_parent_geography_type = 'COUNTRY' THEN
759:
767: IF l_count > 0 THEN
768: fnd_message.set_name('AR', 'HZ_GEO_MULTIPLE_COUNTRIES');
769: fnd_message.set_token('GEO_ID', p_master_relation_rec.geography_id);
770: fnd_msg_pub.add;
771: RAISE FND_API.G_EXC_ERROR;
772: END IF;
773: END IF;
774:
775:
806: --dbms_output.put_line('relationship_id is '||x_relationship_id);
807:
808: ----dbms_output.put_line('parent_id is '||to_char(l_parent_count));
809:
810: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
811: RAISE FND_API.G_EXC_ERROR;
812: END IF;
813: ----dbms_output.put_line('relationship_id is '||to_char(x_relationship_id));
814:
807:
808: ----dbms_output.put_line('parent_id is '||to_char(l_parent_count));
809:
810: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
811: RAISE FND_API.G_EXC_ERROR;
812: END IF;
813: ----dbms_output.put_line('relationship_id is '||to_char(x_relationship_id));
814:
815: -- check whether this geography_id has multiple parents
927: p_column_value => p_object_version_number,
928: x_return_status => x_return_status
929: );
930:
931: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
932: RAISE FND_API.G_EXC_ERROR;
933: END IF;
934:
935: BEGIN
928: x_return_status => x_return_status
929: );
930:
931: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
932: RAISE FND_API.G_EXC_ERROR;
933: END IF;
934:
935: BEGIN
936: -- validate relationship_id
943: fnd_message.set_name('AR', 'HZ_GEO_NO_RECORD');
944: fnd_message.set_token('token1', 'relationship');
945: fnd_message.set_token('token1', 'relationship_id '||p_relationship_id);
946: fnd_msg_pub.add;
947: RAISE FND_API.G_EXC_ERROR;
948: END;
949:
950: --dbms_output.put_line('after master relation validation');
951:
961: p_geography_id => l_geography_id,
962: x_return_status => x_return_status);
963:
964: ----dbms_output.put_line('after getting geography type '||l_geography_type);
965: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
966: RAISE FND_API.G_EXC_ERROR;
967: END IF;
968:
969: -- construct the relationship record for update
962: x_return_status => x_return_status);
963:
964: ----dbms_output.put_line('after getting geography type '||l_geography_type);
965: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
966: RAISE FND_API.G_EXC_ERROR;
967: END IF;
968:
969: -- construct the relationship record for update
970: l_relationship_rec.relationship_id := p_relationship_id;
1005: FND_MESSAGE.SET_NAME( 'AR', 'HZ_GEO_NO_RECORD' );
1006: FND_MESSAGE.SET_TOKEN( 'TOKEN1', 'Relationship');
1007: FND_MESSAGE.SET_TOKEN( 'TOKEN2', 'object_id '||l_geography_id||',object_type '||l_geography_type||' and relationship_type MASTER_REF');
1008: FND_MSG_PUB.ADD;
1009: RAISE FND_API.G_EXC_ERROR;
1010: END;
1011:
1012:
1013: -- if there exists only one parent then do not update
1015: FND_MESSAGE.SET_NAME( 'AR', 'HZ_GEO_SINGLE_PARENT' );
1016: FND_MESSAGE.SET_TOKEN( 'REL_ID', p_relationship_id);
1017: FND_MESSAGE.SET_TOKEN( 'GEO_ID', l_geography_id);
1018: FND_MSG_PUB.ADD;
1019: RAISE FND_API.G_EXC_ERROR;
1020: --l_update_flag := 'N';
1021: END IF;
1022: ----dbms_output.put_line ('parent_count '||to_char(l_parent_count));
1023: IF (l_parent_count = 2 AND p_status= 'I') THEN
1043: x_msg_count => x_msg_count,
1044: x_msg_data => x_msg_data
1045: );
1046:
1047: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1048: RAISE FND_API.G_EXC_ERROR;
1049: END IF;
1050: END IF;
1051:
1044: x_msg_data => x_msg_data
1045: );
1046:
1047: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1048: RAISE FND_API.G_EXC_ERROR;
1049: END IF;
1050: END IF;
1051:
1052:
1178: p_create_update_flag => 'C',
1179: x_return_status => x_return_status
1180: );
1181:
1182: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1183: RAISE FND_API.G_EXC_ERROR;
1184: END IF;
1185:
1186: -- check for the duplicate name and code
1179: x_return_status => x_return_status
1180: );
1181:
1182: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1183: RAISE FND_API.G_EXC_ERROR;
1184: END IF;
1185:
1186: -- check for the duplicate name and code
1187:
1197: fnd_message.set_name('AR', 'HZ_GEO_NO_RECORD');
1198: fnd_message.set_token('TOKEN1','Geography record');
1199: fnd_message.set_token('TOKEN2','geography_id '||p_geo_identifier_rec.geography_id);
1200: fnd_msg_pub.add;
1201: RAISE FND_API.G_EXC_ERROR;
1202: END;
1203:
1204: IF l_geography_use = 'MASTER_REF' THEN
1205: IF l_geography_type <> 'COUNTRY' THEN
1216: p_child_identifier_subtype => l_identifier_subtype,
1217: p_child_language => l_language_code,
1218: x_return_status => x_return_status
1219: );
1220: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1221: RAISE FND_API.G_EXC_ERROR;
1222: EXIT;
1223: END IF;
1224: ELSIF p_geo_identifier_rec.identifier_type = 'CODE' THEN
1217: p_child_language => l_language_code,
1218: x_return_status => x_return_status
1219: );
1220: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1221: RAISE FND_API.G_EXC_ERROR;
1222: EXIT;
1223: END IF;
1224: ELSIF p_geo_identifier_rec.identifier_type = 'CODE' THEN
1225: check_duplicate_code(p_parent_id => l_get_all_parents.subject_id,
1230: p_child_language => l_language_code,
1231: x_return_status => x_return_status
1232: );
1233:
1234: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1235: RAISE FND_API.G_EXC_ERROR;
1236: EXIT;
1237: END IF;
1238: END IF;
1231: x_return_status => x_return_status
1232: );
1233:
1234: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1235: RAISE FND_API.G_EXC_ERROR;
1236: EXIT;
1237: END IF;
1238: END IF;
1239: END LOOP;
1251: IF l_count > 0 THEN
1252: FND_MESSAGE.SET_NAME('AR', 'HZ_GEO_DUP_COUNTRY_IDEN');
1253: FND_MESSAGE.SET_TOKEN('IDEN_VAL', p_geo_identifier_rec.identifier_value);
1254: FND_MSG_PUB.ADD;
1255: x_return_status := fnd_api.g_ret_sts_error;
1256: RAISE FND_API.G_EXC_ERROR;
1257: END IF;
1258: END IF;
1259:
1252: FND_MESSAGE.SET_NAME('AR', 'HZ_GEO_DUP_COUNTRY_IDEN');
1253: FND_MESSAGE.SET_TOKEN('IDEN_VAL', p_geo_identifier_rec.identifier_value);
1254: FND_MSG_PUB.ADD;
1255: x_return_status := fnd_api.g_ret_sts_error;
1256: RAISE FND_API.G_EXC_ERROR;
1257: END IF;
1258: END IF;
1259:
1260: END IF;
1264: IF p_geo_identifier_rec.identifier_subtype <> 'STANDARD_NAME' THEN
1265: FND_MESSAGE.SET_NAME( 'AR', 'HZ_GEO_INVALID_SUBTYPE' );
1266: FND_MESSAGE.SET_TOKEN( 'SUBTYPE', p_geo_identifier_rec.identifier_subtype);
1267: FND_MSG_PUB.ADD;
1268: x_return_status := FND_API.G_RET_STS_ERROR;
1269: RAISE FND_API.G_EXC_ERROR;
1270: END IF;
1271: END IF;
1272:
1265: FND_MESSAGE.SET_NAME( 'AR', 'HZ_GEO_INVALID_SUBTYPE' );
1266: FND_MESSAGE.SET_TOKEN( 'SUBTYPE', p_geo_identifier_rec.identifier_subtype);
1267: FND_MSG_PUB.ADD;
1268: x_return_status := FND_API.G_RET_STS_ERROR;
1269: RAISE FND_API.G_EXC_ERROR;
1270: END IF;
1271: END IF;
1272:
1273: -- If this is the first row for the language_code for type NAME then if it is of subtype other than STANDAR_NAME,
1373: FND_MESSAGE.SET_NAME('AR', 'HZ_GEO_NO_RECORD');
1374: FND_MESSAGE.SET_TOKEN('TOKEN1', 'geography structure level');
1375: FND_MESSAGE.SET_TOKEN('TOKEN2', 'geography_id: '||to_char(l_count)||',country_code: '||l_country_code||',geography_type: '||l_geography_type);
1376: FND_MSG_PUB.ADD;
1377: x_return_status := FND_API.G_RET_STS_ERROR;
1378: END;
1379: END IF;
1380:
1381:
1483: p_create_update_flag => 'U',
1484: x_return_status => x_return_status
1485: );
1486:
1487: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1488: RAISE FND_API.G_EXC_ERROR;
1489: END IF;
1490:
1491: hz_utility_v2pub.validate_mandatory(
1484: x_return_status => x_return_status
1485: );
1486:
1487: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1488: RAISE FND_API.G_EXC_ERROR;
1489: END IF;
1490:
1491: hz_utility_v2pub.validate_mandatory(
1492: p_create_update_flag => 'U',
1493: p_column => 'object_version_number',
1494: p_column_value => p_object_version_number,
1495: x_return_status => x_return_status
1496: );
1497: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1498: RAISE FND_API.G_EXC_ERROR;
1499: END IF;
1500:
1501: BEGIN
1494: p_column_value => p_object_version_number,
1495: x_return_status => x_return_status
1496: );
1497: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1498: RAISE FND_API.G_EXC_ERROR;
1499: END IF;
1500:
1501: BEGIN
1502:
1514: IF l_object_version_number <> p_object_version_number THEN
1515: FND_MESSAGE.SET_NAME('AR', 'HZ_API_RECORD_CHANGED');
1516: FND_MESSAGE.SET_TOKEN('TABLE', 'hz_geography_identifiers');
1517: FND_MSG_PUB.ADD;
1518: RAISE FND_API.G_EXC_ERROR;
1519: ELSE
1520: p_object_version_number := l_object_version_number + 1;
1521: END IF;
1522:
1526: FND_MESSAGE.SET_TOKEN('TOKEN2', 'geography_id: '||p_geo_identifier_rec.geography_id||', identifier_type: '||
1527: p_geo_identifier_rec.identifier_type||', identifier_subtype: '||p_geo_identifier_rec.identifier_subtype||', identifier_value: '||
1528: p_geo_identifier_rec.identifier_value||', language_code: '||p_geo_identifier_rec.language_code);
1529: FND_MSG_PUB.ADD;
1530: RAISE FND_API.G_EXC_ERROR;
1531: END;
1532:
1533: -- Validate new subtype. Update only if valid and geo type is CODE.
1534: IF (p_geo_identifier_rec.identifier_type = 'CODE') THEN
1540: p_lookup_type => 'HZ_GEO_IDENTIFIER_SUBTYPE',
1541: p_column_value => l_new_geo_subtype,
1542: x_return_status => x_return_status
1543: );
1544: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1545: RAISE FND_API.G_EXC_ERROR;
1546: END IF;
1547: l_subtype_updated := 'Y';
1548: ELSE -- new geo subtype is null (i.e. no need to update), use the old subtype
1541: p_column_value => l_new_geo_subtype,
1542: x_return_status => x_return_status
1543: );
1544: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1545: RAISE FND_API.G_EXC_ERROR;
1546: END IF;
1547: l_subtype_updated := 'Y';
1548: ELSE -- new geo subtype is null (i.e. no need to update), use the old subtype
1549: l_new_geo_subtype := l_geo_identifier_subtype;
1557: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_LOOKUP' );
1558: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'identifier_subtype' );
1559: FND_MESSAGE.SET_TOKEN( 'LOOKUP_TYPE', 'HZ_GEO_IDENTIFIER_SUBTYPE' );
1560: FND_MSG_PUB.ADD;
1561: x_return_status := FND_API.G_RET_STS_ERROR;
1562: END IF;
1563: l_subtype_updated := 'Y';
1564: ELSE -- new geo subtype is null (i.e. no need to update), use the old subtype
1565: l_new_geo_subtype := l_geo_identifier_subtype;
1613: FND_MESSAGE.SET_TOKEN('VALUE', l_new_geo_value);
1614: FND_MESSAGE.SET_TOKEN('GEO_ID', p_geo_identifier_rec.geography_id);
1615: FND_MESSAGE.SET_TOKEN('PARENT_GEO_ID', l_get_all_parents.subject_id);
1616: FND_MSG_PUB.ADD;
1617: x_return_status := fnd_api.g_ret_sts_error;
1618: RAISE FND_API.G_EXC_ERROR;
1619: EXIT;
1620: END IF;
1621: ELSIF p_geo_identifier_rec.identifier_type = 'CODE' THEN
1614: FND_MESSAGE.SET_TOKEN('GEO_ID', p_geo_identifier_rec.geography_id);
1615: FND_MESSAGE.SET_TOKEN('PARENT_GEO_ID', l_get_all_parents.subject_id);
1616: FND_MSG_PUB.ADD;
1617: x_return_status := fnd_api.g_ret_sts_error;
1618: RAISE FND_API.G_EXC_ERROR;
1619: EXIT;
1620: END IF;
1621: ELSIF p_geo_identifier_rec.identifier_type = 'CODE' THEN
1622: -- check if the name is duplicated with in the parent of p_child_id
1642: FND_MESSAGE.SET_TOKEN('VALUE', l_new_geo_value);
1643: FND_MESSAGE.SET_TOKEN('GEO_ID', p_geo_identifier_rec.geography_id);
1644: FND_MESSAGE.SET_TOKEN('PARENT_GEO_ID', l_get_all_parents.subject_id);
1645: FND_MSG_PUB.ADD;
1646: x_return_status := fnd_api.g_ret_sts_error;
1647: RAISE FND_API.G_EXC_ERROR;
1648: EXIT;
1649: END IF;
1650: END IF;
1643: FND_MESSAGE.SET_TOKEN('GEO_ID', p_geo_identifier_rec.geography_id);
1644: FND_MESSAGE.SET_TOKEN('PARENT_GEO_ID', l_get_all_parents.subject_id);
1645: FND_MSG_PUB.ADD;
1646: x_return_status := fnd_api.g_ret_sts_error;
1647: RAISE FND_API.G_EXC_ERROR;
1648: EXIT;
1649: END IF;
1650: END IF;
1651: END LOOP;
1664: IF l_count > 0 THEN
1665: FND_MESSAGE.SET_NAME('AR', 'HZ_GEO_DUP_COUNTRY_IDEN');
1666: FND_MESSAGE.SET_TOKEN('IDEN_VAL', l_new_geo_value);
1667: FND_MSG_PUB.ADD;
1668: x_return_status := fnd_api.g_ret_sts_error;
1669: RAISE FND_API.G_EXC_ERROR;
1670: END IF;
1671:
1672: END IF;
1665: FND_MESSAGE.SET_NAME('AR', 'HZ_GEO_DUP_COUNTRY_IDEN');
1666: FND_MESSAGE.SET_TOKEN('IDEN_VAL', l_new_geo_value);
1667: FND_MSG_PUB.ADD;
1668: x_return_status := fnd_api.g_ret_sts_error;
1669: RAISE FND_API.G_EXC_ERROR;
1670: END IF;
1671:
1672: END IF;
1673:
1678: IF (l_old_primary_flag = 'Y' AND p_geo_identifier_rec.primary_flag = 'N') THEN
1679: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_NONUPDATEABLE_COLUMN' );
1680: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'primary_flag from Y to N');
1681: FND_MSG_PUB.ADD;
1682: x_return_status := FND_API.G_RET_STS_ERROR;
1683: RAISE FND_API.G_EXC_ERROR;
1684: END IF;
1685:
1686: -- for updating primary_flag from 'N' to 'Y'
1679: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_NONUPDATEABLE_COLUMN' );
1680: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'primary_flag from Y to N');
1681: FND_MSG_PUB.ADD;
1682: x_return_status := FND_API.G_RET_STS_ERROR;
1683: RAISE FND_API.G_EXC_ERROR;
1684: END IF;
1685:
1686: -- for updating primary_flag from 'N' to 'Y'
1687: IF (l_old_primary_flag = 'N' AND p_geo_identifier_rec.primary_flag = 'Y') THEN
1798: IF l_primary_flag = 'Y' THEN
1799: l_delete_flag := 'N';
1800: FND_MESSAGE.SET_NAME( 'AR', 'HZ_GEO_NONDELETEABLE' );
1801: FND_MSG_PUB.ADD;
1802: x_return_status := FND_API.G_RET_STS_ERROR;
1803: RAISE FND_API.G_EXC_ERROR;
1804: END IF;
1805:
1806: -- If a STANDARD_NAME is being deleted , if there exists another name mark it as STANDARD and delete
1799: l_delete_flag := 'N';
1800: FND_MESSAGE.SET_NAME( 'AR', 'HZ_GEO_NONDELETEABLE' );
1801: FND_MSG_PUB.ADD;
1802: x_return_status := FND_API.G_RET_STS_ERROR;
1803: RAISE FND_API.G_EXC_ERROR;
1804: END IF;
1805:
1806: -- If a STANDARD_NAME is being deleted , if there exists another name mark it as STANDARD and delete
1807: -- this row else if another name doesn't exist then delete the row.
1844: FND_MESSAGE.SET_TOKEN('TOKEN2', 'geography_id: '||p_geography_id||', identifier_type: '||
1845: p_identifier_type||', identifier_subtype: '||p_identifier_subtype||', identifier_value: '||
1846: p_identifier_value||', language_code: '||p_language_code);
1847: FND_MSG_PUB.ADD;
1848: RAISE FND_API.G_EXC_ERROR;
1849:
1850: END do_delete_geo_identifier;
1851:
1852:
1884: );
1885:
1886: --dbms_output.put_line('In do_create_master_geography , after validate_master_geography '|| x_return_status);
1887:
1888: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1889: RAISE FND_API.G_EXC_ERROR;
1890: END IF;
1891:
1892: -- determine the country_code
1885:
1886: --dbms_output.put_line('In do_create_master_geography , after validate_master_geography '|| x_return_status);
1887:
1888: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1889: RAISE FND_API.G_EXC_ERROR;
1890: END IF;
1891:
1892: -- determine the country_code
1893: IF p_master_geography_rec.geography_type='COUNTRY' THEN
1992: x_msg_data => x_msg_data
1993: );
1994: END IF;
1995: END;
1996: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1997: RAISE FND_API.G_EXC_ERROR;
1998: END IF;
1999: -- --dbms_output.put_line('after create_master_relation id is '|| to_char(x_relationship_id));
2000: END LOOP;
1993: );
1994: END IF;
1995: END;
1996: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1997: RAISE FND_API.G_EXC_ERROR;
1998: END IF;
1999: -- --dbms_output.put_line('after create_master_relation id is '|| to_char(x_relationship_id));
2000: END LOOP;
2001: END IF;
2023: x_msg_count => x_msg_count,
2024: x_msg_data => x_msg_data
2025: );
2026:
2027: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2028: RAISE FND_API.G_EXC_ERROR;
2029: END IF;
2030: --dbms_output.put_line('after creating name identifier');
2031:
2024: x_msg_data => x_msg_data
2025: );
2026:
2027: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2028: RAISE FND_API.G_EXC_ERROR;
2029: END IF;
2030: --dbms_output.put_line('after creating name identifier');
2031:
2032: IF p_master_geography_rec.geography_code IS NOT NULL
2030: --dbms_output.put_line('after creating name identifier');
2031:
2032: IF p_master_geography_rec.geography_code IS NOT NULL
2033: -- Bug 4579847 : do not call for g_miss value for code
2034: and p_master_geography_rec.geography_code <> fnd_api.g_miss_char THEN
2035:
2036: -- create an identifier for this geography for identifier_type 'CODE'
2037: l_geo_identifier_rec.identifier_subtype := p_master_geography_rec.geography_code_type;
2038: l_geo_identifier_rec.identifier_value := UPPER(p_master_geography_rec.geography_code);
2047: x_msg_count => x_msg_count,
2048: x_msg_data => x_msg_data
2049: );
2050:
2051: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2052: RAISE FND_API.G_EXC_ERROR;
2053: END IF;
2054: END IF;
2055:
2048: x_msg_data => x_msg_data
2049: );
2050:
2051: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2052: RAISE FND_API.G_EXC_ERROR;
2053: END IF;
2054: END IF;
2055:
2056: END do_create_master_geography;
2100: p_column_value => p_object_version_number,
2101: x_return_status => x_return_status
2102: );
2103:
2104: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2105: RAISE FND_API.G_EXC_ERROR;
2106: END IF;
2107:
2108: BEGIN
2101: x_return_status => x_return_status
2102: );
2103:
2104: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2105: RAISE FND_API.G_EXC_ERROR;
2106: END IF;
2107:
2108: BEGIN
2109:
2118: IF l_object_version_number <> p_object_version_number THEN
2119: FND_MESSAGE.SET_NAME('AR', 'HZ_API_RECORD_CHANGED');
2120: FND_MESSAGE.SET_TOKEN('TABLE', 'hz_geographies');
2121: FND_MSG_PUB.ADD;
2122: RAISE FND_API.G_EXC_ERROR;
2123: ELSE
2124: p_object_version_number := l_object_version_number + 1;
2125: END IF;
2126:
2128: FND_MESSAGE.SET_NAME('AR', 'HZ_GEO_NO_RECORD');
2129: FND_MESSAGE.SET_TOKEN('TOKEN1','geography');
2130: FND_MESSAGE.SET_TOKEN('TOKEN2', 'geography_id '||p_geography_id);
2131: FND_MSG_PUB.ADD;
2132: RAISE FND_API.G_EXC_ERROR;
2133: END;
2134: --dbms_output.put_line('start date and old end date and end date '||to_char(l_start_date,'dd-mon-yyyy')||'*'||to_char(l_end_date,'dd-mon-yyyy')||'*'||to_char(p_end_date,'dd-mon-yyyy')||'*');
2135: --dbms_output.put_line('After date validation '|| x_return_status);
2136: -- check whether end_date >= start_date
2144: p_old_end_date => l_end_date,
2145: x_return_status => x_return_status
2146: );
2147:
2148: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2149: RAISE FND_API.G_EXC_ERROR;
2150: END IF;
2151: -- in case g_miss_date is passed for end_date, assign the default future date to end_date
2152: l_end_date := p_end_date;
2145: x_return_status => x_return_status
2146: );
2147:
2148: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2149: RAISE FND_API.G_EXC_ERROR;
2150: END IF;
2151: -- in case g_miss_date is passed for end_date, assign the default future date to end_date
2152: l_end_date := p_end_date;
2153:
2150: END IF;
2151: -- in case g_miss_date is passed for end_date, assign the default future date to end_date
2152: l_end_date := p_end_date;
2153:
2154: IF l_end_date = fnd_api.g_miss_date THEN
2155: l_end_date := to_date('31-12-4712','DD-MM-YYYY');
2156: END IF;
2157:
2158: -- dbms_output.put_line('timezone_code is '||p_timezone_code);
2169: fnd_message.set_token('FK', 'timezone_code');
2170: fnd_message.set_token('COLUMN','timezone_code');
2171: fnd_message.set_token('TABLE','FND_TIMEZONES_B');
2172: fnd_msg_pub.add;
2173: RAISE FND_API.G_EXC_ERROR;
2174: END IF;
2175: END IF;
2176: --dbms_output.put_line('After date validation '|| x_return_status);
2177:
2282: set status = l_status,
2283: end_date = p_end_date
2284: WHERE relationship_id=l_get_all_relationships.relationship_id;*/
2285:
2286: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2287: RAISE FND_API.G_EXC_ERROR;
2288: EXIT;
2289: END IF;
2290:
2283: end_date = p_end_date
2284: WHERE relationship_id=l_get_all_relationships.relationship_id;*/
2285:
2286: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2287: RAISE FND_API.G_EXC_ERROR;
2288: EXIT;
2289: END IF;
2290:
2291:
2334: l_msg_count NUMBER;
2335: l_count NUMBER;
2336: */
2337: BEGIN
2338: x_return_status := FND_API.G_RET_STS_SUCCESS;
2339: /*
2340: l_geography_range_rec := p_geography_range_rec;
2341: l_geo_range_from := TO_NUMBER(l_geography_range_rec.geography_from);
2342: l_geo_range_to := TO_NUMBER(l_geography_range_rec.geography_to);
2407:
2408: IF (l_count = 0) THEN
2409: -- create geography
2410: HZ_GEOGRAPHY_PUB.create_master_geography(
2411: p_init_msg_list => FND_API.G_FALSE,
2412: p_master_geography_rec => l_master_geography_rec,
2413: x_geography_id => l_geography_id,
2414: x_return_status => x_return_status,
2415: x_msg_count => l_msg_count,
2414: x_return_status => x_return_status,
2415: x_msg_count => l_msg_count,
2416: x_msg_data => l_msg_data);
2417:
2418: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2419: -- In case api throuws any exception, raise execution error
2420: -- which will be cought by calling api.
2421: RAISE FND_API.G_EXC_ERROR;
2422: END IF;
2417:
2418: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2419: -- In case api throuws any exception, raise execution error
2420: -- which will be cought by calling api.
2421: RAISE FND_API.G_EXC_ERROR;
2422: END IF;
2423: END IF;
2424: --dbms_output.put_line('Create Master Geo For :'||l_master_geography_rec.geography_name||':GeoId:'||l_geography_id);
2425: END LOOP;
2477: IF l_count > 0 THEN
2478: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_DUPLICATE_COLUMN' );
2479: FND_MESSAGE.SET_TOKEN( 'COLUMN','geography_id, geography_from, start_date');
2480: FND_MSG_PUB.ADD;
2481: RAISE FND_API.G_EXC_ERROR;
2482: END IF; */
2483:
2484:
2485: -- validate geography range
2488: p_create_update_flag => 'C',
2489: x_return_status => x_return_status
2490: );
2491:
2492: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2493: RAISE FND_API.G_EXC_ERROR;
2494: END IF;
2495:
2496: -- get the geography_type of the zone_id
2489: x_return_status => x_return_status
2490: );
2491:
2492: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2493: RAISE FND_API.G_EXC_ERROR;
2494: END IF;
2495:
2496: -- get the geography_type of the zone_id
2497: l_zone_type := hz_geography_validate_pvt.get_geography_type(p_geography_id => p_geography_range_rec.zone_id,
2559: p_create_update_flag => 'U',
2560: x_return_status => x_return_status
2561: );
2562:
2563: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2564: RAISE FND_API.G_EXC_ERROR;
2565: END IF;
2566:
2567: hz_utility_v2pub.validate_mandatory(
2560: x_return_status => x_return_status
2561: );
2562:
2563: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2564: RAISE FND_API.G_EXC_ERROR;
2565: END IF;
2566:
2567: hz_utility_v2pub.validate_mandatory(
2568: p_create_update_flag => 'U',
2570: p_column_value => p_object_version_number,
2571: x_return_status => x_return_status
2572: );
2573:
2574: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2575: RAISE FND_API.G_EXC_ERROR;
2576: END IF;
2577:
2578: -- check if the row exists
2571: x_return_status => x_return_status
2572: );
2573:
2574: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2575: RAISE FND_API.G_EXC_ERROR;
2576: END IF;
2577:
2578: -- check if the row exists
2579: BEGIN
2589: IF l_object_version_number <> p_object_version_number THEN
2590: FND_MESSAGE.SET_NAME('AR', 'HZ_API_RECORD_CHANGED');
2591: FND_MESSAGE.SET_TOKEN('TABLE', 'hz_geography_ranges');
2592: FND_MSG_PUB.ADD;
2593: RAISE FND_API.G_EXC_ERROR;
2594: ELSE
2595: p_object_version_number := l_object_version_number + 1;
2596: END IF;
2597:
2599: FND_MESSAGE.SET_NAME( 'AR', 'HZ_GEO_NO_RECORD' );
2600: FND_MESSAGE.SET_TOKEN( 'TOKEN1', 'Geography Range');
2601: FND_MESSAGE.SET_TOKEN( 'TOKEN2', 'geography_id '||p_geography_id||', geography_from '||p_geography_from||', start_date '||p_start_date);
2602: FND_MSG_PUB.ADD;
2603: RAISE FND_API.G_EXC_ERROR;
2604:
2605: END;
2606: -- check if start_date <= end_date
2607:
2615: p_old_end_date => l_end_date,
2616: x_return_status => x_return_status
2617: );
2618:
2619: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2620: RAISE FND_API.G_EXC_ERROR;
2621: END IF;
2622:
2623: -- call table handler to update the row
2616: x_return_status => x_return_status
2617: );
2618:
2619: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2620: RAISE FND_API.G_EXC_ERROR;
2621: END IF;
2622:
2623: -- call table handler to update the row
2624: HZ_GEOGRAPHY_RANGES_PKG.update_row(
2676: l_zone_type := HZ_GEOGRAPHY_VALIDATE_PVT.get_geography_type(p_geography_id =>p_geography_id,
2677: x_return_status => x_return_status);
2678:
2679:
2680: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2681: RAISE FND_API.G_EXC_ERROR;
2682: END IF;
2683:
2684: SELECT geography_use,limited_by_geography_id INTO l_geography_use,l_limited_by_geography_id
2677: x_return_status => x_return_status);
2678:
2679:
2680: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2681: RAISE FND_API.G_EXC_ERROR;
2682: END IF;
2683:
2684: SELECT geography_use,limited_by_geography_id INTO l_geography_use,l_limited_by_geography_id
2685: FROM hz_geography_types_b
2699: p_create_update_flag => 'C',
2700: x_return_status => x_return_status
2701: );
2702:
2703: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2704: RAISE FND_API.G_EXC_ERROR;
2705: EXIT;
2706: END IF;
2707:
2700: x_return_status => x_return_status
2701: );
2702:
2703: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2704: RAISE FND_API.G_EXC_ERROR;
2705: EXIT;
2706: END IF;
2707:
2708: --dbms_output.put_line('In loop after validate zone relaion '||x_return_status);
2710: --get geography_type of included_geography_id
2711: l_incl_geo_type := HZ_GEOGRAPHY_VALIDATE_PVT.get_geography_type(p_geography_id =>p_zone_relation_tbl(i).included_geography_id,
2712: x_return_status => x_return_status);
2713:
2714: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2715: RAISE FND_API.G_EXC_ERROR;
2716: EXIT;
2717: END IF;
2718:
2711: l_incl_geo_type := HZ_GEOGRAPHY_VALIDATE_PVT.get_geography_type(p_geography_id =>p_zone_relation_tbl(i).included_geography_id,
2712: x_return_status => x_return_status);
2713:
2714: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2715: RAISE FND_API.G_EXC_ERROR;
2716: EXIT;
2717: END IF;
2718:
2719: IF l_limited_by_geography_id IS NOT NULL THEN
2735: FND_MESSAGE.SET_TOKEN( 'INCL_GEO_ID',p_zone_relation_tbl(i).included_geography_id);
2736: FND_MESSAGE.SET_TOKEN( 'LIM_GEO_ID', l_limited_by_geography_id );
2737: FND_MESSAGE.SET_TOKEN( 'ZONE_TYPE', l_zone_type);
2738: FND_MSG_PUB.ADD;
2739: RAISE FND_API.G_EXC_ERROR;
2740: END;
2741: END IF;
2742:
2743: -- Fix for ER 4232852
2768: x_msg_count => x_msg_count,
2769: x_msg_data => x_msg_data
2770: );
2771:
2772: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2773: RAISE FND_API.G_EXC_ERROR;
2774: END IF;
2775: END IF;
2776: END IF;
2769: x_msg_data => x_msg_data
2770: );
2771:
2772: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2773: RAISE FND_API.G_EXC_ERROR;
2774: END IF;
2775: END IF;
2776: END IF;
2777:
2795: FND_MESSAGE.SET_NAME( 'AR', 'HZ_GEO_OVERLAPPING_GEOGS' );
2796: FND_MESSAGE.SET_TOKEN( 'GEO_ID',p_zone_relation_tbl(i).included_geography_id );
2797: FND_MESSAGE.SET_TOKEN( 'ZONE_TYPE', l_zone_type);
2798: FND_MSG_PUB.ADD;
2799: RAISE FND_API.G_EXC_ERROR;
2800: EXIT;
2801: END IF;
2802:
2803: -- included_geography_id must be unique within a geography_id
2816: FND_MESSAGE.SET_NAME( 'AR', 'HZ_GEO_DUPL_INCL_GEO_ID' );
2817: FND_MESSAGE.SET_TOKEN( 'GEO_ID',p_zone_relation_tbl(i).included_geography_id );
2818: FND_MESSAGE.SET_TOKEN( 'ZONE_ID', p_geography_id);
2819: FND_MSG_PUB.ADD;
2820: RAISE FND_API.G_EXC_ERROR;
2821: EXIT;
2822: END IF;
2823:
2824: -- call relationship API to create a relationship between geography_id and included_geography_id
2848: x_msg_data => x_msg_data,
2849: p_create_org_contact => 'N'
2850: );
2851:
2852: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2853: --dbms_output.put_line('After call to create relationship API '|| x_return_status);
2854: RAISE FND_API.G_EXC_ERROR;
2855: EXIT;
2856: END IF;
2850: );
2851:
2852: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2853: --dbms_output.put_line('After call to create relationship API '|| x_return_status);
2854: RAISE FND_API.G_EXC_ERROR;
2855: EXIT;
2856: END IF;
2857: IF (p_zone_relation_tbl(i).geography_from IS NOT NULL AND
2858: p_zone_relation_tbl(i).geography_to IS NOT NULL AND
2855: EXIT;
2856: END IF;
2857: IF (p_zone_relation_tbl(i).geography_from IS NOT NULL AND
2858: p_zone_relation_tbl(i).geography_to IS NOT NULL AND
2859: p_zone_relation_tbl(i).geography_from <> fnd_api.g_miss_char AND
2860: p_zone_relation_tbl(i).geography_to <> fnd_api.g_miss_char) THEN
2861: --call create_geography_range API
2862:
2863: l_geography_range_rec.zone_id := p_geography_id;
2856: END IF;
2857: IF (p_zone_relation_tbl(i).geography_from IS NOT NULL AND
2858: p_zone_relation_tbl(i).geography_to IS NOT NULL AND
2859: p_zone_relation_tbl(i).geography_from <> fnd_api.g_miss_char AND
2860: p_zone_relation_tbl(i).geography_to <> fnd_api.g_miss_char) THEN
2861: --call create_geography_range API
2862:
2863: l_geography_range_rec.zone_id := p_geography_id;
2864: l_geography_range_rec.master_ref_geography_id := p_zone_relation_tbl(i).included_geography_id;
2881: x_msg_count => x_msg_count,
2882: x_msg_data => x_msg_data
2883: );
2884:
2885: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2886: RAISE FND_API.G_EXC_ERROR;
2887: EXIT;
2888: END IF;
2889: END IF;
2882: x_msg_data => x_msg_data
2883: );
2884:
2885: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2886: RAISE FND_API.G_EXC_ERROR;
2887: EXIT;
2888: END IF;
2889: END IF;
2890: END LOOP;
2934: p_restricted => 'N',
2935: x_return_status => x_return_status
2936: );
2937:
2938: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2939: RAISE FND_API.G_EXC_ERROR;
2940: END IF;
2941:
2942: HZ_UTILITY_V2PUB.validate_mandatory (
2935: x_return_status => x_return_status
2936: );
2937:
2938: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2939: RAISE FND_API.G_EXC_ERROR;
2940: END IF;
2941:
2942: HZ_UTILITY_V2PUB.validate_mandatory (
2943: p_create_update_flag =>'C',
2946: p_restricted => 'N',
2947: x_return_status => x_return_status
2948: );
2949:
2950: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2951: RAISE FND_API.G_EXC_ERROR;
2952: END IF;
2953:
2954: -- get geography_use
2947: x_return_status => x_return_status
2948: );
2949:
2950: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2951: RAISE FND_API.G_EXC_ERROR;
2952: END IF;
2953:
2954: -- get geography_use
2955: BEGIN
2963: fnd_message.set_token('FK', 'geography_type');
2964: fnd_message.set_token('COLUMN','zone_type');
2965: fnd_message.set_token('TABLE','HZ_GEOGRAPHY_TYPES_B');
2966: fnd_msg_pub.add;
2967: RAISE FND_API.G_EXC_ERROR;
2968: END;
2969:
2970: -- zone_name must be unique with in a zone_type
2971: SELECT count(*) INTO l_count
2977: IF l_count > 0 THEN
2978: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_DUPLICATE_COLUMN' );
2979: FND_MESSAGE.SET_TOKEN( 'COLUMN','zone name');
2980: FND_MSG_PUB.ADD;
2981: RAISE FND_API.G_EXC_ERROR;
2982: END IF;
2983:
2984: -- zone_code must be unique within a zone_type
2985:
2993: IF l_count > 0 THEN
2994: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_DUPLICATE_COLUMN' );
2995: FND_MESSAGE.SET_TOKEN( 'COLUMN','zone code');
2996: FND_MSG_PUB.ADD;
2997: RAISE FND_API.G_EXC_ERROR;
2998: END IF;
2999: END IF;
3000:
3001: -- zone_code_type is mandatory if zone_code is NOT NULL
3002: IF (p_zone_code IS NOT NULL AND p_zone_code_type IS NULL) THEN
3003: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
3004: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'zone_code_type' );
3005: FND_MSG_PUB.ADD;
3006: RAISE FND_API.G_EXC_ERROR;
3007: END IF;
3008:
3009:
3010: -- timezone_code must be FK to fnd_timezones_b
3019: fnd_message.set_token('FK', 'timezone_code');
3020: fnd_message.set_token('COLUMN','timezone_code');
3021: fnd_message.set_token('TABLE','FND_TIMEZONES_B');
3022: fnd_msg_pub.add;
3023: RAISE FND_API.G_EXC_ERROR;
3024: END IF;
3025: END IF;
3026:
3027: -- there must be atleast one included geography for a zone
3027: -- there must be atleast one included geography for a zone
3028: IF p_zone_relation_tbl.count = 0 THEN
3029: fnd_message.set_name('AR', 'HZ_GEO_NO_INCL_GEOGRAPHIES');
3030: fnd_msg_pub.add;
3031: RAISE FND_API.G_EXC_ERROR;
3032: END IF;
3033:
3034: -- get country code of one of the included_geography_id of this zone_type
3035:
3048: FND_MESSAGE.SET_NAME( 'AR', 'HZ_GEO_NO_RECORD');
3049: FND_MESSAGE.SET_TOKEN( 'TOKEN1','country code');
3050: FND_MESSAGE.SET_TOKEN( 'TOKEN2', 'included_geography_id '||p_zone_relation_tbl(i).included_geography_id);
3051: FND_MSG_PUB.ADD;
3052: RAISE FND_API.G_EXC_ERROR;
3053: EXIT;
3054: END;
3055: END IF;
3056: END LOOP;
3152: x_msg_count => x_msg_count,
3153: x_msg_data => x_msg_data
3154: );
3155:
3156: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3157: RAISE FND_API.G_EXC_ERROR;
3158: END IF;
3159:
3160: --dbms_output.put_line('After first identifier row '||x_return_status);
3153: x_msg_data => x_msg_data
3154: );
3155:
3156: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3157: RAISE FND_API.G_EXC_ERROR;
3158: END IF;
3159:
3160: --dbms_output.put_line('After first identifier row '||x_return_status);
3161:
3160: --dbms_output.put_line('After first identifier row '||x_return_status);
3161:
3162: IF p_zone_code IS NOT NULL
3163: -- Bug 4579847 : do not call for g_miss value for code
3164: and p_zone_code <> fnd_api.g_miss_char THEN
3165: -- create identifier for zone code
3166: l_geo_identifier_rec.identifier_subtype := p_zone_code_type;
3167: l_geo_identifier_rec.identifier_value := p_zone_code;
3168: l_geo_identifier_rec.identifier_type := 'CODE';
3174: x_msg_count => x_msg_count,
3175: x_msg_data => x_msg_data
3176: );
3177:
3178: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3179: RAISE FND_API.G_EXC_ERROR;
3180: END IF;
3181:
3182: --dbms_output.put_line('After second identifier row '||x_return_status);
3175: x_msg_data => x_msg_data
3176: );
3177:
3178: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3179: RAISE FND_API.G_EXC_ERROR;
3180: END IF;
3181:
3182: --dbms_output.put_line('After second identifier row '||x_return_status);
3183: END IF;
3193: x_msg_count => x_msg_count,
3194: x_msg_data => x_msg_data
3195: );
3196:
3197: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3198: RAISE FND_API.G_EXC_ERROR;
3199: END IF;
3200: --dbms_output.put_line('After insert zone relation '||x_return_status);
3201:
3194: x_msg_data => x_msg_data
3195: );
3196:
3197: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3198: RAISE FND_API.G_EXC_ERROR;
3199: END IF;
3200: --dbms_output.put_line('After insert zone relation '||x_return_status);
3201:
3202: END do_create_zone;
3215: *
3216: * ARGUMENTS
3217: * IN:
3218: * p_init_msg_list Initialize message stack if it is set to
3219: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
3220: * p_master_relation_rec Geography type record.
3221: * IN/OUT:
3222: * OUT:
3223: * x_relationship_id Returns relationship_id for the relationship created.
3221: * IN/OUT:
3222: * OUT:
3223: * x_relationship_id Returns relationship_id for the relationship created.
3224: * x_return_status Return status after the call. The status can
3225: * be FND_API.G_RET_STS_SUCCESS (success),
3226: * FND_API.G_RET_STS_ERROR (error),
3227: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3228: * x_msg_count Number of messages in message stack.
3229: * x_msg_data Message text if x_msg_count is 1.
3222: * OUT:
3223: * x_relationship_id Returns relationship_id for the relationship created.
3224: * x_return_status Return status after the call. The status can
3225: * be FND_API.G_RET_STS_SUCCESS (success),
3226: * FND_API.G_RET_STS_ERROR (error),
3227: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3228: * x_msg_count Number of messages in message stack.
3229: * x_msg_data Message text if x_msg_count is 1.
3230: *
3223: * x_relationship_id Returns relationship_id for the relationship created.
3224: * x_return_status Return status after the call. The status can
3225: * be FND_API.G_RET_STS_SUCCESS (success),
3226: * FND_API.G_RET_STS_ERROR (error),
3227: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3228: * x_msg_count Number of messages in message stack.
3229: * x_msg_data Message text if x_msg_count is 1.
3230: *
3231: * NOTES
3236: *
3237: */
3238:
3239: PROCEDURE create_master_relation (
3240: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
3241: p_master_relation_rec IN MASTER_RELATION_REC_TYPE,
3242: x_relationship_id OUT NOCOPY NUMBER,
3243: x_return_status OUT NOCOPY VARCHAR2,
3244: x_msg_count OUT NOCOPY NUMBER,
3251: -- Standard start of API savepoint
3252: SAVEPOINT create_master_relation;
3253:
3254: -- Initialize message list if p_init_msg_list is set to TRUE.
3255: IF FND_API.to_Boolean(p_init_msg_list) THEN
3256: FND_MSG_PUB.initialize;
3257: END IF;
3258:
3259: -- Initialize API return status to success.
3256: FND_MSG_PUB.initialize;
3257: END IF;
3258:
3259: -- Initialize API return status to success.
3260: x_return_status := FND_API.G_RET_STS_SUCCESS;
3261:
3262: -- Call to business logic.
3263: do_create_master_relation(
3264: p_master_relation_rec => p_master_relation_rec,
3266: x_return_status => x_return_status
3267: );
3268:
3269: --if validation failed at any point, then raise an exception to stop processing
3270: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3271: RAISE FND_API.G_EXC_ERROR;
3272: END IF;
3273:
3274: --g_dup_checked := 'N';
3267: );
3268:
3269: --if validation failed at any point, then raise an exception to stop processing
3270: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3271: RAISE FND_API.G_EXC_ERROR;
3272: END IF;
3273:
3274: --g_dup_checked := 'N';
3275: -- Standard call to get message count and if count is 1, get message info.
3273:
3274: --g_dup_checked := 'N';
3275: -- Standard call to get message count and if count is 1, get message info.
3276: FND_MSG_PUB.Count_And_Get(
3277: p_encoded => FND_API.G_FALSE,
3278: p_count => x_msg_count,
3279: p_data => x_msg_data);
3280:
3281: EXCEPTION
3278: p_count => x_msg_count,
3279: p_data => x_msg_data);
3280:
3281: EXCEPTION
3282: WHEN FND_API.G_EXC_ERROR THEN
3283: g_dup_checked := 'N';
3284: ROLLBACK TO create_master_relation;
3285: x_return_status := FND_API.G_RET_STS_ERROR;
3286: FND_MSG_PUB.Count_And_Get(
3281: EXCEPTION
3282: WHEN FND_API.G_EXC_ERROR THEN
3283: g_dup_checked := 'N';
3284: ROLLBACK TO create_master_relation;
3285: x_return_status := FND_API.G_RET_STS_ERROR;
3286: FND_MSG_PUB.Count_And_Get(
3287: p_encoded => FND_API.G_FALSE,
3288: p_count => x_msg_count,
3289: p_data => x_msg_data);
3283: g_dup_checked := 'N';
3284: ROLLBACK TO create_master_relation;
3285: x_return_status := FND_API.G_RET_STS_ERROR;
3286: FND_MSG_PUB.Count_And_Get(
3287: p_encoded => FND_API.G_FALSE,
3288: p_count => x_msg_count,
3289: p_data => x_msg_data);
3290: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3291: --g_dup_checked := 'N';
3286: FND_MSG_PUB.Count_And_Get(
3287: p_encoded => FND_API.G_FALSE,
3288: p_count => x_msg_count,
3289: p_data => x_msg_data);
3290: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3291: --g_dup_checked := 'N';
3292: ROLLBACK TO create_master_relation;
3293: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3294: FND_MSG_PUB.Count_And_Get(
3289: p_data => x_msg_data);
3290: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3291: --g_dup_checked := 'N';
3292: ROLLBACK TO create_master_relation;
3293: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3294: FND_MSG_PUB.Count_And_Get(
3295: p_encoded => FND_API.G_FALSE,
3296: p_count => x_msg_count,
3297: p_data => x_msg_data);
3291: --g_dup_checked := 'N';
3292: ROLLBACK TO create_master_relation;
3293: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3294: FND_MSG_PUB.Count_And_Get(
3295: p_encoded => FND_API.G_FALSE,
3296: p_count => x_msg_count,
3297: p_data => x_msg_data);
3298:
3299: WHEN OTHERS THEN
3298:
3299: WHEN OTHERS THEN
3300: --g_dup_checked := 'N';
3301: ROLLBACK TO create_master_relation;
3302: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3303: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
3304: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
3305: FND_MSG_PUB.ADD;
3306: FND_MSG_PUB.Count_And_Get(
3303: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
3304: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
3305: FND_MSG_PUB.ADD;
3306: FND_MSG_PUB.Count_And_Get(
3307: p_encoded => FND_API.G_FALSE,
3308: p_count => x_msg_count,
3309: p_data => x_msg_data);
3310:
3311: END create_master_relation;
3320: *
3321: * ARGUMENTS
3322: * IN:
3323: * p_init_msg_list Initialize message stack if it is set to
3324: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
3325: * p_master_relation_rec Geography type record.
3326: * p_object_version_number Object version number of the row
3327: * IN/OUT:
3328: * OUT:
3327: * IN/OUT:
3328: * OUT:
3329: *
3330: * x_return_status Return status after the call. The status can
3331: * be FND_API.G_RET_STS_SUCCESS (success),
3332: * FND_API.G_RET_STS_ERROR (error),
3333: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3334: * x_msg_count Number of messages in message stack.
3335: * x_msg_data Message text if x_msg_count is 1.
3328: * OUT:
3329: *
3330: * x_return_status Return status after the call. The status can
3331: * be FND_API.G_RET_STS_SUCCESS (success),
3332: * FND_API.G_RET_STS_ERROR (error),
3333: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3334: * x_msg_count Number of messages in message stack.
3335: * x_msg_data Message text if x_msg_count is 1.
3336: *
3329: *
3330: * x_return_status Return status after the call. The status can
3331: * be FND_API.G_RET_STS_SUCCESS (success),
3332: * FND_API.G_RET_STS_ERROR (error),
3333: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3334: * x_msg_count Number of messages in message stack.
3335: * x_msg_data Message text if x_msg_count is 1.
3336: *
3337: * NOTES
3341: *
3342: */
3343:
3344: PROCEDURE update_relationship (
3345: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
3346: p_relationship_id IN NUMBER,
3347: p_status IN VARCHAR2,
3348: p_object_version_number IN OUT NOCOPY NUMBER,
3349: x_return_status OUT NOCOPY VARCHAR2,
3355: -- Standard start of API savepoint
3356: SAVEPOINT update_relationship;
3357:
3358: -- Initialize message list if p_init_msg_list is set to TRUE.
3359: IF FND_API.to_Boolean(p_init_msg_list) THEN
3360: FND_MSG_PUB.initialize;
3361: END IF;
3362:
3363: -- Initialize API return status to success.
3360: FND_MSG_PUB.initialize;
3361: END IF;
3362:
3363: -- Initialize API return status to success.
3364: x_return_status := FND_API.G_RET_STS_SUCCESS;
3365:
3366: -- Call to business logic.
3367: do_update_relationship(
3368: p_relationship_id => p_relationship_id,
3371: x_return_status => x_return_status
3372: );
3373:
3374: --if validation failed at any point, then raise an exception to stop processing
3375: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3376: RAISE FND_API.G_EXC_ERROR;
3377: END IF;
3378:
3379: -- Standard call to get message count and if count is 1, get message info.
3372: );
3373:
3374: --if validation failed at any point, then raise an exception to stop processing
3375: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3376: RAISE FND_API.G_EXC_ERROR;
3377: END IF;
3378:
3379: -- Standard call to get message count and if count is 1, get message info.
3380: FND_MSG_PUB.Count_And_Get(
3377: END IF;
3378:
3379: -- Standard call to get message count and if count is 1, get message info.
3380: FND_MSG_PUB.Count_And_Get(
3381: p_encoded => FND_API.G_FALSE,
3382: p_count => x_msg_count,
3383: p_data => x_msg_data);
3384:
3385: EXCEPTION
3382: p_count => x_msg_count,
3383: p_data => x_msg_data);
3384:
3385: EXCEPTION
3386: WHEN FND_API.G_EXC_ERROR THEN
3387: ROLLBACK TO update_relationship;
3388: x_return_status := FND_API.G_RET_STS_ERROR;
3389: FND_MSG_PUB.Count_And_Get(
3390: p_encoded => FND_API.G_FALSE,
3384:
3385: EXCEPTION
3386: WHEN FND_API.G_EXC_ERROR THEN
3387: ROLLBACK TO update_relationship;
3388: x_return_status := FND_API.G_RET_STS_ERROR;
3389: FND_MSG_PUB.Count_And_Get(
3390: p_encoded => FND_API.G_FALSE,
3391: p_count => x_msg_count,
3392: p_data => x_msg_data);
3386: WHEN FND_API.G_EXC_ERROR THEN
3387: ROLLBACK TO update_relationship;
3388: x_return_status := FND_API.G_RET_STS_ERROR;
3389: FND_MSG_PUB.Count_And_Get(
3390: p_encoded => FND_API.G_FALSE,
3391: p_count => x_msg_count,
3392: p_data => x_msg_data);
3393: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3394: ROLLBACK TO update_relationship;
3389: FND_MSG_PUB.Count_And_Get(
3390: p_encoded => FND_API.G_FALSE,
3391: p_count => x_msg_count,
3392: p_data => x_msg_data);
3393: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3394: ROLLBACK TO update_relationship;
3395: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3396: FND_MSG_PUB.Count_And_Get(
3397: p_encoded => FND_API.G_FALSE,
3391: p_count => x_msg_count,
3392: p_data => x_msg_data);
3393: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3394: ROLLBACK TO update_relationship;
3395: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3396: FND_MSG_PUB.Count_And_Get(
3397: p_encoded => FND_API.G_FALSE,
3398: p_count => x_msg_count,
3399: p_data => x_msg_data);
3393: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3394: ROLLBACK TO update_relationship;
3395: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3396: FND_MSG_PUB.Count_And_Get(
3397: p_encoded => FND_API.G_FALSE,
3398: p_count => x_msg_count,
3399: p_data => x_msg_data);
3400:
3401: WHEN OTHERS THEN
3399: p_data => x_msg_data);
3400:
3401: WHEN OTHERS THEN
3402: ROLLBACK TO update_relationship;
3403: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3404: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
3405: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
3406: FND_MSG_PUB.ADD;
3407: FND_MSG_PUB.Count_And_Get(
3404: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
3405: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
3406: FND_MSG_PUB.ADD;
3407: FND_MSG_PUB.Count_And_Get(
3408: p_encoded => FND_API.G_FALSE,
3409: p_count => x_msg_count,
3410: p_data => x_msg_data);
3411:
3412: END update_relationship;
3421: *
3422: * ARGUMENTS
3423: * IN:
3424: * p_init_msg_list Initialize message stack if it is set to
3425: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
3426: * p_geo_identifier_rec Geo_identifier type record.
3427: * IN/OUT:
3428: * OUT:
3429: *
3427: * IN/OUT:
3428: * OUT:
3429: *
3430: * x_return_status Return status after the call. The status can
3431: * be FND_API.G_RET_STS_SUCCESS (success),
3432: * FND_API.G_RET_STS_ERROR (error),
3433: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3434: * x_msg_count Number of messages in message stack.
3435: * x_msg_data Message text if x_msg_count is 1.
3428: * OUT:
3429: *
3430: * x_return_status Return status after the call. The status can
3431: * be FND_API.G_RET_STS_SUCCESS (success),
3432: * FND_API.G_RET_STS_ERROR (error),
3433: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3434: * x_msg_count Number of messages in message stack.
3435: * x_msg_data Message text if x_msg_count is 1.
3436: *
3429: *
3430: * x_return_status Return status after the call. The status can
3431: * be FND_API.G_RET_STS_SUCCESS (success),
3432: * FND_API.G_RET_STS_ERROR (error),
3433: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3434: * x_msg_count Number of messages in message stack.
3435: * x_msg_data Message text if x_msg_count is 1.
3436: *
3437: * NOTES
3441: *
3442: */
3443:
3444: PROCEDURE create_geo_identifier(
3445: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
3446: p_geo_identifier_rec IN GEO_IDENTIFIER_REC_TYPE,
3447: x_return_status OUT NOCOPY VARCHAR2,
3448: x_msg_count OUT NOCOPY NUMBER,
3449: x_msg_data OUT NOCOPY VARCHAR2
3455: -- Standard start of API savepoint
3456: SAVEPOINT create_geo_identifier;
3457:
3458: -- Initialize message list if p_init_msg_list is set to TRUE.
3459: IF FND_API.to_Boolean(p_init_msg_list) THEN
3460: FND_MSG_PUB.initialize;
3461: END IF;
3462:
3463: -- Initialize API return status to success.
3460: FND_MSG_PUB.initialize;
3461: END IF;
3462:
3463: -- Initialize API return status to success.
3464: x_return_status := FND_API.G_RET_STS_SUCCESS;
3465:
3466: -- Call to business logic.
3467: do_create_geo_identifier(
3468: p_geo_identifier_rec => p_geo_identifier_rec,
3469: x_return_status => x_return_status
3470: );
3471:
3472: --if validation failed at any point, then raise an exception to stop processing
3473: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3474: RAISE FND_API.G_EXC_ERROR;
3475: END IF;
3476:
3477: -- Standard call to get message count and if count is 1, get message info.
3470: );
3471:
3472: --if validation failed at any point, then raise an exception to stop processing
3473: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3474: RAISE FND_API.G_EXC_ERROR;
3475: END IF;
3476:
3477: -- Standard call to get message count and if count is 1, get message info.
3478: FND_MSG_PUB.Count_And_Get(
3475: END IF;
3476:
3477: -- Standard call to get message count and if count is 1, get message info.
3478: FND_MSG_PUB.Count_And_Get(
3479: p_encoded => FND_API.G_FALSE,
3480: p_count => x_msg_count,
3481: p_data => x_msg_data);
3482:
3483: EXCEPTION
3480: p_count => x_msg_count,
3481: p_data => x_msg_data);
3482:
3483: EXCEPTION
3484: WHEN FND_API.G_EXC_ERROR THEN
3485: ROLLBACK TO create_geo_identifier;
3486: x_return_status := FND_API.G_RET_STS_ERROR;
3487: FND_MSG_PUB.Count_And_Get(
3488: p_encoded => FND_API.G_FALSE,
3482:
3483: EXCEPTION
3484: WHEN FND_API.G_EXC_ERROR THEN
3485: ROLLBACK TO create_geo_identifier;
3486: x_return_status := FND_API.G_RET_STS_ERROR;
3487: FND_MSG_PUB.Count_And_Get(
3488: p_encoded => FND_API.G_FALSE,
3489: p_count => x_msg_count,
3490: p_data => x_msg_data);
3484: WHEN FND_API.G_EXC_ERROR THEN
3485: ROLLBACK TO create_geo_identifier;
3486: x_return_status := FND_API.G_RET_STS_ERROR;
3487: FND_MSG_PUB.Count_And_Get(
3488: p_encoded => FND_API.G_FALSE,
3489: p_count => x_msg_count,
3490: p_data => x_msg_data);
3491: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3492: ROLLBACK TO create_geo_identifier;
3487: FND_MSG_PUB.Count_And_Get(
3488: p_encoded => FND_API.G_FALSE,
3489: p_count => x_msg_count,
3490: p_data => x_msg_data);
3491: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3492: ROLLBACK TO create_geo_identifier;
3493: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3494: FND_MSG_PUB.Count_And_Get(
3495: p_encoded => FND_API.G_FALSE,
3489: p_count => x_msg_count,
3490: p_data => x_msg_data);
3491: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3492: ROLLBACK TO create_geo_identifier;
3493: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3494: FND_MSG_PUB.Count_And_Get(
3495: p_encoded => FND_API.G_FALSE,
3496: p_count => x_msg_count,
3497: p_data => x_msg_data);
3491: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3492: ROLLBACK TO create_geo_identifier;
3493: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3494: FND_MSG_PUB.Count_And_Get(
3495: p_encoded => FND_API.G_FALSE,
3496: p_count => x_msg_count,
3497: p_data => x_msg_data);
3498:
3499: WHEN DUP_VAL_ON_INDEX THEN
3497: p_data => x_msg_data);
3498:
3499: WHEN DUP_VAL_ON_INDEX THEN
3500: ROLLBACK TO create_geo_identifier;
3501: x_return_status := FND_API.G_RET_STS_ERROR;
3502: HZ_UTILITY_V2PUB.find_index_name(p_index_name);
3503: IF p_index_name = 'HZ_GEOGRAPHY_IDENTIFIERS_U1' THEN
3504: FND_MESSAGE.SET_NAME('AR', 'HZ_API_DUPLICATE_COLUMN');
3505: FND_MESSAGE.SET_TOKEN('COLUMN', 'geography_id,identifier_type,identifier_subtype,identifier_value,language_code');
3505: FND_MESSAGE.SET_TOKEN('COLUMN', 'geography_id,identifier_type,identifier_subtype,identifier_value,language_code');
3506: FND_MSG_PUB.ADD;
3507: END IF;
3508: FND_MSG_PUB.Count_And_Get(
3509: p_encoded => FND_API.G_FALSE,
3510: p_count => x_msg_count,
3511: p_data => x_msg_data);
3512:
3513: WHEN OTHERS THEN
3511: p_data => x_msg_data);
3512:
3513: WHEN OTHERS THEN
3514: ROLLBACK TO create_geo_identifier;
3515: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3516: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
3517: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
3518: FND_MSG_PUB.ADD;
3519: FND_MSG_PUB.Count_And_Get(
3516: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
3517: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
3518: FND_MSG_PUB.ADD;
3519: FND_MSG_PUB.Count_And_Get(
3520: p_encoded => FND_API.G_FALSE,
3521: p_count => x_msg_count,
3522: p_data => x_msg_data);
3523: END create_geo_identifier;
3524:
3532: *
3533: * ARGUMENTS
3534: * IN:
3535: * p_init_msg_list Initialize message stack if it is set to
3536: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
3537: * p_geo_identifier_rec Geo_identifier type record.
3538: *
3539: * IN/OUT:
3540: * p_object_version_number
3542: *
3543: * x_cp_request_id Concurrent Program Request Id, whenever CP
3544: * to update denormalized data gets kicked off.
3545: * x_return_status Return status after the call. The status can
3546: * be FND_API.G_RET_STS_SUCCESS (success),
3547: * FND_API.G_RET_STS_ERROR (error),
3548: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3549: * x_msg_count Number of messages in message stack.
3550: * x_msg_data Message text if x_msg_count is 1.
3543: * x_cp_request_id Concurrent Program Request Id, whenever CP
3544: * to update denormalized data gets kicked off.
3545: * x_return_status Return status after the call. The status can
3546: * be FND_API.G_RET_STS_SUCCESS (success),
3547: * FND_API.G_RET_STS_ERROR (error),
3548: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3549: * x_msg_count Number of messages in message stack.
3550: * x_msg_data Message text if x_msg_count is 1.
3551: *
3544: * to update denormalized data gets kicked off.
3545: * x_return_status Return status after the call. The status can
3546: * be FND_API.G_RET_STS_SUCCESS (success),
3547: * FND_API.G_RET_STS_ERROR (error),
3548: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3549: * x_msg_count Number of messages in message stack.
3550: * x_msg_data Message text if x_msg_count is 1.
3551: *
3552: * NOTES
3557: * for Bug 457886
3558: *
3559: */
3560: PROCEDURE update_geo_identifier (
3561: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
3562: p_geo_identifier_rec IN GEO_IDENTIFIER_REC_TYPE,
3563: p_object_version_number IN OUT NOCOPY NUMBER,
3564: x_cp_request_id OUT NOCOPY NUMBER,
3565: x_return_status OUT NOCOPY VARCHAR2,
3572: -- Standard start of API savepoint
3573: SAVEPOINT update_geo_identifier;
3574:
3575: -- Initialize message list if p_init_msg_list is set to TRUE.
3576: IF FND_API.to_Boolean(p_init_msg_list) THEN
3577: FND_MSG_PUB.initialize;
3578: END IF;
3579:
3580: -- Initialize API return status to success.
3577: FND_MSG_PUB.initialize;
3578: END IF;
3579:
3580: -- Initialize API return status to success.
3581: x_return_status := FND_API.G_RET_STS_SUCCESS;
3582:
3583: -- Call to business logic.
3584: do_update_geo_identifier(
3585: p_geo_identifier_rec => p_geo_identifier_rec,
3588: x_return_status => x_return_status
3589: );
3590:
3591: --if validation failed at any point, then raise an exception to stop processing
3592: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3593: RAISE FND_API.G_EXC_ERROR;
3594: END IF;
3595:
3596: -- Standard call to get message count and if count is 1, get message info.
3589: );
3590:
3591: --if validation failed at any point, then raise an exception to stop processing
3592: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3593: RAISE FND_API.G_EXC_ERROR;
3594: END IF;
3595:
3596: -- Standard call to get message count and if count is 1, get message info.
3597: FND_MSG_PUB.Count_And_Get(
3594: END IF;
3595:
3596: -- Standard call to get message count and if count is 1, get message info.
3597: FND_MSG_PUB.Count_And_Get(
3598: p_encoded => FND_API.G_FALSE,
3599: p_count => x_msg_count,
3600: p_data => x_msg_data);
3601:
3602: EXCEPTION
3599: p_count => x_msg_count,
3600: p_data => x_msg_data);
3601:
3602: EXCEPTION
3603: WHEN FND_API.G_EXC_ERROR THEN
3604: ROLLBACK TO update_geo_identifier;
3605: x_return_status := FND_API.G_RET_STS_ERROR;
3606: FND_MSG_PUB.Count_And_Get(
3607: p_encoded => FND_API.G_FALSE,
3601:
3602: EXCEPTION
3603: WHEN FND_API.G_EXC_ERROR THEN
3604: ROLLBACK TO update_geo_identifier;
3605: x_return_status := FND_API.G_RET_STS_ERROR;
3606: FND_MSG_PUB.Count_And_Get(
3607: p_encoded => FND_API.G_FALSE,
3608: p_count => x_msg_count,
3609: p_data => x_msg_data);
3603: WHEN FND_API.G_EXC_ERROR THEN
3604: ROLLBACK TO update_geo_identifier;
3605: x_return_status := FND_API.G_RET_STS_ERROR;
3606: FND_MSG_PUB.Count_And_Get(
3607: p_encoded => FND_API.G_FALSE,
3608: p_count => x_msg_count,
3609: p_data => x_msg_data);
3610: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3611: ROLLBACK TO update_geo_identifier;
3606: FND_MSG_PUB.Count_And_Get(
3607: p_encoded => FND_API.G_FALSE,
3608: p_count => x_msg_count,
3609: p_data => x_msg_data);
3610: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3611: ROLLBACK TO update_geo_identifier;
3612: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3613: FND_MSG_PUB.Count_And_Get(
3614: p_encoded => FND_API.G_FALSE,
3608: p_count => x_msg_count,
3609: p_data => x_msg_data);
3610: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3611: ROLLBACK TO update_geo_identifier;
3612: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3613: FND_MSG_PUB.Count_And_Get(
3614: p_encoded => FND_API.G_FALSE,
3615: p_count => x_msg_count,
3616: p_data => x_msg_data);
3610: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3611: ROLLBACK TO update_geo_identifier;
3612: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3613: FND_MSG_PUB.Count_And_Get(
3614: p_encoded => FND_API.G_FALSE,
3615: p_count => x_msg_count,
3616: p_data => x_msg_data);
3617:
3618: WHEN OTHERS THEN
3616: p_data => x_msg_data);
3617:
3618: WHEN OTHERS THEN
3619: ROLLBACK TO update_geo_identifier;
3620: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3621: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
3622: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
3623: FND_MSG_PUB.ADD;
3624: FND_MSG_PUB.Count_And_Get(
3621: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
3622: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
3623: FND_MSG_PUB.ADD;
3624: FND_MSG_PUB.Count_And_Get(
3625: p_encoded => FND_API.G_FALSE,
3626: p_count => x_msg_count,
3627: p_data => x_msg_data);
3628:
3629: END update_geo_identifier;
3638: *
3639: * ARGUMENTS
3640: * IN:
3641: * p_init_msg_list Initialize message stack if it is set to
3642: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
3643: * p_geography_id geography id
3644: * p_identifier_type
3645: * p_identifier_subtype
3646: * p_identifier_value
3647: *
3648: * OUT:
3649: *
3650: * x_return_status Return status after the call. The status can
3651: * be FND_API.G_RET_STS_SUCCESS (success),
3652: * FND_API.G_RET_STS_ERROR (error),
3653: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3654: * x_msg_count Number of messages in message stack.
3655: * x_msg_data Message text if x_msg_count is 1.
3648: * OUT:
3649: *
3650: * x_return_status Return status after the call. The status can
3651: * be FND_API.G_RET_STS_SUCCESS (success),
3652: * FND_API.G_RET_STS_ERROR (error),
3653: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3654: * x_msg_count Number of messages in message stack.
3655: * x_msg_data Message text if x_msg_count is 1.
3656: *
3649: *
3650: * x_return_status Return status after the call. The status can
3651: * be FND_API.G_RET_STS_SUCCESS (success),
3652: * FND_API.G_RET_STS_ERROR (error),
3653: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3654: * x_msg_count Number of messages in message stack.
3655: * x_msg_data Message text if x_msg_count is 1.
3656: *
3657: * NOTES
3661: *
3662: */
3663:
3664: PROCEDURE delete_geo_identifier(
3665: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
3666: p_geography_id IN NUMBER,
3667: p_identifier_type IN VARCHAR2,
3668: p_identifier_subtype IN VARCHAR2,
3669: p_identifier_value IN VARCHAR2,
3677: -- Standard start of API savepoint
3678: SAVEPOINT delete_geo_identifier;
3679:
3680: -- Initialize message list if p_init_msg_list is set to TRUE.
3681: IF FND_API.to_Boolean(p_init_msg_list) THEN
3682: FND_MSG_PUB.initialize;
3683: END IF;
3684:
3685: -- Initialize API return status to success.
3682: FND_MSG_PUB.initialize;
3683: END IF;
3684:
3685: -- Initialize API return status to success.
3686: x_return_status := FND_API.G_RET_STS_SUCCESS;
3687:
3688: -- Call to business logic.
3689: do_delete_geo_identifier(
3690: p_geography_id => p_geography_id,
3695: x_return_status => x_return_status
3696: );
3697:
3698: --if validation failed at any point, then raise an exception to stop processing
3699: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3700: RAISE FND_API.G_EXC_ERROR;
3701: END IF;
3702:
3703: -- Standard call to get message count and if count is 1, get message info.
3696: );
3697:
3698: --if validation failed at any point, then raise an exception to stop processing
3699: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3700: RAISE FND_API.G_EXC_ERROR;
3701: END IF;
3702:
3703: -- Standard call to get message count and if count is 1, get message info.
3704: FND_MSG_PUB.Count_And_Get(
3701: END IF;
3702:
3703: -- Standard call to get message count and if count is 1, get message info.
3704: FND_MSG_PUB.Count_And_Get(
3705: p_encoded => FND_API.G_FALSE,
3706: p_count => x_msg_count,
3707: p_data => x_msg_data);
3708:
3709: EXCEPTION
3706: p_count => x_msg_count,
3707: p_data => x_msg_data);
3708:
3709: EXCEPTION
3710: WHEN FND_API.G_EXC_ERROR THEN
3711: ROLLBACK TO delete_geo_identifier;
3712: x_return_status := FND_API.G_RET_STS_ERROR;
3713: FND_MSG_PUB.Count_And_Get(
3714: p_encoded => FND_API.G_FALSE,
3708:
3709: EXCEPTION
3710: WHEN FND_API.G_EXC_ERROR THEN
3711: ROLLBACK TO delete_geo_identifier;
3712: x_return_status := FND_API.G_RET_STS_ERROR;
3713: FND_MSG_PUB.Count_And_Get(
3714: p_encoded => FND_API.G_FALSE,
3715: p_count => x_msg_count,
3716: p_data => x_msg_data);
3710: WHEN FND_API.G_EXC_ERROR THEN
3711: ROLLBACK TO delete_geo_identifier;
3712: x_return_status := FND_API.G_RET_STS_ERROR;
3713: FND_MSG_PUB.Count_And_Get(
3714: p_encoded => FND_API.G_FALSE,
3715: p_count => x_msg_count,
3716: p_data => x_msg_data);
3717: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3718: ROLLBACK TO delete_geo_identifier;
3713: FND_MSG_PUB.Count_And_Get(
3714: p_encoded => FND_API.G_FALSE,
3715: p_count => x_msg_count,
3716: p_data => x_msg_data);
3717: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3718: ROLLBACK TO delete_geo_identifier;
3719: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3720: FND_MSG_PUB.Count_And_Get(
3721: p_encoded => FND_API.G_FALSE,
3715: p_count => x_msg_count,
3716: p_data => x_msg_data);
3717: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3718: ROLLBACK TO delete_geo_identifier;
3719: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3720: FND_MSG_PUB.Count_And_Get(
3721: p_encoded => FND_API.G_FALSE,
3722: p_count => x_msg_count,
3723: p_data => x_msg_data);
3717: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3718: ROLLBACK TO delete_geo_identifier;
3719: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3720: FND_MSG_PUB.Count_And_Get(
3721: p_encoded => FND_API.G_FALSE,
3722: p_count => x_msg_count,
3723: p_data => x_msg_data);
3724:
3725: WHEN OTHERS THEN
3723: p_data => x_msg_data);
3724:
3725: WHEN OTHERS THEN
3726: ROLLBACK TO delete_geo_identifier;
3727: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3728: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
3729: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
3730: FND_MSG_PUB.ADD;
3731: FND_MSG_PUB.Count_And_Get(
3728: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
3729: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
3730: FND_MSG_PUB.ADD;
3731: FND_MSG_PUB.Count_And_Get(
3732: p_encoded => FND_API.G_FALSE,
3733: p_count => x_msg_count,
3734: p_data => x_msg_data);
3735:
3736: END delete_geo_identifier;
3746: *
3747: * ARGUMENTS
3748: * IN:
3749: * p_init_msg_list Initialize message stack if it is set to
3750: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
3751: * p_master_geography_rec Master Geography type record.
3752: * IN/OUT:
3753: * OUT:
3754: *
3753: * OUT:
3754: *
3755: * x_geography_id Return ID of the geography being created.
3756: * x_return_status Return status after the call. The status can
3757: * be FND_API.G_RET_STS_SUCCESS (success),
3758: * FND_API.G_RET_STS_ERROR (error),
3759: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3760: * x_msg_count Number of messages in message stack.
3761: * x_msg_data Message text if x_msg_count is 1.
3754: *
3755: * x_geography_id Return ID of the geography being created.
3756: * x_return_status Return status after the call. The status can
3757: * be FND_API.G_RET_STS_SUCCESS (success),
3758: * FND_API.G_RET_STS_ERROR (error),
3759: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3760: * x_msg_count Number of messages in message stack.
3761: * x_msg_data Message text if x_msg_count is 1.
3762: *
3755: * x_geography_id Return ID of the geography being created.
3756: * x_return_status Return status after the call. The status can
3757: * be FND_API.G_RET_STS_SUCCESS (success),
3758: * FND_API.G_RET_STS_ERROR (error),
3759: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3760: * x_msg_count Number of messages in message stack.
3761: * x_msg_data Message text if x_msg_count is 1.
3762: *
3763: * NOTES
3767: *
3768: */
3769:
3770: PROCEDURE create_master_geography(
3771: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
3772: p_master_geography_rec IN MASTER_GEOGRAPHY_REC_TYPE,
3773: x_geography_id OUT NOCOPY NUMBER,
3774: x_return_status OUT NOCOPY VARCHAR2,
3775: x_msg_count OUT NOCOPY NUMBER,
3781: SAVEPOINT create_master_geography;
3782: --dbms_output.put_line('In the beginning of create_master_geography');
3783:
3784: -- Initialize message list if p_init_msg_list is set to TRUE.
3785: IF FND_API.to_Boolean(p_init_msg_list) THEN
3786: FND_MSG_PUB.initialize;
3787: END IF;
3788:
3789: -- Initialize API return status to success.
3786: FND_MSG_PUB.initialize;
3787: END IF;
3788:
3789: -- Initialize API return status to success.
3790: x_return_status := FND_API.G_RET_STS_SUCCESS;
3791:
3792: --dbms_output.put_line('before do_create_master_geography');
3793: -- Call to business logic.
3794: do_create_master_geography(
3797: x_return_status => x_return_status
3798: );
3799:
3800: --if validation failed at any point, then raise an exception to stop processing
3801: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3802: RAISE FND_API.G_EXC_ERROR;
3803: END IF;
3804:
3805: -- Standard call to get message count and if count is 1, get message info.
3798: );
3799:
3800: --if validation failed at any point, then raise an exception to stop processing
3801: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3802: RAISE FND_API.G_EXC_ERROR;
3803: END IF;
3804:
3805: -- Standard call to get message count and if count is 1, get message info.
3806: FND_MSG_PUB.Count_And_Get(
3803: END IF;
3804:
3805: -- Standard call to get message count and if count is 1, get message info.
3806: FND_MSG_PUB.Count_And_Get(
3807: p_encoded => FND_API.G_FALSE,
3808: p_count => x_msg_count,
3809: p_data => x_msg_data);
3810:
3811: EXCEPTION
3808: p_count => x_msg_count,
3809: p_data => x_msg_data);
3810:
3811: EXCEPTION
3812: WHEN FND_API.G_EXC_ERROR THEN
3813: ROLLBACK TO create_master_geography;
3814: x_return_status := FND_API.G_RET_STS_ERROR;
3815: FND_MSG_PUB.Count_And_Get(
3816: p_encoded => FND_API.G_FALSE,
3810:
3811: EXCEPTION
3812: WHEN FND_API.G_EXC_ERROR THEN
3813: ROLLBACK TO create_master_geography;
3814: x_return_status := FND_API.G_RET_STS_ERROR;
3815: FND_MSG_PUB.Count_And_Get(
3816: p_encoded => FND_API.G_FALSE,
3817: p_count => x_msg_count,
3818: p_data => x_msg_data);
3812: WHEN FND_API.G_EXC_ERROR THEN
3813: ROLLBACK TO create_master_geography;
3814: x_return_status := FND_API.G_RET_STS_ERROR;
3815: FND_MSG_PUB.Count_And_Get(
3816: p_encoded => FND_API.G_FALSE,
3817: p_count => x_msg_count,
3818: p_data => x_msg_data);
3819: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3820: ROLLBACK TO create_master_geography;
3815: FND_MSG_PUB.Count_And_Get(
3816: p_encoded => FND_API.G_FALSE,
3817: p_count => x_msg_count,
3818: p_data => x_msg_data);
3819: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3820: ROLLBACK TO create_master_geography;
3821: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3822: FND_MSG_PUB.Count_And_Get(
3823: p_encoded => FND_API.G_FALSE,
3817: p_count => x_msg_count,
3818: p_data => x_msg_data);
3819: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3820: ROLLBACK TO create_master_geography;
3821: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3822: FND_MSG_PUB.Count_And_Get(
3823: p_encoded => FND_API.G_FALSE,
3824: p_count => x_msg_count,
3825: p_data => x_msg_data);
3819: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3820: ROLLBACK TO create_master_geography;
3821: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3822: FND_MSG_PUB.Count_And_Get(
3823: p_encoded => FND_API.G_FALSE,
3824: p_count => x_msg_count,
3825: p_data => x_msg_data);
3826:
3827: WHEN OTHERS THEN
3825: p_data => x_msg_data);
3826:
3827: WHEN OTHERS THEN
3828: ROLLBACK TO create_master_geography;
3829: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3830: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
3831: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
3832: FND_MSG_PUB.ADD;
3833: FND_MSG_PUB.Count_And_Get(
3830: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
3831: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
3832: FND_MSG_PUB.ADD;
3833: FND_MSG_PUB.Count_And_Get(
3834: p_encoded => FND_API.G_FALSE,
3835: p_count => x_msg_count,
3836: p_data => x_msg_data);
3837:
3838: END create_master_geography;
3847: *
3848: * ARGUMENTS
3849: * IN:
3850: * p_init_msg_list Initialize message stack if it is set to
3851: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
3852: * p_master_geography_rec Master Geography type record.
3853: *
3854: * IN/OUT:
3855: * p_object_version_number
3855: * p_object_version_number
3856: * OUT:
3857: *
3858: * x_return_status Return status after the call. The status can
3859: * be FND_API.G_RET_STS_SUCCESS (success),
3860: * FND_API.G_RET_STS_ERROR (error),
3861: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3862: * x_msg_count Number of messages in message stack.
3863: * x_msg_data Message text if x_msg_count is 1.
3856: * OUT:
3857: *
3858: * x_return_status Return status after the call. The status can
3859: * be FND_API.G_RET_STS_SUCCESS (success),
3860: * FND_API.G_RET_STS_ERROR (error),
3861: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3862: * x_msg_count Number of messages in message stack.
3863: * x_msg_data Message text if x_msg_count is 1.
3864: *
3857: *
3858: * x_return_status Return status after the call. The status can
3859: * be FND_API.G_RET_STS_SUCCESS (success),
3860: * FND_API.G_RET_STS_ERROR (error),
3861: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3862: * x_msg_count Number of messages in message stack.
3863: * x_msg_data Message text if x_msg_count is 1.
3864: *
3865: * NOTES
3868: * 12-12-2002 Rekha Nalluri o Created.
3869: *
3870: */
3871: PROCEDURE update_geography (
3872: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
3873: p_geography_id IN NUMBER,
3874: p_end_date IN DATE,
3875: p_geometry IN MDSYS.SDO_GEOMETRY,
3876: p_timezone_code IN VARCHAR2,
3885: -- Standard start of API savepoint
3886: SAVEPOINT update_geography;
3887:
3888: -- Initialize message list if p_init_msg_list is set to TRUE.
3889: IF FND_API.to_Boolean(p_init_msg_list) THEN
3890: FND_MSG_PUB.initialize;
3891: END IF;
3892:
3893: -- Initialize API return status to success.
3890: FND_MSG_PUB.initialize;
3891: END IF;
3892:
3893: -- Initialize API return status to success.
3894: x_return_status := FND_API.G_RET_STS_SUCCESS;
3895:
3896: -- Call to business logic.
3897: do_update_geography(
3898: p_geography_id => p_geography_id,
3903: x_return_status => x_return_status
3904: );
3905:
3906: --if validation failed at any point, then raise an exception to stop processing
3907: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3908: RAISE FND_API.G_EXC_ERROR;
3909: END IF;
3910:
3911: -- Standard call to get message count and if count is 1, get message info.
3904: );
3905:
3906: --if validation failed at any point, then raise an exception to stop processing
3907: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3908: RAISE FND_API.G_EXC_ERROR;
3909: END IF;
3910:
3911: -- Standard call to get message count and if count is 1, get message info.
3912: FND_MSG_PUB.Count_And_Get(
3909: END IF;
3910:
3911: -- Standard call to get message count and if count is 1, get message info.
3912: FND_MSG_PUB.Count_And_Get(
3913: p_encoded => FND_API.G_FALSE,
3914: p_count => x_msg_count,
3915: p_data => x_msg_data);
3916:
3917: EXCEPTION
3914: p_count => x_msg_count,
3915: p_data => x_msg_data);
3916:
3917: EXCEPTION
3918: WHEN FND_API.G_EXC_ERROR THEN
3919: ROLLBACK TO update_geography;
3920: x_return_status := FND_API.G_RET_STS_ERROR;
3921: FND_MSG_PUB.Count_And_Get(
3922: p_encoded => FND_API.G_FALSE,
3916:
3917: EXCEPTION
3918: WHEN FND_API.G_EXC_ERROR THEN
3919: ROLLBACK TO update_geography;
3920: x_return_status := FND_API.G_RET_STS_ERROR;
3921: FND_MSG_PUB.Count_And_Get(
3922: p_encoded => FND_API.G_FALSE,
3923: p_count => x_msg_count,
3924: p_data => x_msg_data);
3918: WHEN FND_API.G_EXC_ERROR THEN
3919: ROLLBACK TO update_geography;
3920: x_return_status := FND_API.G_RET_STS_ERROR;
3921: FND_MSG_PUB.Count_And_Get(
3922: p_encoded => FND_API.G_FALSE,
3923: p_count => x_msg_count,
3924: p_data => x_msg_data);
3925: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3926: ROLLBACK TO update_geography;
3921: FND_MSG_PUB.Count_And_Get(
3922: p_encoded => FND_API.G_FALSE,
3923: p_count => x_msg_count,
3924: p_data => x_msg_data);
3925: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3926: ROLLBACK TO update_geography;
3927: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3928: FND_MSG_PUB.Count_And_Get(
3929: p_encoded => FND_API.G_FALSE,
3923: p_count => x_msg_count,
3924: p_data => x_msg_data);
3925: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3926: ROLLBACK TO update_geography;
3927: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3928: FND_MSG_PUB.Count_And_Get(
3929: p_encoded => FND_API.G_FALSE,
3930: p_count => x_msg_count,
3931: p_data => x_msg_data);
3925: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3926: ROLLBACK TO update_geography;
3927: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3928: FND_MSG_PUB.Count_And_Get(
3929: p_encoded => FND_API.G_FALSE,
3930: p_count => x_msg_count,
3931: p_data => x_msg_data);
3932:
3933: WHEN OTHERS THEN
3931: p_data => x_msg_data);
3932:
3933: WHEN OTHERS THEN
3934: ROLLBACK TO update_geography;
3935: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3936: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
3937: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
3938: FND_MSG_PUB.ADD;
3939: FND_MSG_PUB.Count_And_Get(
3936: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
3937: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
3938: FND_MSG_PUB.ADD;
3939: FND_MSG_PUB.Count_And_Get(
3940: p_encoded => FND_API.G_FALSE,
3941: p_count => x_msg_count,
3942: p_data => x_msg_data);
3943:
3944: END update_geography;
3953: *
3954: * ARGUMENTS
3955: * IN:
3956: * p_init_msg_list Initialize message stack if it is set to
3957: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
3958: * p_geography_range_rec Geography range type record.
3959: * IN/OUT:
3960: * OUT:
3961: *
3959: * IN/OUT:
3960: * OUT:
3961: *
3962: * x_return_status Return status after the call. The status can
3963: * be FND_API.G_RET_STS_SUCCESS (success),
3964: * FND_API.G_RET_STS_ERROR (error),
3965: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3966: * x_msg_count Number of messages in message stack.
3967: * x_msg_data Message text if x_msg_count is 1.
3960: * OUT:
3961: *
3962: * x_return_status Return status after the call. The status can
3963: * be FND_API.G_RET_STS_SUCCESS (success),
3964: * FND_API.G_RET_STS_ERROR (error),
3965: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3966: * x_msg_count Number of messages in message stack.
3967: * x_msg_data Message text if x_msg_count is 1.
3968: *
3961: *
3962: * x_return_status Return status after the call. The status can
3963: * be FND_API.G_RET_STS_SUCCESS (success),
3964: * FND_API.G_RET_STS_ERROR (error),
3965: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
3966: * x_msg_count Number of messages in message stack.
3967: * x_msg_data Message text if x_msg_count is 1.
3968: *
3969: * NOTES
3973: *
3974: */
3975:
3976: PROCEDURE create_geography_range(
3977: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
3978: p_geography_range_rec IN GEOGRAPHY_RANGE_REC_TYPE,
3979: x_return_status OUT NOCOPY VARCHAR2,
3980: x_msg_count OUT NOCOPY NUMBER,
3981: x_msg_data OUT NOCOPY VARCHAR2
3988: SAVEPOINT create_geography_range;
3989: --dbms_output.put_line('In the beginning of create_master_geography');
3990:
3991: -- Initialize message list if p_init_msg_list is set to TRUE.
3992: IF FND_API.to_Boolean(p_init_msg_list) THEN
3993: FND_MSG_PUB.initialize;
3994: END IF;
3995:
3996: -- Initialize API return status to success.
3993: FND_MSG_PUB.initialize;
3994: END IF;
3995:
3996: -- Initialize API return status to success.
3997: x_return_status := FND_API.G_RET_STS_SUCCESS;
3998:
3999: --dbms_output.put_line('before do_create_geography_range');
4000: -- Call to business logic.
4001: do_create_geography_range(
4003: x_return_status => x_return_status
4004: );
4005:
4006: --if validation failed at any point, then raise an exception to stop processing
4007: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4008: RAISE FND_API.G_EXC_ERROR;
4009: END IF;
4010:
4011: -- Standard call to get message count and if count is 1, get message info.
4004: );
4005:
4006: --if validation failed at any point, then raise an exception to stop processing
4007: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4008: RAISE FND_API.G_EXC_ERROR;
4009: END IF;
4010:
4011: -- Standard call to get message count and if count is 1, get message info.
4012: FND_MSG_PUB.Count_And_Get(
4009: END IF;
4010:
4011: -- Standard call to get message count and if count is 1, get message info.
4012: FND_MSG_PUB.Count_And_Get(
4013: p_encoded => FND_API.G_FALSE,
4014: p_count => x_msg_count,
4015: p_data => x_msg_data);
4016:
4017: EXCEPTION
4014: p_count => x_msg_count,
4015: p_data => x_msg_data);
4016:
4017: EXCEPTION
4018: WHEN FND_API.G_EXC_ERROR THEN
4019: ROLLBACK TO create_geography_range;
4020: x_return_status := FND_API.G_RET_STS_ERROR;
4021: FND_MSG_PUB.Count_And_Get(
4022: p_encoded => FND_API.G_FALSE,
4016:
4017: EXCEPTION
4018: WHEN FND_API.G_EXC_ERROR THEN
4019: ROLLBACK TO create_geography_range;
4020: x_return_status := FND_API.G_RET_STS_ERROR;
4021: FND_MSG_PUB.Count_And_Get(
4022: p_encoded => FND_API.G_FALSE,
4023: p_count => x_msg_count,
4024: p_data => x_msg_data);
4018: WHEN FND_API.G_EXC_ERROR THEN
4019: ROLLBACK TO create_geography_range;
4020: x_return_status := FND_API.G_RET_STS_ERROR;
4021: FND_MSG_PUB.Count_And_Get(
4022: p_encoded => FND_API.G_FALSE,
4023: p_count => x_msg_count,
4024: p_data => x_msg_data);
4025: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4026: ROLLBACK TO create_geography_range;
4021: FND_MSG_PUB.Count_And_Get(
4022: p_encoded => FND_API.G_FALSE,
4023: p_count => x_msg_count,
4024: p_data => x_msg_data);
4025: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4026: ROLLBACK TO create_geography_range;
4027: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4028: FND_MSG_PUB.Count_And_Get(
4029: p_encoded => FND_API.G_FALSE,
4023: p_count => x_msg_count,
4024: p_data => x_msg_data);
4025: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4026: ROLLBACK TO create_geography_range;
4027: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4028: FND_MSG_PUB.Count_And_Get(
4029: p_encoded => FND_API.G_FALSE,
4030: p_count => x_msg_count,
4031: p_data => x_msg_data);
4025: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4026: ROLLBACK TO create_geography_range;
4027: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4028: FND_MSG_PUB.Count_And_Get(
4029: p_encoded => FND_API.G_FALSE,
4030: p_count => x_msg_count,
4031: p_data => x_msg_data);
4032:
4033: WHEN DUP_VAL_ON_INDEX THEN
4031: p_data => x_msg_data);
4032:
4033: WHEN DUP_VAL_ON_INDEX THEN
4034: ROLLBACK TO create_geography_range;
4035: x_return_status := FND_API.G_RET_STS_ERROR;
4036: HZ_UTILITY_V2PUB.find_index_name(p_index_name);
4037: IF p_index_name = 'HZ_GEOGRAPHY_RANGES_U1' THEN
4038: FND_MESSAGE.SET_NAME('AR', 'HZ_API_DUPLICATE_COLUMN');
4039: FND_MESSAGE.SET_TOKEN('COLUMN', 'geography_id,geography_from and start_date');
4039: FND_MESSAGE.SET_TOKEN('COLUMN', 'geography_id,geography_from and start_date');
4040: FND_MSG_PUB.ADD;
4041: END IF;
4042: FND_MSG_PUB.Count_And_Get(
4043: p_encoded => FND_API.G_FALSE,
4044: p_count => x_msg_count,
4045: p_data => x_msg_data);
4046:
4047: WHEN OTHERS THEN
4045: p_data => x_msg_data);
4046:
4047: WHEN OTHERS THEN
4048: ROLLBACK TO create_geography_range;
4049: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4050: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
4051: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
4052: FND_MSG_PUB.ADD;
4053: FND_MSG_PUB.Count_And_Get(
4050: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
4051: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
4052: FND_MSG_PUB.ADD;
4053: FND_MSG_PUB.Count_And_Get(
4054: p_encoded => FND_API.G_FALSE,
4055: p_count => x_msg_count,
4056: p_data => x_msg_data);
4057:
4058: END create_geography_range;
4067: *
4068: * ARGUMENTS
4069: * IN:
4070: * p_init_msg_list Initialize message stack if it is set to
4071: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
4072: * geography_id
4073: * geography_from
4074: * start_date
4075: * end_date
4078: * p_object_version_number
4079: * OUT:
4080: *
4081: * x_return_status Return status after the call. The status can
4082: * be FND_API.G_RET_STS_SUCCESS (success),
4083: * FND_API.G_RET_STS_ERROR (error),
4084: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
4085: * x_msg_count Number of messages in message stack.
4086: * x_msg_data Message text if x_msg_count is 1.
4079: * OUT:
4080: *
4081: * x_return_status Return status after the call. The status can
4082: * be FND_API.G_RET_STS_SUCCESS (success),
4083: * FND_API.G_RET_STS_ERROR (error),
4084: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
4085: * x_msg_count Number of messages in message stack.
4086: * x_msg_data Message text if x_msg_count is 1.
4087: *
4080: *
4081: * x_return_status Return status after the call. The status can
4082: * be FND_API.G_RET_STS_SUCCESS (success),
4083: * FND_API.G_RET_STS_ERROR (error),
4084: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
4085: * x_msg_count Number of messages in message stack.
4086: * x_msg_data Message text if x_msg_count is 1.
4087: *
4088: * NOTES
4091: * 01-23-2003 Rekha Nalluri o Created.
4092: *
4093: */
4094: PROCEDURE update_geography_range (
4095: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
4096: p_geography_id IN NUMBER,
4097: p_geography_from IN VARCHAR2,
4098: p_start_date IN DATE,
4099: p_end_date IN DATE,
4108: -- Standard start of API savepoint
4109: SAVEPOINT update_geography_range;
4110:
4111: -- Initialize message list if p_init_msg_list is set to TRUE.
4112: IF FND_API.to_Boolean(p_init_msg_list) THEN
4113: FND_MSG_PUB.initialize;
4114: END IF;
4115:
4116: -- Initialize API return status to success.
4113: FND_MSG_PUB.initialize;
4114: END IF;
4115:
4116: -- Initialize API return status to success.
4117: x_return_status := FND_API.G_RET_STS_SUCCESS;
4118:
4119: -- Call to business logic.
4120: do_update_geography_range(
4121: p_geography_id => p_geography_id,
4126: x_return_status => x_return_status
4127: );
4128:
4129: --if validation failed at any point, then raise an exception to stop processing
4130: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4131: RAISE FND_API.G_EXC_ERROR;
4132: END IF;
4133:
4134: -- Standard call to get message count and if count is 1, get message info.
4127: );
4128:
4129: --if validation failed at any point, then raise an exception to stop processing
4130: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4131: RAISE FND_API.G_EXC_ERROR;
4132: END IF;
4133:
4134: -- Standard call to get message count and if count is 1, get message info.
4135: FND_MSG_PUB.Count_And_Get(
4132: END IF;
4133:
4134: -- Standard call to get message count and if count is 1, get message info.
4135: FND_MSG_PUB.Count_And_Get(
4136: p_encoded => FND_API.G_FALSE,
4137: p_count => x_msg_count,
4138: p_data => x_msg_data);
4139:
4140: EXCEPTION
4137: p_count => x_msg_count,
4138: p_data => x_msg_data);
4139:
4140: EXCEPTION
4141: WHEN FND_API.G_EXC_ERROR THEN
4142: ROLLBACK TO update_geography_range;
4143: x_return_status := FND_API.G_RET_STS_ERROR;
4144: FND_MSG_PUB.Count_And_Get(
4145: p_encoded => FND_API.G_FALSE,
4139:
4140: EXCEPTION
4141: WHEN FND_API.G_EXC_ERROR THEN
4142: ROLLBACK TO update_geography_range;
4143: x_return_status := FND_API.G_RET_STS_ERROR;
4144: FND_MSG_PUB.Count_And_Get(
4145: p_encoded => FND_API.G_FALSE,
4146: p_count => x_msg_count,
4147: p_data => x_msg_data);
4141: WHEN FND_API.G_EXC_ERROR THEN
4142: ROLLBACK TO update_geography_range;
4143: x_return_status := FND_API.G_RET_STS_ERROR;
4144: FND_MSG_PUB.Count_And_Get(
4145: p_encoded => FND_API.G_FALSE,
4146: p_count => x_msg_count,
4147: p_data => x_msg_data);
4148: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4149: ROLLBACK TO update_geography_range;
4144: FND_MSG_PUB.Count_And_Get(
4145: p_encoded => FND_API.G_FALSE,
4146: p_count => x_msg_count,
4147: p_data => x_msg_data);
4148: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4149: ROLLBACK TO update_geography_range;
4150: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4151: FND_MSG_PUB.Count_And_Get(
4152: p_encoded => FND_API.G_FALSE,
4146: p_count => x_msg_count,
4147: p_data => x_msg_data);
4148: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4149: ROLLBACK TO update_geography_range;
4150: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4151: FND_MSG_PUB.Count_And_Get(
4152: p_encoded => FND_API.G_FALSE,
4153: p_count => x_msg_count,
4154: p_data => x_msg_data);
4148: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4149: ROLLBACK TO update_geography_range;
4150: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4151: FND_MSG_PUB.Count_And_Get(
4152: p_encoded => FND_API.G_FALSE,
4153: p_count => x_msg_count,
4154: p_data => x_msg_data);
4155:
4156: WHEN OTHERS THEN
4154: p_data => x_msg_data);
4155:
4156: WHEN OTHERS THEN
4157: ROLLBACK TO update_geography_range;
4158: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4159: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
4160: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
4161: FND_MSG_PUB.ADD;
4162: FND_MSG_PUB.Count_And_Get(
4159: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
4160: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
4161: FND_MSG_PUB.ADD;
4162: FND_MSG_PUB.Count_And_Get(
4163: p_encoded => FND_API.G_FALSE,
4164: p_count => x_msg_count,
4165: p_data => x_msg_data);
4166:
4167: END update_geography_range;
4176: *
4177: * ARGUMENTS
4178: * IN:
4179: * p_init_msg_list Initialize message stack if it is set to
4180: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
4181: * p_geography_id
4182: * p_zone_relation_tbl Zone relation table of records.
4183: * IN/OUT:
4184: * OUT:
4183: * IN/OUT:
4184: * OUT:
4185: *
4186: * x_return_status Return status after the call. The status can
4187: * be FND_API.G_RET_STS_SUCCESS (success),
4188: * FND_API.G_RET_STS_ERROR (error),
4189: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
4190: * x_msg_count Number of messages in message stack.
4191: * x_msg_data Message text if x_msg_count is 1.
4184: * OUT:
4185: *
4186: * x_return_status Return status after the call. The status can
4187: * be FND_API.G_RET_STS_SUCCESS (success),
4188: * FND_API.G_RET_STS_ERROR (error),
4189: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
4190: * x_msg_count Number of messages in message stack.
4191: * x_msg_data Message text if x_msg_count is 1.
4192: *
4185: *
4186: * x_return_status Return status after the call. The status can
4187: * be FND_API.G_RET_STS_SUCCESS (success),
4188: * FND_API.G_RET_STS_ERROR (error),
4189: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
4190: * x_msg_count Number of messages in message stack.
4191: * x_msg_data Message text if x_msg_count is 1.
4192: *
4193: * NOTES
4197: *
4198: */
4199:
4200: PROCEDURE create_zone_relation(
4201: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
4202: p_geography_id IN NUMBER,
4203: p_zone_relation_tbl IN ZONE_RELATION_TBL_TYPE,
4204: p_created_by_module IN VARCHAR2,
4205: p_application_id IN NUMBER,
4213: SAVEPOINT create_zone_relation;
4214: --dbms_output.put_line('In the beginning of create_zone_relation');
4215:
4216: -- Initialize message list if p_init_msg_list is set to TRUE.
4217: IF FND_API.to_Boolean(p_init_msg_list) THEN
4218: FND_MSG_PUB.initialize;
4219: END IF;
4220:
4221: -- Initialize API return status to success.
4218: FND_MSG_PUB.initialize;
4219: END IF;
4220:
4221: -- Initialize API return status to success.
4222: x_return_status := FND_API.G_RET_STS_SUCCESS;
4223:
4224: --dbms_output.put_line('before do_create_zone_relation');
4225: -- Call to business logic.
4226: do_create_zone_relation(
4231: x_return_status => x_return_status
4232: );
4233:
4234: --if validation failed at any point, then raise an exception to stop processing
4235: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4236: RAISE FND_API.G_EXC_ERROR;
4237: END IF;
4238:
4239: --dbms_output.put_line('after call to do_create '|| x_return_status);
4232: );
4233:
4234: --if validation failed at any point, then raise an exception to stop processing
4235: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4236: RAISE FND_API.G_EXC_ERROR;
4237: END IF;
4238:
4239: --dbms_output.put_line('after call to do_create '|| x_return_status);
4240:
4239: --dbms_output.put_line('after call to do_create '|| x_return_status);
4240:
4241: -- Standard call to get message count and if count is 1, get message info.
4242: FND_MSG_PUB.Count_And_Get(
4243: p_encoded => FND_API.G_FALSE,
4244: p_count => x_msg_count,
4245: p_data => x_msg_data);
4246:
4247: EXCEPTION
4244: p_count => x_msg_count,
4245: p_data => x_msg_data);
4246:
4247: EXCEPTION
4248: WHEN FND_API.G_EXC_ERROR THEN
4249: ROLLBACK TO create_zone_relation;
4250: x_return_status := FND_API.G_RET_STS_ERROR;
4251: FND_MSG_PUB.Count_And_Get(
4252: p_encoded => FND_API.G_FALSE,
4246:
4247: EXCEPTION
4248: WHEN FND_API.G_EXC_ERROR THEN
4249: ROLLBACK TO create_zone_relation;
4250: x_return_status := FND_API.G_RET_STS_ERROR;
4251: FND_MSG_PUB.Count_And_Get(
4252: p_encoded => FND_API.G_FALSE,
4253: p_count => x_msg_count,
4254: p_data => x_msg_data);
4248: WHEN FND_API.G_EXC_ERROR THEN
4249: ROLLBACK TO create_zone_relation;
4250: x_return_status := FND_API.G_RET_STS_ERROR;
4251: FND_MSG_PUB.Count_And_Get(
4252: p_encoded => FND_API.G_FALSE,
4253: p_count => x_msg_count,
4254: p_data => x_msg_data);
4255: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4256: ROLLBACK TO create_zone_relation;
4251: FND_MSG_PUB.Count_And_Get(
4252: p_encoded => FND_API.G_FALSE,
4253: p_count => x_msg_count,
4254: p_data => x_msg_data);
4255: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4256: ROLLBACK TO create_zone_relation;
4257: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4258: FND_MSG_PUB.Count_And_Get(
4259: p_encoded => FND_API.G_FALSE,
4253: p_count => x_msg_count,
4254: p_data => x_msg_data);
4255: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4256: ROLLBACK TO create_zone_relation;
4257: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4258: FND_MSG_PUB.Count_And_Get(
4259: p_encoded => FND_API.G_FALSE,
4260: p_count => x_msg_count,
4261: p_data => x_msg_data);
4255: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4256: ROLLBACK TO create_zone_relation;
4257: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4258: FND_MSG_PUB.Count_And_Get(
4259: p_encoded => FND_API.G_FALSE,
4260: p_count => x_msg_count,
4261: p_data => x_msg_data);
4262:
4263: WHEN OTHERS THEN
4261: p_data => x_msg_data);
4262:
4263: WHEN OTHERS THEN
4264: ROLLBACK TO create_zone_relation;
4265: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4266: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
4267: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
4268: FND_MSG_PUB.ADD;
4269: FND_MSG_PUB.Count_And_Get(
4266: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
4267: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
4268: FND_MSG_PUB.ADD;
4269: FND_MSG_PUB.Count_And_Get(
4270: p_encoded => FND_API.G_FALSE,
4271: p_count => x_msg_count,
4272: p_data => x_msg_data);
4273:
4274: END create_zone_relation;
4284: *
4285: * ARGUMENTS
4286: * IN:
4287: * p_init_msg_list Initialize message stack if it is set to
4288: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
4289: * p_zone_type
4290: * p_zone_name
4291: * p_zone_code
4292: * p_start_date
4301: *
4302: * OUT:
4303: * x_return_status
4304: * Return status after the call. The status can
4305: * be FND_API.G_RET_STS_SUCCESS (success),
4306: * FND_API.G_RET_STS_ERROR (error),
4307: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
4308: * x_msg_count Number of messages in message stack.
4309: * x_msg_data Message text if x_msg_count is 1.
4302: * OUT:
4303: * x_return_status
4304: * Return status after the call. The status can
4305: * be FND_API.G_RET_STS_SUCCESS (success),
4306: * FND_API.G_RET_STS_ERROR (error),
4307: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
4308: * x_msg_count Number of messages in message stack.
4309: * x_msg_data Message text if x_msg_count is 1.
4310: *
4303: * x_return_status
4304: * Return status after the call. The status can
4305: * be FND_API.G_RET_STS_SUCCESS (success),
4306: * FND_API.G_RET_STS_ERROR (error),
4307: * FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
4308: * x_msg_count Number of messages in message stack.
4309: * x_msg_data Message text if x_msg_count is 1.
4310: *
4311: * NOTES
4315: *
4316: */
4317:
4318: PROCEDURE create_zone(
4319: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
4320: p_zone_type IN VARCHAR2,
4321: p_zone_name IN VARCHAR2,
4322: p_zone_code IN VARCHAR2,
4323: p_zone_code_type IN VARCHAR2,
4343: SAVEPOINT create_zone;
4344: --dbms_output.put_line('In the beginning of create_zone');
4345:
4346: -- Initialize message list if p_init_msg_list is set to TRUE.
4347: IF FND_API.to_Boolean(p_init_msg_list) THEN
4348: FND_MSG_PUB.initialize;
4349: END IF;
4350:
4351: -- Initialize API return status to success.
4348: FND_MSG_PUB.initialize;
4349: END IF;
4350:
4351: -- Initialize API return status to success.
4352: x_return_status := FND_API.G_RET_STS_SUCCESS;
4353:
4354: --dbms_output.put_line('before do_create_zone');
4355: -- Call to business logic.
4356: do_create_zone (
4371: x_return_status => x_return_status
4372: );
4373:
4374: --if validation failed at any point, then raise an exception to stop processing
4375: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4376: RAISE FND_API.G_EXC_ERROR;
4377: END IF;
4378:
4379: -- Standard call to get message count and if count is 1, get message info.
4372: );
4373:
4374: --if validation failed at any point, then raise an exception to stop processing
4375: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4376: RAISE FND_API.G_EXC_ERROR;
4377: END IF;
4378:
4379: -- Standard call to get message count and if count is 1, get message info.
4380: FND_MSG_PUB.Count_And_Get(
4377: END IF;
4378:
4379: -- Standard call to get message count and if count is 1, get message info.
4380: FND_MSG_PUB.Count_And_Get(
4381: p_encoded => FND_API.G_FALSE,
4382: p_count => x_msg_count,
4383: p_data => x_msg_data);
4384:
4385: EXCEPTION
4382: p_count => x_msg_count,
4383: p_data => x_msg_data);
4384:
4385: EXCEPTION
4386: WHEN FND_API.G_EXC_ERROR THEN
4387: ROLLBACK TO create_zone;
4388: x_return_status := FND_API.G_RET_STS_ERROR;
4389: FND_MSG_PUB.Count_And_Get(
4390: p_encoded => FND_API.G_FALSE,
4384:
4385: EXCEPTION
4386: WHEN FND_API.G_EXC_ERROR THEN
4387: ROLLBACK TO create_zone;
4388: x_return_status := FND_API.G_RET_STS_ERROR;
4389: FND_MSG_PUB.Count_And_Get(
4390: p_encoded => FND_API.G_FALSE,
4391: p_count => x_msg_count,
4392: p_data => x_msg_data);
4386: WHEN FND_API.G_EXC_ERROR THEN
4387: ROLLBACK TO create_zone;
4388: x_return_status := FND_API.G_RET_STS_ERROR;
4389: FND_MSG_PUB.Count_And_Get(
4390: p_encoded => FND_API.G_FALSE,
4391: p_count => x_msg_count,
4392: p_data => x_msg_data);
4393: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4394: ROLLBACK TO create_zone;
4389: FND_MSG_PUB.Count_And_Get(
4390: p_encoded => FND_API.G_FALSE,
4391: p_count => x_msg_count,
4392: p_data => x_msg_data);
4393: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4394: ROLLBACK TO create_zone;
4395: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4396: FND_MSG_PUB.Count_And_Get(
4397: p_encoded => FND_API.G_FALSE,
4391: p_count => x_msg_count,
4392: p_data => x_msg_data);
4393: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4394: ROLLBACK TO create_zone;
4395: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4396: FND_MSG_PUB.Count_And_Get(
4397: p_encoded => FND_API.G_FALSE,
4398: p_count => x_msg_count,
4399: p_data => x_msg_data);
4393: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4394: ROLLBACK TO create_zone;
4395: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4396: FND_MSG_PUB.Count_And_Get(
4397: p_encoded => FND_API.G_FALSE,
4398: p_count => x_msg_count,
4399: p_data => x_msg_data);
4400:
4401: WHEN OTHERS THEN
4399: p_data => x_msg_data);
4400:
4401: WHEN OTHERS THEN
4402: ROLLBACK TO create_zone;
4403: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4404: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
4405: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
4406: FND_MSG_PUB.ADD;
4407: FND_MSG_PUB.Count_And_Get(
4404: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
4405: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
4406: FND_MSG_PUB.ADD;
4407: FND_MSG_PUB.Count_And_Get(
4408: p_encoded => FND_API.G_FALSE,
4409: p_count => x_msg_count,
4410: p_data => x_msg_data);
4411: END create_zone;
4412: