52: ,x_return_status => v_return_status
53: ,x_error_message_code => v_error_message_code
54: );
55:
56: If v_return_status = FND_API.G_RET_STS_SUCCESS then
57: return 'Y';
58: else
59: return 'N';
60: End if;
92: ) IS
93:
94: BEGIN
95:
96: if P_return_status <> FND_API.G_RET_STS_SUCCESS then
97: PA_UTILS.add_message(p_app_short_name => 'PA',
98: p_msg_name => P_error_message_code);
99: end if;
100:
309: BEGIN
310: -- Initialize the Error stack
311: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.check_exp_OU');
312: -- Initialize the error status
313: x_return_status := FND_API.G_RET_STS_SUCCESS;
314:
315: If p_org_id is NOT NULL then
316:
317: SELECT 'Y'
333: EXCEPTION
334:
335: WHEN NO_DATA_FOUND THEN
336: x_error_message_code := v_error_message_code;
337: x_return_status := FND_API.G_RET_STS_ERROR;
338:
339:
340: WHEN OTHERS THEN
341: -- Set the exception Message and the stack
340: WHEN OTHERS THEN
341: -- Set the exception Message and the stack
342: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.check_exp_OU'
343: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
344: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
345: -- 4537865 : RESET x_error_message_code also
346: x_error_message_code := SQLCODE ;
347:
348: raise;
375: v_msg_count NUMBER;
376: BEGIN
377: -- Initialize the Error stack
378: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.call_create_resoruce_denorm');
379: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
380: v_job_id_new := P_job_id_new;
381: v_job_level_new := P_job_level_new;
382: v_job_id_old := P_job_id_old;
383: v_job_level_old := 0;
425:
426: -- Set the exception Message and the stack
427: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_HR_UPDATE_API.call_create_resource_denorm'
428: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
429: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
430: raise;
431:
432:
433:
457:
458: BEGIN
459: -- Initialize the Error stack
460: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.update_job_level_res_denorm');
461: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
462:
463: l_job_id_new := P_job_id_new;
464: l_job_level_new := P_job_level_new;
465: l_job_id_old := P_job_id_old;
499:
500: -- Set the exception Message and the stack
501: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.update_job_level_res_denorm'
502: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
503: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
504: raise;
505:
506: END update_job_level_res_denorm;
507:
552: BEGIN
553:
554: -- Initialize the Error stack
555: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.update_all_jobs');
556: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
557:
558: l_job_id := P_job_id;
559:
560: -- just assign the value to the local variable because job_level can be
603:
604: -- Set the exception Message and the stack
605: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.update_all_jobs'
606: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
607: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
608: raise;
609:
610: END update_all_jobs;
611:
634:
635: BEGIN
636: -- Initialize the Error stack
637: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.pa_job_relation_job_id');
638: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
639:
640: IF P_DEBUG_MODE = 'Y' THEN
641: log_message('P_from_job_id_old = ' || P_from_job_id_old);
642: log_message('P_from_job_id_new = ' || P_from_job_id_new);
910:
911: -- Set the exception Message and the stack
912: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.pa_job_relation_job_id'
913: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
914: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
915: raise;
916:
917:
918: END pa_job_relation_job_id;
956: BEGIN
957:
958: -- Initialize the Error stack
959: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.perform_job_updates');
960: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
961: IF P_DEBUG_MODE = 'Y' THEN
962: log_message('**** Performing Job Level Updates ****');
963: END IF;
964:
1030: WHEN OTHERS THEN -- Included WHEN OTHERS Block for 4537865
1031: -- 4537865 : RESET x_msg_count and x_msg_data also
1032: x_msg_count := 1 ;
1033: x_msg_data := SUBSTRB(SQLERRM ,1,240);
1034: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1035: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API',
1036: p_procedure_name => 'perform_job_updates',
1037: p_error_text => x_msg_data );
1038: RAISE ;
1062: BEGIN
1063:
1064: -- Initialize the Error stack
1065: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.update_job_level_dff');
1066: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
1067:
1068: l_job_id := P_job_id;
1069: l_job_level_old := P_job_level_old;
1070: l_job_level_new := P_job_level_new;
1143: WHEN OTHERS THEN -- Included WHEN OTHERS Block for 4537865
1144: -- 4537865 : RESET x_msg_count and x_msg_data also
1145: x_msg_count := 1 ;
1146: x_msg_data := SUBSTRB(SQLERRM ,1,240);
1147: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1148: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API',
1149: p_procedure_name => 'update_job_level_dff',
1150: p_error_text => x_msg_data );
1151: RAISE ;
1209: BEGIN
1210:
1211: -- Initialize the Error stack
1212: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.per_valid_grades_job_id');
1213: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
1214:
1215: -- if the grade id changes then update all the jobs which are affected and
1216: -- call PA_RESOURCE_PVT.UPDATE_RESOURCE_DENORM API to update the resource_denorm_table
1217: OPEN get_job_ids(P_job_id) ;
1252: x_msg_data := SUBSTRB(SQLERRM ,1,240);
1253: -- Set the exception Message and the stack
1254: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.per_valid_grades_job_id'
1255: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
1256: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1257: raise;
1258:
1259:
1260: END per_valid_grades_job_id;
1322:
1323:
1324: -- Initialize the Error stack
1325: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.per_grades_job_id');
1326: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
1327:
1328: -- if the sequence is changes then update all the jobs which are affected due to
1329: -- call PA_RESOURCE_PVT.UPDATE_RESOURCE_DENORM API to update the resource_denorm_table
1330: OPEN get_job_ids(P_grade_id) ;
1363: x_msg_data := SUBSTRB(SQLERRM ,1,240);
1364: -- Set the exception Message and the stack
1365: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.per_grades_job_id'
1366: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
1367: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1368: raise;
1369:
1370:
1371:
1411:
1412: BEGIN
1413: -- Initialize the Error stack
1414: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.Update_job_levels');
1415: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
1416:
1417: -- Code for if job mapping has changed
1418:
1419: If (P_from_job_group_id is NOT NULL and P_to_job_group_id is NOT NULL) and
1448:
1449: -- Set the exception Message and the stack
1450: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.Update_job_levels'
1451: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
1452: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1453: raise;
1454:
1455: END update_job_levels;
1456:
1505: --dbms_output.put_line('End date for OU:' || p_default_OU_new || 'end date:' || P_end_date_new);
1506:
1507: -- Initialize the Error stack
1508: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.Update_OU_resource');
1509: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
1510:
1511: FOR rec IN res_denorm_recs LOOP
1512:
1513: v_resource_rec_old.resource_effective_start_date := rec.resource_effective_start_date;
1550: x_msg_count := 1 ;
1551: x_msg_data := SUBSTRB(SQLERRM ,1,240);
1552: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.Update_OU_resource'
1553: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
1554: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1555: raise;
1556: END Update_OU_resource;
1557:
1558:
1585: v_assn_start_date Per_all_assignments_f.Effective_Start_Date%type;
1586: v_assn_end_date Per_all_assignments_f.Effective_End_Date%type;
1587: v_Person_id Per_all_assignments_f.person_id%type;
1588: v_Default_OU Hr_Organization_Information.Org_Information1%type;
1589: v_commit VARCHAR2(200) := FND_API.G_FALSE;
1590: -- set to false since the api is being called from trigger
1591: v_validate_only VARCHAR2(200) := FND_API.G_FALSE;
1592: v_internal VARCHAR2(1) := 'Y';
1593: v_individual VARCHAR2(1) := 'Y'; -- to process single resource in loop
1587: v_Person_id Per_all_assignments_f.person_id%type;
1588: v_Default_OU Hr_Organization_Information.Org_Information1%type;
1589: v_commit VARCHAR2(200) := FND_API.G_FALSE;
1590: -- set to false since the api is being called from trigger
1591: v_validate_only VARCHAR2(200) := FND_API.G_FALSE;
1592: v_internal VARCHAR2(1) := 'Y';
1593: v_individual VARCHAR2(1) := 'Y'; -- to process single resource in loop
1594: v_resource_type VARCHAR2(15):= 'EMPLOYEE';
1595: v_org_type VARCHAR2(15):= 'YES'; --'EXPENDITURES';
1622: BEGIN
1623:
1624: -- Initialize the Error stack
1625: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.Default_OU_Change');
1626: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
1627: -- for each resource found for the default ou changes update
1628: -- pa resource ou entity with new default OU
1629:
1630: -- check whether the new OU is a valid exp OU or not
1657: ,x_return_status => v_return_status
1658: ,x_error_message_code => v_error_message_code
1659: );
1660:
1661: If v_return_status <> FND_API.G_RET_STS_SUCCESS then
1662: X_RETURN_STATUS := FND_API.G_RET_STS_ERROR;
1663: x_msg_data := v_error_message_code;
1664: v_process_further := FALSE;
1665: PA_UTILS.add_message(p_app_short_name => 'PA',
1658: ,x_error_message_code => v_error_message_code
1659: );
1660:
1661: If v_return_status <> FND_API.G_RET_STS_SUCCESS then
1662: X_RETURN_STATUS := FND_API.G_RET_STS_ERROR;
1663: x_msg_data := v_error_message_code;
1664: v_process_further := FALSE;
1665: PA_UTILS.add_message(p_app_short_name => 'PA',
1666: p_msg_name => v_error_message_code);
1665: PA_UTILS.add_message(p_app_short_name => 'PA',
1666: p_msg_name => v_error_message_code);
1667: x_msg_count := fnd_msg_pub.count_msg;
1668:
1669: Elsif v_return_status = FND_API.G_RET_STS_SUCCESS then
1670:
1671: v_process_further := TRUE;
1672:
1673: End if;
1724: ,x_msg_count => x_msg_count
1725: ,x_msg_data => x_msg_data
1726: ) ;
1727:
1728: if (x_return_status = FND_API.G_RET_STS_SUCCESS) then
1729: COMMIT;
1730: else
1731: ROLLBACK;
1732: end if;
1754:
1755: -- call this procedure to update the forecast data for
1756: -- assigned time ONLY for this resource
1757: -- this is called only if create_resource is a success
1758: if (x_return_status = FND_API.G_RET_STS_SUCCESS) then
1759: PA_FORECASTITEM_PVT.Create_Forecast_Item
1760: ( p_person_id => v_person_id
1761: ,p_start_date => null
1762: ,p_end_date => null
1765: ,x_msg_count => x_msg_count
1766: ,x_msg_data => x_msg_data
1767: ) ;
1768:
1769: if (x_return_status = FND_API.G_RET_STS_SUCCESS) then
1770: COMMIT;
1771: else
1772: ROLLBACK;
1773: end if;
1777:
1778: End if;
1779:
1780: /* cannot raise - because will be out from the loop and will not process other records
1781: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1782: RAISE FND_API.G_EXC_ERROR;
1783: END IF;
1784: */
1785:
1778: End if;
1779:
1780: /* cannot raise - because will be out from the loop and will not process other records
1781: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1782: RAISE FND_API.G_EXC_ERROR;
1783: END IF;
1784: */
1785:
1786: Elsif P_calling_mode = 'INSERT' then
1813: -- the assigned time for this person when he/she was with Org1
1814: -- So, call this procedure to update the forecast data for
1815: -- assigned time ONLY for this resource
1816: -- this is called only if create_resource is a success
1817: if (x_return_status = FND_API.G_RET_STS_SUCCESS) then
1818: PA_FORECASTITEM_PVT.Create_Forecast_Item
1819: ( p_person_id => v_person_id
1820: ,p_start_date => null
1821: ,p_end_date => null
1824: ,x_msg_count => x_msg_count
1825: ,x_msg_data => x_msg_data
1826: ) ;
1827:
1828: if (x_return_status = FND_API.G_RET_STS_SUCCESS) then
1829: COMMIT;
1830: else
1831: ROLLBACK;
1832: end if;
1835: end if;
1836:
1837:
1838: /* cannot raise - because will be out from the loop and will not process other records
1839: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1840: RAISE FND_API.G_EXC_ERROR;
1841: END IF;
1842: */
1843:
1836:
1837:
1838: /* cannot raise - because will be out from the loop and will not process other records
1839: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1840: RAISE FND_API.G_EXC_ERROR;
1841: END IF;
1842: */
1843:
1844: End if;
1845: END LOOP;
1846: close get_all_resource;
1847:
1848: --set the final return status to SUCCESS after loop
1849: x_return_status := FND_API.G_RET_STS_SUCCESS;
1850:
1851: End if;
1852:
1853: -- reset the Error stack
1853: -- reset the Error stack
1854: PA_DEBUG.Reset_Err_Stack;
1855:
1856: EXCEPTION
1857: WHEN FND_API.G_EXC_ERROR THEN
1858: x_return_status := FND_API.G_RET_STS_ERROR;
1859: WHEN OTHERS THEN
1860: -- 4537865 : RESET x_msg_count and x_msg_data also
1861: x_msg_count := 1 ;
1854: PA_DEBUG.Reset_Err_Stack;
1855:
1856: EXCEPTION
1857: WHEN FND_API.G_EXC_ERROR THEN
1858: x_return_status := FND_API.G_RET_STS_ERROR;
1859: WHEN OTHERS THEN
1860: -- 4537865 : RESET x_msg_count and x_msg_data also
1861: x_msg_count := 1 ;
1862: x_msg_data := SUBSTRB(SQLERRM ,1,240);
1862: x_msg_data := SUBSTRB(SQLERRM ,1,240);
1863: -- Set the exception Message and the stack
1864: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.Default_OU_Change'
1865: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
1866: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1867: raise;
1868:
1869: END Default_OU_Change;
1870:
1905: BEGIN
1906:
1907: -- Initialize the Error stack
1908: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.Proj_Res_Job_Group_Change');
1909: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
1910:
1911: l_proj_job_group_old := TO_NUMBER(p_proj_job_group_old);
1912: l_proj_job_group_new := TO_NUMBER(p_proj_job_group_new);
1913:
2036: -- reset the Error stack
2037: PA_DEBUG.Reset_Err_Stack;
2038:
2039: EXCEPTION
2040: WHEN FND_API.G_EXC_ERROR THEN
2041: x_return_status := FND_API.G_RET_STS_ERROR;
2042: WHEN OTHERS THEN
2043: -- 4537865 : RESET x_msg_count and x_msg_data also
2044: x_msg_count := 1 ;
2037: PA_DEBUG.Reset_Err_Stack;
2038:
2039: EXCEPTION
2040: WHEN FND_API.G_EXC_ERROR THEN
2041: x_return_status := FND_API.G_RET_STS_ERROR;
2042: WHEN OTHERS THEN
2043: -- 4537865 : RESET x_msg_count and x_msg_data also
2044: x_msg_count := 1 ;
2045: x_msg_data := SUBSTRB(SQLERRM ,1,240);
2045: x_msg_data := SUBSTRB(SQLERRM ,1,240);
2046: -- Set the exception Message and the stack
2047: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.Proj_Res_Job_Group_Change'
2048: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
2049: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2050: raise;
2051:
2052: END Proj_Res_Job_Group_Change;
2053:
2060: ,x_msg_data OUT NOCOPY VARCHAR2 --File.Sql.39 bug 4440895
2061: ,x_msg_count OUT NOCOPY NUMBER ) --File.Sql.39 bug 4440895
2062: IS
2063: PRAGMA AUTONOMOUS_TRANSACTION;
2064: l_commit VARCHAR2(200) := FND_API.G_FALSE;
2065: -- set to false since the api is being called from trigger
2066: l_validate_only VARCHAR2(200) := FND_API.G_FALSE;
2067: l_internal VARCHAR2(1) := 'Y';
2068: l_individual VARCHAR2(1) := 'Y'; -- to process single resource in loop
2062: IS
2063: PRAGMA AUTONOMOUS_TRANSACTION;
2064: l_commit VARCHAR2(200) := FND_API.G_FALSE;
2065: -- set to false since the api is being called from trigger
2066: l_validate_only VARCHAR2(200) := FND_API.G_FALSE;
2067: l_internal VARCHAR2(1) := 'Y';
2068: l_individual VARCHAR2(1) := 'Y'; -- to process single resource in loop
2069: l_resource_type VARCHAR2(15):= 'EMPLOYEE';
2070: l_Person_id Per_all_assignments_f.person_id%type;
2088:
2089: BEGIN
2090: -- Initialize the Error stack
2091: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.pull_resources');
2092: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
2093:
2094: open get_all_resource(p_organization_id);
2095: LOOP
2096: fetch get_all_resource into
2113: -- call this procedure to update the forecast data for
2114: -- assigned time ONLY for this resource
2115: -- pass null to start date and end date
2116: -- this is called only if create_resource is a success
2117: if (l_return_status = FND_API.G_RET_STS_SUCCESS) then
2118: PA_FORECASTITEM_PVT.Create_Forecast_Item(
2119: p_person_id => l_person_id
2120: ,p_start_date => null
2121: ,p_end_date => null
2124: ,x_msg_count => l_msg_count
2125: ,x_msg_data => l_msg_data
2126: ) ;
2127:
2128: if (x_return_status = FND_API.G_RET_STS_SUCCESS) then
2129: COMMIT;
2130: else
2131: ROLLBACK;
2132: end if;
2137: END LOOP;
2138: close get_all_resource;
2139:
2140: --set the final return status to SUCCESS after loop
2141: x_return_status := FND_API.G_RET_STS_SUCCESS;
2142:
2143: -- reset the Error stack
2144: PA_DEBUG.Reset_Err_Stack;
2145:
2151: -- Set the exception Message and the stack
2152: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.pull_resources'
2153: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
2154:
2155: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2156: raise;
2157:
2158: END pull_resources;
2159:
2292:
2293: BEGIN
2294: -- Initialize the Error stack
2295: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.make_resource_inactive');
2296: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
2297:
2298: --dbms_output.put_line('Inside make resource inactive');
2299: --dbms_output.put_line('Default OU:' || p_default_ou);
2300: /* bug 5330402
2339: ,x_return_status => x_return_status
2340: ,x_msg_data => x_msg_data
2341: ,x_msg_count => x_msg_count );
2342:
2343: if (x_return_status = FND_API.G_RET_STS_SUCCESS) then
2344: COMMIT;
2345: else
2346: ROLLBACK;
2347: end if;
2355: close get_all_inactive_resource_org;
2356: end if;
2357:
2358: --set the final return status to SUCCESS after loop
2359: x_return_status := FND_API.G_RET_STS_SUCCESS;
2360:
2361: END IF;
2362:
2363: -- reset the Error stack
2369: x_msg_data := SUBSTRB(SQLERRM ,1,240);
2370: -- Set the exception Message and the stack
2371: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.make_resource_inactive'
2372: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
2373: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2374: raise;
2375:
2376:
2377:
2482:
2483: BEGIN
2484: -- Initialize the Error stack
2485: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.call_forcast_api');
2486: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
2487:
2488: If (P_table_name = 'PER_JOB_EXTRA_INFO' or
2489: P_table_name = 'PER_VALID_GRADES' or
2490: P_table_name = 'PER_GRADES' or
2510: ,x_msg_count => x_msg_count
2511: ,x_msg_data => x_msg_data
2512: ) ;
2513:
2514: if (x_return_status = FND_API.G_RET_STS_SUCCESS) then
2515: COMMIT;
2516: else
2517: ROLLBACK;
2518: end if;
2517: ROLLBACK;
2518: end if;
2519:
2520: /* cannot raise - because will be out from the loop and will not process other records
2521: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2522: RAISE FND_API.G_EXC_ERROR;
2523: END IF;
2524: */
2525:
2518: end if;
2519:
2520: /* cannot raise - because will be out from the loop and will not process other records
2521: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2522: RAISE FND_API.G_EXC_ERROR;
2523: END IF;
2524: */
2525:
2526: END LOOP;
2548: ,x_msg_count => x_msg_count
2549: ,x_msg_data => x_msg_data
2550: ) ;
2551:
2552: if (x_return_status = FND_API.G_RET_STS_SUCCESS) then
2553: COMMIT;
2554: else
2555: ROLLBACK;
2556: end if;
2555: ROLLBACK;
2556: end if;
2557:
2558: /* cannot raise - because will be out from the loop and will not process other records
2559: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2560: RAISE FND_API.G_EXC_ERROR;
2561: END IF;
2562: */
2563: END LOOP;
2556: end if;
2557:
2558: /* cannot raise - because will be out from the loop and will not process other records
2559: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2560: RAISE FND_API.G_EXC_ERROR;
2561: END IF;
2562: */
2563: END LOOP;
2564: CLOSE person_orgs;
2565:
2566: End if;
2567:
2568: --set the final return status to SUCCESS after loop
2569: x_return_status := FND_API.G_RET_STS_SUCCESS;
2570:
2571: -- reset the Error stack
2572: PA_DEBUG.Reset_Err_Stack;
2573: EXCEPTION
2570:
2571: -- reset the Error stack
2572: PA_DEBUG.Reset_Err_Stack;
2573: EXCEPTION
2574: WHEN FND_API.G_EXC_ERROR THEN
2575: x_return_status := FND_API.G_RET_STS_ERROR;
2576: WHEN OTHERS THEN
2577: -- 4537865 : RESET x_msg_count and x_msg_data also
2578: x_msg_count := 1 ;
2571: -- reset the Error stack
2572: PA_DEBUG.Reset_Err_Stack;
2573: EXCEPTION
2574: WHEN FND_API.G_EXC_ERROR THEN
2575: x_return_status := FND_API.G_RET_STS_ERROR;
2576: WHEN OTHERS THEN
2577: -- 4537865 : RESET x_msg_count and x_msg_data also
2578: x_msg_count := 1 ;
2579: x_msg_data := SUBSTRB(SQLERRM ,1,240);
2579: x_msg_data := SUBSTRB(SQLERRM ,1,240);
2580: -- Set the exception Message and the stack
2581: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.call_forcast_api'
2582: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
2583: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2584: raise;
2585:
2586:
2587:
2621: BEGIN
2622:
2623: -- Initialize the Error stack
2624: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.call_billable_resoruce_denorm');
2625: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
2626: v_job_id_new := P_job_id_new;
2627: v_job_id_old := P_job_id_old;
2628:
2629: If P_billable_flag_new is NOT NULL then
2696: x_msg_data := SUBSTRB(SQLERRM ,1,240);
2697: -- Set the exception Message and the stack
2698: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.call_billable_resoruce_denorm'
2699: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
2700: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2701: raise;
2702:
2703: END call_billable_resoruce_denorm;
2704:
2764:
2765: BEGIN
2766: -- Initialize the Error stack
2767: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.per_job_extra_billability');
2768: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
2769:
2770: IF P_DEBUG_MODE = 'Y' THEN
2771: log_message('beginning of per_job_extra_billability, P_calling_mode:'|| P_calling_mode || ', job_id: '||P_job_id);
2772: END IF;
2885: END IF;
2886:
2887: PA_R_PROJECT_RESOURCES_PUB.CREATE_RESOURCE (
2888: p_api_version => 1.0
2889: ,p_commit => FND_API.G_FALSE
2890: ,p_validate_only => FND_API.G_FALSE
2891: ,p_internal => 'Y'
2892: ,p_person_id => rec.person_id
2893: ,p_individual => 'Y'
2886:
2887: PA_R_PROJECT_RESOURCES_PUB.CREATE_RESOURCE (
2888: p_api_version => 1.0
2889: ,p_commit => FND_API.G_FALSE
2890: ,p_validate_only => FND_API.G_FALSE
2891: ,p_internal => 'Y'
2892: ,p_person_id => rec.person_id
2893: ,p_individual => 'Y'
2894: ,p_resource_type => 'EMPLOYEE'
2899:
2900: IF P_DEBUG_MODE = 'Y' THEN
2901: log_message('Return status from CREATE_RESOURCE = ' || x_return_status);
2902: END IF;
2903: IF (x_return_status = FND_API.G_RET_STS_SUCCESS) then
2904: COMMIT;
2905: ELSE
2906: ROLLBACK;
2907: END IF;
2910: -- whenever an expected error is raised from this API
2911: -- will need to continue for the next record
2912: WHEN OTHERS THEN
2913: FND_MSG_PUB.get (
2914: p_encoded => FND_API.G_FALSE,
2915: p_msg_index => 1,
2916: p_data => x_msg_data,
2917: p_msg_index_out => x_msg_count );
2918: IF P_DEBUG_MODE = 'Y' THEN
2948:
2949: IF P_DEBUG_MODE = 'Y' THEN
2950: log_message('Return status from Update_EndDate = ' || x_return_status);
2951: END IF;
2952: IF (x_return_status = FND_API.G_RET_STS_SUCCESS) then
2953: COMMIT;
2954: ELSE
2955: ROLLBACK;
2956: END IF;
2962: log_message('error occured');
2963: END IF;
2964: ROLLBACK;
2965: FND_MSG_PUB.get (
2966: p_encoded => FND_API.G_FALSE,
2967: p_msg_index => 1,
2968: p_data => x_msg_data,
2969: p_msg_index_out => x_msg_count );
2970: IF P_DEBUG_MODE = 'Y' THEN
2987: IF P_DEBUG_MODE = 'Y' THEN
2988: log_message('After calling call_forcast_api, x_return_status: '||x_return_status);
2989: END IF;
2990:
2991: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2992: IF P_DEBUG_MODE = 'Y' THEN
2993: log_message('It will raise exception');
2994: END IF;
2995: RAISE FND_API.G_EXC_ERROR;
2991: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2992: IF P_DEBUG_MODE = 'Y' THEN
2993: log_message('It will raise exception');
2994: END IF;
2995: RAISE FND_API.G_EXC_ERROR;
2996: ELSIF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
2997: IF P_DEBUG_MODE = 'Y' THEN
2998: log_message('will commit');
2999: END IF;
2992: IF P_DEBUG_MODE = 'Y' THEN
2993: log_message('It will raise exception');
2994: END IF;
2995: RAISE FND_API.G_EXC_ERROR;
2996: ELSIF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
2997: IF P_DEBUG_MODE = 'Y' THEN
2998: log_message('will commit');
2999: END IF;
3000: COMMIT;
3006: log_message('after Reset_Err_Stack');
3007: END IF;
3008:
3009: EXCEPTION
3010: WHEN FND_API.G_EXC_ERROR THEN
3011: ROLLBACK;
3012: x_return_status := FND_API.G_RET_STS_ERROR;
3013: WHEN NO_DATA_FOUND THEN
3014: NULL;
3008:
3009: EXCEPTION
3010: WHEN FND_API.G_EXC_ERROR THEN
3011: ROLLBACK;
3012: x_return_status := FND_API.G_RET_STS_ERROR;
3013: WHEN NO_DATA_FOUND THEN
3014: NULL;
3015: WHEN OTHERS THEN
3016: IF P_DEBUG_MODE = 'Y' THEN
3021: x_msg_data := SUBSTRB(SQLERRM ,1,240);
3022: -- Set the exception Message and the stack
3023: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.per_job_extra_billability'
3024: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
3025: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3026: RAISE;
3027: END per_job_extra_billability;
3028:
3029:
3072: BEGIN
3073:
3074: -- Initialize the Error stack
3075: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.withdraw_cand_nominations');
3076: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
3077:
3078: l_resource_id := PA_RESOURCE_UTILS.get_resource_id(p_person_id);
3079:
3080: IF (l_resource_id <> -999) THEN
3104: p_status_code => l_status_code,
3105: p_ranking => null,
3106: p_change_reason_code => null,
3107: p_record_version_number => rec.record_version_number,
3108: p_init_msg_list => FND_API.G_FALSE,
3109: p_validate_status => FND_API.G_FALSE,
3110: -- Added for bug 9187892
3111: p_attribute_category => l_candidate_in_rec.attribute_category,
3112: p_attribute1 => l_candidate_in_rec.attribute1,
3105: p_ranking => null,
3106: p_change_reason_code => null,
3107: p_record_version_number => rec.record_version_number,
3108: p_init_msg_list => FND_API.G_FALSE,
3109: p_validate_status => FND_API.G_FALSE,
3110: -- Added for bug 9187892
3111: p_attribute_category => l_candidate_in_rec.attribute_category,
3112: p_attribute1 => l_candidate_in_rec.attribute1,
3113: p_attribute2 => l_candidate_in_rec.attribute2,
3135:
3136: EXCEPTION
3137: -- whenever an expected error is raised from this API
3138: -- will need to continue for the next record
3139: WHEN FND_API.G_EXC_ERROR THEN
3140: ROLLBACK TO save_candidate;
3141: FND_MSG_PUB.get (
3142: p_encoded => FND_API.G_FALSE,
3143: p_msg_index => 1,
3138: -- will need to continue for the next record
3139: WHEN FND_API.G_EXC_ERROR THEN
3140: ROLLBACK TO save_candidate;
3141: FND_MSG_PUB.get (
3142: p_encoded => FND_API.G_FALSE,
3143: p_msg_index => 1,
3144: p_data => x_msg_data,
3145: p_msg_index_out => x_msg_count );
3146: IF P_DEBUG_MODE = 'Y' THEN
3150: END;
3151:
3152: END LOOP;
3153:
3154: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
3155:
3156: ELSE
3157: -- person does not exist in pa_resource_txn_attributes
3158: X_RETURN_STATUS := FND_API.G_RET_STS_ERROR;
3154: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
3155:
3156: ELSE
3157: -- person does not exist in pa_resource_txn_attributes
3158: X_RETURN_STATUS := FND_API.G_RET_STS_ERROR;
3159: END IF;
3160:
3161: -- reset the Error stack
3162: PA_DEBUG.Reset_Err_Stack;
3169: x_msg_data := SUBSTRB(SQLERRM ,1,240);
3170: -- Set the exception Message and the stack
3171: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.withdraw_cand_nominations'
3172: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
3173: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3174: raise;
3175: END withdraw_cand_nominations;
3176:
3177:
3242: --dbms_output.put_line('New End Date:' || p_new_end_date);
3243:
3244: -- Initialize the Error stack
3245: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.Update_EndDate');
3246: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
3247:
3248: l_count := 0; -- bug 7147575 : None records in pa_resources_denorm so far.
3249:
3250: FOR rec IN res_denorm_recs LOOP
3291: ,x_return_status => l_return_status
3292: ,x_msg_data => x_msg_data
3293: ,x_msg_count => x_msg_count);
3294:
3295: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
3296: x_return_status := FND_API.G_RET_STS_ERROR ;
3297: END IF;
3298:
3299: ELSIF p_new_end_date < rec.resource_effective_start_date THEN
3292: ,x_msg_data => x_msg_data
3293: ,x_msg_count => x_msg_count);
3294:
3295: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
3296: x_return_status := FND_API.G_RET_STS_ERROR ;
3297: END IF;
3298:
3299: ELSIF p_new_end_date < rec.resource_effective_start_date THEN
3300: --Bug 9838014 Start
3315: ,x_msg_count => x_msg_count);
3316:
3317: END IF; --Bug 9838014
3318:
3319: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
3320: x_return_status := FND_API.G_RET_STS_ERROR ;
3321: END IF;
3322:
3323: END IF;
3316:
3317: END IF; --Bug 9838014
3318:
3319: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
3320: x_return_status := FND_API.G_RET_STS_ERROR ;
3321: END IF;
3322:
3323: END IF;
3324:
3332: x_return_status => l_return_status,
3333: x_msg_data => x_msg_data,
3334: x_msg_count => x_msg_count);
3335:
3336: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3337: x_return_status := FND_API.G_RET_STS_ERROR ;
3338: END IF ;
3339:
3340: /*if block added for bug 5683340*/
3333: x_msg_data => x_msg_data,
3334: x_msg_count => x_msg_count);
3335:
3336: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3337: x_return_status := FND_API.G_RET_STS_ERROR ;
3338: END IF ;
3339:
3340: /*if block added for bug 5683340*/
3341: IF ((l_invol_term = 'N') AND (l_return_status = FND_API.G_RET_STS_SUCCESS)) THEN
3337: x_return_status := FND_API.G_RET_STS_ERROR ;
3338: END IF ;
3339:
3340: /*if block added for bug 5683340*/
3341: IF ((l_invol_term = 'N') AND (l_return_status = FND_API.G_RET_STS_SUCCESS)) THEN
3342:
3343: --Call Forecast Item regeneration API
3344: --to fix forecast data after resource was end_dated
3345: --start_date passed is the date when it changes
3352: x_return_status => l_return_status,
3353: x_msg_count => x_msg_count,
3354: x_msg_data => x_msg_data) ;
3355:
3356: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3357: x_return_status := FND_API.G_RET_STS_ERROR ;
3358: END IF;
3359:
3360:
3353: x_msg_count => x_msg_count,
3354: x_msg_data => x_msg_data) ;
3355:
3356: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3357: x_return_status := FND_API.G_RET_STS_ERROR ;
3358: END IF;
3359:
3360:
3361: -- Bug 8791391
3421: END IF;
3422:
3423: -- reset the Error stack
3424:
3425: END IF ; --((l_invol_term = 'N') AND (l_return_status = FND_API.G_RET_STS_SUCCESS)) bug 5683340
3426:
3427: END IF ; -- bug 7147575 : IF (l_count > 0 )
3428:
3429: PA_DEBUG.Reset_Err_Stack;
3430:
3431: EXCEPTION
3432:
3433: WHEN NO_DATA_FOUND THEN
3434: x_return_status := FND_API.G_RET_STS_ERROR ;
3435:
3436: WHEN OTHERS THEN
3437: -- 4537865 : RESET x_msg_count and x_msg_data also
3438: x_msg_count := 1 ;
3439: x_msg_data := SUBSTRB(SQLERRM ,1,240);
3440: -- Set the exception Message and the stack
3441: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.Update_EndDate'
3442: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
3443: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3444: raise;
3445: END Update_EndDate;
3446:
3447: /* Procedure Update_Org calls Update_Resource_Denorm and Create_Forecast_Item to update the organization and org_id for the resources in pa_resources_denorm table and regenerate forecast items for the resource respectively.
3493:
3494: -- Initialize the Error stack
3495: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.Update_Org');
3496:
3497: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
3498:
3499: /* Check if new organization belongs to an expenditure
3500: organization, if yes then get default ou for old and new organization
3501: and update pa_resource_ou.organization.*/
3510:
3511: pa_r_project_resources_pub.create_resource (
3512: p_api_version => 1.0
3513: ,p_init_msg_list => NULL
3514: ,p_commit => FND_API.G_FALSE
3515: ,p_validate_only => NULL
3516: ,p_max_msg_count => NULL
3517: ,p_internal => 'Y'
3518: ,p_person_id => p_person_id
3558: p_app_short_name => 'PA'
3559: ,p_msg_name => 'PA_RS_DEF_OU_NULL');
3560:
3561: x_msg_data := 'PA_RS_DEF_OU_NULL';
3562: X_RETURN_STATUS := FND_API.G_RET_STS_ERROR;
3563: RETURN;
3564: -- ELSE
3565: -- l_default_ou_new := NULL;
3566: -- END IF;
3592: ,x_return_status => l_return_status
3593: ,x_msg_data => x_msg_data
3594: ,x_msg_count => x_msg_count);
3595:
3596: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
3597: x_return_status := FND_API.G_RET_STS_ERROR ;
3598: END IF;
3599:
3600: END LOOP; --end FOR
3593: ,x_msg_data => x_msg_data
3594: ,x_msg_count => x_msg_count);
3595:
3596: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
3597: x_return_status := FND_API.G_RET_STS_ERROR ;
3598: END IF;
3599:
3600: END LOOP; --end FOR
3601:
3612: x_msg_data => x_msg_data) ;
3613:
3614: END IF;
3615:
3616: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3617: x_return_status := FND_API.G_RET_STS_ERROR ;
3618: END IF;
3619: END IF; -- Bug 7690398
3620: ELSE
3613:
3614: END IF;
3615:
3616: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3617: x_return_status := FND_API.G_RET_STS_ERROR ;
3618: END IF;
3619: END IF; -- Bug 7690398
3620: ELSE
3621: /* In case the organization does not belong to expenditure
3630: x_return_status => l_return_status,
3631: x_msg_data => x_msg_data,
3632: x_msg_count => x_msg_count);
3633:
3634: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3635: x_return_status := FND_API.G_RET_STS_ERROR ;
3636: END IF;
3637:
3638: END IF;
3631: x_msg_data => x_msg_data,
3632: x_msg_count => x_msg_count);
3633:
3634: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3635: x_return_status := FND_API.G_RET_STS_ERROR ;
3636: END IF;
3637:
3638: END IF;
3639:
3642: PA_DEBUG.Reset_Err_Stack;
3643:
3644: EXCEPTION
3645: WHEN NO_DATA_FOUND THEN
3646: X_RETURN_STATUS := fnd_api.g_ret_sts_error;
3647:
3648: WHEN OTHERS THEN
3649: -- 4537865 : RESET x_msg_count and x_msg_data also
3650: x_msg_count := 1 ;
3651: x_msg_data := SUBSTRB(SQLERRM ,1,240);
3652: -- Set the exception Message and the stack
3653: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.Update_Org'
3654: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
3655: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3656: raise;
3657: END Update_Org;
3658:
3659: -- Start Bug : 4656855
3825:
3826: BEGIN
3827: -- Initialize the Error stack
3828: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.Update_Job');
3829: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
3830: IF P_DEBUG_MODE = 'Y' THEN
3831: log_message('beginning of Update_Job');
3832: END IF;
3833:
3865: END IF;
3866:
3867: PA_R_PROJECT_RESOURCES_PUB.CREATE_RESOURCE (
3868: p_api_version => 1.0
3869: ,p_commit => FND_API.G_FALSE
3870: ,p_validate_only => FND_API.G_FALSE
3871: ,p_internal => 'Y'
3872: ,p_person_id => p_person_id
3873: ,p_individual => 'Y'
3866:
3867: PA_R_PROJECT_RESOURCES_PUB.CREATE_RESOURCE (
3868: p_api_version => 1.0
3869: ,p_commit => FND_API.G_FALSE
3870: ,p_validate_only => FND_API.G_FALSE
3871: ,p_internal => 'Y'
3872: ,p_person_id => p_person_id
3873: ,p_individual => 'Y'
3874: ,p_resource_type => 'EMPLOYEE'
3938: ,x_return_status => l_return_status
3939: ,x_msg_data => x_msg_data
3940: ,x_msg_count => x_msg_count);
3941:
3942: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
3943: x_return_status := FND_API.G_RET_STS_ERROR ;
3944: END IF;
3945: END LOOP;
3946:
3939: ,x_msg_data => x_msg_data
3940: ,x_msg_count => x_msg_count);
3941:
3942: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
3943: x_return_status := FND_API.G_RET_STS_ERROR ;
3944: END IF;
3945: END LOOP;
3946:
3947: END IF;
3963:
3964: IF P_DEBUG_MODE = 'Y' THEN
3965: log_message('after calling Create_Forecast_Item, l_return_status:'||l_return_status);
3966: END IF;
3967: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3968: x_return_status := FND_API.G_RET_STS_ERROR ;
3969: END IF;
3970: END IF; --Bug 7690398
3971: -- reset the Error stack
3964: IF P_DEBUG_MODE = 'Y' THEN
3965: log_message('after calling Create_Forecast_Item, l_return_status:'||l_return_status);
3966: END IF;
3967: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3968: x_return_status := FND_API.G_RET_STS_ERROR ;
3969: END IF;
3970: END IF; --Bug 7690398
3971: -- reset the Error stack
3972: PA_DEBUG.Reset_Err_Stack;
3981: x_msg_data := SUBSTRB(SQLERRM ,1,240);
3982: -- Set the exception Message and the stack
3983: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.Update_Job'
3984: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
3985: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3986: RAISE;
3987: END Update_Job;
3988:
3989: /* Procedure Update_Supervisor calls Update_Resource_Denorm to update
4024: BEGIN
4025:
4026: -- Initialize the Error stack
4027: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.Update_Supervisor');
4028: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
4029:
4030: --Set the values for the Resources Denorm Record Type
4031: l_resource_rec_old.person_id := p_person_id;
4032: l_resource_rec_new.person_id := p_person_id;
4050: ,x_return_status => l_return_status
4051: ,x_msg_data => x_msg_data
4052: ,x_msg_count => x_msg_count);
4053:
4054: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4055: x_return_status := FND_API.G_RET_STS_ERROR ;
4056: END IF;
4057:
4058: END LOOP;--end FOR
4051: ,x_msg_data => x_msg_data
4052: ,x_msg_count => x_msg_count);
4053:
4054: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4055: x_return_status := FND_API.G_RET_STS_ERROR ;
4056: END IF;
4057:
4058: END LOOP;--end FOR
4059:
4067: x_msg_data := SUBSTRB(SQLERRM ,1,240);
4068: -- Set the exception Message and the stack
4069: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.Update_Supervisor'
4070: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
4071: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
4072: raise;
4073: END Update_Supervisor;
4074:
4075: /* Procedure Update_PrimaryFlag calls Update_EndDate to end date the
4091:
4092: BEGIN
4093: -- Initialize the Error stack
4094: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.Update_PrimaryFlag');
4095: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
4096:
4097: --Call Update_EndDate to end date the resource_ou record.
4098: -- Commented the end date change in PA as this is not required
4099: -- Solves bug 1608837
4119: x_msg_count => x_msg_count,
4120: x_msg_data => x_msg_data) ;
4121: END IF;
4122:
4123: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4124: x_return_status := FND_API.G_RET_STS_ERROR ;
4125: END IF;
4126:
4127: -- reset the Error stack
4120: x_msg_data => x_msg_data) ;
4121: END IF;
4122:
4123: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4124: x_return_status := FND_API.G_RET_STS_ERROR ;
4125: END IF;
4126:
4127: -- reset the Error stack
4128: PA_DEBUG.Reset_Err_Stack;
4134: x_msg_data := SUBSTRB(SQLERRM ,1,240);
4135: -- Set the exception Message and the stack
4136: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.Update_PrimaryFlag'
4137: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
4138: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
4139: raise;
4140: END Update_PrimaryFlag;
4141:
4142: /* Procedure Update_Name calls updates the resource's name in pa_resources.
4157: BEGIN
4158:
4159: --Initialize the Error stack
4160: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.Update_Name');
4161: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
4162:
4163: --Get resource_id for person_id
4164: l_resource_id := pa_resource_utils.get_resource_id(p_person_id);
4165:
4163: --Get resource_id for person_id
4164: l_resource_id := pa_resource_utils.get_resource_id(p_person_id);
4165:
4166: IF (l_resource_id = -999) THEN
4167: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
4168: return;
4169: END IF;
4170:
4171: UPDATE pa_resources
4186: ,x_return_status => l_return_status
4187: ,x_msg_data => x_msg_data
4188: ,x_msg_count => x_msg_count);
4189:
4190: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4191: x_return_status := FND_API.G_RET_STS_ERROR ;
4192: END IF;
4193:
4194: --Reset the Error stack
4187: ,x_msg_data => x_msg_data
4188: ,x_msg_count => x_msg_count);
4189:
4190: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4191: x_return_status := FND_API.G_RET_STS_ERROR ;
4192: END IF;
4193:
4194: --Reset the Error stack
4195: PA_DEBUG.Reset_Err_Stack;
4201: x_msg_data := SUBSTRB(SQLERRM ,1,240);
4202: -- Set the exception Message and the stack
4203: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.Update_Name'
4204: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
4205: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
4206: raise;
4207: END Update_Name;
4208:
4209:
4234:
4235: BEGIN
4236:
4237:
4238: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
4239:
4240: IF p_addr_prim_flag_new = 'Y' THEN
4241:
4242: --dbms_output.put_line('Inside address Update for person id:' || p_person_id);
4243:
4244: pa_r_project_resources_pub.create_resource (
4245: p_api_version => 1.0
4246: ,p_init_msg_list => NULL
4247: ,p_commit => FND_API.G_FALSE
4248: ,p_validate_only => NULL
4249: ,p_max_msg_count => NULL
4250: ,p_internal => 'Y'
4251: ,p_person_id => p_person_id
4259: END IF;
4260:
4261: --dbms_output.put_line('After address Update');
4262:
4263: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4264: x_return_status := FND_API.G_RET_STS_ERROR ;
4265: END IF;
4266:
4267: EXCEPTION
4260:
4261: --dbms_output.put_line('After address Update');
4262:
4263: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4264: x_return_status := FND_API.G_RET_STS_ERROR ;
4265: END IF;
4266:
4267: EXCEPTION
4268: when others then
4380:
4381: BEGIN
4382: -- Initialize the Error stack
4383: PA_DEBUG.init_err_stack('PA_HR_UPDATE_API.Delete_PA_Resource_Denorm');
4384: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
4385:
4386: FOR rec IN res_denorm_recs LOOP
4387: --Delete the record
4388: DELETE FROM PA_RESOURCES_DENORM
4396:
4397: EXCEPTION
4398:
4399: WHEN NO_DATA_FOUND THEN
4400: x_return_status := FND_API.G_RET_STS_ERROR ;
4401:
4402: WHEN OTHERS THEN
4403: -- 4537865 : RESET x_msg_count and x_msg_data also
4404: x_msg_count := 1 ;
4405: x_msg_data := SUBSTRB(SQLERRM ,1,240);
4406: -- Set the exception Message and the stack
4407: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_HR_UPDATE_API.Delete_PA_Resource_Denorm'
4408: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
4409: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
4410: raise;
4411: END Delete_PA_Resource_Denorm;
4412:
4413: END PA_HR_UPDATE_API;