97: IF (p_dept_description IS NOT NULL)
98: THEN
99:
100: IF G_DEBUG='Y' THEN
101: AHL_DEBUG_PUB.debug( 'Org id'||p_organization_id);
102: END IF;
103:
104: SELECT department_id
105: INTO x_department_id
641: END IF;
642:
643: END IF;
644: IF G_DEBUG='Y' THEN
645: AHL_DEBUG_PUB.debug( 'date 3:'||p_space_restriction_rec.start_date);
646: END IF;
647: --Check for any visits exist during start and end dates
648: OPEN space_visit_cur(p_space_restriction_rec.space_id);
649: LOOP
847: -- Standard Start of API savepoint
848: SAVEPOINT create_space_restriction;
849: -- Check if API is called in debug mode. If yes, enable debug.
850: IF G_DEBUG='Y' THEN
851: AHL_DEBUG_PUB.enable_debug;
852: END IF;
853: -- Debug info.
854: IF G_DEBUG='Y' THEN
855: AHL_DEBUG_PUB.debug( 'enter ahl_ltp_space_unavl_pvt.Create Space Restriction','+SUAVL+');
851: AHL_DEBUG_PUB.enable_debug;
852: END IF;
853: -- Debug info.
854: IF G_DEBUG='Y' THEN
855: AHL_DEBUG_PUB.debug( 'enter ahl_ltp_space_unavl_pvt.Create Space Restriction','+SUAVL+');
856: END IF;
857: -- Standard call to check for call compatibility.
858: IF FND_API.to_boolean(p_init_msg_list)
859: THEN
900: --Assign the returned value
901: p_x_space_restriction_rec.organization_id := l_organization_id;
902:
903: IF G_DEBUG='Y' THEN
904: AHL_DEBUG_PUB.debug( 'Org id'||p_x_space_restriction_rec.organization_id);
905: END IF;
906:
907: -- Get dept code using dept description
908: IF (p_x_space_restriction_rec.dept_description IS NOT NULL AND
929: --Assign the returned value
930: p_x_space_restriction_rec.department_id := l_department_id;
931:
932: IF G_DEBUG='Y' THEN
933: AHL_DEBUG_PUB.debug( 'Dept id'||p_x_space_restriction_rec.department_id);
934: END IF;
935: -- Convert Space name to space id
936: IF (p_x_space_restriction_rec.space_name IS NOT NULL AND
937: p_x_space_restriction_rec.space_name <> FND_API.G_MISS_CHAR ) OR
955: --Assign the returned value
956: p_x_space_restriction_rec.space_id := l_space_id;
957:
958: IF G_DEBUG='Y' THEN
959: AHL_DEBUG_PUB.debug( 'Space id'||p_x_space_restriction_rec.space_id);
960: END IF;
961:
962: --Standard check to count messages
963: l_msg_count := Fnd_Msg_Pub.count_msg;
1197: COMMIT;
1198: END IF;
1199: -- Debug info
1200: IF G_DEBUG='Y' THEN
1201: Ahl_Debug_Pub.debug( 'End of private api Create Space Restriction','+SUAVL+');
1202: -- Check if API is called in debug mode. If yes, disable debug.
1203: Ahl_Debug_Pub.disable_debug;
1204: END IF;
1205:
1199: -- Debug info
1200: IF G_DEBUG='Y' THEN
1201: Ahl_Debug_Pub.debug( 'End of private api Create Space Restriction','+SUAVL+');
1202: -- Check if API is called in debug mode. If yes, disable debug.
1203: Ahl_Debug_Pub.disable_debug;
1204: END IF;
1205:
1206: EXCEPTION
1207: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1210: FND_MSG_PUB.count_and_get( p_encoded => FND_API.G_FALSE,
1211: p_count => x_msg_count,
1212: p_data => x_msg_data);
1213: IF G_DEBUG='Y' THEN
1214: AHL_DEBUG_PUB.log_app_messages (
1215: x_msg_count, x_msg_data, 'ERROR' );
1216: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Create Space Restriction','+SUAVL+');
1217: -- Check if API is called in debug mode. If yes, disable debug.
1218: AHL_DEBUG_PUB.disable_debug;
1212: p_data => x_msg_data);
1213: IF G_DEBUG='Y' THEN
1214: AHL_DEBUG_PUB.log_app_messages (
1215: x_msg_count, x_msg_data, 'ERROR' );
1216: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Create Space Restriction','+SUAVL+');
1217: -- Check if API is called in debug mode. If yes, disable debug.
1218: AHL_DEBUG_PUB.disable_debug;
1219: END IF;
1220: WHEN FND_API.G_EXC_ERROR THEN
1214: AHL_DEBUG_PUB.log_app_messages (
1215: x_msg_count, x_msg_data, 'ERROR' );
1216: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Create Space Restriction','+SUAVL+');
1217: -- Check if API is called in debug mode. If yes, disable debug.
1218: AHL_DEBUG_PUB.disable_debug;
1219: END IF;
1220: WHEN FND_API.G_EXC_ERROR THEN
1221: ROLLBACK TO create_space_restriction;
1222: X_return_status := FND_API.G_RET_STS_ERROR;
1224: p_count => x_msg_count,
1225: p_data => X_msg_data);
1226: IF G_DEBUG='Y' THEN
1227: -- Debug info.
1228: AHL_DEBUG_PUB.log_app_messages (
1229: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
1230: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Create Space Restriction','+SUAVL+');
1231: -- Check if API is called in debug mode. If yes, disable debug.
1232: AHL_DEBUG_PUB.disable_debug;
1226: IF G_DEBUG='Y' THEN
1227: -- Debug info.
1228: AHL_DEBUG_PUB.log_app_messages (
1229: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
1230: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Create Space Restriction','+SUAVL+');
1231: -- Check if API is called in debug mode. If yes, disable debug.
1232: AHL_DEBUG_PUB.disable_debug;
1233: END IF;
1234:
1228: AHL_DEBUG_PUB.log_app_messages (
1229: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
1230: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Create Space Restriction','+SUAVL+');
1231: -- Check if API is called in debug mode. If yes, disable debug.
1232: AHL_DEBUG_PUB.disable_debug;
1233: END IF;
1234:
1235: WHEN OTHERS THEN
1236: ROLLBACK TO create_space_restriction;
1245: p_count => x_msg_count,
1246: p_data => X_msg_data);
1247: IF G_DEBUG='Y' THEN
1248: -- Debug info.
1249: AHL_DEBUG_PUB.log_app_messages (
1250: x_msg_count, x_msg_data, 'SQL ERROR' );
1251: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Create Space Restriction','+SUAVL+');
1252: -- Check if API is called in debug mode. If yes, disable debug.
1253: AHL_DEBUG_PUB.disable_debug;
1247: IF G_DEBUG='Y' THEN
1248: -- Debug info.
1249: AHL_DEBUG_PUB.log_app_messages (
1250: x_msg_count, x_msg_data, 'SQL ERROR' );
1251: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Create Space Restriction','+SUAVL+');
1252: -- Check if API is called in debug mode. If yes, disable debug.
1253: AHL_DEBUG_PUB.disable_debug;
1254: END IF;
1255:
1249: AHL_DEBUG_PUB.log_app_messages (
1250: x_msg_count, x_msg_data, 'SQL ERROR' );
1251: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Create Space Restriction','+SUAVL+');
1252: -- Check if API is called in debug mode. If yes, disable debug.
1253: AHL_DEBUG_PUB.disable_debug;
1254: END IF;
1255:
1256: END Create_Space_Restriction;
1257:
1330: -- Standard Start of API savepoint
1331: SAVEPOINT update_space_restriction;
1332: -- Check if API is called in debug mode. If yes, enable debug.
1333: IF G_DEBUG='Y' THEN
1334: AHL_DEBUG_PUB.enable_debug;
1335: -- Debug info.
1336: AHL_DEBUG_PUB.debug( 'enter ahl_ltp_space_unavl_pvt.Update Space Restriction','+SUAVL+');
1337: END IF;
1338: -- Standard call to check for call compatibility.
1332: -- Check if API is called in debug mode. If yes, enable debug.
1333: IF G_DEBUG='Y' THEN
1334: AHL_DEBUG_PUB.enable_debug;
1335: -- Debug info.
1336: AHL_DEBUG_PUB.debug( 'enter ahl_ltp_space_unavl_pvt.Update Space Restriction','+SUAVL+');
1337: END IF;
1338: -- Standard call to check for call compatibility.
1339: IF FND_API.to_boolean(p_init_msg_list)
1340: THEN
1388:
1389: --Assign the returned value
1390: l_space_restriction_rec.space_id := l_space_id;
1391: IF G_DEBUG='Y' THEN
1392: AHL_DEBUG_PUB.debug( 'start date'||l_space_restriction_rec.start_date);
1393: AHL_DEBUG_PUB.debug( 'end date'||l_space_restriction_rec.end_date);
1394: AHL_DEBUG_PUB.debug( 'org id'||l_space_restriction_rec.organization_id);
1395: AHL_DEBUG_PUB.debug( 'dept id'||l_space_restriction_rec.department_id);
1396: END IF;
1389: --Assign the returned value
1390: l_space_restriction_rec.space_id := l_space_id;
1391: IF G_DEBUG='Y' THEN
1392: AHL_DEBUG_PUB.debug( 'start date'||l_space_restriction_rec.start_date);
1393: AHL_DEBUG_PUB.debug( 'end date'||l_space_restriction_rec.end_date);
1394: AHL_DEBUG_PUB.debug( 'org id'||l_space_restriction_rec.organization_id);
1395: AHL_DEBUG_PUB.debug( 'dept id'||l_space_restriction_rec.department_id);
1396: END IF;
1397: --------------------------------Validation ---------------------------
1390: l_space_restriction_rec.space_id := l_space_id;
1391: IF G_DEBUG='Y' THEN
1392: AHL_DEBUG_PUB.debug( 'start date'||l_space_restriction_rec.start_date);
1393: AHL_DEBUG_PUB.debug( 'end date'||l_space_restriction_rec.end_date);
1394: AHL_DEBUG_PUB.debug( 'org id'||l_space_restriction_rec.organization_id);
1395: AHL_DEBUG_PUB.debug( 'dept id'||l_space_restriction_rec.department_id);
1396: END IF;
1397: --------------------------------Validation ---------------------------
1398: -- get existing values and compare
1391: IF G_DEBUG='Y' THEN
1392: AHL_DEBUG_PUB.debug( 'start date'||l_space_restriction_rec.start_date);
1393: AHL_DEBUG_PUB.debug( 'end date'||l_space_restriction_rec.end_date);
1394: AHL_DEBUG_PUB.debug( 'org id'||l_space_restriction_rec.organization_id);
1395: AHL_DEBUG_PUB.debug( 'dept id'||l_space_restriction_rec.department_id);
1396: END IF;
1397: --------------------------------Validation ---------------------------
1398: -- get existing values and compare
1399: Complete_Space_Restric_Rec (
1483: COMMIT;
1484: END IF;
1485: IF G_DEBUG='Y' THEN
1486: -- Debug info
1487: Ahl_Debug_Pub.debug( 'End of private api Update Space Restriction','+SUAVL+');
1488: -- Check if API is called in debug mode. If yes, disable debug.
1489: Ahl_Debug_Pub.disable_debug;
1490: END IF;
1491:
1485: IF G_DEBUG='Y' THEN
1486: -- Debug info
1487: Ahl_Debug_Pub.debug( 'End of private api Update Space Restriction','+SUAVL+');
1488: -- Check if API is called in debug mode. If yes, disable debug.
1489: Ahl_Debug_Pub.disable_debug;
1490: END IF;
1491:
1492: EXCEPTION
1493: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1496: FND_MSG_PUB.count_and_get( p_encoded => FND_API.G_FALSE,
1497: p_count => x_msg_count,
1498: p_data => x_msg_data);
1499: IF G_DEBUG='Y' THEN
1500: AHL_DEBUG_PUB.log_app_messages (
1501: x_msg_count, x_msg_data, 'ERROR' );
1502: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Update Space Restriction','+SUAVL+');
1503: -- Check if API is called in debug mode. If yes, disable debug.
1504: AHL_DEBUG_PUB.disable_debug;
1498: p_data => x_msg_data);
1499: IF G_DEBUG='Y' THEN
1500: AHL_DEBUG_PUB.log_app_messages (
1501: x_msg_count, x_msg_data, 'ERROR' );
1502: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Update Space Restriction','+SUAVL+');
1503: -- Check if API is called in debug mode. If yes, disable debug.
1504: AHL_DEBUG_PUB.disable_debug;
1505: END IF;
1506:
1500: AHL_DEBUG_PUB.log_app_messages (
1501: x_msg_count, x_msg_data, 'ERROR' );
1502: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Update Space Restriction','+SUAVL+');
1503: -- Check if API is called in debug mode. If yes, disable debug.
1504: AHL_DEBUG_PUB.disable_debug;
1505: END IF;
1506:
1507: WHEN FND_API.G_EXC_ERROR THEN
1508: ROLLBACK TO update_space_restriction;
1511: p_count => x_msg_count,
1512: p_data => X_msg_data);
1513: IF G_DEBUG='Y' THEN
1514: -- Debug info.
1515: AHL_DEBUG_PUB.log_app_messages (
1516: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
1517: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Update Space Restriction','+SUAVL+');
1518: -- Check if API is called in debug mode. If yes, disable debug.
1519: AHL_DEBUG_PUB.disable_debug;
1513: IF G_DEBUG='Y' THEN
1514: -- Debug info.
1515: AHL_DEBUG_PUB.log_app_messages (
1516: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
1517: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Update Space Restriction','+SUAVL+');
1518: -- Check if API is called in debug mode. If yes, disable debug.
1519: AHL_DEBUG_PUB.disable_debug;
1520: END IF;
1521:
1515: AHL_DEBUG_PUB.log_app_messages (
1516: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
1517: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Update Space Restriction','+SUAVL+');
1518: -- Check if API is called in debug mode. If yes, disable debug.
1519: AHL_DEBUG_PUB.disable_debug;
1520: END IF;
1521:
1522: WHEN OTHERS THEN
1523: ROLLBACK TO update_space_restriction;
1532: p_count => x_msg_count,
1533: p_data => X_msg_data);
1534: IF G_DEBUG='Y' THEN
1535: -- Debug info.
1536: AHL_DEBUG_PUB.log_app_messages (
1537: x_msg_count, x_msg_data, 'SQL ERROR' );
1538: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Update Space Restriction','+SUAVL+');
1539: -- Check if API is called in debug mode. If yes, disable debug.
1540: AHL_DEBUG_PUB.disable_debug;
1534: IF G_DEBUG='Y' THEN
1535: -- Debug info.
1536: AHL_DEBUG_PUB.log_app_messages (
1537: x_msg_count, x_msg_data, 'SQL ERROR' );
1538: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Update Space Restriction','+SUAVL+');
1539: -- Check if API is called in debug mode. If yes, disable debug.
1540: AHL_DEBUG_PUB.disable_debug;
1541: END IF;
1542: END Update_Space_Restriction;
1536: AHL_DEBUG_PUB.log_app_messages (
1537: x_msg_count, x_msg_data, 'SQL ERROR' );
1538: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Update Space Restriction','+SUAVL+');
1539: -- Check if API is called in debug mode. If yes, disable debug.
1540: AHL_DEBUG_PUB.disable_debug;
1541: END IF;
1542: END Update_Space_Restriction;
1543:
1544: --------------------------------------------------------------------
1589: -- Standard Start of API savepoint
1590: SAVEPOINT delete_space_restriction;
1591: -- Check if API is called in debug mode. If yes, enable debug.
1592: IF G_DEBUG='Y' THEN
1593: AHL_DEBUG_PUB.enable_debug;
1594: END IF;
1595: -- Debug info.
1596: IF G_DEBUG='Y' THEN
1597: AHL_DEBUG_PUB.debug( 'enter ahl_ltp_space_unavl_pvt.Delete Space Restriction','+SUAVL+');
1593: AHL_DEBUG_PUB.enable_debug;
1594: END IF;
1595: -- Debug info.
1596: IF G_DEBUG='Y' THEN
1597: AHL_DEBUG_PUB.debug( 'enter ahl_ltp_space_unavl_pvt.Delete Space Restriction','+SUAVL+');
1598: END IF;
1599: -- Standard call to check for call compatibility.
1600: IF FND_API.to_boolean(p_init_msg_list)
1601: THEN
1650: COMMIT;
1651: END IF;
1652: IF G_DEBUG='Y' THEN
1653: -- Debug info
1654: Ahl_Debug_Pub.debug( 'End of private api Delete Space Restriction','+SUAVL+');
1655: -- Check if API is called in debug mode. If yes, disable debug.
1656: Ahl_Debug_Pub.disable_debug;
1657: END IF;
1658:
1652: IF G_DEBUG='Y' THEN
1653: -- Debug info
1654: Ahl_Debug_Pub.debug( 'End of private api Delete Space Restriction','+SUAVL+');
1655: -- Check if API is called in debug mode. If yes, disable debug.
1656: Ahl_Debug_Pub.disable_debug;
1657: END IF;
1658:
1659: EXCEPTION
1660: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1663: FND_MSG_PUB.count_and_get( p_encoded => FND_API.G_FALSE,
1664: p_count => x_msg_count,
1665: p_data => x_msg_data);
1666: IF G_DEBUG='Y' THEN
1667: AHL_DEBUG_PUB.log_app_messages (
1668: x_msg_count, x_msg_data, 'ERROR' );
1669: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Delete Space Restriction','+SUAVL+');
1670: -- Check if API is called in debug mode. If yes, disable debug.
1671: AHL_DEBUG_PUB.disable_debug;
1665: p_data => x_msg_data);
1666: IF G_DEBUG='Y' THEN
1667: AHL_DEBUG_PUB.log_app_messages (
1668: x_msg_count, x_msg_data, 'ERROR' );
1669: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Delete Space Restriction','+SUAVL+');
1670: -- Check if API is called in debug mode. If yes, disable debug.
1671: AHL_DEBUG_PUB.disable_debug;
1672: END IF;
1673: WHEN FND_API.G_EXC_ERROR THEN
1667: AHL_DEBUG_PUB.log_app_messages (
1668: x_msg_count, x_msg_data, 'ERROR' );
1669: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Delete Space Restriction','+SUAVL+');
1670: -- Check if API is called in debug mode. If yes, disable debug.
1671: AHL_DEBUG_PUB.disable_debug;
1672: END IF;
1673: WHEN FND_API.G_EXC_ERROR THEN
1674: ROLLBACK TO delete_space_restriction;
1675: X_return_status := FND_API.G_RET_STS_ERROR;
1677: p_count => x_msg_count,
1678: p_data => X_msg_data);
1679: IF G_DEBUG='Y' THEN
1680: -- Debug info.
1681: AHL_DEBUG_PUB.log_app_messages (
1682: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
1683: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Delete Space Restriction','+SUAVL+');
1684: -- Check if API is called in debug mode. If yes, disable debug.
1685: AHL_DEBUG_PUB.disable_debug;
1679: IF G_DEBUG='Y' THEN
1680: -- Debug info.
1681: AHL_DEBUG_PUB.log_app_messages (
1682: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
1683: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Delete Space Restriction','+SUAVL+');
1684: -- Check if API is called in debug mode. If yes, disable debug.
1685: AHL_DEBUG_PUB.disable_debug;
1686: END IF;
1687:
1681: AHL_DEBUG_PUB.log_app_messages (
1682: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
1683: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Delete Space Restriction','+SUAVL+');
1684: -- Check if API is called in debug mode. If yes, disable debug.
1685: AHL_DEBUG_PUB.disable_debug;
1686: END IF;
1687:
1688: WHEN OTHERS THEN
1689: ROLLBACK TO delete_space_restriction;
1698: p_count => x_msg_count,
1699: p_data => X_msg_data);
1700: IF G_DEBUG='Y' THEN
1701: -- Debug info.
1702: AHL_DEBUG_PUB.log_app_messages (
1703: x_msg_count, x_msg_data, 'SQL ERROR' );
1704: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Delete Space Restriction','+SUAVL+');
1705: -- Check if API is called in debug mode. If yes, disable debug.
1706: AHL_DEBUG_PUB.disable_debug;
1700: IF G_DEBUG='Y' THEN
1701: -- Debug info.
1702: AHL_DEBUG_PUB.log_app_messages (
1703: x_msg_count, x_msg_data, 'SQL ERROR' );
1704: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Delete Space Restriction','+SUAVL+');
1705: -- Check if API is called in debug mode. If yes, disable debug.
1706: AHL_DEBUG_PUB.disable_debug;
1707: END IF;
1708:
1702: AHL_DEBUG_PUB.log_app_messages (
1703: x_msg_count, x_msg_data, 'SQL ERROR' );
1704: AHL_DEBUG_PUB.debug( 'ahl_ltp_space_unavl_pvt.Delete Space Restriction','+SUAVL+');
1705: -- Check if API is called in debug mode. If yes, disable debug.
1706: AHL_DEBUG_PUB.disable_debug;
1707: END IF;
1708:
1709: END Delete_Space_Restriction;
1710: