18: l_proc VARCHAR2(72) := g_package||'Chk_Unique';
19:
20: BEGIN
21: --
22: hr_utility.set_location('Entering:'||l_proc, 5);
23: --
24: SELECT NULL
25: INTO l_result
26: FROM per_budgets b
29: AND X_Business_Group_Id = b.Business_Group_Id + 0
30: AND (b.Rowid <> X_Rowid or X_Rowid is null);
31:
32: IF (SQL%FOUND) then
33: hr_utility.set_message(801,'PER_7852_DEF_BUDGET_EXISTS');
34: hr_utility.raise_error;
35: END IF;
36: --
37: hr_utility.set_location(' Leaving:'||l_proc, 10);
30: AND (b.Rowid <> X_Rowid or X_Rowid is null);
31:
32: IF (SQL%FOUND) then
33: hr_utility.set_message(801,'PER_7852_DEF_BUDGET_EXISTS');
34: hr_utility.raise_error;
35: END IF;
36: --
37: hr_utility.set_location(' Leaving:'||l_proc, 10);
38: --
33: hr_utility.set_message(801,'PER_7852_DEF_BUDGET_EXISTS');
34: hr_utility.raise_error;
35: END IF;
36: --
37: hr_utility.set_location(' Leaving:'||l_proc, 10);
38: --
39: EXCEPTION
40: when NO_DATA_FOUND then
41: null;
76: l_proc VARCHAR2(72) := g_package||'Chk_OTA_Budget_Type';
77: --
78: BEGIN
79: --
80: hr_utility.set_location('Entering:'||l_proc, 5);
81: --
82: IF X_Budget_Id IS NOT NULL AND X_Budget_Version_Id IS NULL AND X_Rowid IS NULL THEN
83: OPEN c_bdg1;
84: FETCH c_bdg1 into l_result;
109: CLOSE c_bdv;
110: RETURN TRUE;
111: END IF;
112: ELSIF X_Budget_Id IS NULL AND X_Budget_Version_Id IS NULL AND X_Rowid IS NULL THEN
113: hr_utility.set_message(800,'PER_52867_INV_ARGS');
114: hr_utility.raise_error;
115: ELSE
116: hr_utility.set_message(800,'PER_52868_TOO_MANY_ARGS');
117: hr_utility.raise_error;
110: RETURN TRUE;
111: END IF;
112: ELSIF X_Budget_Id IS NULL AND X_Budget_Version_Id IS NULL AND X_Rowid IS NULL THEN
113: hr_utility.set_message(800,'PER_52867_INV_ARGS');
114: hr_utility.raise_error;
115: ELSE
116: hr_utility.set_message(800,'PER_52868_TOO_MANY_ARGS');
117: hr_utility.raise_error;
118: END IF;
112: ELSIF X_Budget_Id IS NULL AND X_Budget_Version_Id IS NULL AND X_Rowid IS NULL THEN
113: hr_utility.set_message(800,'PER_52867_INV_ARGS');
114: hr_utility.raise_error;
115: ELSE
116: hr_utility.set_message(800,'PER_52868_TOO_MANY_ARGS');
117: hr_utility.raise_error;
118: END IF;
119: --
120: hr_utility.set_location(' Leaving:'||l_proc, 10);
113: hr_utility.set_message(800,'PER_52867_INV_ARGS');
114: hr_utility.raise_error;
115: ELSE
116: hr_utility.set_message(800,'PER_52868_TOO_MANY_ARGS');
117: hr_utility.raise_error;
118: END IF;
119: --
120: hr_utility.set_location(' Leaving:'||l_proc, 10);
121: --
116: hr_utility.set_message(800,'PER_52868_TOO_MANY_ARGS');
117: hr_utility.raise_error;
118: END IF;
119: --
120: hr_utility.set_location(' Leaving:'||l_proc, 10);
121: --
122: END Chk_OTA_Budget_Type;
123:
124: -- ----------------------------------------------------------------------------
157:
158: --
159: BEGIN
160: --
161: hr_utility.set_location('Entering:'||l_proc, 5);
162:
163: l_dyn_curs := dbms_sql.open_cursor;
164: --
165: -- Determine if the OTA_TP_MEASUREEMNT_TYPES table exists
173: l_dyn_rows := dbms_sql.execute_and_fetch(l_dyn_curs);
174: --
175: if dbms_sql.last_row_count < 1 then
176: dbms_sql.close_cursor(l_dyn_curs);
177: hr_utility.set_message(800,'PER_52869_MEASURE_NOT_EXISTS');
178: hr_utility.raise_error;
179: end if;
180: end if;
181: if dbms_sql.is_open(l_dyn_curs) then
174: --
175: if dbms_sql.last_row_count < 1 then
176: dbms_sql.close_cursor(l_dyn_curs);
177: hr_utility.set_message(800,'PER_52869_MEASURE_NOT_EXISTS');
178: hr_utility.raise_error;
179: end if;
180: end if;
181: if dbms_sql.is_open(l_dyn_curs) then
182: dbms_sql.close_cursor(l_dyn_curs);
181: if dbms_sql.is_open(l_dyn_curs) then
182: dbms_sql.close_cursor(l_dyn_curs);
183: end if;
184:
185: hr_utility.set_location(' Leaving:'|| l_proc, 10);
186: --
187: END Chk_Measurement_Type_Exists;
188: -- ----------------------------------------------------------------------------
189: -- |------------------------< Chk_Budget_Type_Code >--------------------------|
193: l_proc VARCHAR2(72) := g_package||'Chk_Budget_Type_Code';
194: --
195: BEGIN
196: --
197: hr_utility.set_location('Entering:'||l_proc, 5);
198: --
199: IF (UPPER(X_Budget_Type_Code) <> 'HR_BUDGET' AND UPPER(X_Budget_Type_Code) <> 'OTA_BUDGET') OR X_Budget_Type_Code IS NULL THEN
200: hr_utility.set_message(800,'PER_52870_INV_BUD_TYPE');
201: hr_utility.raise_error;
196: --
197: hr_utility.set_location('Entering:'||l_proc, 5);
198: --
199: IF (UPPER(X_Budget_Type_Code) <> 'HR_BUDGET' AND UPPER(X_Budget_Type_Code) <> 'OTA_BUDGET') OR X_Budget_Type_Code IS NULL THEN
200: hr_utility.set_message(800,'PER_52870_INV_BUD_TYPE');
201: hr_utility.raise_error;
202: END IF;
203: --
204: hr_utility.set_location(' Leaving:'||l_proc, 10);
197: hr_utility.set_location('Entering:'||l_proc, 5);
198: --
199: IF (UPPER(X_Budget_Type_Code) <> 'HR_BUDGET' AND UPPER(X_Budget_Type_Code) <> 'OTA_BUDGET') OR X_Budget_Type_Code IS NULL THEN
200: hr_utility.set_message(800,'PER_52870_INV_BUD_TYPE');
201: hr_utility.raise_error;
202: END IF;
203: --
204: hr_utility.set_location(' Leaving:'||l_proc, 10);
205: --
200: hr_utility.set_message(800,'PER_52870_INV_BUD_TYPE');
201: hr_utility.raise_error;
202: END IF;
203: --
204: hr_utility.set_location(' Leaving:'||l_proc, 10);
205: --
206: END Chk_Budget_Type_Code;
207:
208:
220: l_proc VARCHAR2(72) := g_package||'Chk_Period_Set_Name';
221: --
222: BEGIN
223: --
224: hr_utility.set_location('Entering:'||l_proc, 5);
225: --
226: OPEN c_ptp;
227: FETCH c_ptp INTO l_exists;
228: IF c_ptp%NOTFOUND THEN
225: --
226: OPEN c_ptp;
227: FETCH c_ptp INTO l_exists;
228: IF c_ptp%NOTFOUND THEN
229: hr_utility.set_message(800,'PER_52871_CAL_NOT_EXIST');
230: hr_utility.raise_error;
231: END IF;
232: CLOSE c_ptp;
233: --
226: OPEN c_ptp;
227: FETCH c_ptp INTO l_exists;
228: IF c_ptp%NOTFOUND THEN
229: hr_utility.set_message(800,'PER_52871_CAL_NOT_EXIST');
230: hr_utility.raise_error;
231: END IF;
232: CLOSE c_ptp;
233: --
234: hr_utility.set_location(' Leaving:'||l_proc, 10);
230: hr_utility.raise_error;
231: END IF;
232: CLOSE c_ptp;
233: --
234: hr_utility.set_location(' Leaving:'||l_proc, 10);
235: --
236: END Chk_Period_Set_Name;
237:
238:
264: l_proc VARCHAR2(72) := g_package||'Chk_df';
265:
266: BEGIN
267: --
268: hr_utility.set_location('Entering:'||l_proc, 5);
269: --
270: hr_dflex_utility.ins_or_upd_descflex_attribs
271: (p_appl_short_name => 'PER'
272: ,p_descflex_name => 'PER_BUDGETS'
311: ,p_attribute19_value => x_attribute19
312: ,p_attribute20_name => 'ATTRIBUTE20'
313: ,p_attribute20_value => x_attribute20);
314: --
315: hr_utility.set_location(' Leaving:'||l_proc, 10);
316: --
317: END Chk_df;
318:
319:
360: l_name PER_BUDGETS.NAME%TYPE;
361:
362: BEGIN
363: --
364: --hr_utility.trace_on;
365: hr_utility.set_location('Entering:'||l_proc, 5);
366: --
367: -- validate mandatory business_group
368: hr_api.validate_bus_grp_id(X_Business_Group_Id);
361:
362: BEGIN
363: --
364: --hr_utility.trace_on;
365: hr_utility.set_location('Entering:'||l_proc, 5);
366: --
367: -- validate mandatory business_group
368: hr_api.validate_bus_grp_id(X_Business_Group_Id);
369: --
503: OPEN C1;
504: FETCH C1 INTO X_Rowid;
505: if (C1%NOTFOUND) then
506: CLOSE C1;
507: /* hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
508: hr_utility.set_message_token('PROCEDURE','Insert_Row');
509: hr_utility.set_message_token('STEP','1');
510: hr_utility.raise_error;*/
511: RAISE NO_DATA_FOUND;
504: FETCH C1 INTO X_Rowid;
505: if (C1%NOTFOUND) then
506: CLOSE C1;
507: /* hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
508: hr_utility.set_message_token('PROCEDURE','Insert_Row');
509: hr_utility.set_message_token('STEP','1');
510: hr_utility.raise_error;*/
511: RAISE NO_DATA_FOUND;
512: end if;
505: if (C1%NOTFOUND) then
506: CLOSE C1;
507: /* hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
508: hr_utility.set_message_token('PROCEDURE','Insert_Row');
509: hr_utility.set_message_token('STEP','1');
510: hr_utility.raise_error;*/
511: RAISE NO_DATA_FOUND;
512: end if;
513: CLOSE C1;
506: CLOSE C1;
507: /* hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
508: hr_utility.set_message_token('PROCEDURE','Insert_Row');
509: hr_utility.set_message_token('STEP','1');
510: hr_utility.raise_error;*/
511: RAISE NO_DATA_FOUND;
512: end if;
513: CLOSE C1;
514: --
511: RAISE NO_DATA_FOUND;
512: end if;
513: CLOSE C1;
514: --
515: hr_utility.set_location(' Leaving:'||l_proc, 10);
516: --
517: END Insert_Row;
518:
519:
558: Recinfo C%ROWTYPE;
559: l_proc VARCHAR2(72) := g_package||'Lock_Row';
560: BEGIN
561: --
562: hr_utility.set_location('Entering:'||l_proc, 5);
563: --
564: OPEN C;
565: FETCH C INTO Recinfo;
566: if (C%NOTFOUND) then
564: OPEN C;
565: FETCH C INTO Recinfo;
566: if (C%NOTFOUND) then
567: CLOSE C;
568: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
569: hr_utility.set_message_token('PROCEDURE','Lock_Row');
570: hr_utility.set_message_token('STEP','1');
571: hr_utility.raise_error;
572: end if;
565: FETCH C INTO Recinfo;
566: if (C%NOTFOUND) then
567: CLOSE C;
568: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
569: hr_utility.set_message_token('PROCEDURE','Lock_Row');
570: hr_utility.set_message_token('STEP','1');
571: hr_utility.raise_error;
572: end if;
573: CLOSE C;
566: if (C%NOTFOUND) then
567: CLOSE C;
568: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
569: hr_utility.set_message_token('PROCEDURE','Lock_Row');
570: hr_utility.set_message_token('STEP','1');
571: hr_utility.raise_error;
572: end if;
573: CLOSE C;
574: --
567: CLOSE C;
568: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
569: hr_utility.set_message_token('PROCEDURE','Lock_Row');
570: hr_utility.set_message_token('STEP','1');
571: hr_utility.raise_error;
572: end if;
573: CLOSE C;
574: --
575: Recinfo.budget_id := rtrim(Recinfo.budget_id);
691: FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
692: APP_EXCEPTION.RAISE_EXCEPTION;
693: end if;
694: --
695: hr_utility.set_location(' Leaving:'||l_proc, 10);
696: --
697: END Lock_Row;
698:
699: -- ----------------------------------------------------------------------------
731: ) IS
732: l_proc VARCHAR2(72) := g_package||'Update_Row';
733: BEGIN
734: --
735: hr_utility.set_location('Entering:'||l_proc, 5);
736: --
737: -- validate mandatory business_group
738: hr_api.validate_bus_grp_id(X_Business_Group_Id);
739:
845: budget_type_code = X_Budget_Type_Code
846: WHERE rowid = X_rowid;
847:
848: if (SQL%NOTFOUND) then
849: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
850: hr_utility.set_message_token('PROCEDURE','Update_Row');
851: hr_utility.set_message_token('STEP','1');
852: hr_utility.raise_error;
853: end if;
846: WHERE rowid = X_rowid;
847:
848: if (SQL%NOTFOUND) then
849: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
850: hr_utility.set_message_token('PROCEDURE','Update_Row');
851: hr_utility.set_message_token('STEP','1');
852: hr_utility.raise_error;
853: end if;
854: --
847:
848: if (SQL%NOTFOUND) then
849: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
850: hr_utility.set_message_token('PROCEDURE','Update_Row');
851: hr_utility.set_message_token('STEP','1');
852: hr_utility.raise_error;
853: end if;
854: --
855: hr_utility.set_location(' Leaving:'||l_proc, 10);
848: if (SQL%NOTFOUND) then
849: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
850: hr_utility.set_message_token('PROCEDURE','Update_Row');
851: hr_utility.set_message_token('STEP','1');
852: hr_utility.raise_error;
853: end if;
854: --
855: hr_utility.set_location(' Leaving:'||l_proc, 10);
856: --
851: hr_utility.set_message_token('STEP','1');
852: hr_utility.raise_error;
853: end if;
854: --
855: hr_utility.set_location(' Leaving:'||l_proc, 10);
856: --
857: END Update_Row;
858:
859: -- ----------------------------------------------------------------------------
871: l_proc VARCHAR2(72) := g_package||'Delete_Row';
872: --
873: BEGIN
874: --
875: hr_utility.set_location('Entering:'||l_proc, 5);
876: --
877:
878: OPEN C_Version;
879: -- Cascade delete the appropriate child budget_versions recs if
888: FETCH C_Version into l_ver_rowid;
889: IF C_Version%FOUND THEN
890: CLOSE C_Version;
891: --raise error as child record has been found
892: hr_utility.set_message(800,'PER_52872_BUD_DELETE_FAIL');
893: hr_utility.raise_error;
894: END IF;
895: END IF;
896: CLOSE C_Version;
889: IF C_Version%FOUND THEN
890: CLOSE C_Version;
891: --raise error as child record has been found
892: hr_utility.set_message(800,'PER_52872_BUD_DELETE_FAIL');
893: hr_utility.raise_error;
894: END IF;
895: END IF;
896: CLOSE C_Version;
897:
899: DELETE FROM PER_BUDGETS
900: WHERE rowid = X_Rowid;
901:
902: if (SQL%NOTFOUND) then
903: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
904: hr_utility.set_message_token('PROCEDURE','Delete_Row');
905: hr_utility.set_message_token('STEP','1');
906: hr_utility.raise_error;
907: end if;
900: WHERE rowid = X_Rowid;
901:
902: if (SQL%NOTFOUND) then
903: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
904: hr_utility.set_message_token('PROCEDURE','Delete_Row');
905: hr_utility.set_message_token('STEP','1');
906: hr_utility.raise_error;
907: end if;
908: --
901:
902: if (SQL%NOTFOUND) then
903: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
904: hr_utility.set_message_token('PROCEDURE','Delete_Row');
905: hr_utility.set_message_token('STEP','1');
906: hr_utility.raise_error;
907: end if;
908: --
909: hr_utility.set_location(' Leaving:'||l_proc, 10);
902: if (SQL%NOTFOUND) then
903: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
904: hr_utility.set_message_token('PROCEDURE','Delete_Row');
905: hr_utility.set_message_token('STEP','1');
906: hr_utility.raise_error;
907: end if;
908: --
909: hr_utility.set_location(' Leaving:'||l_proc, 10);
910: --
905: hr_utility.set_message_token('STEP','1');
906: hr_utility.raise_error;
907: end if;
908: --
909: hr_utility.set_location(' Leaving:'||l_proc, 10);
910: --
911: END Delete_Row;
912:
913: END PER_BUDGETS_PKG;