35: -- Added Dynamic SQL for the cs_incidents_all_vl
36: --
37: -- : 04/05/00 ** VVUYYURU ** Vijay Vuyyuru **
38: -- Added Functions to get the default values of
39: -- FND_API variables
40: --
41: -- : 04/14/00 ** VVUYYURU ** Vijay Vuyyuru **
42: -- Added the procedure for Escalations
43: --
96: -- *******************************************************************************
97:
98: -- Start of comments
99:
100: -- Functions : These functions are to get the FND_API default values.
101:
102: -- End of comments
103:
104: -- *******************************************************************************
111:
112: FUNCTION am_miss_num RETURN NUMBER IS
113:
114: BEGIN
115: RETURN (FND_API.g_miss_num);
116: END am_miss_num;
117:
118:
119: FUNCTION am_miss_char RETURN VARCHAR2 IS
118:
119: FUNCTION am_miss_char RETURN VARCHAR2 IS
120:
121: BEGIN
122: RETURN (FND_API.g_miss_char);
123: END am_miss_char;
124:
125:
126: FUNCTION am_miss_date RETURN DATE IS
125:
126: FUNCTION am_miss_date RETURN DATE IS
127:
128: BEGIN
129: RETURN (FND_API.g_miss_date);
130: END am_miss_date;
131:
132:
133: FUNCTION am_false RETURN VARCHAR2 IS
132:
133: FUNCTION am_false RETURN VARCHAR2 IS
134:
135: BEGIN
136: RETURN (FND_API.g_false);
137: END am_false;
138:
139:
140: FUNCTION am_true RETURN VARCHAR2 IS
139:
140: FUNCTION am_true RETURN VARCHAR2 IS
141:
142: BEGIN
143: RETURN (FND_API.g_true);
144: END am_true;
145:
146:
147: FUNCTION am_valid_level_full RETURN VARCHAR2 IS
146:
147: FUNCTION am_valid_level_full RETURN VARCHAR2 IS
148:
149: BEGIN
150: RETURN (FND_API.g_valid_level_full);
151: END am_valid_level_full;
152:
153:
154:
940:
941:
942: BEGIN
943: -- initialize the variables
944: x_return_status := fnd_api.g_ret_sts_success;
945: l_current_rec := 0;
946: l_resources_tbl.delete;
947:
948: -- Added by SBARAT on 21/04/2005 for Bug-4300801
999:
1000: -- set back the API name to original name
1001: l_api_name := l_api_name_1;
1002:
1003: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
1004: -- Unexpected Execution Error from call to Calendar
1005: fnd_message.set_name('JTF', 'JTF_AM_ERROR_CAL_API');
1006: fnd_msg_pub.add;
1007: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
1003: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
1004: -- Unexpected Execution Error from call to Calendar
1005: fnd_message.set_name('JTF', 'JTF_AM_ERROR_CAL_API');
1006: fnd_msg_pub.add;
1007: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
1008: -- 12/22/05 ** MPADHIAR ** Manas padhiary **
1009: -- Removed Comment to Show error message Bug # 2919389
1010: RAISE fnd_api.g_exc_error;
1011: ELSE
1006: fnd_msg_pub.add;
1007: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
1008: -- 12/22/05 ** MPADHIAR ** Manas padhiary **
1009: -- Removed Comment to Show error message Bug # 2919389
1010: RAISE fnd_api.g_exc_error;
1011: ELSE
1012: RAISE fnd_api.g_exc_unexpected_error;
1013: END IF;
1014: END IF;
1008: -- 12/22/05 ** MPADHIAR ** Manas padhiary **
1009: -- Removed Comment to Show error message Bug # 2919389
1010: RAISE fnd_api.g_exc_error;
1011: ELSE
1012: RAISE fnd_api.g_exc_unexpected_error;
1013: END IF;
1014: END IF;
1015:
1016: -- Put the records into the PL/SQL Table.
1074:
1075: END IF;
1076:
1077: EXCEPTION
1078: WHEN FND_API.G_EXC_ERROR THEN
1079: x_return_status := FND_API.G_RET_STS_ERROR ;
1080: FND_MSG_PUB.Count_And_Get
1081: (
1082: p_count => x_msg_count,
1075: END IF;
1076:
1077: EXCEPTION
1078: WHEN FND_API.G_EXC_ERROR THEN
1079: x_return_status := FND_API.G_RET_STS_ERROR ;
1080: FND_MSG_PUB.Count_And_Get
1081: (
1082: p_count => x_msg_count,
1083: p_data => x_msg_data
1082: p_count => x_msg_count,
1083: p_data => x_msg_data
1084: );
1085:
1086: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1087: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1088: FND_MSG_PUB.Count_And_Get
1089: (
1090: p_count => x_msg_count,
1083: p_data => x_msg_data
1084: );
1085:
1086: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1087: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1088: FND_MSG_PUB.Count_And_Get
1089: (
1090: p_count => x_msg_count,
1091: p_data => x_msg_data
1097: fnd_message.set_token('P_SQLERRM',SQLERRM);
1098: fnd_message.set_token('P_API_NAME',l_api_name);
1099: FND_MSG_PUB.add;
1100:
1101: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1102: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
1103: FND_MSG_PUB.Add_Exc_Msg
1104: (
1105: G_PKG_NAME,
1185: l_avail_resource JTF_ASSIGN_PUB.Avail_tbl_type;
1186: l_temp_count NUMBER := 0;
1187: BEGIN
1188: -- initialize the variables
1189: x_return_status := fnd_api.g_ret_sts_success;
1190: l_current_rec := 0;
1191: l_resources_tbl.delete;
1192: JTF_ASSIGN_PUB.g_resource_avail.delete;
1193:
1302:
1303: -- set back the API name to original name
1304: l_api_name := l_api_name_1;
1305:
1306: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
1307: -- Unexpected Execution Error from call to Calendar
1308: fnd_message.set_name('JTF', 'JTF_AM_ERROR_CAL_API');
1309: fnd_msg_pub.add;
1310: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
1306: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
1307: -- Unexpected Execution Error from call to Calendar
1308: fnd_message.set_name('JTF', 'JTF_AM_ERROR_CAL_API');
1309: fnd_msg_pub.add;
1310: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
1311: -- 12/22/05 ** MPADHIAR ** Manas padhiary **
1312: -- Removed Comment to Show error message Bug # 2919389
1313: RAISE fnd_api.g_exc_error;
1314: ELSE
1309: fnd_msg_pub.add;
1310: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
1311: -- 12/22/05 ** MPADHIAR ** Manas padhiary **
1312: -- Removed Comment to Show error message Bug # 2919389
1313: RAISE fnd_api.g_exc_error;
1314: ELSE
1315: RAISE fnd_api.g_exc_unexpected_error;
1316: END IF;
1317: END IF;
1311: -- 12/22/05 ** MPADHIAR ** Manas padhiary **
1312: -- Removed Comment to Show error message Bug # 2919389
1313: RAISE fnd_api.g_exc_error;
1314: ELSE
1315: RAISE fnd_api.g_exc_unexpected_error;
1316: END IF;
1317: END IF;
1318:
1319: -- Put the records into the PL/SQL Table.
1472: --dbms_output.put_line('Slots are ...'||to_char(x_assign_resources_tbl(l_current_rec).resource_id)||'...'||to_char(l_x_planned_end_date, 'DD-MON-YYYY HH24:MI'));
1473: -- set back the API name to original name
1474: l_api_name := l_api_name_1;
1475:
1476: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
1477: -- Unexpected Execution Error from call to Calendar
1478: fnd_message.set_name('JTF', 'JTF_AM_ERROR_CAL_API');
1479: fnd_msg_pub.add;
1480: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
1476: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
1477: -- Unexpected Execution Error from call to Calendar
1478: fnd_message.set_name('JTF', 'JTF_AM_ERROR_CAL_API');
1479: fnd_msg_pub.add;
1480: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
1481: -- 12/22/05 ** MPADHIAR ** Manas padhiary **
1482: -- Removed Comment to Show error message Bug # 2919389
1483: RAISE fnd_api.g_exc_error;
1484:
1479: fnd_msg_pub.add;
1480: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
1481: -- 12/22/05 ** MPADHIAR ** Manas padhiary **
1482: -- Removed Comment to Show error message Bug # 2919389
1483: RAISE fnd_api.g_exc_error;
1484:
1485: ELSE
1486: RAISE fnd_api.g_exc_unexpected_error;
1487: END IF;
1482: -- Removed Comment to Show error message Bug # 2919389
1483: RAISE fnd_api.g_exc_error;
1484:
1485: ELSE
1486: RAISE fnd_api.g_exc_unexpected_error;
1487: END IF;
1488: END IF;
1489: if(l_x_shift_construct_id is not null)
1490: then
1583: --Added for Bug # 5573916 Ends here
1584: END IF; -- if x_assign_resurces_tbl count > 0 check
1585:
1586: EXCEPTION
1587: WHEN FND_API.G_EXC_ERROR THEN
1588: x_return_status := FND_API.G_RET_STS_ERROR ;
1589: FND_MSG_PUB.Count_And_Get
1590: (
1591: p_count => x_msg_count,
1584: END IF; -- if x_assign_resurces_tbl count > 0 check
1585:
1586: EXCEPTION
1587: WHEN FND_API.G_EXC_ERROR THEN
1588: x_return_status := FND_API.G_RET_STS_ERROR ;
1589: FND_MSG_PUB.Count_And_Get
1590: (
1591: p_count => x_msg_count,
1592: p_data => x_msg_data
1591: p_count => x_msg_count,
1592: p_data => x_msg_data
1593: );
1594:
1595: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1596: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1597: FND_MSG_PUB.Count_And_Get
1598: (
1599: p_count => x_msg_count,
1592: p_data => x_msg_data
1593: );
1594:
1595: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1596: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1597: FND_MSG_PUB.Count_And_Get
1598: (
1599: p_count => x_msg_count,
1600: p_data => x_msg_data
1606: fnd_message.set_token('P_SQLERRM',SQLERRM);
1607: fnd_message.set_token('P_API_NAME',l_api_name);
1608: FND_MSG_PUB.add;
1609:
1610: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1611: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
1612: FND_MSG_PUB.Add_Exc_Msg
1613: (
1614: G_PKG_NAME,
1709: l_excl_record NUMBER := 0;
1710:
1711: BEGIN
1712:
1713: x_return_status := fnd_api.g_ret_sts_success;
1714:
1715: OPEN cur_contracts_installed;
1716: FETCH cur_contracts_installed INTO l_cur_contracts_installed;
1717: CLOSE cur_contracts_installed;
1724:
1725: IF (l_cur_contracts_installed.application_id IS NULL) THEN
1726: fnd_message.set_name('JTF', 'JTF_AM_CONTRACTS_NOT_INSTALLED');
1727: fnd_msg_pub.add;
1728: RAISE fnd_api.g_exc_error;
1729: ELSE
1730:
1731: IF FND_INSTALLATION.GET
1732: (
1737: ) THEN
1738: IF ( UPPER(l_status) <> 'I' ) THEN
1739: fnd_message.set_name('JTF', 'JTF_AM_CONTRACTS_NOT_INSTALLED');
1740: fnd_msg_pub.add;
1741: RAISE fnd_api.g_exc_error;
1742: END IF;
1743: ELSE
1744: fnd_message.set_name('JTF', 'JTF_AM_CONTRACTS_NOT_INSTALLED');
1745: fnd_msg_pub.add;
1742: END IF;
1743: ELSE
1744: fnd_message.set_name('JTF', 'JTF_AM_CONTRACTS_NOT_INSTALLED');
1745: fnd_msg_pub.add;
1746: RAISE fnd_api.g_exc_error;
1747: END IF;
1748: END IF;
1749:
1750: IF(x_excluded_tbl.count > 0)
1795: :5 := l_msg_data;
1796: :6 := l_return_status;
1797:
1798:
1799: IF NOT (l_return_status = fnd_api.g_ret_sts_success) THEN
1800: -- Unexpected Execution Error from call to Contracts API
1801: fnd_message.set_name('||''''||'JTF'||''''||','||''''||'JTF_AM_ERROR_CONTRACTS_API'||''''||');'||
1802: 'fnd_msg_pub.add;
1803: IF (l_return_status = fnd_api.g_ret_sts_error) THEN
1799: IF NOT (l_return_status = fnd_api.g_ret_sts_success) THEN
1800: -- Unexpected Execution Error from call to Contracts API
1801: fnd_message.set_name('||''''||'JTF'||''''||','||''''||'JTF_AM_ERROR_CONTRACTS_API'||''''||');'||
1802: 'fnd_msg_pub.add;
1803: IF (l_return_status = fnd_api.g_ret_sts_error) THEN
1804: RAISE fnd_api.g_exc_error;
1805: ELSE
1806: RAISE fnd_api.g_exc_unexpected_error;
1807: END IF;
1800: -- Unexpected Execution Error from call to Contracts API
1801: fnd_message.set_name('||''''||'JTF'||''''||','||''''||'JTF_AM_ERROR_CONTRACTS_API'||''''||');'||
1802: 'fnd_msg_pub.add;
1803: IF (l_return_status = fnd_api.g_ret_sts_error) THEN
1804: RAISE fnd_api.g_exc_error;
1805: ELSE
1806: RAISE fnd_api.g_exc_unexpected_error;
1807: END IF;
1808: END IF;
1802: 'fnd_msg_pub.add;
1803: IF (l_return_status = fnd_api.g_ret_sts_error) THEN
1804: RAISE fnd_api.g_exc_error;
1805: ELSE
1806: RAISE fnd_api.g_exc_unexpected_error;
1807: END IF;
1808: END IF;
1809:
1810: /* Procedure for Copying out the TABLE contents
2002:
2003: -- set back the API name to original name
2004: l_api_name := l_api_name_1;
2005:
2006: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
2007: -- Unexpected Execution Error from call to Get_contracts_resources
2008: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
2009: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
2010: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_CONTRACTS_RESOURCES');
2008: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
2009: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
2010: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_CONTRACTS_RESOURCES');
2011: fnd_msg_pub.add;
2012: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
2013: RAISE fnd_api.g_exc_error;
2014: ELSE
2015: RAISE fnd_api.g_exc_unexpected_error;
2016: END IF;
2009: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
2010: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_CONTRACTS_RESOURCES');
2011: fnd_msg_pub.add;
2012: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
2013: RAISE fnd_api.g_exc_error;
2014: ELSE
2015: RAISE fnd_api.g_exc_unexpected_error;
2016: END IF;
2017: END IF; -- end of x_return_status check
2011: fnd_msg_pub.add;
2012: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
2013: RAISE fnd_api.g_exc_error;
2014: ELSE
2015: RAISE fnd_api.g_exc_unexpected_error;
2016: END IF;
2017: END IF; -- end of x_return_status check
2018: -- end if; -- if p_calendar_flag = Y
2019: end if; --l_preferred_engineers_tbl.COUNT > 0
2019: end if; --l_preferred_engineers_tbl.COUNT > 0
2020:
2021:
2022: EXCEPTION
2023: WHEN FND_API.G_EXC_ERROR THEN
2024: x_return_status := FND_API.G_RET_STS_ERROR ;
2025: FND_MSG_PUB.Count_And_Get
2026: (
2027: p_count => x_msg_count,
2020:
2021:
2022: EXCEPTION
2023: WHEN FND_API.G_EXC_ERROR THEN
2024: x_return_status := FND_API.G_RET_STS_ERROR ;
2025: FND_MSG_PUB.Count_And_Get
2026: (
2027: p_count => x_msg_count,
2028: p_data => x_msg_data
2027: p_count => x_msg_count,
2028: p_data => x_msg_data
2029: );
2030:
2031: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2032: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2033: FND_MSG_PUB.Count_And_Get
2034: (
2035: p_count => x_msg_count,
2028: p_data => x_msg_data
2029: );
2030:
2031: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2032: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2033: FND_MSG_PUB.Count_And_Get
2034: (
2035: p_count => x_msg_count,
2036: p_data => x_msg_data
2042: fnd_message.set_token('P_SQLERRM',SQLERRM);
2043: fnd_message.set_token('P_API_NAME',l_api_name);
2044: FND_MSG_PUB.add;
2045:
2046: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2047: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
2048: FND_MSG_PUB.Add_Exc_Msg
2049: (
2050: G_PKG_NAME,
2173:
2174:
2175: BEGIN
2176:
2177: x_return_status := fnd_api.g_ret_sts_success;
2178:
2179: l_pref_record := 0;
2180:
2181: -- added by sudarsana on 30th nov 2001
2444:
2445: -- set back the API name to original name
2446: l_api_name := l_api_name_1;
2447:
2448: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
2449: -- Unexpected Execution Error from call to Get_contracts_resources
2450: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
2451: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
2452: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_IB_RESOURCES');
2450: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
2451: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
2452: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_IB_RESOURCES');
2453: fnd_msg_pub.add;
2454: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
2455: RAISE fnd_api.g_exc_error;
2456: ELSE
2457: RAISE fnd_api.g_exc_unexpected_error;
2458: END IF;
2451: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
2452: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_IB_RESOURCES');
2453: fnd_msg_pub.add;
2454: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
2455: RAISE fnd_api.g_exc_error;
2456: ELSE
2457: RAISE fnd_api.g_exc_unexpected_error;
2458: END IF;
2459: END IF; -- end of x_return_status check
2453: fnd_msg_pub.add;
2454: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
2455: RAISE fnd_api.g_exc_error;
2456: ELSE
2457: RAISE fnd_api.g_exc_unexpected_error;
2458: END IF;
2459: END IF; -- end of x_return_status check
2460: -- end if; -- end if p_calendar_flag
2461: end if; --l_preferred_engineers_tbl.COUNT > 0
2461: end if; --l_preferred_engineers_tbl.COUNT > 0
2462:
2463:
2464: EXCEPTION
2465: WHEN FND_API.G_EXC_ERROR THEN
2466: x_return_status := FND_API.G_RET_STS_ERROR ;
2467: FND_MSG_PUB.Count_And_Get
2468: (
2469: p_count => x_msg_count,
2462:
2463:
2464: EXCEPTION
2465: WHEN FND_API.G_EXC_ERROR THEN
2466: x_return_status := FND_API.G_RET_STS_ERROR ;
2467: FND_MSG_PUB.Count_And_Get
2468: (
2469: p_count => x_msg_count,
2470: p_data => x_msg_data
2469: p_count => x_msg_count,
2470: p_data => x_msg_data
2471: );
2472:
2473: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2474: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2475: FND_MSG_PUB.Count_And_Get
2476: (
2477: p_count => x_msg_count,
2470: p_data => x_msg_data
2471: );
2472:
2473: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2474: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2475: FND_MSG_PUB.Count_And_Get
2476: (
2477: p_count => x_msg_count,
2478: p_data => x_msg_data
2484: fnd_message.set_token('P_SQLERRM',SQLERRM);
2485: fnd_message.set_token('P_API_NAME',l_api_name);
2486: FND_MSG_PUB.add;
2487:
2488: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2489: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
2490: FND_MSG_PUB.Add_Exc_Msg
2491: (
2492: G_PKG_NAME,
2517: -- Parameters :
2518:
2519: -- IN : p_api_version IN NUMBER Required
2520: -- p_init_msg_list IN VARCHAR2 Optional
2521: -- DEFAULT = FND_API.G_FALSE
2522: -- p_commit IN VARCHAR2 optional
2523: -- DEFAULT = FND_API.G_FALSE
2524:
2525: -- Assignment Manager Specific Parameters
2519: -- IN : p_api_version IN NUMBER Required
2520: -- p_init_msg_list IN VARCHAR2 Optional
2521: -- DEFAULT = FND_API.G_FALSE
2522: -- p_commit IN VARCHAR2 optional
2523: -- DEFAULT = FND_API.G_FALSE
2524:
2525: -- Assignment Manager Specific Parameters
2526:
2527: -- This determines the Resource Type required by the
2753:
2754:
2755: /* Standard call to check for call compatibility */
2756:
2757: IF NOT fnd_api.compatible_api_call (l_api_version,
2758: p_api_version,
2759: l_api_name,
2760: g_pkg_name) THEN
2761: RAISE fnd_api.g_exc_unexpected_error;
2757: IF NOT fnd_api.compatible_api_call (l_api_version,
2758: p_api_version,
2759: l_api_name,
2760: g_pkg_name) THEN
2761: RAISE fnd_api.g_exc_unexpected_error;
2762: END IF;
2763:
2764:
2765: /* Initialize message list if p_init_msg_list is set to TRUE */
2763:
2764:
2765: /* Initialize message list if p_init_msg_list is set to TRUE */
2766:
2767: IF fnd_api.to_boolean (p_init_msg_list) THEN
2768: fnd_msg_pub.initialize;
2769: END IF;
2770:
2771: x_return_status := fnd_api.g_ret_sts_success;
2767: IF fnd_api.to_boolean (p_init_msg_list) THEN
2768: fnd_msg_pub.initialize;
2769: END IF;
2770:
2771: x_return_status := fnd_api.g_ret_sts_success;
2772:
2773:
2774:
2775: /* Get TASK source and the related information for contracts and
2783: FETCH cur_task_id INTO l_cur_task_id;
2784: IF ( cur_task_id%NOTFOUND ) THEN
2785: fnd_message.set_name('JTF', 'JTF_AM_INVALID_TASK_ID');
2786: fnd_msg_pub.add;
2787: RAISE fnd_api.g_exc_error;
2788: ELSE
2789: l_task_source_code := l_cur_task_id.source_object_type_code;
2790: l_task_source_id := l_cur_task_id.source_object_id;
2791: l_planned_start_date := l_cur_task_id.planned_start_date;
2821:
2822: IF ( cur_cs_incidents%NOTFOUND ) THEN
2823: fnd_message.set_name('JTF', 'JTF_AM_INVALID_SR_ID');
2824: fnd_msg_pub.add;
2825: RAISE fnd_api.g_exc_error;
2826: ELSE
2827: l_contract_flag := 'Y';
2828: l_planned_start_date := SYSDATE;
2829: END IF;
2883: p_calendar_check => p_calendar_check
2884: --Added for Bug # 5573916 Ends here
2885: );
2886:
2887: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
2888: -- Unexpected Execution Error from call to Get_contracts_resources
2889: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
2890: fnd_message.set_token('P_PROC_NAME','GET_CONTRACTS_RESOURCES');
2891: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_TASK_RESOURCES');
2889: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
2890: fnd_message.set_token('P_PROC_NAME','GET_CONTRACTS_RESOURCES');
2891: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_TASK_RESOURCES');
2892: fnd_msg_pub.add;
2893: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
2894: RAISE fnd_api.g_exc_error;
2895: ELSE
2896: RAISE fnd_api.g_exc_unexpected_error;
2897: END IF;
2890: fnd_message.set_token('P_PROC_NAME','GET_CONTRACTS_RESOURCES');
2891: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_TASK_RESOURCES');
2892: fnd_msg_pub.add;
2893: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
2894: RAISE fnd_api.g_exc_error;
2895: ELSE
2896: RAISE fnd_api.g_exc_unexpected_error;
2897: END IF;
2898: END IF;
2892: fnd_msg_pub.add;
2893: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
2894: RAISE fnd_api.g_exc_error;
2895: ELSE
2896: RAISE fnd_api.g_exc_unexpected_error;
2897: END IF;
2898: END IF;
2899:
2900: END IF; -- p_contracts_preferred_engineer = 'Y'
2925: p_calendar_check => p_calendar_check
2926: --Added for Bug # 5573916 Ends here
2927: );
2928:
2929: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
2930: -- Unexpected Execution Error from call to Get_contracts_resources
2931: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
2932: fnd_message.set_token('P_PROC_NAME','GET_IB_RESOURCES');
2933: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_TASK_RESOURCES');
2931: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
2932: fnd_message.set_token('P_PROC_NAME','GET_IB_RESOURCES');
2933: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_TASK_RESOURCES');
2934: fnd_msg_pub.add;
2935: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
2936: RAISE fnd_api.g_exc_error;
2937: ELSE
2938: RAISE fnd_api.g_exc_unexpected_error;
2939: END IF;
2932: fnd_message.set_token('P_PROC_NAME','GET_IB_RESOURCES');
2933: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_TASK_RESOURCES');
2934: fnd_msg_pub.add;
2935: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
2936: RAISE fnd_api.g_exc_error;
2937: ELSE
2938: RAISE fnd_api.g_exc_unexpected_error;
2939: END IF;
2940: END IF;
2934: fnd_msg_pub.add;
2935: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
2936: RAISE fnd_api.g_exc_error;
2937: ELSE
2938: RAISE fnd_api.g_exc_unexpected_error;
2939: END IF;
2940: END IF;
2941:
2942: END IF; -- p_ib_preferred_engineer = 'Y'
2990:
2991: IF (l_task_source_code = 'SR') THEN
2992: fnd_message.set_name('JTF', 'JTF_AM_TASK_CREATED_BY_SR');
2993: fnd_msg_pub.add;
2994: RAISE fnd_api.g_exc_error;
2995:
2996: /* Query the View which is a combination of Task and Service Request
2997: to get the data into the Record Type to pass it to the Territory API */
2998:
3042:
3043: -- set back the API name to original name
3044: l_api_name := l_api_name_1;
3045:
3046: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
3047: -- Unexpected Execution Error from call to Territory Manager
3048: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
3049: fnd_msg_pub.add;
3050: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3046: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
3047: -- Unexpected Execution Error from call to Territory Manager
3048: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
3049: fnd_msg_pub.add;
3050: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3051: RAISE fnd_api.g_exc_error;
3052: ELSE
3053: RAISE fnd_api.g_exc_unexpected_error;
3054: END IF;
3047: -- Unexpected Execution Error from call to Territory Manager
3048: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
3049: fnd_msg_pub.add;
3050: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3051: RAISE fnd_api.g_exc_error;
3052: ELSE
3053: RAISE fnd_api.g_exc_unexpected_error;
3054: END IF;
3055: END IF;
3049: fnd_msg_pub.add;
3050: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3051: RAISE fnd_api.g_exc_error;
3052: ELSE
3053: RAISE fnd_api.g_exc_unexpected_error;
3054: END IF;
3055: END IF;
3056: -- added 2 april 2003 by sudarsana to conver RS_SUPPLIER TO RS_SUPPLIER_CONTACT
3057: IF(l_assign_resources_tbl.COUNT > 0)
3145:
3146: -- set back the API name to original name
3147: l_api_name := l_api_name_1;
3148:
3149: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
3150: -- Unexpected Execution Error from call to Get_contracts_resources
3151: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
3152: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
3153: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_TASK_RESOURCES');
3151: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
3152: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
3153: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_TASK_RESOURCES');
3154: fnd_msg_pub.add;
3155: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3156: RAISE fnd_api.g_exc_error;
3157: ELSE
3158: RAISE fnd_api.g_exc_unexpected_error;
3159: END IF;
3152: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
3153: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_TASK_RESOURCES');
3154: fnd_msg_pub.add;
3155: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3156: RAISE fnd_api.g_exc_error;
3157: ELSE
3158: RAISE fnd_api.g_exc_unexpected_error;
3159: END IF;
3160: END IF; -- end of x_return_status check
3154: fnd_msg_pub.add;
3155: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3156: RAISE fnd_api.g_exc_error;
3157: ELSE
3158: RAISE fnd_api.g_exc_unexpected_error;
3159: END IF;
3160: END IF; -- end of x_return_status check
3161: -- end if; -- if p_calendar_flag = Y
3162:
3163: IF ( p_calendar_flag = 'Y' AND
3164: x_assign_resources_tbl.count = 0 ) THEN
3165: fnd_message.set_name('JTF', 'JTF_AM_RESOURCE_NOT_AVAILABLE');
3166: fnd_msg_pub.add;
3167: -- RAISE fnd_api.g_exc_error;
3168: END IF;
3169:
3170: -- remove excluded resources
3171: IF(p_filter_excluded_resource = 'Y')
3176:
3177: ELSE -- No resources returned from the Territory API
3178: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
3179: fnd_msg_pub.add;
3180: -- RAISE fnd_api.g_exc_error;
3181: END IF;
3182:
3183: ELSE -- Territory Flag is NO
3184: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
3182:
3183: ELSE -- Territory Flag is NO
3184: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
3185: fnd_msg_pub.add;
3186: -- RAISE fnd_api.g_exc_error;
3187: END IF;
3188:
3189: ELSE -- l_task_source_code <> 'SR'
3190:
3258:
3259: -- set back the API name to original name
3260: l_api_name := l_api_name_1;
3261:
3262: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
3263: -- Unexpected Execution Error from call to Territory Manager for TASKS
3264: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
3265: fnd_msg_pub.add;
3266: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3262: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
3263: -- Unexpected Execution Error from call to Territory Manager for TASKS
3264: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
3265: fnd_msg_pub.add;
3266: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3267: RAISE fnd_api.g_exc_error;
3268: ELSE
3269: RAISE fnd_api.g_exc_unexpected_error;
3270: END IF;
3263: -- Unexpected Execution Error from call to Territory Manager for TASKS
3264: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
3265: fnd_msg_pub.add;
3266: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3267: RAISE fnd_api.g_exc_error;
3268: ELSE
3269: RAISE fnd_api.g_exc_unexpected_error;
3270: END IF;
3271: END IF;
3265: fnd_msg_pub.add;
3266: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3267: RAISE fnd_api.g_exc_error;
3268: ELSE
3269: RAISE fnd_api.g_exc_unexpected_error;
3270: END IF;
3271: END IF;
3272:
3273:
3362:
3363: -- set back the API name to original name
3364: l_api_name := l_api_name_1;
3365:
3366: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
3367: -- Unexpected Execution Error from call to Get_contracts_resources
3368: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
3369: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
3370: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_TASK_RESOURCES');
3368: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
3369: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
3370: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_TASK_RESOURCES');
3371: fnd_msg_pub.add;
3372: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3373: RAISE fnd_api.g_exc_error;
3374: ELSE
3375: RAISE fnd_api.g_exc_unexpected_error;
3376: END IF;
3369: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
3370: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_TASK_RESOURCES');
3371: fnd_msg_pub.add;
3372: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3373: RAISE fnd_api.g_exc_error;
3374: ELSE
3375: RAISE fnd_api.g_exc_unexpected_error;
3376: END IF;
3377: END IF; -- end of x_return_status check
3371: fnd_msg_pub.add;
3372: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3373: RAISE fnd_api.g_exc_error;
3374: ELSE
3375: RAISE fnd_api.g_exc_unexpected_error;
3376: END IF;
3377: END IF; -- end of x_return_status check
3378: -- end if; -- if p_calendar_flag = Y
3379:
3380: IF ( p_calendar_flag = 'Y' AND
3381: x_assign_resources_tbl.count = 0 ) THEN
3382: fnd_message.set_name('JTF', 'JTF_AM_RESOURCE_NOT_AVAILABLE');
3383: fnd_msg_pub.add;
3384: -- RAISE fnd_api.g_exc_error;
3385: END IF;
3386:
3387: ELSE -- No resources returned from the Territory API
3388: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
3386:
3387: ELSE -- No resources returned from the Territory API
3388: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
3389: fnd_msg_pub.add;
3390: -- RAISE fnd_api.g_exc_error;
3391: END IF;
3392:
3393: ELSE -- Territory Flag is NO
3394:
3504:
3505:
3506:
3507: EXCEPTION
3508: WHEN FND_API.G_EXC_ERROR THEN
3509: x_return_status := FND_API.G_RET_STS_ERROR ;
3510: FND_MSG_PUB.Count_And_Get
3511: (
3512: p_count => x_msg_count,
3505:
3506:
3507: EXCEPTION
3508: WHEN FND_API.G_EXC_ERROR THEN
3509: x_return_status := FND_API.G_RET_STS_ERROR ;
3510: FND_MSG_PUB.Count_And_Get
3511: (
3512: p_count => x_msg_count,
3513: p_data => x_msg_data
3512: p_count => x_msg_count,
3513: p_data => x_msg_data
3514: );
3515:
3516: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3517: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3518: FND_MSG_PUB.Count_And_Get
3519: (
3520: p_count => x_msg_count,
3513: p_data => x_msg_data
3514: );
3515:
3516: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3517: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3518: FND_MSG_PUB.Count_And_Get
3519: (
3520: p_count => x_msg_count,
3521: p_data => x_msg_data
3526: fnd_message.set_token('P_SQLCODE',SQLCODE);
3527: fnd_message.set_token('P_SQLERRM',SQLERRM);
3528: fnd_message.set_token('P_API_NAME',l_api_name);
3529: FND_MSG_PUB.add;
3530: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3531: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
3532: FND_MSG_PUB.Add_Exc_Msg
3533: (
3534: G_PKG_NAME,
3561: -- Parameters :
3562:
3563: -- IN : p_api_version IN NUMBER Required
3564: -- p_init_msg_list IN VARCHAR2 Optional
3565: -- DEFAULT = FND_API.G_FALSE
3566: -- p_commit IN VARCHAR2 optional
3567: -- DEFAULT = FND_API.G_FALSE
3568:
3569: -- Assignment Manager Specific Parameters
3563: -- IN : p_api_version IN NUMBER Required
3564: -- p_init_msg_list IN VARCHAR2 Optional
3565: -- DEFAULT = FND_API.G_FALSE
3566: -- p_commit IN VARCHAR2 optional
3567: -- DEFAULT = FND_API.G_FALSE
3568:
3569: -- Assignment Manager Specific Parameters
3570:
3571: -- This determines the Resource Type required by the
3802:
3803:
3804: /* Standard call to check for call compatibility */
3805:
3806: IF NOT fnd_api.compatible_api_call (l_api_version,
3807: p_api_version,
3808: l_api_name,
3809: g_pkg_name) THEN
3810: RAISE fnd_api.g_exc_unexpected_error;
3806: IF NOT fnd_api.compatible_api_call (l_api_version,
3807: p_api_version,
3808: l_api_name,
3809: g_pkg_name) THEN
3810: RAISE fnd_api.g_exc_unexpected_error;
3811: END IF;
3812:
3813: /* Initialize message list if p_init_msg_list is set to TRUE */
3814:
3811: END IF;
3812:
3813: /* Initialize message list if p_init_msg_list is set to TRUE */
3814:
3815: IF fnd_api.to_boolean (p_init_msg_list) THEN
3816: fnd_msg_pub.initialize;
3817: END IF;
3818:
3819:
3816: fnd_msg_pub.initialize;
3817: END IF;
3818:
3819:
3820: x_return_status := fnd_api.g_ret_sts_success;
3821:
3822:
3823: IF ( UPPER(p_resource_type) = 'RS_INDIVIDUAL') THEN
3824: l_p_resource_type := 'RS_INDIVIDUAL';
3900:
3901: IF ( cur_cs_incidents%NOTFOUND ) THEN
3902: fnd_message.set_name('JTF', 'JTF_AM_INVALID_SR_ID');
3903: fnd_msg_pub.add;
3904: RAISE fnd_api.g_exc_error;
3905: /*
3906: ELSE
3907: l_contract_flag := 'Y';
3908: */
3955: p_calendar_check => p_calendar_check
3956: --Added for Bug # 5573916 Ends here
3957: );
3958:
3959: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
3960: -- Unexpected Execution Error from call to Get_contracts_resources
3961: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
3962: fnd_message.set_token('P_PROC_NAME','GET_CONTRACTS_RESOURCES');
3963: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
3961: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
3962: fnd_message.set_token('P_PROC_NAME','GET_CONTRACTS_RESOURCES');
3963: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
3964: fnd_msg_pub.add;
3965: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3966: RAISE fnd_api.g_exc_error;
3967: ELSE
3968: RAISE fnd_api.g_exc_unexpected_error;
3969: END IF;
3962: fnd_message.set_token('P_PROC_NAME','GET_CONTRACTS_RESOURCES');
3963: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
3964: fnd_msg_pub.add;
3965: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3966: RAISE fnd_api.g_exc_error;
3967: ELSE
3968: RAISE fnd_api.g_exc_unexpected_error;
3969: END IF;
3970: END IF;
3964: fnd_msg_pub.add;
3965: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
3966: RAISE fnd_api.g_exc_error;
3967: ELSE
3968: RAISE fnd_api.g_exc_unexpected_error;
3969: END IF;
3970: END IF;
3971: END IF;
3972:
3992: p_calendar_check => p_calendar_check
3993: --Added for Bug # 5573916 Ends here
3994: );
3995:
3996: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
3997: -- Unexpected Execution Error from call to Get_contracts_resources
3998: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
3999: fnd_message.set_token('P_PROC_NAME','GET_IB_RESOURCES');
4000: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
3998: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
3999: fnd_message.set_token('P_PROC_NAME','GET_IB_RESOURCES');
4000: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
4001: fnd_msg_pub.add;
4002: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4003: RAISE fnd_api.g_exc_error;
4004: ELSE
4005: RAISE fnd_api.g_exc_unexpected_error;
4006: END IF;
3999: fnd_message.set_token('P_PROC_NAME','GET_IB_RESOURCES');
4000: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
4001: fnd_msg_pub.add;
4002: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4003: RAISE fnd_api.g_exc_error;
4004: ELSE
4005: RAISE fnd_api.g_exc_unexpected_error;
4006: END IF;
4007: END IF;
4001: fnd_msg_pub.add;
4002: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4003: RAISE fnd_api.g_exc_error;
4004: ELSE
4005: RAISE fnd_api.g_exc_unexpected_error;
4006: END IF;
4007: END IF;
4008:
4009: END IF; -- p_ib_preferred_engineer = 'Y'
4034: x_return_status =>x_return_status ,
4035: x_msg_count =>x_msg_count,
4036: x_msg_data =>x_msg_data);
4037:
4038: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
4039: -- Unexpected Execution Error from call to Get_contracts_resources
4040: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
4041: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
4042: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
4040: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
4041: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
4042: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
4043: fnd_msg_pub.add;
4044: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4045: RAISE fnd_api.g_exc_error;
4046: ELSE
4047: RAISE fnd_api.g_exc_unexpected_error;
4048: END IF;
4041: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
4042: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
4043: fnd_msg_pub.add;
4044: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4045: RAISE fnd_api.g_exc_error;
4046: ELSE
4047: RAISE fnd_api.g_exc_unexpected_error;
4048: END IF;
4049: END IF;
4043: fnd_msg_pub.add;
4044: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4045: RAISE fnd_api.g_exc_error;
4046: ELSE
4047: RAISE fnd_api.g_exc_unexpected_error;
4048: END IF;
4049: END IF;
4050:
4051: end IF; -- end of security check for contracts resource
4059: x_return_status =>x_return_status ,
4060: x_msg_count =>x_msg_count,
4061: x_msg_data =>x_msg_data);
4062:
4063: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
4064: -- Unexpected Execution Error from call to Get_contracts_resources
4065: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
4066: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
4067: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
4065: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
4066: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
4067: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
4068: fnd_msg_pub.add;
4069: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4070: RAISE fnd_api.g_exc_error;
4071: ELSE
4072: RAISE fnd_api.g_exc_unexpected_error;
4073: END IF;
4066: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
4067: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
4068: fnd_msg_pub.add;
4069: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4070: RAISE fnd_api.g_exc_error;
4071: ELSE
4072: RAISE fnd_api.g_exc_unexpected_error;
4073: END IF;
4074: END IF;
4068: fnd_msg_pub.add;
4069: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4070: RAISE fnd_api.g_exc_error;
4071: ELSE
4072: RAISE fnd_api.g_exc_unexpected_error;
4073: END IF;
4074: END IF;
4075:
4076: end IF; -- end of security check for contracts resource
4241:
4242: -- set back the API name to original name
4243: l_api_name := l_api_name_1;
4244:
4245: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
4246: -- Unexpected Execution Error from call to Territory Manager
4247: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
4248: fnd_msg_pub.add;
4249: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4245: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
4246: -- Unexpected Execution Error from call to Territory Manager
4247: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
4248: fnd_msg_pub.add;
4249: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4250: RAISE fnd_api.g_exc_error;
4251: ELSE
4252: RAISE fnd_api.g_exc_unexpected_error;
4253: END IF;
4246: -- Unexpected Execution Error from call to Territory Manager
4247: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
4248: fnd_msg_pub.add;
4249: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4250: RAISE fnd_api.g_exc_error;
4251: ELSE
4252: RAISE fnd_api.g_exc_unexpected_error;
4253: END IF;
4254: END IF;
4248: fnd_msg_pub.add;
4249: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4250: RAISE fnd_api.g_exc_error;
4251: ELSE
4252: RAISE fnd_api.g_exc_unexpected_error;
4253: END IF;
4254: END IF;
4255:
4256: -- added 2 april 2003 by sudarsana to convert RS_SUPPLIER TO RS_SUPPLIER_CONTACT
4367: l_api_name := l_api_name_1;
4368:
4369: -- dbms_output.put_line('Count of TM :: '||l_assign_resources_tbl.count);
4370:
4371: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
4372: -- Unexpected Execution Error from call to Territory Manager
4373: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
4374: fnd_msg_pub.add;
4375: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4371: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
4372: -- Unexpected Execution Error from call to Territory Manager
4373: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
4374: fnd_msg_pub.add;
4375: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4376: RAISE fnd_api.g_exc_error;
4377: ELSE
4378: RAISE fnd_api.g_exc_unexpected_error;
4379: END IF;
4372: -- Unexpected Execution Error from call to Territory Manager
4373: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
4374: fnd_msg_pub.add;
4375: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4376: RAISE fnd_api.g_exc_error;
4377: ELSE
4378: RAISE fnd_api.g_exc_unexpected_error;
4379: END IF;
4380: END IF;
4374: fnd_msg_pub.add;
4375: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4376: RAISE fnd_api.g_exc_error;
4377: ELSE
4378: RAISE fnd_api.g_exc_unexpected_error;
4379: END IF;
4380: END IF;
4381:
4382: -- added 2 april 2003 by sudarsana to conver RS_SUPPLIER TO RS_SUPPLIER_CONTACT
4483:
4484: -- set back the API name to original name
4485: l_api_name := l_api_name_1;
4486:
4487: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
4488: -- Unexpected Execution Error from call to Get_contracts_resources
4489: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
4490: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
4491: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
4489: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
4490: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
4491: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
4492: fnd_msg_pub.add;
4493: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4494: RAISE fnd_api.g_exc_error;
4495: ELSE
4496: RAISE fnd_api.g_exc_unexpected_error;
4497: END IF;
4490: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
4491: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
4492: fnd_msg_pub.add;
4493: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4494: RAISE fnd_api.g_exc_error;
4495: ELSE
4496: RAISE fnd_api.g_exc_unexpected_error;
4497: END IF;
4498: END IF; -- end of x_return_status check
4492: fnd_msg_pub.add;
4493: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4494: RAISE fnd_api.g_exc_error;
4495: ELSE
4496: RAISE fnd_api.g_exc_unexpected_error;
4497: END IF;
4498: END IF; -- end of x_return_status check
4499: -- end if; -- if p_calendar_flag = Y
4500:
4502: IF ( p_calendar_flag = 'Y' AND
4503: x_assign_resources_tbl.count = 0 ) THEN
4504: fnd_message.set_name('JTF', 'JTF_AM_RESOURCE_NOT_AVAILABLE');
4505: fnd_msg_pub.add;
4506: -- RAISE fnd_api.g_exc_error;
4507: END IF;
4508:
4509:
4510: -- remove excluded resources from territory qualifeid resource list
4525: x_return_status =>x_return_status ,
4526: x_msg_count =>x_msg_count,
4527: x_msg_data =>x_msg_data);
4528:
4529: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
4530: -- Unexpected Execution Error from call to Get_contracts_resources
4531: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
4532: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
4533: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
4531: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
4532: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
4533: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
4534: fnd_msg_pub.add;
4535: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4536: RAISE fnd_api.g_exc_error;
4537: ELSE
4538: RAISE fnd_api.g_exc_unexpected_error;
4539: END IF;
4532: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
4533: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
4534: fnd_msg_pub.add;
4535: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4536: RAISE fnd_api.g_exc_error;
4537: ELSE
4538: RAISE fnd_api.g_exc_unexpected_error;
4539: END IF;
4540: END IF;
4534: fnd_msg_pub.add;
4535: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
4536: RAISE fnd_api.g_exc_error;
4537: ELSE
4538: RAISE fnd_api.g_exc_unexpected_error;
4539: END IF;
4540: END IF;
4541: END IF; -- end of security check
4542: ELSE -- No resources returned from the Territory API
4542: ELSE -- No resources returned from the Territory API
4543:
4544: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
4545: fnd_msg_pub.add;
4546: -- RAISE fnd_api.g_exc_error;
4547: END IF;
4548:
4549:
4550: -- Logic for getting resources belonging to group id passed in
4860: x_msg_data => x_msg_data );
4861:
4862: -- set back the API name to original name
4863: l_api_name := l_api_name_1;
4864: if(l_skill_ret_sts <> fnd_api.g_ret_sts_success)
4865: then
4866: IF (l_skill_ret_sts = fnd_api.g_ret_sts_error) THEN
4867: RAISE fnd_api.g_exc_error;
4868: ELSE
4862: -- set back the API name to original name
4863: l_api_name := l_api_name_1;
4864: if(l_skill_ret_sts <> fnd_api.g_ret_sts_success)
4865: then
4866: IF (l_skill_ret_sts = fnd_api.g_ret_sts_error) THEN
4867: RAISE fnd_api.g_exc_error;
4868: ELSE
4869: RAISE fnd_api.g_exc_unexpected_error;
4870: END IF;
4863: l_api_name := l_api_name_1;
4864: if(l_skill_ret_sts <> fnd_api.g_ret_sts_success)
4865: then
4866: IF (l_skill_ret_sts = fnd_api.g_ret_sts_error) THEN
4867: RAISE fnd_api.g_exc_error;
4868: ELSE
4869: RAISE fnd_api.g_exc_unexpected_error;
4870: END IF;
4871: end if;
4865: then
4866: IF (l_skill_ret_sts = fnd_api.g_ret_sts_error) THEN
4867: RAISE fnd_api.g_exc_error;
4868: ELSE
4869: RAISE fnd_api.g_exc_unexpected_error;
4870: END IF;
4871: end if;
4872:
4873: -- End of enhancement
4886:
4887:
4888:
4889: EXCEPTION
4890: WHEN FND_API.G_EXC_ERROR THEN
4891: x_return_status := FND_API.G_RET_STS_ERROR ;
4892: FND_MSG_PUB.Count_And_Get
4893: (
4894: p_count => x_msg_count,
4887:
4888:
4889: EXCEPTION
4890: WHEN FND_API.G_EXC_ERROR THEN
4891: x_return_status := FND_API.G_RET_STS_ERROR ;
4892: FND_MSG_PUB.Count_And_Get
4893: (
4894: p_count => x_msg_count,
4895: p_data => x_msg_data
4894: p_count => x_msg_count,
4895: p_data => x_msg_data
4896: );
4897:
4898: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4899: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
4900: FND_MSG_PUB.Count_And_Get
4901: (
4902: p_count => x_msg_count,
4895: p_data => x_msg_data
4896: );
4897:
4898: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4899: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
4900: FND_MSG_PUB.Count_And_Get
4901: (
4902: p_count => x_msg_count,
4903: p_data => x_msg_data
4909: fnd_message.set_token('P_SQLERRM',SQLERRM);
4910: fnd_message.set_token('P_API_NAME',l_api_name);
4911: FND_MSG_PUB.add;
4912:
4913: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
4914: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
4915: FND_MSG_PUB.Add_Exc_Msg
4916: (
4917: G_PKG_NAME,
4945: -- Parameters :
4946:
4947: -- IN : p_api_version IN NUMBER Required
4948: -- p_init_msg_list IN VARCHAR2 Optional
4949: -- DEFAULT = FND_API.G_FALSE
4950:
4951: -- Assignment Manager Specific Parameters
4952:
4953: -- This determines the Resource Type required by the
5228: -- Started Assignment Manager Public API
5229:
5230: /* Standard call to check for call compatibility */
5231:
5232: IF NOT fnd_api.compatible_api_call (l_api_version,
5233: p_api_version,
5234: l_api_name,
5235: g_pkg_name) THEN
5236: RAISE fnd_api.g_exc_unexpected_error;
5232: IF NOT fnd_api.compatible_api_call (l_api_version,
5233: p_api_version,
5234: l_api_name,
5235: g_pkg_name) THEN
5236: RAISE fnd_api.g_exc_unexpected_error;
5237: END IF;
5238:
5239:
5240: /* Initialize message list if p_init_msg_list is set to TRUE */
5238:
5239:
5240: /* Initialize message list if p_init_msg_list is set to TRUE */
5241:
5242: IF fnd_api.to_boolean (p_init_msg_list) THEN
5243: fnd_msg_pub.initialize;
5244: END IF;
5245:
5246: x_return_status := fnd_api.g_ret_sts_success;
5242: IF fnd_api.to_boolean (p_init_msg_list) THEN
5243: fnd_msg_pub.initialize;
5244: END IF;
5245:
5246: x_return_status := fnd_api.g_ret_sts_success;
5247:
5248: /* Paramater Validation */
5249:
5250: IF (p_resource_type IS NOT NULL) THEN
5252: FETCH cur_resource_type INTO l_cur_resource_type;
5253: IF ( cur_resource_type%NOTFOUND) THEN
5254: fnd_message.set_name('JTF', 'JTF_AM_INVALID_RESOURCE_TYPE');
5255: fnd_msg_pub.add;
5256: RAISE fnd_api.g_exc_error;
5257: END IF;
5258: CLOSE cur_resource_type;
5259: END IF;
5260:
5335: l_effort_duration := p_effort_duration;
5336: END IF;
5337:
5338: /* This assigning is being done because of the limitation for
5339: the direct use of the variables FND_API.MISS_NUM, MISS_CHAR etc. */
5340:
5341:
5342: /* Assigning values to the Depot Repair Record Type */
5343:
5472:
5473: IF ( cur_cs_incidents%NOTFOUND ) THEN
5474: fnd_message.set_name('JTF', 'JTF_AM_INVALID_DR_ID');
5475: fnd_msg_pub.add;
5476: RAISE fnd_api.g_exc_error;
5477: END IF;
5478:
5479: CLOSE cur_cs_incidents;
5480:
5525: p_calendar_check => p_calendar_check
5526: --Added for Bug # 5573916 Ends here
5527: );
5528:
5529: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
5530: -- Unexpected Execution Error from call to Get_contracts_resources
5531: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
5532: fnd_message.set_token('P_PROC_NAME','GET_CONTRACTS_RESOURCES');
5533: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5531: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
5532: fnd_message.set_token('P_PROC_NAME','GET_CONTRACTS_RESOURCES');
5533: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5534: fnd_msg_pub.add;
5535: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5536: RAISE fnd_api.g_exc_error;
5537: ELSE
5538: RAISE fnd_api.g_exc_unexpected_error;
5539: END IF;
5532: fnd_message.set_token('P_PROC_NAME','GET_CONTRACTS_RESOURCES');
5533: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5534: fnd_msg_pub.add;
5535: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5536: RAISE fnd_api.g_exc_error;
5537: ELSE
5538: RAISE fnd_api.g_exc_unexpected_error;
5539: END IF;
5540: END IF;
5534: fnd_msg_pub.add;
5535: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5536: RAISE fnd_api.g_exc_error;
5537: ELSE
5538: RAISE fnd_api.g_exc_unexpected_error;
5539: END IF;
5540: END IF;
5541: END IF;
5542:
5562: p_calendar_check => p_calendar_check
5563: --Added for Bug # 5573916 Ends here
5564: );
5565:
5566: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
5567: -- Unexpected Execution Error from call to Get_contracts_resources
5568: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
5569: fnd_message.set_token('P_PROC_NAME','GET_IB_RESOURCES');
5570: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5568: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
5569: fnd_message.set_token('P_PROC_NAME','GET_IB_RESOURCES');
5570: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5571: fnd_msg_pub.add;
5572: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5573: RAISE fnd_api.g_exc_error;
5574: ELSE
5575: RAISE fnd_api.g_exc_unexpected_error;
5576: END IF;
5569: fnd_message.set_token('P_PROC_NAME','GET_IB_RESOURCES');
5570: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5571: fnd_msg_pub.add;
5572: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5573: RAISE fnd_api.g_exc_error;
5574: ELSE
5575: RAISE fnd_api.g_exc_unexpected_error;
5576: END IF;
5577: END IF;
5571: fnd_msg_pub.add;
5572: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5573: RAISE fnd_api.g_exc_error;
5574: ELSE
5575: RAISE fnd_api.g_exc_unexpected_error;
5576: END IF;
5577: END IF;
5578:
5579: END IF; -- p_ib_preferred_engineer = 'Y'
5604: x_return_status =>x_return_status ,
5605: x_msg_count =>x_msg_count,
5606: x_msg_data =>x_msg_data);
5607:
5608: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
5609: -- Unexpected Execution Error from call to Get_contracts_resources
5610: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
5611: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
5612: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5610: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
5611: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
5612: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5613: fnd_msg_pub.add;
5614: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5615: RAISE fnd_api.g_exc_error;
5616: ELSE
5617: RAISE fnd_api.g_exc_unexpected_error;
5618: END IF;
5611: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
5612: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5613: fnd_msg_pub.add;
5614: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5615: RAISE fnd_api.g_exc_error;
5616: ELSE
5617: RAISE fnd_api.g_exc_unexpected_error;
5618: END IF;
5619: END IF;
5613: fnd_msg_pub.add;
5614: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5615: RAISE fnd_api.g_exc_error;
5616: ELSE
5617: RAISE fnd_api.g_exc_unexpected_error;
5618: END IF;
5619: END IF;
5620:
5621: end IF; -- end of security check for contracts resource
5629: x_return_status =>x_return_status ,
5630: x_msg_count =>x_msg_count,
5631: x_msg_data =>x_msg_data);
5632:
5633: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
5634: -- Unexpected Execution Error from call to Get_contracts_resources
5635: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
5636: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
5637: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5635: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
5636: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
5637: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5638: fnd_msg_pub.add;
5639: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5640: RAISE fnd_api.g_exc_error;
5641: ELSE
5642: RAISE fnd_api.g_exc_unexpected_error;
5643: END IF;
5636: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
5637: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5638: fnd_msg_pub.add;
5639: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5640: RAISE fnd_api.g_exc_error;
5641: ELSE
5642: RAISE fnd_api.g_exc_unexpected_error;
5643: END IF;
5644: END IF;
5638: fnd_msg_pub.add;
5639: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5640: RAISE fnd_api.g_exc_error;
5641: ELSE
5642: RAISE fnd_api.g_exc_unexpected_error;
5643: END IF;
5644: END IF;
5645:
5646: end IF; -- end of security check for contracts resource
5734:
5735: -- set back the API name to original name
5736: l_api_name := l_api_name_1;
5737:
5738: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
5739: -- Unexpected Execution Error from call to Territory Manager
5740: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
5741: fnd_msg_pub.add;
5742: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5738: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
5739: -- Unexpected Execution Error from call to Territory Manager
5740: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
5741: fnd_msg_pub.add;
5742: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5743: RAISE fnd_api.g_exc_error;
5744: ELSE
5745: RAISE fnd_api.g_exc_unexpected_error;
5746: END IF;
5739: -- Unexpected Execution Error from call to Territory Manager
5740: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
5741: fnd_msg_pub.add;
5742: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5743: RAISE fnd_api.g_exc_error;
5744: ELSE
5745: RAISE fnd_api.g_exc_unexpected_error;
5746: END IF;
5747: END IF;
5741: fnd_msg_pub.add;
5742: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5743: RAISE fnd_api.g_exc_error;
5744: ELSE
5745: RAISE fnd_api.g_exc_unexpected_error;
5746: END IF;
5747: END IF;
5748:
5749: IF(l_winningterrmember_tbl.COUNT > 0)
5828: -- set back the API name to original name
5829:
5830: l_api_name := l_api_name_1;
5831:
5832: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
5833: -- Unexpected Execution Error from call to Get_contracts_resources
5834: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
5835: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
5836: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5834: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
5835: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
5836: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5837: fnd_msg_pub.add;
5838: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5839: RAISE fnd_api.g_exc_error;
5840: ELSE
5841: RAISE fnd_api.g_exc_unexpected_error;
5842: END IF;
5835: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
5836: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5837: fnd_msg_pub.add;
5838: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5839: RAISE fnd_api.g_exc_error;
5840: ELSE
5841: RAISE fnd_api.g_exc_unexpected_error;
5842: END IF;
5843: END IF; -- end of x_return_status check
5837: fnd_msg_pub.add;
5838: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5839: RAISE fnd_api.g_exc_error;
5840: ELSE
5841: RAISE fnd_api.g_exc_unexpected_error;
5842: END IF;
5843: END IF; -- end of x_return_status check
5844:
5845: IF ( p_calendar_flag = 'Y' AND
5866: x_return_status =>x_return_status ,
5867: x_msg_count =>x_msg_count,
5868: x_msg_data =>x_msg_data);
5869:
5870: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
5871: -- Unexpected Execution Error from call to Get_contracts_resources
5872: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
5873: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
5874: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5872: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
5873: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
5874: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5875: fnd_msg_pub.add;
5876: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5877: RAISE fnd_api.g_exc_error;
5878: ELSE
5879: RAISE fnd_api.g_exc_unexpected_error;
5880: END IF;
5873: fnd_message.set_token('P_PROC_NAME','SERVICE_SECURITY_CHECK');
5874: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DR_RESOURCES');
5875: fnd_msg_pub.add;
5876: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5877: RAISE fnd_api.g_exc_error;
5878: ELSE
5879: RAISE fnd_api.g_exc_unexpected_error;
5880: END IF;
5881: END IF;
5875: fnd_msg_pub.add;
5876: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
5877: RAISE fnd_api.g_exc_error;
5878: ELSE
5879: RAISE fnd_api.g_exc_unexpected_error;
5880: END IF;
5881: END IF;
5882: END IF; -- end of security check
5883: ELSE -- No resources returned from the Territory API
6118:
6119: -- set back the API name to original name
6120: l_api_name := l_api_name_1;
6121:
6122: if(l_skill_ret_sts <> fnd_api.g_ret_sts_success)
6123: then
6124: IF (l_skill_ret_sts = fnd_api.g_ret_sts_error) THEN
6125: RAISE fnd_api.g_exc_error;
6126: ELSE
6120: l_api_name := l_api_name_1;
6121:
6122: if(l_skill_ret_sts <> fnd_api.g_ret_sts_success)
6123: then
6124: IF (l_skill_ret_sts = fnd_api.g_ret_sts_error) THEN
6125: RAISE fnd_api.g_exc_error;
6126: ELSE
6127: RAISE fnd_api.g_exc_unexpected_error;
6128: END IF;
6121:
6122: if(l_skill_ret_sts <> fnd_api.g_ret_sts_success)
6123: then
6124: IF (l_skill_ret_sts = fnd_api.g_ret_sts_error) THEN
6125: RAISE fnd_api.g_exc_error;
6126: ELSE
6127: RAISE fnd_api.g_exc_unexpected_error;
6128: END IF;
6129: end if;
6123: then
6124: IF (l_skill_ret_sts = fnd_api.g_ret_sts_error) THEN
6125: RAISE fnd_api.g_exc_error;
6126: ELSE
6127: RAISE fnd_api.g_exc_unexpected_error;
6128: END IF;
6129: end if;
6130:
6131:
6131:
6132: -- added this to filter by usage
6133:
6134: IF ((l_assign_resources_tbl.count > 0 ) AND
6135: (nvl(l_usage, fnd_api.g_miss_char) <> 'ALL' ) AND
6136: (l_usage is not null)
6137: )
6138: THEN
6139: get_usage_resource(l_usage ,
6293: X_MSG_DATA => l_wf_msg_data
6294: );
6295:
6296:
6297: IF NOT (l_wf_return_status = fnd_api.g_ret_sts_success) THEN
6298: -- Unexpected Execution Error from call to assign_dr_resource
6299: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
6300: fnd_message.set_token('P_PROC_NAME','JTF_AM_WF_EVENTS_PUB');
6301: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_RESOURCES');
6342: )
6343: ) THEN
6344:
6345:
6346: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
6347: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
6348: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
6349: fnd_msg_pub.add;
6350: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
6346: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
6347: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
6348: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
6349: fnd_msg_pub.add;
6350: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
6351: RAISE fnd_api.g_exc_error;
6352: ELSE
6353: RAISE fnd_api.g_exc_unexpected_error;
6354: END IF;
6347: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
6348: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
6349: fnd_msg_pub.add;
6350: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
6351: RAISE fnd_api.g_exc_error;
6352: ELSE
6353: RAISE fnd_api.g_exc_unexpected_error;
6354: END IF;
6355: END IF;
6349: fnd_msg_pub.add;
6350: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
6351: RAISE fnd_api.g_exc_error;
6352: ELSE
6353: RAISE fnd_api.g_exc_unexpected_error;
6354: END IF;
6355: END IF;
6356:
6357:
6372: 'W'
6373: );
6374:
6375:
6376: IF (l_return_code = fnd_api.g_ret_sts_error) THEN
6377: -- Execution Error from call to Assignment Manager Workflow Hook
6378: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
6379: fnd_msg_pub.add;
6380: RAISE fnd_api.g_exc_error;
6376: IF (l_return_code = fnd_api.g_ret_sts_error) THEN
6377: -- Execution Error from call to Assignment Manager Workflow Hook
6378: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
6379: fnd_msg_pub.add;
6380: RAISE fnd_api.g_exc_error;
6381: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
6382: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
6383: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
6384: fnd_msg_pub.add;
6377: -- Execution Error from call to Assignment Manager Workflow Hook
6378: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
6379: fnd_msg_pub.add;
6380: RAISE fnd_api.g_exc_error;
6381: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
6382: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
6383: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
6384: fnd_msg_pub.add;
6385: RAISE fnd_api.g_exc_unexpected_error;
6381: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
6382: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
6383: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
6384: fnd_msg_pub.add;
6385: RAISE fnd_api.g_exc_unexpected_error;
6386: END IF;
6387:
6388: END IF; -- End of JTF_ASSIGN_CUHK
6389:
6399: p_data => x_msg_data
6400: );
6401:
6402:
6403: x_return_status := fnd_api.g_ret_sts_success;
6404:
6405: EXCEPTION
6406: WHEN FND_API.G_EXC_ERROR THEN
6407: x_return_status := FND_API.G_RET_STS_ERROR ;
6402:
6403: x_return_status := fnd_api.g_ret_sts_success;
6404:
6405: EXCEPTION
6406: WHEN FND_API.G_EXC_ERROR THEN
6407: x_return_status := FND_API.G_RET_STS_ERROR ;
6408: FND_MSG_PUB.Count_And_Get
6409: (
6410: p_count => x_msg_count,
6403: x_return_status := fnd_api.g_ret_sts_success;
6404:
6405: EXCEPTION
6406: WHEN FND_API.G_EXC_ERROR THEN
6407: x_return_status := FND_API.G_RET_STS_ERROR ;
6408: FND_MSG_PUB.Count_And_Get
6409: (
6410: p_count => x_msg_count,
6411: p_data => x_msg_data
6410: p_count => x_msg_count,
6411: p_data => x_msg_data
6412: );
6413:
6414: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
6415: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
6416: FND_MSG_PUB.Count_And_Get
6417: (
6418: p_count => x_msg_count,
6411: p_data => x_msg_data
6412: );
6413:
6414: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
6415: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
6416: FND_MSG_PUB.Count_And_Get
6417: (
6418: p_count => x_msg_count,
6419: p_data => x_msg_data
6425: fnd_message.set_token('P_SQLERRM',SQLERRM);
6426: fnd_message.set_token('P_API_NAME',l_api_name);
6427: FND_MSG_PUB.add;
6428:
6429: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
6430: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
6431: FND_MSG_PUB.Add_Exc_Msg
6432: (
6433: G_PKG_NAME,
6461: -- Parameters :
6462:
6463: -- IN : p_api_version IN NUMBER Required
6464: -- p_init_msg_list IN VARCHAR2 Optional
6465: -- DEFAULT = FND_API.G_FALSE
6466: -- p_commit IN VARCHAR2 optional
6467: -- DEFAULT = FND_API.G_FALSE
6468:
6469: -- Assignment Manager Specific Parameters
6463: -- IN : p_api_version IN NUMBER Required
6464: -- p_init_msg_list IN VARCHAR2 Optional
6465: -- DEFAULT = FND_API.G_FALSE
6466: -- p_commit IN VARCHAR2 optional
6467: -- DEFAULT = FND_API.G_FALSE
6468:
6469: -- Assignment Manager Specific Parameters
6470:
6471: -- This determines the Resource Type required by the
6622:
6623:
6624: /* Standard call to check for call compatibility */
6625:
6626: IF NOT fnd_api.compatible_api_call (l_api_version,
6627: p_api_version,
6628: l_api_name,
6629: g_pkg_name) THEN
6630: RAISE fnd_api.g_exc_unexpected_error;
6626: IF NOT fnd_api.compatible_api_call (l_api_version,
6627: p_api_version,
6628: l_api_name,
6629: g_pkg_name) THEN
6630: RAISE fnd_api.g_exc_unexpected_error;
6631: END IF;
6632:
6633:
6634: /* Initialize message list if p_init_msg_list is set to TRUE */
6632:
6633:
6634: /* Initialize message list if p_init_msg_list is set to TRUE */
6635:
6636: IF fnd_api.to_boolean (p_init_msg_list) THEN
6637: fnd_msg_pub.initialize;
6638: END IF;
6639:
6640: x_return_status := fnd_api.g_ret_sts_success;
6636: IF fnd_api.to_boolean (p_init_msg_list) THEN
6637: fnd_msg_pub.initialize;
6638: END IF;
6639:
6640: x_return_status := fnd_api.g_ret_sts_success;
6641:
6642:
6643:
6644: /* Getting the Auto Select Profile value defined for the Assignment Manager */
6680: FETCH cur_oppr INTO l_assign_resources_rec;
6681: IF (cur_oppr%NOTFOUND) THEN
6682: fnd_message.set_name('JTF', 'JTF_AM_INVALID_OPPR_ID');
6683: fnd_msg_pub.add;
6684: RAISE fnd_api.g_exc_error;
6685: END IF;
6686: CLOSE cur_oppr;
6687: */
6688:
6797: -- set back the API name to original name
6798: l_api_name := l_api_name_1;
6799:
6800:
6801: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
6802: -- Unexpected Execution Error from call to Territory Manager
6803: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
6804: fnd_msg_pub.add;
6805: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
6801: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
6802: -- Unexpected Execution Error from call to Territory Manager
6803: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
6804: fnd_msg_pub.add;
6805: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
6806: RAISE fnd_api.g_exc_error;
6807: ELSE
6808: RAISE fnd_api.g_exc_unexpected_error;
6809: END IF;
6802: -- Unexpected Execution Error from call to Territory Manager
6803: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
6804: fnd_msg_pub.add;
6805: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
6806: RAISE fnd_api.g_exc_error;
6807: ELSE
6808: RAISE fnd_api.g_exc_unexpected_error;
6809: END IF;
6810: END IF;
6804: fnd_msg_pub.add;
6805: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
6806: RAISE fnd_api.g_exc_error;
6807: ELSE
6808: RAISE fnd_api.g_exc_unexpected_error;
6809: END IF;
6810: END IF;
6811:
6812:
6904:
6905: -- set back the API name to original name
6906: l_api_name := l_api_name_1;
6907:
6908: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
6909: -- Unexpected Execution Error from call to Get_contracts_resources
6910: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
6911: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
6912: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_OPPR_RESOURCES');
6910: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
6911: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
6912: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_OPPR_RESOURCES');
6913: fnd_msg_pub.add;
6914: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
6915: RAISE fnd_api.g_exc_error;
6916: ELSE
6917: RAISE fnd_api.g_exc_unexpected_error;
6918: END IF;
6911: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
6912: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_OPPR_RESOURCES');
6913: fnd_msg_pub.add;
6914: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
6915: RAISE fnd_api.g_exc_error;
6916: ELSE
6917: RAISE fnd_api.g_exc_unexpected_error;
6918: END IF;
6919: END IF; -- end of x_return_status check
6913: fnd_msg_pub.add;
6914: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
6915: RAISE fnd_api.g_exc_error;
6916: ELSE
6917: RAISE fnd_api.g_exc_unexpected_error;
6918: END IF;
6919: END IF; -- end of x_return_status check
6920: end if; -- if p_calendar_flag = Y
6921:
6922: IF ( p_calendar_flag = 'Y' AND
6923: x_assign_resources_tbl.count = 0 ) THEN
6924: fnd_message.set_name('JTF', 'JTF_AM_RESOURCE_NOT_AVAILABLE');
6925: fnd_msg_pub.add;
6926: -- RAISE fnd_api.g_exc_error;
6927: END IF;
6928:
6929: -- check auto assignment
6930: -- if auto assignment is Y then return only the number of resources that have been requested
6951:
6952: ELSE -- No resources returned from the Territory API
6953: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
6954: fnd_msg_pub.add;
6955: -- RAISE fnd_api.g_exc_error;
6956: END IF;
6957:
6958: ELSE -- Territory Flag is NO
6959: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
6957:
6958: ELSE -- Territory Flag is NO
6959: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
6960: fnd_msg_pub.add;
6961: -- RAISE fnd_api.g_exc_error;
6962: END IF;
6963:
6964: /********************** Start of Addition for Enh. No 3076744 by SBARAT, 23/09/2004 ************************/
6965:
6980: X_MSG_DATA => l_wf_msg_data
6981: );
6982:
6983:
6984: IF NOT (l_wf_return_status = fnd_api.g_ret_sts_success) THEN
6985: -- Unexpected Execution Error from call to assign_sr_resource
6986: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
6987: fnd_message.set_token('P_PROC_NAME','JTF_AM_WF_EVENTS_PUB');
6988: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_OPPR_RESOURCES');
7035: x_msg_data => x_msg_data
7036: )
7037: ) THEN
7038:
7039: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
7040: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
7041: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7042: fnd_msg_pub.add;
7043: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7039: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
7040: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
7041: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7042: fnd_msg_pub.add;
7043: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7044: RAISE fnd_api.g_exc_error;
7045: ELSE
7046: RAISE fnd_api.g_exc_unexpected_error;
7047: END IF;
7040: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
7041: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7042: fnd_msg_pub.add;
7043: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7044: RAISE fnd_api.g_exc_error;
7045: ELSE
7046: RAISE fnd_api.g_exc_unexpected_error;
7047: END IF;
7048: END IF;
7042: fnd_msg_pub.add;
7043: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7044: RAISE fnd_api.g_exc_error;
7045: ELSE
7046: RAISE fnd_api.g_exc_unexpected_error;
7047: END IF;
7048: END IF;
7049:
7050: l_bind_data_id := JTF_USR_HKS.get_bind_data_id;
7063: l_bind_data_id,
7064: 'W'
7065: );
7066:
7067: IF (l_return_code = fnd_api.g_ret_sts_error) THEN
7068: -- Execution Error from call to Assignment Manager Workflow Hook
7069: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7070: fnd_msg_pub.add;
7071: RAISE fnd_api.g_exc_error;
7067: IF (l_return_code = fnd_api.g_ret_sts_error) THEN
7068: -- Execution Error from call to Assignment Manager Workflow Hook
7069: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7070: fnd_msg_pub.add;
7071: RAISE fnd_api.g_exc_error;
7072: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
7073: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
7074: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7075: fnd_msg_pub.add;
7068: -- Execution Error from call to Assignment Manager Workflow Hook
7069: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7070: fnd_msg_pub.add;
7071: RAISE fnd_api.g_exc_error;
7072: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
7073: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
7074: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7075: fnd_msg_pub.add;
7076: RAISE fnd_api.g_exc_unexpected_error;
7072: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
7073: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
7074: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7075: fnd_msg_pub.add;
7076: RAISE fnd_api.g_exc_unexpected_error;
7077: END IF;
7078:
7079: END IF; -- End of JTF_ASSIGN_CUHK
7080:
7095:
7096:
7097:
7098: EXCEPTION
7099: WHEN FND_API.G_EXC_ERROR THEN
7100: x_return_status := FND_API.G_RET_STS_ERROR ;
7101: FND_MSG_PUB.Count_And_Get
7102: (
7103: p_count => x_msg_count,
7096:
7097:
7098: EXCEPTION
7099: WHEN FND_API.G_EXC_ERROR THEN
7100: x_return_status := FND_API.G_RET_STS_ERROR ;
7101: FND_MSG_PUB.Count_And_Get
7102: (
7103: p_count => x_msg_count,
7104: p_data => x_msg_data
7103: p_count => x_msg_count,
7104: p_data => x_msg_data
7105: );
7106:
7107: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
7108: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
7109: FND_MSG_PUB.Count_And_Get
7110: (
7111: p_count => x_msg_count,
7104: p_data => x_msg_data
7105: );
7106:
7107: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
7108: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
7109: FND_MSG_PUB.Count_And_Get
7110: (
7111: p_count => x_msg_count,
7112: p_data => x_msg_data
7118: fnd_message.set_token('P_SQLERRM',SQLERRM);
7119: fnd_message.set_token('P_API_NAME',l_api_name);
7120: FND_MSG_PUB.add;
7121:
7122: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
7123: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
7124: FND_MSG_PUB.Add_Exc_Msg
7125: (
7126: G_PKG_NAME,
7307:
7308:
7309: /* Standard call to check for call compatibility */
7310:
7311: IF NOT fnd_api.compatible_api_call (l_api_version,
7312: p_api_version,
7313: l_api_name,
7314: g_pkg_name) THEN
7315: RAISE fnd_api.g_exc_unexpected_error;
7311: IF NOT fnd_api.compatible_api_call (l_api_version,
7312: p_api_version,
7313: l_api_name,
7314: g_pkg_name) THEN
7315: RAISE fnd_api.g_exc_unexpected_error;
7316: END IF;
7317:
7318:
7319: /* Initialize message list if p_init_msg_list is set to TRUE */
7317:
7318:
7319: /* Initialize message list if p_init_msg_list is set to TRUE */
7320:
7321: IF fnd_api.to_boolean (p_init_msg_list) THEN
7322: fnd_msg_pub.initialize;
7323: END IF;
7324:
7325: x_return_status := fnd_api.g_ret_sts_success;
7321: IF fnd_api.to_boolean (p_init_msg_list) THEN
7322: fnd_msg_pub.initialize;
7323: END IF;
7324:
7325: x_return_status := fnd_api.g_ret_sts_success;
7326:
7327:
7328:
7329: /* Getting the Auto Select Profile value defined for the Assignment Manager */
7397:
7398: -- set back the API name to original name
7399: l_api_name := l_api_name_1;
7400:
7401: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
7402: -- Unexpected Execution Error from call to Territory Manager
7403: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
7404: fnd_msg_pub.add;
7405: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7401: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
7402: -- Unexpected Execution Error from call to Territory Manager
7403: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
7404: fnd_msg_pub.add;
7405: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7406: RAISE fnd_api.g_exc_error;
7407: ELSE
7408: RAISE fnd_api.g_exc_unexpected_error;
7409: END IF;
7402: -- Unexpected Execution Error from call to Territory Manager
7403: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
7404: fnd_msg_pub.add;
7405: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7406: RAISE fnd_api.g_exc_error;
7407: ELSE
7408: RAISE fnd_api.g_exc_unexpected_error;
7409: END IF;
7410: END IF;
7404: fnd_msg_pub.add;
7405: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7406: RAISE fnd_api.g_exc_error;
7407: ELSE
7408: RAISE fnd_api.g_exc_unexpected_error;
7409: END IF;
7410: END IF;
7411:
7412:
7492:
7493: -- set back the API name to original name
7494: l_api_name := l_api_name_1;
7495:
7496: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
7497: -- Unexpected Execution Error from call to Get_contracts_resources
7498: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
7499: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
7500: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_LEAD_RESOURCES');
7498: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
7499: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
7500: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_LEAD_RESOURCES');
7501: fnd_msg_pub.add;
7502: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7503: RAISE fnd_api.g_exc_error;
7504: ELSE
7505: RAISE fnd_api.g_exc_unexpected_error;
7506: END IF;
7499: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
7500: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_LEAD_RESOURCES');
7501: fnd_msg_pub.add;
7502: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7503: RAISE fnd_api.g_exc_error;
7504: ELSE
7505: RAISE fnd_api.g_exc_unexpected_error;
7506: END IF;
7507: END IF; -- end of x_return_status check
7501: fnd_msg_pub.add;
7502: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7503: RAISE fnd_api.g_exc_error;
7504: ELSE
7505: RAISE fnd_api.g_exc_unexpected_error;
7506: END IF;
7507: END IF; -- end of x_return_status check
7508: end if; -- if p_calendar_flag = Y
7509:
7510: IF ( p_calendar_flag = 'Y' AND
7511: x_assign_resources_tbl.count = 0 ) THEN
7512: fnd_message.set_name('JTF', 'JTF_AM_RESOURCE_NOT_AVAILABLE');
7513: fnd_msg_pub.add;
7514: -- RAISE fnd_api.g_exc_error;
7515: END IF;
7516:
7517:
7518: -- If auto_select is Y then ensure correct number of resources are returned
7539:
7540: ELSE -- No resources returned from the Territory API
7541: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
7542: fnd_msg_pub.add;
7543: -- RAISE fnd_api.g_exc_error;
7544: END IF;
7545:
7546: ELSE -- Territory Flag is NO
7547: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
7545:
7546: ELSE -- Territory Flag is NO
7547: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
7548: fnd_msg_pub.add;
7549: -- RAISE fnd_api.g_exc_error;
7550: END IF;
7551:
7552: /********************** Start of Addition for Enh. No 3076744 by SBARAT, 23/09/2004 ************************/
7553:
7569: X_MSG_DATA => l_wf_msg_data
7570: );
7571:
7572:
7573: IF NOT (l_wf_return_status = fnd_api.g_ret_sts_success) THEN
7574: -- Unexpected Execution Error from call to assign_sr_resource
7575: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
7576: fnd_message.set_token('P_PROC_NAME','JTF_AM_WF_EVENTS_PUB');
7577: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_LEAD_RESOURCES');
7623: x_msg_data => x_msg_data
7624: )
7625: ) THEN
7626:
7627: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
7628: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
7629: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7630: fnd_msg_pub.add;
7631: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7627: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
7628: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
7629: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7630: fnd_msg_pub.add;
7631: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7632: RAISE fnd_api.g_exc_error;
7633: ELSE
7634: RAISE fnd_api.g_exc_unexpected_error;
7635: END IF;
7628: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
7629: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7630: fnd_msg_pub.add;
7631: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7632: RAISE fnd_api.g_exc_error;
7633: ELSE
7634: RAISE fnd_api.g_exc_unexpected_error;
7635: END IF;
7636: END IF;
7630: fnd_msg_pub.add;
7631: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7632: RAISE fnd_api.g_exc_error;
7633: ELSE
7634: RAISE fnd_api.g_exc_unexpected_error;
7635: END IF;
7636: END IF;
7637:
7638: l_bind_data_id := JTF_USR_HKS.get_bind_data_id;
7651: l_bind_data_id,
7652: 'W'
7653: );
7654:
7655: IF (l_return_code = fnd_api.g_ret_sts_error) THEN
7656: -- Execution Error from call to Assignment Manager Workflow Hook
7657: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7658: fnd_msg_pub.add;
7659: RAISE fnd_api.g_exc_error;
7655: IF (l_return_code = fnd_api.g_ret_sts_error) THEN
7656: -- Execution Error from call to Assignment Manager Workflow Hook
7657: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7658: fnd_msg_pub.add;
7659: RAISE fnd_api.g_exc_error;
7660: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
7661: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
7662: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7663: fnd_msg_pub.add;
7656: -- Execution Error from call to Assignment Manager Workflow Hook
7657: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7658: fnd_msg_pub.add;
7659: RAISE fnd_api.g_exc_error;
7660: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
7661: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
7662: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7663: fnd_msg_pub.add;
7664: RAISE fnd_api.g_exc_unexpected_error;
7660: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
7661: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
7662: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
7663: fnd_msg_pub.add;
7664: RAISE fnd_api.g_exc_unexpected_error;
7665: END IF;
7666:
7667: END IF; -- End of JTF_ASSIGN_CUHK
7668:
7682:
7683:
7684:
7685: EXCEPTION
7686: WHEN FND_API.G_EXC_ERROR THEN
7687: x_return_status := FND_API.G_RET_STS_ERROR ;
7688: FND_MSG_PUB.Count_And_Get
7689: (
7690: p_count => x_msg_count,
7683:
7684:
7685: EXCEPTION
7686: WHEN FND_API.G_EXC_ERROR THEN
7687: x_return_status := FND_API.G_RET_STS_ERROR ;
7688: FND_MSG_PUB.Count_And_Get
7689: (
7690: p_count => x_msg_count,
7691: p_data => x_msg_data
7690: p_count => x_msg_count,
7691: p_data => x_msg_data
7692: );
7693:
7694: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
7695: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
7696: FND_MSG_PUB.Count_And_Get
7697: (
7698: p_count => x_msg_count,
7691: p_data => x_msg_data
7692: );
7693:
7694: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
7695: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
7696: FND_MSG_PUB.Count_And_Get
7697: (
7698: p_count => x_msg_count,
7699: p_data => x_msg_data
7705: fnd_message.set_token('P_SQLERRM',SQLERRM);
7706: fnd_message.set_token('P_API_NAME',l_api_name);
7707: FND_MSG_PUB.add;
7708:
7709: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
7710: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
7711: FND_MSG_PUB.Add_Exc_Msg
7712: (
7713: G_PKG_NAME,
7833:
7834:
7835: /* Standard call to check for call compatibility */
7836:
7837: IF NOT fnd_api.compatible_api_call (l_api_version,
7838: p_api_version,
7839: l_api_name,
7840: g_pkg_name) THEN
7841: RAISE fnd_api.g_exc_unexpected_error;
7837: IF NOT fnd_api.compatible_api_call (l_api_version,
7838: p_api_version,
7839: l_api_name,
7840: g_pkg_name) THEN
7841: RAISE fnd_api.g_exc_unexpected_error;
7842: END IF;
7843:
7844:
7845: /* Initialize message list if p_init_msg_list is set to TRUE */
7843:
7844:
7845: /* Initialize message list if p_init_msg_list is set to TRUE */
7846:
7847: IF fnd_api.to_boolean (p_init_msg_list) THEN
7848: fnd_msg_pub.initialize;
7849: END IF;
7850:
7851: x_return_status := fnd_api.g_ret_sts_success;
7847: IF fnd_api.to_boolean (p_init_msg_list) THEN
7848: fnd_msg_pub.initialize;
7849: END IF;
7850:
7851: x_return_status := fnd_api.g_ret_sts_success;
7852:
7853:
7854: /* Getting the Auto Select Profile value defined for the Assignment Manager */
7855:
7972:
7973: -- set back the API name to original name
7974: l_api_name := l_api_name_1;
7975:
7976: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
7977: -- Unexpected Execution Error from call to Territory Manager
7978: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
7979: fnd_msg_pub.add;
7980: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7976: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
7977: -- Unexpected Execution Error from call to Territory Manager
7978: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
7979: fnd_msg_pub.add;
7980: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7981: RAISE fnd_api.g_exc_error;
7982: ELSE
7983: RAISE fnd_api.g_exc_unexpected_error;
7984: END IF;
7977: -- Unexpected Execution Error from call to Territory Manager
7978: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
7979: fnd_msg_pub.add;
7980: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7981: RAISE fnd_api.g_exc_error;
7982: ELSE
7983: RAISE fnd_api.g_exc_unexpected_error;
7984: END IF;
7985: END IF;
7979: fnd_msg_pub.add;
7980: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
7981: RAISE fnd_api.g_exc_error;
7982: ELSE
7983: RAISE fnd_api.g_exc_unexpected_error;
7984: END IF;
7985: END IF;
7986:
7987: -- added 2 april 2003 by sudarsana to conver RS_SUPPLIER TO RS_SUPPLIER_CONTACT
8045:
8046: -- set back the API name to original name
8047: l_api_name := l_api_name_1;
8048:
8049: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
8050: -- Unexpected Execution Error from call to Calendar
8051: fnd_message.set_name('JTF', 'JTF_AM_ERROR_CAL_API');
8052: fnd_msg_pub.add;
8053: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8049: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
8050: -- Unexpected Execution Error from call to Calendar
8051: fnd_message.set_name('JTF', 'JTF_AM_ERROR_CAL_API');
8052: fnd_msg_pub.add;
8053: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8054: -- 12/22/05 ** MPADHIAR ** Manas padhiary **
8055: -- Removed Comment to Show error message Bug # 2919389
8056: RAISE fnd_api.g_exc_error;
8057: ELSE
8052: fnd_msg_pub.add;
8053: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8054: -- 12/22/05 ** MPADHIAR ** Manas padhiary **
8055: -- Removed Comment to Show error message Bug # 2919389
8056: RAISE fnd_api.g_exc_error;
8057: ELSE
8058: RAISE fnd_api.g_exc_unexpected_error;
8059: END IF;
8060: END IF;
8054: -- 12/22/05 ** MPADHIAR ** Manas padhiary **
8055: -- Removed Comment to Show error message Bug # 2919389
8056: RAISE fnd_api.g_exc_error;
8057: ELSE
8058: RAISE fnd_api.g_exc_unexpected_error;
8059: END IF;
8060: END IF;
8061:
8062:
8145: IF ( p_calendar_flag = 'Y' AND
8146: x_assign_resources_tbl.count = 0 ) THEN
8147: fnd_message.set_name('JTF', 'JTF_AM_RESOURCE_NOT_AVAILABLE');
8148: fnd_msg_pub.add;
8149: -- RAISE fnd_api.g_exc_error;
8150: END IF;
8151:
8152: ELSE -- No resources returned from the Territory API
8153: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
8151:
8152: ELSE -- No resources returned from the Territory API
8153: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
8154: fnd_msg_pub.add;
8155: -- RAISE fnd_api.g_exc_error;
8156: END IF;
8157:
8158: ELSE -- Territory Flag is NO
8159: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
8157:
8158: ELSE -- Territory Flag is NO
8159: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
8160: fnd_msg_pub.add;
8161: -- RAISE fnd_api.g_exc_error;
8162: END IF;
8163:
8164: /********************** Start of Addition for Enh. No 3076744 by SBARAT, 23/09/2004 ************************/
8165:
8181: X_MSG_DATA => l_wf_msg_data
8182: );
8183:
8184:
8185: IF NOT (l_wf_return_status = fnd_api.g_ret_sts_success) THEN
8186: -- Unexpected Execution Error from call to assign_sr_resource
8187: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
8188: fnd_message.set_token('P_PROC_NAME','JTF_AM_WF_EVENTS_PUB');
8189: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_LEAD_RESOURCES');
8235: x_msg_data => x_msg_data
8236: )
8237: ) THEN
8238:
8239: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
8240: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
8241: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8242: fnd_msg_pub.add;
8243: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8239: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
8240: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
8241: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8242: fnd_msg_pub.add;
8243: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8244: RAISE fnd_api.g_exc_error;
8245: ELSE
8246: RAISE fnd_api.g_exc_unexpected_error;
8247: END IF;
8240: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
8241: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8242: fnd_msg_pub.add;
8243: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8244: RAISE fnd_api.g_exc_error;
8245: ELSE
8246: RAISE fnd_api.g_exc_unexpected_error;
8247: END IF;
8248: END IF;
8242: fnd_msg_pub.add;
8243: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8244: RAISE fnd_api.g_exc_error;
8245: ELSE
8246: RAISE fnd_api.g_exc_unexpected_error;
8247: END IF;
8248: END IF;
8249:
8250: l_bind_data_id := JTF_USR_HKS.get_bind_data_id;
8264: 'W'
8265: );
8266:
8267:
8268: IF (l_return_code = fnd_api.g_ret_sts_error) THEN
8269: -- Execution Error from call to Assignment Manager Workflow Hook
8270: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8271: fnd_msg_pub.add;
8272: RAISE fnd_api.g_exc_error;
8268: IF (l_return_code = fnd_api.g_ret_sts_error) THEN
8269: -- Execution Error from call to Assignment Manager Workflow Hook
8270: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8271: fnd_msg_pub.add;
8272: RAISE fnd_api.g_exc_error;
8273: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
8274: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
8275: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8276: fnd_msg_pub.add;
8269: -- Execution Error from call to Assignment Manager Workflow Hook
8270: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8271: fnd_msg_pub.add;
8272: RAISE fnd_api.g_exc_error;
8273: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
8274: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
8275: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8276: fnd_msg_pub.add;
8277: RAISE fnd_api.g_exc_unexpected_error;
8273: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
8274: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
8275: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8276: fnd_msg_pub.add;
8277: RAISE fnd_api.g_exc_unexpected_error;
8278: END IF;
8279:
8280: END IF; -- End of JTF_ASSIGN_CUHK
8281:
8294:
8295:
8296:
8297: EXCEPTION
8298: WHEN FND_API.G_EXC_ERROR THEN
8299: x_return_status := FND_API.G_RET_STS_ERROR ;
8300: FND_MSG_PUB.Count_And_Get
8301: (
8302: p_count => x_msg_count,
8295:
8296:
8297: EXCEPTION
8298: WHEN FND_API.G_EXC_ERROR THEN
8299: x_return_status := FND_API.G_RET_STS_ERROR ;
8300: FND_MSG_PUB.Count_And_Get
8301: (
8302: p_count => x_msg_count,
8303: p_data => x_msg_data
8302: p_count => x_msg_count,
8303: p_data => x_msg_data
8304: );
8305:
8306: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
8307: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
8308: FND_MSG_PUB.Count_And_Get
8309: (
8310: p_count => x_msg_count,
8303: p_data => x_msg_data
8304: );
8305:
8306: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
8307: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
8308: FND_MSG_PUB.Count_And_Get
8309: (
8310: p_count => x_msg_count,
8311: p_data => x_msg_data
8317: fnd_message.set_token('P_SQLERRM',SQLERRM);
8318: fnd_message.set_token('P_API_NAME',l_api_name);
8319: FND_MSG_PUB.add;
8320:
8321: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
8322: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
8323: FND_MSG_PUB.Add_Exc_Msg
8324: (
8325: G_PKG_NAME,
8510:
8511:
8512: /* Standard call to check for call compatibility */
8513:
8514: IF NOT fnd_api.compatible_api_call (l_api_version,
8515: p_api_version,
8516: l_api_name,
8517: g_pkg_name) THEN
8518: RAISE fnd_api.g_exc_unexpected_error;
8514: IF NOT fnd_api.compatible_api_call (l_api_version,
8515: p_api_version,
8516: l_api_name,
8517: g_pkg_name) THEN
8518: RAISE fnd_api.g_exc_unexpected_error;
8519: END IF;
8520:
8521:
8522: /* Initialize message list if p_init_msg_list is set to TRUE */
8520:
8521:
8522: /* Initialize message list if p_init_msg_list is set to TRUE */
8523:
8524: IF fnd_api.to_boolean (p_init_msg_list) THEN
8525: fnd_msg_pub.initialize;
8526: END IF;
8527:
8528: x_return_status := fnd_api.g_ret_sts_success;
8524: IF fnd_api.to_boolean (p_init_msg_list) THEN
8525: fnd_msg_pub.initialize;
8526: END IF;
8527:
8528: x_return_status := fnd_api.g_ret_sts_success;
8529:
8530:
8531:
8532: /* Getting the Auto Select Profile value defined for the Assignment Manager */
8641:
8642: -- set back the API name to original name
8643: l_api_name := l_api_name_1;
8644:
8645: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
8646: -- Unexpected Execution Error from call to Territory Manager
8647: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
8648: fnd_msg_pub.add;
8649: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8645: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
8646: -- Unexpected Execution Error from call to Territory Manager
8647: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
8648: fnd_msg_pub.add;
8649: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8650: RAISE fnd_api.g_exc_error;
8651: ELSE
8652: RAISE fnd_api.g_exc_unexpected_error;
8653: END IF;
8646: -- Unexpected Execution Error from call to Territory Manager
8647: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
8648: fnd_msg_pub.add;
8649: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8650: RAISE fnd_api.g_exc_error;
8651: ELSE
8652: RAISE fnd_api.g_exc_unexpected_error;
8653: END IF;
8654: END IF;
8648: fnd_msg_pub.add;
8649: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8650: RAISE fnd_api.g_exc_error;
8651: ELSE
8652: RAISE fnd_api.g_exc_unexpected_error;
8653: END IF;
8654: END IF;
8655:
8656:
8754:
8755: -- set back the API name to original name
8756: l_api_name := l_api_name_1;
8757:
8758: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
8759: -- Unexpected Execution Error from call to Get_contracts_resources
8760: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
8761: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
8762: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_ACCOUNT_RESOURCES');
8760: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
8761: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
8762: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_ACCOUNT_RESOURCES');
8763: fnd_msg_pub.add;
8764: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8765: RAISE fnd_api.g_exc_error;
8766: ELSE
8767: RAISE fnd_api.g_exc_unexpected_error;
8768: END IF;
8761: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
8762: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_ACCOUNT_RESOURCES');
8763: fnd_msg_pub.add;
8764: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8765: RAISE fnd_api.g_exc_error;
8766: ELSE
8767: RAISE fnd_api.g_exc_unexpected_error;
8768: END IF;
8769: END IF; -- end of x_return_status check
8763: fnd_msg_pub.add;
8764: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8765: RAISE fnd_api.g_exc_error;
8766: ELSE
8767: RAISE fnd_api.g_exc_unexpected_error;
8768: END IF;
8769: END IF; -- end of x_return_status check
8770: end if; -- if p_calendar_flag = Y
8771:
8772: IF ( p_calendar_flag = 'Y' AND
8773: x_assign_resources_tbl.count = 0 ) THEN
8774: fnd_message.set_name('JTF', 'JTF_AM_RESOURCE_NOT_AVAILABLE');
8775: fnd_msg_pub.add;
8776: -- RAISE fnd_api.g_exc_error;
8777: END IF;
8778:
8779: -- to implement auto selection
8780: IF(l_auto_select_flag = 'Y')
8799: END IF; -- end of auto select flag
8800: ELSE -- No resources returned from the Territory API
8801: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
8802: fnd_msg_pub.add;
8803: -- RAISE fnd_api.g_exc_error;
8804: END IF;
8805:
8806: ELSE -- Territory Flag is NO
8807: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
8805:
8806: ELSE -- Territory Flag is NO
8807: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
8808: fnd_msg_pub.add;
8809: -- RAISE fnd_api.g_exc_error;
8810: END IF;
8811:
8812: /********************** Start of Addition for Enh. No 3076744 by SBARAT, 23/09/2004 ************************/
8813:
8828: X_MSG_DATA => l_wf_msg_data
8829: );
8830:
8831:
8832: IF NOT (l_wf_return_status = fnd_api.g_ret_sts_success) THEN
8833: -- Unexpected Execution Error from call to assign_sr_resource
8834: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
8835: fnd_message.set_token('P_PROC_NAME','JTF_AM_WF_EVENTS_PUB');
8836: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_ACCOUNT_RESOURCES');
8883: x_msg_data => x_msg_data
8884: )
8885: ) THEN
8886:
8887: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
8888: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
8889: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8890: fnd_msg_pub.add;
8891: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8887: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
8888: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
8889: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8890: fnd_msg_pub.add;
8891: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8892: RAISE fnd_api.g_exc_error;
8893: ELSE
8894: RAISE fnd_api.g_exc_unexpected_error;
8895: END IF;
8888: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
8889: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8890: fnd_msg_pub.add;
8891: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8892: RAISE fnd_api.g_exc_error;
8893: ELSE
8894: RAISE fnd_api.g_exc_unexpected_error;
8895: END IF;
8896: END IF;
8890: fnd_msg_pub.add;
8891: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
8892: RAISE fnd_api.g_exc_error;
8893: ELSE
8894: RAISE fnd_api.g_exc_unexpected_error;
8895: END IF;
8896: END IF;
8897:
8898: l_bind_data_id := JTF_USR_HKS.get_bind_data_id;
8911: l_bind_data_id,
8912: 'W'
8913: );
8914:
8915: IF (l_return_code = fnd_api.g_ret_sts_error) THEN
8916: -- Execution Error from call to Assignment Manager Workflow Hook
8917: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8918: fnd_msg_pub.add;
8919: RAISE fnd_api.g_exc_error;
8915: IF (l_return_code = fnd_api.g_ret_sts_error) THEN
8916: -- Execution Error from call to Assignment Manager Workflow Hook
8917: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8918: fnd_msg_pub.add;
8919: RAISE fnd_api.g_exc_error;
8920: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
8921: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
8922: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8923: fnd_msg_pub.add;
8916: -- Execution Error from call to Assignment Manager Workflow Hook
8917: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8918: fnd_msg_pub.add;
8919: RAISE fnd_api.g_exc_error;
8920: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
8921: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
8922: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8923: fnd_msg_pub.add;
8924: RAISE fnd_api.g_exc_unexpected_error;
8920: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
8921: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
8922: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
8923: fnd_msg_pub.add;
8924: RAISE fnd_api.g_exc_unexpected_error;
8925: END IF;
8926:
8927: END IF; -- End of JTF_ASSIGN_CUHK
8928:
8942:
8943:
8944:
8945: EXCEPTION
8946: WHEN FND_API.G_EXC_ERROR THEN
8947: x_return_status := FND_API.G_RET_STS_ERROR ;
8948: FND_MSG_PUB.Count_And_Get
8949: (
8950: p_count => x_msg_count,
8943:
8944:
8945: EXCEPTION
8946: WHEN FND_API.G_EXC_ERROR THEN
8947: x_return_status := FND_API.G_RET_STS_ERROR ;
8948: FND_MSG_PUB.Count_And_Get
8949: (
8950: p_count => x_msg_count,
8951: p_data => x_msg_data
8950: p_count => x_msg_count,
8951: p_data => x_msg_data
8952: );
8953:
8954: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
8955: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
8956: FND_MSG_PUB.Count_And_Get
8957: (
8958: p_count => x_msg_count,
8951: p_data => x_msg_data
8952: );
8953:
8954: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
8955: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
8956: FND_MSG_PUB.Count_And_Get
8957: (
8958: p_count => x_msg_count,
8959: p_data => x_msg_data
8965: fnd_message.set_token('P_SQLERRM',SQLERRM);
8966: fnd_message.set_token('P_API_NAME',l_api_name);
8967: FND_MSG_PUB.add;
8968:
8969: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
8970: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
8971: FND_MSG_PUB.Add_Exc_Msg
8972: (
8973: G_PKG_NAME,
9009: -- Parameters :
9010:
9011: -- IN : p_api_version IN NUMBER Required
9012: -- p_init_msg_list IN VARCHAR2 Optional
9013: -- DEFAULT = FND_API.G_FALSE
9014: -- Assignment Manager Specific Parameters
9015:
9016: -- This determines the Resource Type required by the
9017: -- calling document
9127:
9128:
9129: /* Standard call to check for call compatibility */
9130:
9131: IF NOT fnd_api.compatible_api_call (l_api_version,
9132: p_api_version,
9133: l_api_name,
9134: g_pkg_name) THEN
9135: RAISE fnd_api.g_exc_unexpected_error;
9131: IF NOT fnd_api.compatible_api_call (l_api_version,
9132: p_api_version,
9133: l_api_name,
9134: g_pkg_name) THEN
9135: RAISE fnd_api.g_exc_unexpected_error;
9136: END IF;
9137:
9138:
9139:
9138:
9139:
9140: /* Initialize message list if p_init_msg_list is set to TRUE */
9141:
9142: IF fnd_api.to_boolean (p_init_msg_list) THEN
9143: fnd_msg_pub.initialize;
9144: END IF;
9145:
9146: x_return_status := fnd_api.g_ret_sts_success;
9142: IF fnd_api.to_boolean (p_init_msg_list) THEN
9143: fnd_msg_pub.initialize;
9144: END IF;
9145:
9146: x_return_status := fnd_api.g_ret_sts_success;
9147:
9148:
9149:
9150:
9191:
9192: -- set back the API name to original name
9193: l_api_name := l_api_name_1;
9194:
9195: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
9196: -- Unexpected Execution Error from call to Territory Manager
9197: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
9198: fnd_msg_pub.add;
9199: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9195: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
9196: -- Unexpected Execution Error from call to Territory Manager
9197: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
9198: fnd_msg_pub.add;
9199: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9200: RAISE fnd_api.g_exc_error;
9201: ELSE
9202: RAISE fnd_api.g_exc_unexpected_error;
9203: END IF;
9196: -- Unexpected Execution Error from call to Territory Manager
9197: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
9198: fnd_msg_pub.add;
9199: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9200: RAISE fnd_api.g_exc_error;
9201: ELSE
9202: RAISE fnd_api.g_exc_unexpected_error;
9203: END IF;
9204: END IF;
9198: fnd_msg_pub.add;
9199: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9200: RAISE fnd_api.g_exc_error;
9201: ELSE
9202: RAISE fnd_api.g_exc_unexpected_error;
9203: END IF;
9204: END IF;
9205:
9206: ELSE -- Territory Flag is NO
9205:
9206: ELSE -- Territory Flag is NO
9207: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
9208: fnd_msg_pub.add;
9209: -- RAISE fnd_api.g_exc_error;
9210: END IF;
9211:
9212: -- added 2 april 2003 by sudarsana to conver RS_SUPPLIER TO RS_SUPPLIER_CONTACT
9213:
9305:
9306: -- set back the API name to original name
9307: l_api_name := l_api_name_1;
9308:
9309: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
9310: -- Unexpected Execution Error from call to Get_contracts_resources
9311: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
9312: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
9313: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DEFECT_RESOURCES');
9311: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
9312: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
9313: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DEFECT_RESOURCES');
9314: fnd_msg_pub.add;
9315: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9316: RAISE fnd_api.g_exc_error;
9317: ELSE
9318: RAISE fnd_api.g_exc_unexpected_error;
9319: END IF;
9312: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
9313: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_DEFECT_RESOURCES');
9314: fnd_msg_pub.add;
9315: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9316: RAISE fnd_api.g_exc_error;
9317: ELSE
9318: RAISE fnd_api.g_exc_unexpected_error;
9319: END IF;
9320: END IF; -- end of x_return_status check
9314: fnd_msg_pub.add;
9315: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9316: RAISE fnd_api.g_exc_error;
9317: ELSE
9318: RAISE fnd_api.g_exc_unexpected_error;
9319: END IF;
9320: END IF; -- end of x_return_status check
9321: end if; -- if p_calendar_flag = Y
9322:
9324: IF ( p_calendar_flag = 'Y' AND
9325: x_assign_resources_tbl.count = 0 ) THEN
9326: fnd_message.set_name('JTF', 'JTF_AM_RESOURCE_NOT_AVAILABLE');
9327: fnd_msg_pub.add;
9328: -- RAISE fnd_api.g_exc_error;
9329: END IF;
9330:
9331: ELSE -- No resources returned from the Territory API
9332: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
9330:
9331: ELSE -- No resources returned from the Territory API
9332: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
9333: fnd_msg_pub.add;
9334: -- RAISE fnd_api.g_exc_error;
9335: END IF;
9336:
9337:
9338: /* Standard call to get message count and
9345: );
9346:
9347:
9348: EXCEPTION
9349: WHEN FND_API.G_EXC_ERROR THEN
9350: x_return_status := FND_API.G_RET_STS_ERROR ;
9351: FND_MSG_PUB.Count_And_Get
9352: (
9353: p_count => x_msg_count,
9346:
9347:
9348: EXCEPTION
9349: WHEN FND_API.G_EXC_ERROR THEN
9350: x_return_status := FND_API.G_RET_STS_ERROR ;
9351: FND_MSG_PUB.Count_And_Get
9352: (
9353: p_count => x_msg_count,
9354: p_data => x_msg_data
9353: p_count => x_msg_count,
9354: p_data => x_msg_data
9355: );
9356:
9357: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9358: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
9359: FND_MSG_PUB.Count_And_Get
9360: (
9361: p_count => x_msg_count,
9354: p_data => x_msg_data
9355: );
9356:
9357: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9358: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
9359: FND_MSG_PUB.Count_And_Get
9360: (
9361: p_count => x_msg_count,
9362: p_data => x_msg_data
9368: fnd_message.set_token('P_SQLERRM',SQLERRM);
9369: fnd_message.set_token('P_API_NAME',l_api_name);
9370: FND_MSG_PUB.add;
9371:
9372: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
9373: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
9374: FND_MSG_PUB.Add_Exc_Msg
9375: (
9376: G_PKG_NAME,
9630:
9631:
9632: /* Standard call to check for call compatibility */
9633:
9634: IF NOT fnd_api.compatible_api_call (l_api_version,
9635: p_api_version,
9636: l_api_name,
9637: g_pkg_name) THEN
9638: RAISE fnd_api.g_exc_unexpected_error;
9634: IF NOT fnd_api.compatible_api_call (l_api_version,
9635: p_api_version,
9636: l_api_name,
9637: g_pkg_name) THEN
9638: RAISE fnd_api.g_exc_unexpected_error;
9639: END IF;
9640:
9641:
9642: /* Initialize message list if p_init_msg_list is set to TRUE */
9640:
9641:
9642: /* Initialize message list if p_init_msg_list is set to TRUE */
9643:
9644: IF fnd_api.to_boolean (p_init_msg_list) THEN
9645: fnd_msg_pub.initialize;
9646: END IF;
9647:
9648: x_return_status := fnd_api.g_ret_sts_success;
9644: IF fnd_api.to_boolean (p_init_msg_list) THEN
9645: fnd_msg_pub.initialize;
9646: END IF;
9647:
9648: x_return_status := fnd_api.g_ret_sts_success;
9649:
9650:
9651:
9652: /* Get TASK source and the related information */
9656: FETCH cur_esc_id INTO l_cur_esc_id;
9657: IF ( cur_esc_id%NOTFOUND ) THEN
9658: fnd_message.set_name('JTF', 'JTF_AM_INVALID_ESC_ID');
9659: fnd_msg_pub.add;
9660: RAISE fnd_api.g_exc_error;
9661: ELSE
9662: l_esc_source_code := l_cur_esc_id.source_object_type_code;
9663: l_esc_source_id := l_cur_esc_id.source_object_id;
9664: l_planned_start_date := l_cur_esc_id.planned_start_date;
9671:
9672: IF ( l_esc_source_code <> 'ESC' ) THEN
9673: fnd_message.set_name('JTF', 'JTF_AM_INVALID_ESC_ID');
9674: fnd_msg_pub.add;
9675: RAISE fnd_api.g_exc_error;
9676: ELSE
9677: OPEN cur_reference_code;
9678: FETCH cur_reference_code INTO l_cur_reference_code;
9679: IF ( cur_reference_code%NOTFOUND) THEN
9678: FETCH cur_reference_code INTO l_cur_reference_code;
9679: IF ( cur_reference_code%NOTFOUND) THEN
9680: fnd_message.set_name('JTF', 'JTF_AM_INVALID_ESC_ID');
9681: fnd_msg_pub.add;
9682: RAISE fnd_api.g_exc_error;
9683: ELSE
9684: l_reference_code := l_cur_reference_code.reference_code;
9685: l_object_type_code := l_cur_reference_code.object_type_code;
9686: l_object_id := l_cur_reference_code.object_id;
9687:
9688: IF ( l_reference_code <> 'ESC' ) THEN
9689: fnd_message.set_name('JTF', 'JTF_AM_INVALID_ESC_REF');
9690: fnd_msg_pub.add;
9691: RAISE fnd_api.g_exc_error;
9692: END IF;
9693: END IF;
9694: CLOSE cur_reference_code;
9695: END IF;
9776:
9777: IF ( cur_source_task%NOTFOUND ) THEN
9778: fnd_message.set_name('JTF', 'JTF_AM_INVALID_TASK_ID');
9779: fnd_msg_pub.add;
9780: RAISE fnd_api.g_exc_error;
9781: END IF;
9782:
9783: CLOSE cur_source_task;
9784:
9797:
9798: IF ( cur_source_sr%NOTFOUND ) THEN
9799: fnd_message.set_name('JTF', 'JTF_AM_INVALID_SR_ID');
9800: fnd_msg_pub.add;
9801: RAISE fnd_api.g_exc_error;
9802: END IF;
9803:
9804: CLOSE cur_source_sr;
9805:
9821:
9822: IF ( cur_source_defect%NOTFOUND ) THEN
9823: fnd_message.set_name('JTF', 'JTF_AM_INVALID_DEFECT_ID');
9824: fnd_msg_pub.add;
9825: RAISE fnd_api.g_exc_error;
9826: END IF;
9827:
9828: CLOSE cur_source_defect;
9829:
9855: -- set back the API name to original name
9856: l_api_name := l_api_name_1;
9857:
9858:
9859: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
9860: -- Unexpected Execution Error from call to Territory Manager
9861: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
9862: fnd_msg_pub.add;
9863: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9859: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
9860: -- Unexpected Execution Error from call to Territory Manager
9861: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
9862: fnd_msg_pub.add;
9863: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9864: RAISE fnd_api.g_exc_error;
9865: ELSE
9866: RAISE fnd_api.g_exc_unexpected_error;
9867: END IF;
9860: -- Unexpected Execution Error from call to Territory Manager
9861: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
9862: fnd_msg_pub.add;
9863: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9864: RAISE fnd_api.g_exc_error;
9865: ELSE
9866: RAISE fnd_api.g_exc_unexpected_error;
9867: END IF;
9868: END IF;
9862: fnd_msg_pub.add;
9863: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9864: RAISE fnd_api.g_exc_error;
9865: ELSE
9866: RAISE fnd_api.g_exc_unexpected_error;
9867: END IF;
9868: END IF;
9869:
9870: l_assign_resources_tbl.DELETE;
9889:
9890: -- set back the API name to original name
9891: l_api_name := l_api_name_1;
9892:
9893: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
9894: -- Unexpected Execution Error from call to Territory Manager
9895: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
9896: fnd_msg_pub.add;
9897: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9893: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
9894: -- Unexpected Execution Error from call to Territory Manager
9895: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
9896: fnd_msg_pub.add;
9897: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9898: RAISE fnd_api.g_exc_error;
9899: ELSE
9900: RAISE fnd_api.g_exc_unexpected_error;
9901: END IF;
9894: -- Unexpected Execution Error from call to Territory Manager
9895: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
9896: fnd_msg_pub.add;
9897: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9898: RAISE fnd_api.g_exc_error;
9899: ELSE
9900: RAISE fnd_api.g_exc_unexpected_error;
9901: END IF;
9902: END IF;
9896: fnd_msg_pub.add;
9897: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9898: RAISE fnd_api.g_exc_error;
9899: ELSE
9900: RAISE fnd_api.g_exc_unexpected_error;
9901: END IF;
9902: END IF;
9903:
9904: --ELSE
9903:
9904: --ELSE
9905: --fnd_message.set_name('JTF', 'JTF_AM_NO_ESC_TERR');
9906: --fnd_msg_pub.add;
9907: --RAISE fnd_api.g_exc_error;
9908: END IF;
9909:
9910: END IF; -- IF (l_territory_id IS NOT NULL) THEN
9911:
9930:
9931: -- set back the API name to original name
9932: l_api_name := l_api_name_1;
9933:
9934: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
9935: -- Unexpected Execution Error from call to Territory Manager
9936: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
9937: fnd_msg_pub.add;
9938: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9934: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
9935: -- Unexpected Execution Error from call to Territory Manager
9936: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
9937: fnd_msg_pub.add;
9938: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9939: RAISE fnd_api.g_exc_error;
9940: ELSE
9941: RAISE fnd_api.g_exc_unexpected_error;
9942: END IF;
9935: -- Unexpected Execution Error from call to Territory Manager
9936: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
9937: fnd_msg_pub.add;
9938: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9939: RAISE fnd_api.g_exc_error;
9940: ELSE
9941: RAISE fnd_api.g_exc_unexpected_error;
9942: END IF;
9943: END IF;
9937: fnd_msg_pub.add;
9938: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
9939: RAISE fnd_api.g_exc_error;
9940: ELSE
9941: RAISE fnd_api.g_exc_unexpected_error;
9942: END IF;
9943: END IF;
9944: END IF;
9945:
10044:
10045: -- set back the API name to original name
10046: l_api_name := l_api_name_1;
10047:
10048: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
10049: -- Unexpected Execution Error from call to Get_contracts_resources
10050: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
10051: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
10052: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_ESC_RESOURCES');
10050: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
10051: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
10052: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_ESC_RESOURCES');
10053: fnd_msg_pub.add;
10054: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
10055: RAISE fnd_api.g_exc_error;
10056: ELSE
10057: RAISE fnd_api.g_exc_unexpected_error;
10058: END IF;
10051: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
10052: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_ESC_RESOURCES');
10053: fnd_msg_pub.add;
10054: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
10055: RAISE fnd_api.g_exc_error;
10056: ELSE
10057: RAISE fnd_api.g_exc_unexpected_error;
10058: END IF;
10059: END IF; -- end of x_return_status check
10053: fnd_msg_pub.add;
10054: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
10055: RAISE fnd_api.g_exc_error;
10056: ELSE
10057: RAISE fnd_api.g_exc_unexpected_error;
10058: END IF;
10059: END IF; -- end of x_return_status check
10060: -- end if; -- if p_calendar_flag = Y
10061:
10062: IF ( p_calendar_flag = 'Y' AND
10063: x_assign_resources_tbl.count = 0 ) THEN
10064: fnd_message.set_name('JTF', 'JTF_AM_RESOURCE_NOT_AVAILABLE');
10065: fnd_msg_pub.add;
10066: -- RAISE fnd_api.g_exc_error;
10067: END IF;
10068:
10069: -- to implement auto selection
10070: IF(l_auto_select_flag = 'Y')
10090:
10091: ELSE -- No resources returned from the Territory API
10092: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
10093: fnd_msg_pub.add;
10094: -- RAISE fnd_api.g_exc_error;
10095: END IF;
10096:
10097: ELSE -- Territory Flag is NO
10098: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
10096:
10097: ELSE -- Territory Flag is NO
10098: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
10099: fnd_msg_pub.add;
10100: -- RAISE fnd_api.g_exc_error;
10101: END IF;
10102:
10103: l_esc_record := p_esc_tbl.NEXT(l_esc_record);
10104:
10124:
10125: -- set back the API name to original name
10126: l_api_name := l_api_name_1;
10127:
10128: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
10129: -- Unexpected Execution Error from call to Territory Manager
10130: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
10131: fnd_msg_pub.add;
10132: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
10128: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
10129: -- Unexpected Execution Error from call to Territory Manager
10130: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
10131: fnd_msg_pub.add;
10132: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
10133: RAISE fnd_api.g_exc_error;
10134: ELSE
10135: RAISE fnd_api.g_exc_unexpected_error;
10136: END IF;
10129: -- Unexpected Execution Error from call to Territory Manager
10130: fnd_message.set_name('JTF', 'JTF_AM_ERROR_TERR_API');
10131: fnd_msg_pub.add;
10132: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
10133: RAISE fnd_api.g_exc_error;
10134: ELSE
10135: RAISE fnd_api.g_exc_unexpected_error;
10136: END IF;
10137: END IF;
10131: fnd_msg_pub.add;
10132: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
10133: RAISE fnd_api.g_exc_error;
10134: ELSE
10135: RAISE fnd_api.g_exc_unexpected_error;
10136: END IF;
10137: END IF;
10138:
10139:
10191:
10192: ELSE -- l_assign_resources_tbl.COUNT <= 0
10193: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
10194: fnd_msg_pub.add;
10195: -- RAISE fnd_api.g_exc_error;
10196: END IF;
10197:
10198:
10199: /*
10198:
10199: /*
10200: fnd_message.set_name('JTF', 'JTF_AM_EMPTY_ESC_TBL');
10201: fnd_msg_pub.add;
10202: RAISE fnd_api.g_exc_error;
10203: */
10204:
10205: END IF; -- End of l_esc_tbl.count > 0
10206:
10318: X_MSG_DATA => l_wf_msg_data
10319: );
10320:
10321:
10322: IF NOT (l_wf_return_status = fnd_api.g_ret_sts_success) THEN
10323: -- Unexpected Execution Error from call to assign_sr_resource
10324: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
10325: fnd_message.set_token('P_PROC_NAME','JTF_AM_WF_EVENTS_PUB');
10326: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ESC_RESOURCES');
10348: X_MSG_DATA => l_wf_msg_data
10349: );
10350:
10351:
10352: IF NOT (l_wf_return_status = fnd_api.g_ret_sts_success) THEN
10353: -- Unexpected Execution Error from call to assign_sr_resource
10354: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
10355: fnd_message.set_token('P_PROC_NAME','JTF_AM_WF_EVENTS_PUB');
10356: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ESC_RESOURCES');
10405: x_msg_data => x_msg_data
10406: )
10407: ) THEN
10408:
10409: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
10410: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
10411: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
10412: fnd_msg_pub.add;
10413: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
10409: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
10410: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
10411: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
10412: fnd_msg_pub.add;
10413: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
10414: RAISE fnd_api.g_exc_error;
10415: ELSE
10416: RAISE fnd_api.g_exc_unexpected_error;
10417: END IF;
10410: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
10411: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
10412: fnd_msg_pub.add;
10413: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
10414: RAISE fnd_api.g_exc_error;
10415: ELSE
10416: RAISE fnd_api.g_exc_unexpected_error;
10417: END IF;
10418: END IF;
10412: fnd_msg_pub.add;
10413: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
10414: RAISE fnd_api.g_exc_error;
10415: ELSE
10416: RAISE fnd_api.g_exc_unexpected_error;
10417: END IF;
10418: END IF;
10419:
10420:
10435: 'W'
10436: );
10437:
10438:
10439: IF (l_return_code = fnd_api.g_ret_sts_error) THEN
10440: -- Execution Error from call to Assignment Manager Workflow Hook
10441: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
10442: fnd_msg_pub.add;
10443: RAISE fnd_api.g_exc_error;
10439: IF (l_return_code = fnd_api.g_ret_sts_error) THEN
10440: -- Execution Error from call to Assignment Manager Workflow Hook
10441: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
10442: fnd_msg_pub.add;
10443: RAISE fnd_api.g_exc_error;
10444: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
10445: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
10446: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
10447: fnd_msg_pub.add;
10440: -- Execution Error from call to Assignment Manager Workflow Hook
10441: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
10442: fnd_msg_pub.add;
10443: RAISE fnd_api.g_exc_error;
10444: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
10445: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
10446: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
10447: fnd_msg_pub.add;
10448: RAISE fnd_api.g_exc_unexpected_error;
10444: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
10445: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
10446: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
10447: fnd_msg_pub.add;
10448: RAISE fnd_api.g_exc_unexpected_error;
10449: END IF;
10450:
10451: END IF; -- End of JTF_ASSIGN_CUHK
10452:
10465:
10466:
10467:
10468: EXCEPTION
10469: WHEN FND_API.G_EXC_ERROR THEN
10470: x_return_status := FND_API.G_RET_STS_ERROR ;
10471: FND_MSG_PUB.Count_And_Get
10472: (
10473: p_count => x_msg_count,
10466:
10467:
10468: EXCEPTION
10469: WHEN FND_API.G_EXC_ERROR THEN
10470: x_return_status := FND_API.G_RET_STS_ERROR ;
10471: FND_MSG_PUB.Count_And_Get
10472: (
10473: p_count => x_msg_count,
10474: p_data => x_msg_data
10473: p_count => x_msg_count,
10474: p_data => x_msg_data
10475: );
10476:
10477: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
10478: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10479: FND_MSG_PUB.Count_And_Get
10480: (
10481: p_count => x_msg_count,
10474: p_data => x_msg_data
10475: );
10476:
10477: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
10478: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10479: FND_MSG_PUB.Count_And_Get
10480: (
10481: p_count => x_msg_count,
10482: p_data => x_msg_data
10488: fnd_message.set_token('P_SQLERRM',SQLERRM);
10489: fnd_message.set_token('P_API_NAME',l_api_name);
10490: FND_MSG_PUB.add;
10491:
10492: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10493: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
10494: FND_MSG_PUB.Add_Exc_Msg
10495: (
10496: G_PKG_NAME,
10771:
10772:
10773: /* Standard call to check for call compatibility */
10774:
10775: IF NOT fnd_api.compatible_api_call (l_api_version,
10776: p_api_version,
10777: l_api_name,
10778: g_pkg_name) THEN
10779: RAISE fnd_api.g_exc_unexpected_error;
10775: IF NOT fnd_api.compatible_api_call (l_api_version,
10776: p_api_version,
10777: l_api_name,
10778: g_pkg_name) THEN
10779: RAISE fnd_api.g_exc_unexpected_error;
10780: END IF;
10781:
10782:
10783: /* Initialize message list if p_init_msg_list is set to TRUE */
10781:
10782:
10783: /* Initialize message list if p_init_msg_list is set to TRUE */
10784:
10785: IF fnd_api.to_boolean (p_init_msg_list) THEN
10786: fnd_msg_pub.initialize;
10787: END IF;
10788:
10789:
10796: FETCH cur_resource_type INTO l_cur_resource_type;
10797: IF ( cur_resource_type%NOTFOUND) THEN
10798: fnd_message.set_name('JTF', 'JTF_AM_INVALID_RESOURCE_TYPE');
10799: fnd_msg_pub.add;
10800: RAISE fnd_api.g_exc_error;
10801: END IF;
10802: CLOSE cur_resource_type;
10803: END IF;
10804:
10809: FETCH cur_effort_uom INTO l_cur_effort_uom;
10810: IF ( cur_effort_uom%NOTFOUND) THEN
10811: fnd_message.set_name('JTF', 'JTF_AM_INVALID_EFFORT_UOM');
10812: fnd_msg_pub.add;
10813: RAISE fnd_api.g_exc_error;
10814: END IF;
10815: CLOSE cur_effort_uom;
10816: END IF;
10817: */
10925:
10926: l_effort_duration := p_effort_duration; --Added by SBARAT on 21/04/2005 for Bug-4300801
10927:
10928: /* This assigning is being done because of the limitation for
10929: the direct use of the variables FND_API.MISS_NUM, MISS_CHAR etc. */
10930:
10931:
10932: /* Assigning values to the Service Request Record Type */
10933:
11149: ) THEN
11150:
11151: fnd_message.set_name('JTF', 'JTF_AM_INVALID_DOC_TYPE');
11152: fnd_msg_pub.add;
11153: RAISE fnd_api.g_exc_error;
11154:
11155: END IF;
11156:
11157:
11196: p_calendar_check => p_calendar_check
11197: --Added for Bug # 5573916 Ends here
11198: );
11199:
11200: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
11201: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
11202: fnd_message.set_token('P_PROC_NAME','GET_ASSIGN_SR_RESOURCES');
11203: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_RESOURCES');
11204: fnd_msg_pub.add;
11201: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
11202: fnd_message.set_token('P_PROC_NAME','GET_ASSIGN_SR_RESOURCES');
11203: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_RESOURCES');
11204: fnd_msg_pub.add;
11205: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
11206: RAISE fnd_api.g_exc_error;
11207: ELSE
11208: RAISE fnd_api.g_exc_unexpected_error;
11209: END IF;
11202: fnd_message.set_token('P_PROC_NAME','GET_ASSIGN_SR_RESOURCES');
11203: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_RESOURCES');
11204: fnd_msg_pub.add;
11205: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
11206: RAISE fnd_api.g_exc_error;
11207: ELSE
11208: RAISE fnd_api.g_exc_unexpected_error;
11209: END IF;
11210: END IF;
11204: fnd_msg_pub.add;
11205: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
11206: RAISE fnd_api.g_exc_error;
11207: ELSE
11208: RAISE fnd_api.g_exc_unexpected_error;
11209: END IF;
11210: END IF;
11211:
11212: -- added this to filter by usage
11210: END IF;
11211:
11212: -- added this to filter by usage
11213: IF ((l_assign_resources_tbl.count > 0 ) AND
11214: (nvl(l_usage, fnd_api.g_miss_char) <> 'ALL' ) AND
11215: (l_usage is not null)
11216: )
11217: THEN
11218: get_usage_resource(l_usage ,
11360: ELSE
11361: -- No resources returned from the Assignment Manager API for SERVICE REQUESTS
11362: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
11363: fnd_msg_pub.add;
11364: -- RAISE fnd_api.g_exc_error;
11365: END IF;
11366:
11367:
11368: -- raise workfow event
11392: X_MSG_DATA => l_wf_msg_data
11393: );
11394:
11395:
11396: IF NOT (l_wf_return_status = fnd_api.g_ret_sts_success) THEN
11397: -- Unexpected Execution Error from call to assign_sr_resource
11398: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
11399: fnd_message.set_token('P_PROC_NAME','JTF_AM_WF_EVENTS_PUB');
11400: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_RESOURCES');
11399: fnd_message.set_token('P_PROC_NAME','JTF_AM_WF_EVENTS_PUB');
11400: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_RESOURCES');
11401: fnd_msg_pub.add;
11402: /* Not raising the errors as req by tele service team
11403: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
11404: RAISE fnd_api.g_exc_error;
11405: ELSE
11406: RAISE fnd_api.g_exc_unexpected_error;
11407: END IF;
11400: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_RESOURCES');
11401: fnd_msg_pub.add;
11402: /* Not raising the errors as req by tele service team
11403: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
11404: RAISE fnd_api.g_exc_error;
11405: ELSE
11406: RAISE fnd_api.g_exc_unexpected_error;
11407: END IF;
11408: */
11402: /* Not raising the errors as req by tele service team
11403: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
11404: RAISE fnd_api.g_exc_error;
11405: ELSE
11406: RAISE fnd_api.g_exc_unexpected_error;
11407: END IF;
11408: */
11409: ELSE
11410: x_assign_resources_tbl := jtf_assign_pub.g_assign_resources_tbl;
11469: p_calendar_check => p_calendar_check
11470: --Added for Bug # 5573916 Ends here
11471: );
11472:
11473: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
11474: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
11475: fnd_message.set_token('P_PROC_NAME','GET_ASSIGN_TASK_RESOURCES');
11476: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_RESOURCES');
11477: fnd_msg_pub.add;
11474: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
11475: fnd_message.set_token('P_PROC_NAME','GET_ASSIGN_TASK_RESOURCES');
11476: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_RESOURCES');
11477: fnd_msg_pub.add;
11478: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
11479: RAISE fnd_api.g_exc_error;
11480: ELSE
11481: RAISE fnd_api.g_exc_unexpected_error;
11482: END IF;
11475: fnd_message.set_token('P_PROC_NAME','GET_ASSIGN_TASK_RESOURCES');
11476: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_RESOURCES');
11477: fnd_msg_pub.add;
11478: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
11479: RAISE fnd_api.g_exc_error;
11480: ELSE
11481: RAISE fnd_api.g_exc_unexpected_error;
11482: END IF;
11483: END IF;
11477: fnd_msg_pub.add;
11478: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
11479: RAISE fnd_api.g_exc_error;
11480: ELSE
11481: RAISE fnd_api.g_exc_unexpected_error;
11482: END IF;
11483: END IF;
11484:
11485: /* Begin code to implement the sorting of resources by postal code */
11484:
11485: /* Begin code to implement the sorting of resources by postal code */
11486: -- added this to filter by usage
11487: IF ((l_assign_resources_tbl.count > 0 ) AND
11488: (nvl(l_usage, fnd_api.g_miss_char) <> 'ALL' ) AND
11489: (l_usage is not null)
11490: --(l_usage is not null or l_usage <> 'ALL')
11491: )
11492: THEN
11654:
11655: ELSE -- No resources returned from the Assignment Manager API for TASKS
11656: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
11657: fnd_msg_pub.add;
11658: -- RAISE fnd_api.g_exc_error;
11659: END IF;
11660:
11661: -- raise workfow event
11662: -- workflow test
11678: X_MSG_DATA => l_wf_msg_data
11679: );
11680:
11681:
11682: IF NOT (l_wf_return_status = fnd_api.g_ret_sts_success) THEN
11683: -- Unexpected Execution Error from call to assign_sr_resource
11684: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
11685: fnd_message.set_token('P_PROC_NAME','JTF_AM_WF_EVENTS_PUB');
11686: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_RESOURCES');
11741: x_msg_count => x_msg_count,
11742: x_msg_data => x_msg_data
11743: );
11744:
11745: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
11746: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
11747: fnd_message.set_token('P_PROC_NAME','GET_ASSIGN_DEFECT_RESOURCES');
11748: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_RESOURCES');
11749: fnd_msg_pub.add;
11746: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
11747: fnd_message.set_token('P_PROC_NAME','GET_ASSIGN_DEFECT_RESOURCES');
11748: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_RESOURCES');
11749: fnd_msg_pub.add;
11750: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
11751: RAISE fnd_api.g_exc_error;
11752: ELSE
11753: RAISE fnd_api.g_exc_unexpected_error;
11754: END IF;
11747: fnd_message.set_token('P_PROC_NAME','GET_ASSIGN_DEFECT_RESOURCES');
11748: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_RESOURCES');
11749: fnd_msg_pub.add;
11750: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
11751: RAISE fnd_api.g_exc_error;
11752: ELSE
11753: RAISE fnd_api.g_exc_unexpected_error;
11754: END IF;
11755: END IF;
11749: fnd_msg_pub.add;
11750: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
11751: RAISE fnd_api.g_exc_error;
11752: ELSE
11753: RAISE fnd_api.g_exc_unexpected_error;
11754: END IF;
11755: END IF;
11756:
11757: -- added this to filter by usage
11755: END IF;
11756:
11757: -- added this to filter by usage
11758: IF ((l_assign_resources_tbl.count > 0 ) AND
11759: (nvl(l_usage, fnd_api.g_miss_char) <> 'ALL' ) AND
11760: (l_usage is not null)
11761: --(l_usage is not null or l_usage <> 'ALL')
11762: )
11763: THEN
11834:
11835: ELSE -- No resources returned from the Assignment Manager API for DEFECTS
11836: fnd_message.set_name('JTF', 'JTF_AM_NO_RESOURCES_FOUND');
11837: fnd_msg_pub.add;
11838: -- RAISE fnd_api.g_exc_error;
11839: END IF;
11840:
11841: -- raise workfow event
11842: -- workflow test
11858: X_MSG_DATA => l_wf_msg_data
11859: );
11860:
11861:
11862: IF NOT (l_wf_return_status = fnd_api.g_ret_sts_success) THEN
11863: -- Unexpected Execution Error from call to assign_sr_resource
11864: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
11865: fnd_message.set_token('P_PROC_NAME','JTF_AM_WF_EVENTS_PUB');
11866: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_RESOURCES');
11911: )
11912: ) THEN
11913:
11914:
11915: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
11916: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
11917: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
11918: fnd_msg_pub.add;
11919: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
11915: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
11916: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
11917: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
11918: fnd_msg_pub.add;
11919: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
11920: RAISE fnd_api.g_exc_error;
11921: ELSE
11922: RAISE fnd_api.g_exc_unexpected_error;
11923: END IF;
11916: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
11917: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
11918: fnd_msg_pub.add;
11919: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
11920: RAISE fnd_api.g_exc_error;
11921: ELSE
11922: RAISE fnd_api.g_exc_unexpected_error;
11923: END IF;
11924: END IF;
11918: fnd_msg_pub.add;
11919: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
11920: RAISE fnd_api.g_exc_error;
11921: ELSE
11922: RAISE fnd_api.g_exc_unexpected_error;
11923: END IF;
11924: END IF;
11925:
11926:
11941: 'W'
11942: );
11943:
11944:
11945: IF (l_return_code = fnd_api.g_ret_sts_error) THEN
11946: -- Execution Error from call to Assignment Manager Workflow Hook
11947: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
11948: fnd_msg_pub.add;
11949: RAISE fnd_api.g_exc_error;
11945: IF (l_return_code = fnd_api.g_ret_sts_error) THEN
11946: -- Execution Error from call to Assignment Manager Workflow Hook
11947: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
11948: fnd_msg_pub.add;
11949: RAISE fnd_api.g_exc_error;
11950: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
11951: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
11952: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
11953: fnd_msg_pub.add;
11946: -- Execution Error from call to Assignment Manager Workflow Hook
11947: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
11948: fnd_msg_pub.add;
11949: RAISE fnd_api.g_exc_error;
11950: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
11951: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
11952: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
11953: fnd_msg_pub.add;
11954: RAISE fnd_api.g_exc_unexpected_error;
11950: ELSIF (l_return_code = fnd_api.g_ret_sts_unexp_error) THEN
11951: -- Unexpected Execution Error from call to Assignment Manager Workflow Hook
11952: fnd_message.set_name('JTF', 'JTF_AM_ERROR_WF_API');
11953: fnd_msg_pub.add;
11954: RAISE fnd_api.g_exc_unexpected_error;
11955: END IF;
11956:
11957: END IF; -- End of JTF_ASSIGN_CUHK
11958:
11968: p_data => x_msg_data
11969: );
11970:
11971:
11972: x_return_status := fnd_api.g_ret_sts_success;
11973:
11974:
11975:
11976: EXCEPTION
11973:
11974:
11975:
11976: EXCEPTION
11977: WHEN FND_API.G_EXC_ERROR THEN
11978: x_return_status := FND_API.G_RET_STS_ERROR ;
11979: FND_MSG_PUB.Count_And_Get
11980: (
11981: p_count => x_msg_count,
11974:
11975:
11976: EXCEPTION
11977: WHEN FND_API.G_EXC_ERROR THEN
11978: x_return_status := FND_API.G_RET_STS_ERROR ;
11979: FND_MSG_PUB.Count_And_Get
11980: (
11981: p_count => x_msg_count,
11982: p_data => x_msg_data
11981: p_count => x_msg_count,
11982: p_data => x_msg_data
11983: );
11984:
11985: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
11986: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
11987: FND_MSG_PUB.Count_And_Get
11988: (
11989: p_count => x_msg_count,
11982: p_data => x_msg_data
11983: );
11984:
11985: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
11986: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
11987: FND_MSG_PUB.Count_And_Get
11988: (
11989: p_count => x_msg_count,
11990: p_data => x_msg_data
11996: fnd_message.set_token('P_SQLERRM',SQLERRM);
11997: fnd_message.set_token('P_API_NAME',l_api_name);
11998: FND_MSG_PUB.add;
11999:
12000: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
12001: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
12002: FND_MSG_PUB.Add_Exc_Msg
12003: (
12004: G_PKG_NAME,
12079: BEGIN
12080:
12081: /* Standard call to check for call compatibility */
12082:
12083: IF NOT fnd_api.compatible_api_call (l_api_version,
12084: p_api_version,
12085: l_api_name,
12086: g_pkg_name) THEN
12087: RAISE fnd_api.g_exc_unexpected_error;
12083: IF NOT fnd_api.compatible_api_call (l_api_version,
12084: p_api_version,
12085: l_api_name,
12086: g_pkg_name) THEN
12087: RAISE fnd_api.g_exc_unexpected_error;
12088: END IF;
12089:
12090:
12091: /* Initialize message list if p_init_msg_list is set to TRUE */
12089:
12090:
12091: /* Initialize message list if p_init_msg_list is set to TRUE */
12092:
12093: IF fnd_api.to_boolean (p_init_msg_list) THEN
12094: fnd_msg_pub.initialize;
12095: END IF;
12096:
12097: x_return_status := fnd_api.g_ret_sts_success;
12093: IF fnd_api.to_boolean (p_init_msg_list) THEN
12094: fnd_msg_pub.initialize;
12095: END IF;
12096:
12097: x_return_status := fnd_api.g_ret_sts_success;
12098:
12099: -- If p_document_type = TASK then get the contract_service_id and the customer_product_id from the table
12100: IF(p_calling_doc_type = 'TASK')
12101: THEN
12212: x_assign_resources_tbl => l_contracts_tbl,
12213: x_excluded_tbl => l_excluded_resource_tbl
12214: );
12215:
12216: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
12217: -- Unexpected Execution Error from call to Get_contracts_resources
12218: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
12219: fnd_message.set_token('P_PROC_NAME','GET_CONTRACTS_RESOURCES');
12220: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
12218: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
12219: fnd_message.set_token('P_PROC_NAME','GET_CONTRACTS_RESOURCES');
12220: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
12221: fnd_msg_pub.add;
12222: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
12223: RAISE fnd_api.g_exc_error;
12224: ELSE
12225: RAISE fnd_api.g_exc_unexpected_error;
12226: END IF;
12219: fnd_message.set_token('P_PROC_NAME','GET_CONTRACTS_RESOURCES');
12220: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_SR_RESOURCES');
12221: fnd_msg_pub.add;
12222: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
12223: RAISE fnd_api.g_exc_error;
12224: ELSE
12225: RAISE fnd_api.g_exc_unexpected_error;
12226: END IF;
12227: END IF;
12221: fnd_msg_pub.add;
12222: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
12223: RAISE fnd_api.g_exc_error;
12224: ELSE
12225: RAISE fnd_api.g_exc_unexpected_error;
12226: END IF;
12227: END IF;
12228: END IF;
12229:
12246: x_assign_resources_tbl => l_ib_tbl,
12247: x_excluded_tbl => l_excluded_resource_tbl
12248: );
12249:
12250: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
12251: -- Unexpected Execution Error from call to Get_contracts_resources
12252: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
12253: fnd_message.set_token('P_PROC_NAME','GET_IB_RESOURCES');
12254: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_TASK_RESOURCES');
12252: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
12253: fnd_message.set_token('P_PROC_NAME','GET_IB_RESOURCES');
12254: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_TASK_RESOURCES');
12255: fnd_msg_pub.add;
12256: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
12257: RAISE fnd_api.g_exc_error;
12258: ELSE
12259: RAISE fnd_api.g_exc_unexpected_error;
12260: END IF;
12253: fnd_message.set_token('P_PROC_NAME','GET_IB_RESOURCES');
12254: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_ASSIGN_TASK_RESOURCES');
12255: fnd_msg_pub.add;
12256: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
12257: RAISE fnd_api.g_exc_error;
12258: ELSE
12259: RAISE fnd_api.g_exc_unexpected_error;
12260: END IF;
12261: END IF;
12255: fnd_msg_pub.add;
12256: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
12257: RAISE fnd_api.g_exc_error;
12258: ELSE
12259: RAISE fnd_api.g_exc_unexpected_error;
12260: END IF;
12261: END IF;
12262: END IF;
12263:
12266: x_excluded_resouurce_tbl.delete;
12267: x_excluded_resouurce_tbl := l_excluded_resource_tbl;
12268:
12269: EXCEPTION
12270: WHEN FND_API.G_EXC_ERROR THEN
12271: x_return_status := FND_API.G_RET_STS_ERROR ;
12272: FND_MSG_PUB.Count_And_Get
12273: (
12274: p_count => x_msg_count,
12267: x_excluded_resouurce_tbl := l_excluded_resource_tbl;
12268:
12269: EXCEPTION
12270: WHEN FND_API.G_EXC_ERROR THEN
12271: x_return_status := FND_API.G_RET_STS_ERROR ;
12272: FND_MSG_PUB.Count_And_Get
12273: (
12274: p_count => x_msg_count,
12275: p_data => x_msg_data
12274: p_count => x_msg_count,
12275: p_data => x_msg_data
12276: );
12277:
12278: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
12279: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
12280: FND_MSG_PUB.Count_And_Get
12281: (
12282: p_count => x_msg_count,
12275: p_data => x_msg_data
12276: );
12277:
12278: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
12279: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
12280: FND_MSG_PUB.Count_And_Get
12281: (
12282: p_count => x_msg_count,
12283: p_data => x_msg_data
12289: fnd_message.set_token('P_SQLERRM',SQLERRM);
12290: fnd_message.set_token('P_API_NAME',l_api_name);
12291: FND_MSG_PUB.add;
12292:
12293: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
12294: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
12295: FND_MSG_PUB.Add_Exc_Msg
12296: (
12297: G_PKG_NAME,
12334: l_api_version NUMBER := 1.0;
12335:
12336: BEGIN
12337: /* Standard call to check for call compatibility */
12338: IF NOT fnd_api.compatible_api_call (l_api_version,
12339: p_api_version,
12340: l_api_name,
12341: g_pkg_name)
12342: THEN
12339: p_api_version,
12340: l_api_name,
12341: g_pkg_name)
12342: THEN
12343: RAISE fnd_api.g_exc_unexpected_error;
12344: END IF;
12345:
12346:
12347: /* Initialize message list if p_init_msg_list is set to TRUE */
12344: END IF;
12345:
12346:
12347: /* Initialize message list if p_init_msg_list is set to TRUE */
12348: IF fnd_api.to_boolean (p_init_msg_list)
12349: THEN
12350: fnd_msg_pub.initialize;
12351: END IF;
12352:
12349: THEN
12350: fnd_msg_pub.initialize;
12351: END IF;
12352:
12353: x_return_status := fnd_api.g_ret_sts_success;
12354:
12355: l_api_name := l_api_name||'-GET_AVAILABLE_RESOURCE';
12356: l_return_status_1 := x_return_status ;
12357: -- call the api to check resource availability
12373:
12374: -- set back the API name to original name
12375: l_api_name := l_api_name_1;
12376:
12377: IF NOT (x_return_status = fnd_api.g_ret_sts_success) THEN
12378: -- Unexpected Execution Error from call to Get_contracts_resources
12379: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
12380: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
12381: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_CONTRACTS_RESOURCES');
12379: fnd_message.set_name('JTF', 'JTF_AM_GENERIC_API_ERROR');
12380: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
12381: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_CONTRACTS_RESOURCES');
12382: fnd_msg_pub.add;
12383: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
12384: RAISE fnd_api.g_exc_error;
12385: ELSE
12386: RAISE fnd_api.g_exc_unexpected_error;
12387: END IF;
12380: fnd_message.set_token('P_PROC_NAME','GET_AVAILABLE_RESOURCE');
12381: fnd_message.set_token('P_API_NAME','JTF_ASSIGN_PUB.GET_CONTRACTS_RESOURCES');
12382: fnd_msg_pub.add;
12383: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
12384: RAISE fnd_api.g_exc_error;
12385: ELSE
12386: RAISE fnd_api.g_exc_unexpected_error;
12387: END IF;
12388: END IF; -- end of x_return_status check
12382: fnd_msg_pub.add;
12383: IF (x_return_status = fnd_api.g_ret_sts_error) THEN
12384: RAISE fnd_api.g_exc_error;
12385: ELSE
12386: RAISE fnd_api.g_exc_unexpected_error;
12387: END IF;
12388: END IF; -- end of x_return_status check
12389:
12390:
12390:
12391:
12392:
12393: EXCEPTION
12394: WHEN FND_API.G_EXC_ERROR THEN
12395: x_return_status := FND_API.G_RET_STS_ERROR ;
12396: FND_MSG_PUB.Count_And_Get
12397: (
12398: p_count => x_msg_count,
12391:
12392:
12393: EXCEPTION
12394: WHEN FND_API.G_EXC_ERROR THEN
12395: x_return_status := FND_API.G_RET_STS_ERROR ;
12396: FND_MSG_PUB.Count_And_Get
12397: (
12398: p_count => x_msg_count,
12399: p_data => x_msg_data
12398: p_count => x_msg_count,
12399: p_data => x_msg_data
12400: );
12401:
12402: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
12403: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
12404: FND_MSG_PUB.Count_And_Get
12405: (
12406: p_count => x_msg_count,
12399: p_data => x_msg_data
12400: );
12401:
12402: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
12403: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
12404: FND_MSG_PUB.Count_And_Get
12405: (
12406: p_count => x_msg_count,
12407: p_data => x_msg_data
12413: fnd_message.set_token('P_SQLERRM',SQLERRM);
12414: fnd_message.set_token('P_API_NAME',l_api_name);
12415: FND_MSG_PUB.add;
12416:
12417: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
12418: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
12419: FND_MSG_PUB.Add_Exc_Msg
12420: (
12421: G_PKG_NAME,