12: default task elements based on the automatic resource selection parameter and resource planning
13: level for automatic resource selection. Currently only the defaul task elements are created based
14: on the input planning level and resource list id.
15: ==================================================================================================*/
16: P_PA_DEBUG_MODE varchar2(1) := NVL(FND_PROFILE.value('PA_DEBUG_MODE'), 'N');
17:
18: PROCEDURE Refresh_FP_Elements (
19: p_proj_fp_options_id IN NUMBER
20: ,p_cost_planning_level IN VARCHAR2
44:
45: BEGIN
46:
47: FND_MSG_PUB.initialize;
48: IF P_PA_DEBUG_MODE = 'Y' THEN
49: pa_debug.init_err_stack('PA_FP_ELEMENTS_PUB.Refresh_FP_Elements');
50: END IF;
51: fnd_profile.get('pa_debug_MODE',l_debug_mode);
52: l_debug_mode := NVL(l_debug_mode, 'Y');
45: BEGIN
46:
47: FND_MSG_PUB.initialize;
48: IF P_PA_DEBUG_MODE = 'Y' THEN
49: pa_debug.init_err_stack('PA_FP_ELEMENTS_PUB.Refresh_FP_Elements');
50: END IF;
51: fnd_profile.get('pa_debug_MODE',l_debug_mode);
52: l_debug_mode := NVL(l_debug_mode, 'Y');
53: IF P_PA_DEBUG_MODE = 'Y' THEN
47: FND_MSG_PUB.initialize;
48: IF P_PA_DEBUG_MODE = 'Y' THEN
49: pa_debug.init_err_stack('PA_FP_ELEMENTS_PUB.Refresh_FP_Elements');
50: END IF;
51: fnd_profile.get('pa_debug_MODE',l_debug_mode);
52: l_debug_mode := NVL(l_debug_mode, 'Y');
53: IF P_PA_DEBUG_MODE = 'Y' THEN
54: pa_debug.set_process('Refresh_FP_Elements: ' || 'PLSQL','LOG',l_debug_mode);
55: END IF;
49: pa_debug.init_err_stack('PA_FP_ELEMENTS_PUB.Refresh_FP_Elements');
50: END IF;
51: fnd_profile.get('pa_debug_MODE',l_debug_mode);
52: l_debug_mode := NVL(l_debug_mode, 'Y');
53: IF P_PA_DEBUG_MODE = 'Y' THEN
54: pa_debug.set_process('Refresh_FP_Elements: ' || 'PLSQL','LOG',l_debug_mode);
55: END IF;
56: x_msg_count := 0;
57:
50: END IF;
51: fnd_profile.get('pa_debug_MODE',l_debug_mode);
52: l_debug_mode := NVL(l_debug_mode, 'Y');
53: IF P_PA_DEBUG_MODE = 'Y' THEN
54: pa_debug.set_process('Refresh_FP_Elements: ' || 'PLSQL','LOG',l_debug_mode);
55: END IF;
56: x_msg_count := 0;
57:
58: x_return_status := FND_API.G_RET_STS_SUCCESS;
57:
58: x_return_status := FND_API.G_RET_STS_SUCCESS;
59:
60: IF (p_proj_fp_options_id IS NULL) THEN
61: pa_debug.g_err_stage := 'Err- Proj FP Options ID cannot be NULL.';
62: IF P_PA_DEBUG_MODE = 'Y' THEN
63: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
64: END IF;
65: x_return_status := FND_API.G_RET_STS_ERROR;
58: x_return_status := FND_API.G_RET_STS_SUCCESS;
59:
60: IF (p_proj_fp_options_id IS NULL) THEN
61: pa_debug.g_err_stage := 'Err- Proj FP Options ID cannot be NULL.';
62: IF P_PA_DEBUG_MODE = 'Y' THEN
63: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
64: END IF;
65: x_return_status := FND_API.G_RET_STS_ERROR;
66: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
59:
60: IF (p_proj_fp_options_id IS NULL) THEN
61: pa_debug.g_err_stage := 'Err- Proj FP Options ID cannot be NULL.';
62: IF P_PA_DEBUG_MODE = 'Y' THEN
63: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
64: END IF;
65: x_return_status := FND_API.G_RET_STS_ERROR;
66: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
67: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
71: /* Depending on the Planning Level, i.e 'COST', PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_REVENUE or PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_ALL, delete the
72: fp_elements for the Proj_FP_Options_ID and then call the Insert_Default procedure
73: to insert into fp_elements. */
74:
75: pa_debug.g_err_stage := 'Deleting records from pa_fp_elements and calling insert_Default';
76: IF P_PA_DEBUG_MODE = 'Y' THEN
77: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
78: END IF;
79:
72: fp_elements for the Proj_FP_Options_ID and then call the Insert_Default procedure
73: to insert into fp_elements. */
74:
75: pa_debug.g_err_stage := 'Deleting records from pa_fp_elements and calling insert_Default';
76: IF P_PA_DEBUG_MODE = 'Y' THEN
77: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
78: END IF;
79:
80: IF (p_cost_planning_level IS NOT NULL) THEN
73: to insert into fp_elements. */
74:
75: pa_debug.g_err_stage := 'Deleting records from pa_fp_elements and calling insert_Default';
76: IF P_PA_DEBUG_MODE = 'Y' THEN
77: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
78: END IF;
79:
80: IF (p_cost_planning_level IS NOT NULL) THEN
81: pa_debug.g_err_stage := 'Deleting and inserting for Cost Planning Level';
77: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
78: END IF;
79:
80: IF (p_cost_planning_level IS NOT NULL) THEN
81: pa_debug.g_err_stage := 'Deleting and inserting for Cost Planning Level';
82: IF P_PA_DEBUG_MODE = 'Y' THEN
83: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
84: END IF;
85: delete_elements(p_proj_fp_options_id => p_proj_fp_options_id
78: END IF;
79:
80: IF (p_cost_planning_level IS NOT NULL) THEN
81: pa_debug.g_err_stage := 'Deleting and inserting for Cost Planning Level';
82: IF P_PA_DEBUG_MODE = 'Y' THEN
83: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
84: END IF;
85: delete_elements(p_proj_fp_options_id => p_proj_fp_options_id
86: ,p_element_type => PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_COST
79:
80: IF (p_cost_planning_level IS NOT NULL) THEN
81: pa_debug.g_err_stage := 'Deleting and inserting for Cost Planning Level';
82: IF P_PA_DEBUG_MODE = 'Y' THEN
83: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
84: END IF;
85: delete_elements(p_proj_fp_options_id => p_proj_fp_options_id
86: ,p_element_type => PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_COST
87: ,p_element_level => PA_FP_CONSTANTS_PKG.G_ELEMENT_LEVEL_TASK
100: ,x_msg_data => x_msg_data);
101: END IF;
102:
103: IF (p_revenue_planning_level IS NOT NULL) THEN
104: pa_debug.g_err_stage := 'Deleting and inserting for Revenue Planning Level';
105: IF P_PA_DEBUG_MODE = 'Y' THEN
106: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
107: END IF;
108: delete_elements(p_proj_fp_options_id => p_proj_fp_options_id
101: END IF;
102:
103: IF (p_revenue_planning_level IS NOT NULL) THEN
104: pa_debug.g_err_stage := 'Deleting and inserting for Revenue Planning Level';
105: IF P_PA_DEBUG_MODE = 'Y' THEN
106: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
107: END IF;
108: delete_elements(p_proj_fp_options_id => p_proj_fp_options_id
109: ,p_element_type => PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_REVENUE
102:
103: IF (p_revenue_planning_level IS NOT NULL) THEN
104: pa_debug.g_err_stage := 'Deleting and inserting for Revenue Planning Level';
105: IF P_PA_DEBUG_MODE = 'Y' THEN
106: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
107: END IF;
108: delete_elements(p_proj_fp_options_id => p_proj_fp_options_id
109: ,p_element_type => PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_REVENUE
110: ,p_element_level => PA_FP_CONSTANTS_PKG.G_ELEMENT_LEVEL_TASK
123: ,x_msg_data => x_msg_data);
124: END IF;
125:
126: IF (p_all_planning_level IS NOT NULL) THEN
127: pa_debug.g_err_stage := 'Deleting and inserting for All Planning Level';
128: IF P_PA_DEBUG_MODE = 'Y' THEN
129: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
130: END IF;
131: delete_elements(p_proj_fp_options_id => p_proj_fp_options_id
124: END IF;
125:
126: IF (p_all_planning_level IS NOT NULL) THEN
127: pa_debug.g_err_stage := 'Deleting and inserting for All Planning Level';
128: IF P_PA_DEBUG_MODE = 'Y' THEN
129: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
130: END IF;
131: delete_elements(p_proj_fp_options_id => p_proj_fp_options_id
132: ,p_element_type => PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_ALL
125:
126: IF (p_all_planning_level IS NOT NULL) THEN
127: pa_debug.g_err_stage := 'Deleting and inserting for All Planning Level';
128: IF P_PA_DEBUG_MODE = 'Y' THEN
129: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
130: END IF;
131: delete_elements(p_proj_fp_options_id => p_proj_fp_options_id
132: ,p_element_type => PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_ALL
133: ,p_element_level => PA_FP_CONSTANTS_PKG.G_ELEMENT_LEVEL_TASK
145: ,x_msg_count => x_msg_count
146: ,x_msg_data => x_msg_data);
147: END IF;
148:
149: pa_debug.g_err_stage := 'End of Refresh_FP_Elements';
150: IF P_PA_DEBUG_MODE = 'Y' THEN
151: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
152: END IF;
153: pa_debug.reset_err_stack;
146: ,x_msg_data => x_msg_data);
147: END IF;
148:
149: pa_debug.g_err_stage := 'End of Refresh_FP_Elements';
150: IF P_PA_DEBUG_MODE = 'Y' THEN
151: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
152: END IF;
153: pa_debug.reset_err_stack;
154:
147: END IF;
148:
149: pa_debug.g_err_stage := 'End of Refresh_FP_Elements';
150: IF P_PA_DEBUG_MODE = 'Y' THEN
151: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
152: END IF;
153: pa_debug.reset_err_stack;
154:
155: EXCEPTION
149: pa_debug.g_err_stage := 'End of Refresh_FP_Elements';
150: IF P_PA_DEBUG_MODE = 'Y' THEN
151: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
152: END IF;
153: pa_debug.reset_err_stack;
154:
155: EXCEPTION
156: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
157: l_msg_count := FND_MSG_PUB.count_msg;
167: x_msg_count := l_msg_count;
168: ELSE
169: x_msg_count := l_msg_count;
170: END IF;
171: pa_debug.reset_err_stack;
172: RAISE;
173: WHEN OTHERS THEN
174: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
175: x_msg_count := 1;
175: x_msg_count := 1;
176: x_msg_data := SQLERRM;
177: FND_MSG_PUB.add_exc_msg
178: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Refresh_FP_Elements'
179: ,p_procedure_name => pa_debug.G_Err_Stack );
180: IF P_PA_DEBUG_MODE = 'Y' THEN
181: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,SQLERRM,4);
182: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.G_Err_Stack,4);
183: END IF;
176: x_msg_data := SQLERRM;
177: FND_MSG_PUB.add_exc_msg
178: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Refresh_FP_Elements'
179: ,p_procedure_name => pa_debug.G_Err_Stack );
180: IF P_PA_DEBUG_MODE = 'Y' THEN
181: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,SQLERRM,4);
182: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.G_Err_Stack,4);
183: END IF;
184: pa_debug.reset_err_stack;
177: FND_MSG_PUB.add_exc_msg
178: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Refresh_FP_Elements'
179: ,p_procedure_name => pa_debug.G_Err_Stack );
180: IF P_PA_DEBUG_MODE = 'Y' THEN
181: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,SQLERRM,4);
182: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.G_Err_Stack,4);
183: END IF;
184: pa_debug.reset_err_stack;
185:
178: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Refresh_FP_Elements'
179: ,p_procedure_name => pa_debug.G_Err_Stack );
180: IF P_PA_DEBUG_MODE = 'Y' THEN
181: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,SQLERRM,4);
182: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.G_Err_Stack,4);
183: END IF;
184: pa_debug.reset_err_stack;
185:
186: raise FND_API.G_EXC_UNEXPECTED_ERROR;
180: IF P_PA_DEBUG_MODE = 'Y' THEN
181: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,SQLERRM,4);
182: pa_debug.write('Refresh_FP_Elements: ' || l_module_name,pa_debug.G_Err_Stack,4);
183: END IF;
184: pa_debug.reset_err_stack;
185:
186: raise FND_API.G_EXC_UNEXPECTED_ERROR;
187: END Refresh_FP_Elements;
188:
259:
260: BEGIN
261:
262: FND_MSG_PUB.initialize;
263: IF P_PA_DEBUG_MODE = 'Y' THEN
264: pa_debug.init_err_stack('PA_FP_ELEMENTS_PUB.Copy_Elements');
265: END IF;
266: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
267: l_debug_mode := NVL(l_debug_mode, 'Y');
260: BEGIN
261:
262: FND_MSG_PUB.initialize;
263: IF P_PA_DEBUG_MODE = 'Y' THEN
264: pa_debug.init_err_stack('PA_FP_ELEMENTS_PUB.Copy_Elements');
265: END IF;
266: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
267: l_debug_mode := NVL(l_debug_mode, 'Y');
268: IF P_PA_DEBUG_MODE = 'Y' THEN
262: FND_MSG_PUB.initialize;
263: IF P_PA_DEBUG_MODE = 'Y' THEN
264: pa_debug.init_err_stack('PA_FP_ELEMENTS_PUB.Copy_Elements');
265: END IF;
266: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
267: l_debug_mode := NVL(l_debug_mode, 'Y');
268: IF P_PA_DEBUG_MODE = 'Y' THEN
269: pa_debug.set_process('Copy_Elements: ' || 'PLSQL','LOG',l_debug_mode);
270: END IF;
264: pa_debug.init_err_stack('PA_FP_ELEMENTS_PUB.Copy_Elements');
265: END IF;
266: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
267: l_debug_mode := NVL(l_debug_mode, 'Y');
268: IF P_PA_DEBUG_MODE = 'Y' THEN
269: pa_debug.set_process('Copy_Elements: ' || 'PLSQL','LOG',l_debug_mode);
270: END IF;
271: x_msg_count := 0;
272:
265: END IF;
266: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
267: l_debug_mode := NVL(l_debug_mode, 'Y');
268: IF P_PA_DEBUG_MODE = 'Y' THEN
269: pa_debug.set_process('Copy_Elements: ' || 'PLSQL','LOG',l_debug_mode);
270: END IF;
271: x_msg_count := 0;
272:
273: x_return_status := FND_API.G_RET_STS_SUCCESS;
272:
273: x_return_status := FND_API.G_RET_STS_SUCCESS;
274:
275: IF (p_to_proj_fp_options_id IS NULL) THEN
276: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Target Proj FP Options ID is NULL.';
277: IF P_PA_DEBUG_MODE = 'Y' THEN
278: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
279: END IF;
280:
273: x_return_status := FND_API.G_RET_STS_SUCCESS;
274:
275: IF (p_to_proj_fp_options_id IS NULL) THEN
276: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Target Proj FP Options ID is NULL.';
277: IF P_PA_DEBUG_MODE = 'Y' THEN
278: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
279: END IF;
280:
281: x_return_status := FND_API.G_RET_STS_ERROR;
274:
275: IF (p_to_proj_fp_options_id IS NULL) THEN
276: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Target Proj FP Options ID is NULL.';
277: IF P_PA_DEBUG_MODE = 'Y' THEN
278: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
279: END IF;
280:
281: x_return_status := FND_API.G_RET_STS_ERROR;
282: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
284: END IF;
285:
286: IF (p_to_element_type IS NULL) THEN
287:
288: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Target Element Type is NULL.';
289: IF P_PA_DEBUG_MODE = 'Y' THEN
290: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
291: END IF;
292: x_return_status := FND_API.G_RET_STS_ERROR;
285:
286: IF (p_to_element_type IS NULL) THEN
287:
288: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Target Element Type is NULL.';
289: IF P_PA_DEBUG_MODE = 'Y' THEN
290: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
291: END IF;
292: x_return_status := FND_API.G_RET_STS_ERROR;
293: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
286: IF (p_to_element_type IS NULL) THEN
287:
288: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Target Element Type is NULL.';
289: IF P_PA_DEBUG_MODE = 'Y' THEN
290: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
291: END IF;
292: x_return_status := FND_API.G_RET_STS_ERROR;
293: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
294: p_msg_name => 'PA_FP_INV_PARAM_PASSED' );
295: END IF;
296:
297: IF (p_from_proj_fp_options_id IS NOT NULL AND p_from_element_type IS NULL) THEN
298:
299: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Source Element Type is NULL.';
300: IF P_PA_DEBUG_MODE = 'Y' THEN
301: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
302: END IF;
303: x_return_status := FND_API.G_RET_STS_ERROR;
296:
297: IF (p_from_proj_fp_options_id IS NOT NULL AND p_from_element_type IS NULL) THEN
298:
299: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Source Element Type is NULL.';
300: IF P_PA_DEBUG_MODE = 'Y' THEN
301: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
302: END IF;
303: x_return_status := FND_API.G_RET_STS_ERROR;
304: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
297: IF (p_from_proj_fp_options_id IS NOT NULL AND p_from_element_type IS NULL) THEN
298:
299: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Source Element Type is NULL.';
300: IF P_PA_DEBUG_MODE = 'Y' THEN
301: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
302: END IF;
303: x_return_status := FND_API.G_RET_STS_ERROR;
304: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
305: p_msg_name => 'PA_FP_INV_PARAM_PASSED' );
313: l_stage := 200;
314: IF (p_from_proj_fp_options_id IS NOT NULL) THEN
315: /* If the Source Proj FP Option is passed, then the records have to be copied
316: from pa_fp_elements for the Source FP Option and the Source Element Type. */
317: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Source Proj FP Option is passed.';
318: IF P_PA_DEBUG_MODE = 'Y' THEN
319: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
320: END IF;
321:
314: IF (p_from_proj_fp_options_id IS NOT NULL) THEN
315: /* If the Source Proj FP Option is passed, then the records have to be copied
316: from pa_fp_elements for the Source FP Option and the Source Element Type. */
317: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Source Proj FP Option is passed.';
318: IF P_PA_DEBUG_MODE = 'Y' THEN
319: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
320: END IF;
321:
322: l_from_proj_fp_option_id := p_from_proj_fp_options_id;
315: /* If the Source Proj FP Option is passed, then the records have to be copied
316: from pa_fp_elements for the Source FP Option and the Source Element Type. */
317: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Source Proj FP Option is passed.';
318: IF P_PA_DEBUG_MODE = 'Y' THEN
319: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
320: END IF;
321:
322: l_from_proj_fp_option_id := p_from_proj_fp_options_id;
323: l_from_element_type := p_from_element_type;
330:
331: IF (l_par_fp_option_id IS NOT NULL) THEN
332: /* Since Parent FP Option is found, records have to be copied from pa_fp_elements
333: for the Parent FP Option and the Target Element Type. */
334: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Parent FP Option is not null.';
335: IF P_PA_DEBUG_MODE = 'Y' THEN
336: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
337: END IF;
338:
331: IF (l_par_fp_option_id IS NOT NULL) THEN
332: /* Since Parent FP Option is found, records have to be copied from pa_fp_elements
333: for the Parent FP Option and the Target Element Type. */
334: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Parent FP Option is not null.';
335: IF P_PA_DEBUG_MODE = 'Y' THEN
336: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
337: END IF;
338:
339: l_from_proj_fp_option_id := l_par_fp_option_id ;
332: /* Since Parent FP Option is found, records have to be copied from pa_fp_elements
333: for the Parent FP Option and the Target Element Type. */
334: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Parent FP Option is not null.';
335: IF P_PA_DEBUG_MODE = 'Y' THEN
336: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
337: END IF;
338:
339: l_from_proj_fp_option_id := l_par_fp_option_id ;
340: -- l_from_element_type := p_to_element_type; /* M20-08: commented this */
338:
339: l_from_proj_fp_option_id := l_par_fp_option_id ;
340: -- l_from_element_type := p_to_element_type; /* M20-08: commented this */
341:
342: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Got parent. l_from_proj_fp_option_id = '|| l_from_proj_fp_option_id ;
343: IF P_PA_DEBUG_MODE = 'Y' THEN
344: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
345: END IF;
346:
339: l_from_proj_fp_option_id := l_par_fp_option_id ;
340: -- l_from_element_type := p_to_element_type; /* M20-08: commented this */
341:
342: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Got parent. l_from_proj_fp_option_id = '|| l_from_proj_fp_option_id ;
343: IF P_PA_DEBUG_MODE = 'Y' THEN
344: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
345: END IF;
346:
347:
340: -- l_from_element_type := p_to_element_type; /* M20-08: commented this */
341:
342: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Got parent. l_from_proj_fp_option_id = '|| l_from_proj_fp_option_id ;
343: IF P_PA_DEBUG_MODE = 'Y' THEN
344: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
345: END IF;
346:
347:
348: /* M20-AUG changes start from here */
382: l_from_element_type := p_to_element_type;
383:
384: END IF;
385:
386: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': from element type set = '|| l_from_element_type ;
387: IF P_PA_DEBUG_MODE = 'Y' THEN
388: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
389: END IF;
390:
383:
384: END IF;
385:
386: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': from element type set = '|| l_from_element_type ;
387: IF P_PA_DEBUG_MODE = 'Y' THEN
388: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
389: END IF;
390:
391:
384: END IF;
385:
386: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': from element type set = '|| l_from_element_type ;
387: IF P_PA_DEBUG_MODE = 'Y' THEN
388: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
389: END IF;
390:
391:
392: ELSE
393: /* Parent Proj Option ID not found, so Insert Default */
394: /* First delete the records from pa_fp_elements and then insert the Default
395: Values into PA_FP_Elements table. */
396:
397: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Parent FP Option is null, hence insert_default.';
398: IF P_PA_DEBUG_MODE = 'Y' THEN
399: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
400: END IF;
401:
394: /* First delete the records from pa_fp_elements and then insert the Default
395: Values into PA_FP_Elements table. */
396:
397: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Parent FP Option is null, hence insert_default.';
398: IF P_PA_DEBUG_MODE = 'Y' THEN
399: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
400: END IF;
401:
402: Delete_Elements(p_proj_fp_options_id => p_to_proj_fp_options_id
395: Values into PA_FP_Elements table. */
396:
397: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Parent FP Option is null, hence insert_default.';
398: IF P_PA_DEBUG_MODE = 'Y' THEN
399: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
400: END IF;
401:
402: Delete_Elements(p_proj_fp_options_id => p_to_proj_fp_options_id
403: ,p_element_type => p_to_element_type
408:
409: /* Insert Default values for the proj_fp_option_id, element_type and planning_level. */
410: IF (p_to_element_type = PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_BOTH) THEN
411: l_stage := 400;
412: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Inserting Default Values for Both - COST
413: and REVENUE.';
414: IF P_PA_DEBUG_MODE = 'Y' THEN
415: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
416: END IF;
410: IF (p_to_element_type = PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_BOTH) THEN
411: l_stage := 400;
412: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Inserting Default Values for Both - COST
413: and REVENUE.';
414: IF P_PA_DEBUG_MODE = 'Y' THEN
415: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
416: END IF;
417:
418: /* Get the value of the Cost and Revenue Planning Level for the proj_fp_options_id
411: l_stage := 400;
412: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Inserting Default Values for Both - COST
413: and REVENUE.';
414: IF P_PA_DEBUG_MODE = 'Y' THEN
415: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
416: END IF;
417:
418: /* Get the value of the Cost and Revenue Planning Level for the proj_fp_options_id
419: depending on the p_element_type value. */
417:
418: /* Get the value of the Cost and Revenue Planning Level for the proj_fp_options_id
419: depending on the p_element_type value. */
420:
421: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': getting planning level.';
422: IF P_PA_DEBUG_MODE = 'Y' THEN
423: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
424: END IF;
425:
418: /* Get the value of the Cost and Revenue Planning Level for the proj_fp_options_id
419: depending on the p_element_type value. */
420:
421: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': getting planning level.';
422: IF P_PA_DEBUG_MODE = 'Y' THEN
423: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
424: END IF;
425:
426: SELECT cost_fin_plan_level_code
419: depending on the p_element_type value. */
420:
421: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': getting planning level.';
422: IF P_PA_DEBUG_MODE = 'Y' THEN
423: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
424: END IF;
425:
426: SELECT cost_fin_plan_level_code
427: ,revenue_fin_plan_level_code
439: WHERE proj_fp_options_id = p_to_proj_fp_options_id;
440:
441: /* Call Insert_Default twice, once with Element_Type as 'COST' and then as PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_REVENUE
442: as the case of element_type being 'BOTH' is not handled in Insert_Default. */
443: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': calling insert default for cost.';
444: IF P_PA_DEBUG_MODE = 'Y' THEN
445: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
446: END IF;
447: Insert_Default(p_proj_fp_options_id => p_to_proj_fp_options_id
440:
441: /* Call Insert_Default twice, once with Element_Type as 'COST' and then as PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_REVENUE
442: as the case of element_type being 'BOTH' is not handled in Insert_Default. */
443: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': calling insert default for cost.';
444: IF P_PA_DEBUG_MODE = 'Y' THEN
445: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
446: END IF;
447: Insert_Default(p_proj_fp_options_id => p_to_proj_fp_options_id
448: ,p_element_type => PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_COST
441: /* Call Insert_Default twice, once with Element_Type as 'COST' and then as PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_REVENUE
442: as the case of element_type being 'BOTH' is not handled in Insert_Default. */
443: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': calling insert default for cost.';
444: IF P_PA_DEBUG_MODE = 'Y' THEN
445: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
446: END IF;
447: Insert_Default(p_proj_fp_options_id => p_to_proj_fp_options_id
448: ,p_element_type => PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_COST
449: ,p_planning_level => l_cost_planning_level
453: ,x_return_status => x_return_status
454: ,x_msg_count => x_msg_count
455: ,x_msg_data => x_msg_data);
456:
457: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': calling insert default for revenue.';
458: IF P_PA_DEBUG_MODE = 'Y' THEN
459: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
460: END IF;
461:
454: ,x_msg_count => x_msg_count
455: ,x_msg_data => x_msg_data);
456:
457: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': calling insert default for revenue.';
458: IF P_PA_DEBUG_MODE = 'Y' THEN
459: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
460: END IF;
461:
462: Insert_Default(p_proj_fp_options_id => p_to_proj_fp_options_id
455: ,x_msg_data => x_msg_data);
456:
457: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': calling insert default for revenue.';
458: IF P_PA_DEBUG_MODE = 'Y' THEN
459: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
460: END IF;
461:
462: Insert_Default(p_proj_fp_options_id => p_to_proj_fp_options_id
463: ,p_element_type => PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_REVENUE
472: l_stage := 500;
473: /* Get the value of the Planning Level for the proj_fp_options_id depending on the
474: p_element_type value. */
475:
476: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Inserting Default Values for either COST
477: OR REVENUE.';
478: IF P_PA_DEBUG_MODE = 'Y' THEN
479: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
480: END IF;
474: p_element_type value. */
475:
476: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Inserting Default Values for either COST
477: OR REVENUE.';
478: IF P_PA_DEBUG_MODE = 'Y' THEN
479: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
480: END IF;
481:
482: /* M20-AUG: replaced select with call to fin plan utils */
475:
476: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Inserting Default Values for either COST
477: OR REVENUE.';
478: IF P_PA_DEBUG_MODE = 'Y' THEN
479: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
480: END IF;
481:
482: /* M20-AUG: replaced select with call to fin plan utils */
483:
482: /* M20-AUG: replaced select with call to fin plan utils */
483:
484: l_planning_level := PA_FIN_PLAN_UTILS.get_option_planning_level(p_to_proj_fp_options_id ,l_planning_level);
485:
486: IF P_PA_DEBUG_MODE = 'Y' THEN
487: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': fetching auto res addition params from option.';
488: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
489: END IF;
490:
483:
484: l_planning_level := PA_FIN_PLAN_UTILS.get_option_planning_level(p_to_proj_fp_options_id ,l_planning_level);
485:
486: IF P_PA_DEBUG_MODE = 'Y' THEN
487: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': fetching auto res addition params from option.';
488: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
489: END IF;
490:
491: /* Bug 2920954 start of changes */
484: l_planning_level := PA_FIN_PLAN_UTILS.get_option_planning_level(p_to_proj_fp_options_id ,l_planning_level);
485:
486: IF P_PA_DEBUG_MODE = 'Y' THEN
487: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': fetching auto res addition params from option.';
488: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
489: END IF;
490:
491: /* Bug 2920954 start of changes */
492:
504: WHERE proj_fp_options_id = p_to_proj_fp_options_id;
505:
506: /* Bug 2920954 end of changes */
507:
508: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': calling insert default for element type.';
509: IF P_PA_DEBUG_MODE = 'Y' THEN
510: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
511: END IF;
512:
505:
506: /* Bug 2920954 end of changes */
507:
508: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': calling insert default for element type.';
509: IF P_PA_DEBUG_MODE = 'Y' THEN
510: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
511: END IF;
512:
513: Insert_Default(p_proj_fp_options_id => p_to_proj_fp_options_id
506: /* Bug 2920954 end of changes */
507:
508: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': calling insert default for element type.';
509: IF P_PA_DEBUG_MODE = 'Y' THEN
510: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
511: END IF;
512:
513: Insert_Default(p_proj_fp_options_id => p_to_proj_fp_options_id
514: ,p_element_type => p_to_element_type
528:
529: /* Get the values of the Plan_Type_ID and Plan_Version_ID of the Target
530: FP Option to be used while inserting records into pa_fp_elements. */
531:
532: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': getting info from to option id.';
533: IF P_PA_DEBUG_MODE = 'Y' THEN
534: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
535: END IF;
536:
529: /* Get the values of the Plan_Type_ID and Plan_Version_ID of the Target
530: FP Option to be used while inserting records into pa_fp_elements. */
531:
532: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': getting info from to option id.';
533: IF P_PA_DEBUG_MODE = 'Y' THEN
534: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
535: END IF;
536:
537: SELECT fin_plan_type_id, fin_plan_version_id,project_id,
530: FP Option to be used while inserting records into pa_fp_elements. */
531:
532: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': getting info from to option id.';
533: IF P_PA_DEBUG_MODE = 'Y' THEN
534: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
535: END IF;
536:
537: SELECT fin_plan_type_id, fin_plan_version_id,project_id,
538: DECODE(fin_plan_preference_code,
549: WHERE proj_fp_options_id = p_to_proj_fp_options_id;
550:
551:
552: /*Get the project id of source fp options id */
553: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': getting project of source.';
554: IF P_PA_DEBUG_MODE = 'Y' THEN
555: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
556: END IF;
557:
550:
551:
552: /*Get the project id of source fp options id */
553: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': getting project of source.';
554: IF P_PA_DEBUG_MODE = 'Y' THEN
555: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
556: END IF;
557:
558: SELECT project_id,
551:
552: /*Get the project id of source fp options id */
553: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': getting project of source.';
554: IF P_PA_DEBUG_MODE = 'Y' THEN
555: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
556: END IF;
557:
558: SELECT project_id,
559: DECODE(l_from_element_type,
574:
575: IF (l_from_planning_level <> l_to_planning_level OR
576: l_from_resource_list_id <> l_to_resource_list_id) THEN
577:
578: pa_debug.g_err_stage := 'Bug# 2684787: PA_FP_ELEMENTS_PUB.COPY_ELEMENTS being called with ' ||
579: 'incompatible planning levels/resource list ids..';
580: IF P_PA_DEBUG_MODE = 'Y' THEN
581: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,4);
582: END IF;
576: l_from_resource_list_id <> l_to_resource_list_id) THEN
577:
578: pa_debug.g_err_stage := 'Bug# 2684787: PA_FP_ELEMENTS_PUB.COPY_ELEMENTS being called with ' ||
579: 'incompatible planning levels/resource list ids..';
580: IF P_PA_DEBUG_MODE = 'Y' THEN
581: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,4);
582: END IF;
583: pa_debug.g_err_stage := l_from_planning_level || ':' || l_to_planning_level || ':' ||
584: to_char(l_from_resource_list_id) || ':' || to_char(l_to_resource_list_id);
577:
578: pa_debug.g_err_stage := 'Bug# 2684787: PA_FP_ELEMENTS_PUB.COPY_ELEMENTS being called with ' ||
579: 'incompatible planning levels/resource list ids..';
580: IF P_PA_DEBUG_MODE = 'Y' THEN
581: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,4);
582: END IF;
583: pa_debug.g_err_stage := l_from_planning_level || ':' || l_to_planning_level || ':' ||
584: to_char(l_from_resource_list_id) || ':' || to_char(l_to_resource_list_id);
585: IF P_PA_DEBUG_MODE = 'Y' THEN
579: 'incompatible planning levels/resource list ids..';
580: IF P_PA_DEBUG_MODE = 'Y' THEN
581: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,4);
582: END IF;
583: pa_debug.g_err_stage := l_from_planning_level || ':' || l_to_planning_level || ':' ||
584: to_char(l_from_resource_list_id) || ':' || to_char(l_to_resource_list_id);
585: IF P_PA_DEBUG_MODE = 'Y' THEN
586: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,4);
587: END IF;
581: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,4);
582: END IF;
583: pa_debug.g_err_stage := l_from_planning_level || ':' || l_to_planning_level || ':' ||
584: to_char(l_from_resource_list_id) || ':' || to_char(l_to_resource_list_id);
585: IF P_PA_DEBUG_MODE = 'Y' THEN
586: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,4);
587: END IF;
588: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
589: END IF;
582: END IF;
583: pa_debug.g_err_stage := l_from_planning_level || ':' || l_to_planning_level || ':' ||
584: to_char(l_from_resource_list_id) || ':' || to_char(l_to_resource_list_id);
585: IF P_PA_DEBUG_MODE = 'Y' THEN
586: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,4);
587: END IF;
588: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
589: END IF;
590:
590:
591:
592: /* Delete the records from pa_fp_elements for the Target Proj FP Option and Target Element Type
593: before inserting records into pa_fp_elements. */
594: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Deleting the Elements from FP Elements';
595: IF P_PA_DEBUG_MODE = 'Y' THEN
596: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
597: END IF;
598: Delete_Elements(p_proj_fp_options_id => p_to_proj_fp_options_id
591:
592: /* Delete the records from pa_fp_elements for the Target Proj FP Option and Target Element Type
593: before inserting records into pa_fp_elements. */
594: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Deleting the Elements from FP Elements';
595: IF P_PA_DEBUG_MODE = 'Y' THEN
596: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
597: END IF;
598: Delete_Elements(p_proj_fp_options_id => p_to_proj_fp_options_id
599: ,p_element_type => p_to_element_type
592: /* Delete the records from pa_fp_elements for the Target Proj FP Option and Target Element Type
593: before inserting records into pa_fp_elements. */
594: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Deleting the Elements from FP Elements';
595: IF P_PA_DEBUG_MODE = 'Y' THEN
596: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
597: END IF;
598: Delete_Elements(p_proj_fp_options_id => p_to_proj_fp_options_id
599: ,p_element_type => p_to_element_type
600: ,p_element_level => PA_FP_CONSTANTS_PKG.G_ELEMENT_LEVEL_TASK -- 'TASK'
605: /* Get the records from pa_fp_elements for the Proj FP Option and the Element Type
606: and insert into PA_FP_ELEMENTS. */
607: l_stage :=700;
608:
609: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Inserting records into PA_FP_ELEMENTS';
610: IF P_PA_DEBUG_MODE = 'Y' THEN
611: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
612: END IF;
613:
606: and insert into PA_FP_ELEMENTS. */
607: l_stage :=700;
608:
609: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Inserting records into PA_FP_ELEMENTS';
610: IF P_PA_DEBUG_MODE = 'Y' THEN
611: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
612: END IF;
613:
614: -- IF source and target projects are same
607: l_stage :=700;
608:
609: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Inserting records into PA_FP_ELEMENTS';
610: IF P_PA_DEBUG_MODE = 'Y' THEN
611: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
612: END IF;
613:
614: -- IF source and target projects are same
615:
668: /* Bug 2966275 null handling is necessary for plan_amount_exists_flag as in someplaces its being populated as null */
669:
670: ELSE --if projects are different then
671:
672: IF P_PA_DEBUG_MODE = 'Y' THEN
673: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': projects are different.';
674: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
675: END IF;
676:
669:
670: ELSE --if projects are different then
671:
672: IF P_PA_DEBUG_MODE = 'Y' THEN
673: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': projects are different.';
674: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
675: END IF;
676:
677: INSERT INTO pa_fp_elements
670: ELSE --if projects are different then
671:
672: IF P_PA_DEBUG_MODE = 'Y' THEN
673: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': projects are different.';
674: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
675: END IF;
676:
677: INSERT INTO pa_fp_elements
678: (PROJ_FP_ELEMENTS_ID
746: WHERE proj_fp_options_id = l_from_proj_fp_option_id;
747:
748: EXCEPTION
749: WHEN OTHERS THEN
750: IF P_PA_DEBUG_MODE = 'Y' THEN
751: pa_debug.g_err_stage := 'Error while fetching the fp option record of '||l_from_proj_fp_option_id;
752: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
753: END IF;
754: RAISE;
747:
748: EXCEPTION
749: WHEN OTHERS THEN
750: IF P_PA_DEBUG_MODE = 'Y' THEN
751: pa_debug.g_err_stage := 'Error while fetching the fp option record of '||l_from_proj_fp_option_id;
752: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
753: END IF;
754: RAISE;
755: END;
748: EXCEPTION
749: WHEN OTHERS THEN
750: IF P_PA_DEBUG_MODE = 'Y' THEN
751: pa_debug.g_err_stage := 'Error while fetching the fp option record of '||l_from_proj_fp_option_id;
752: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
753: END IF;
754: RAISE;
755: END;
756:
826: IF nvl(p_copy_mode ,'-99') <> PA_FP_CONSTANTS_PKG.G_BUDGET_STATUS_BASELINED AND
827: l_from_proj_fp_option_id IS NOT NULL AND
828: l_from_element_type IS NOT NULL THEN
829:
830: pa_debug.g_err_stage := TO_CHAR(l_stage)||': About to call Copy_Excluded_Elements';
831: IF P_PA_DEBUG_MODE = 'Y' THEN
832: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
833: END IF;
834:
827: l_from_proj_fp_option_id IS NOT NULL AND
828: l_from_element_type IS NOT NULL THEN
829:
830: pa_debug.g_err_stage := TO_CHAR(l_stage)||': About to call Copy_Excluded_Elements';
831: IF P_PA_DEBUG_MODE = 'Y' THEN
832: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
833: END IF;
834:
835: PA_FP_EXCLUDED_ELEMENTS_PUB.Copy_Excluded_Elements
828: l_from_element_type IS NOT NULL THEN
829:
830: pa_debug.g_err_stage := TO_CHAR(l_stage)||': About to call Copy_Excluded_Elements';
831: IF P_PA_DEBUG_MODE = 'Y' THEN
832: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
833: END IF;
834:
835: PA_FP_EXCLUDED_ELEMENTS_PUB.Copy_Excluded_Elements
836: ( p_from_proj_fp_options_id => l_from_proj_fp_option_id
841: ,x_msg_count => x_msg_count
842: ,x_msg_data => x_msg_data);
843:
844: IF x_return_status<>FND_API.G_RET_STS_SUCCESS THEN
845: pa_debug.g_err_stage := TO_CHAR(l_stage)||'Copy_Excluded_Elements errored out '||x_msg_data;
846: IF P_PA_DEBUG_MODE = 'Y' THEN
847: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
848: END IF;
849: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
842: ,x_msg_data => x_msg_data);
843:
844: IF x_return_status<>FND_API.G_RET_STS_SUCCESS THEN
845: pa_debug.g_err_stage := TO_CHAR(l_stage)||'Copy_Excluded_Elements errored out '||x_msg_data;
846: IF P_PA_DEBUG_MODE = 'Y' THEN
847: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
848: END IF;
849: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
850: END IF;
843:
844: IF x_return_status<>FND_API.G_RET_STS_SUCCESS THEN
845: pa_debug.g_err_stage := TO_CHAR(l_stage)||'Copy_Excluded_Elements errored out '||x_msg_data;
846: IF P_PA_DEBUG_MODE = 'Y' THEN
847: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,5);
848: END IF;
849: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
850: END IF;
851: END IF;
849: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
850: END IF;
851: END IF;
852:
853: pa_debug.g_err_stage := TO_CHAR(l_stage)||': End of Copy_Elements';
854: IF P_PA_DEBUG_MODE = 'Y' THEN
855: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
856: END IF;
857: pa_debug.reset_err_stack;
850: END IF;
851: END IF;
852:
853: pa_debug.g_err_stage := TO_CHAR(l_stage)||': End of Copy_Elements';
854: IF P_PA_DEBUG_MODE = 'Y' THEN
855: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
856: END IF;
857: pa_debug.reset_err_stack;
858:
851: END IF;
852:
853: pa_debug.g_err_stage := TO_CHAR(l_stage)||': End of Copy_Elements';
854: IF P_PA_DEBUG_MODE = 'Y' THEN
855: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
856: END IF;
857: pa_debug.reset_err_stack;
858:
859: EXCEPTION
853: pa_debug.g_err_stage := TO_CHAR(l_stage)||': End of Copy_Elements';
854: IF P_PA_DEBUG_MODE = 'Y' THEN
855: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
856: END IF;
857: pa_debug.reset_err_stack;
858:
859: EXCEPTION
860: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
861: l_msg_count := FND_MSG_PUB.count_msg;
871: x_msg_count := l_msg_count;
872: ELSE
873: x_msg_count := l_msg_count;
874: END IF;
875: pa_debug.reset_err_stack;
876: RAISE;
877: WHEN OTHERS THEN
878: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
879: x_msg_count := 1;
879: x_msg_count := 1;
880: x_msg_data := SQLERRM;
881: FND_MSG_PUB.add_exc_msg
882: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Copy_Elements'
883: ,p_procedure_name => pa_debug.G_Err_Stack );
884: IF P_PA_DEBUG_MODE = 'Y' THEN
885: pa_debug.write('Copy_Elements: ' || l_module_name,SQLERRM,4);
886: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.G_Err_Stack,4);
887: END IF;
880: x_msg_data := SQLERRM;
881: FND_MSG_PUB.add_exc_msg
882: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Copy_Elements'
883: ,p_procedure_name => pa_debug.G_Err_Stack );
884: IF P_PA_DEBUG_MODE = 'Y' THEN
885: pa_debug.write('Copy_Elements: ' || l_module_name,SQLERRM,4);
886: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.G_Err_Stack,4);
887: END IF;
888: pa_debug.reset_err_stack;
881: FND_MSG_PUB.add_exc_msg
882: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Copy_Elements'
883: ,p_procedure_name => pa_debug.G_Err_Stack );
884: IF P_PA_DEBUG_MODE = 'Y' THEN
885: pa_debug.write('Copy_Elements: ' || l_module_name,SQLERRM,4);
886: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.G_Err_Stack,4);
887: END IF;
888: pa_debug.reset_err_stack;
889:
882: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Copy_Elements'
883: ,p_procedure_name => pa_debug.G_Err_Stack );
884: IF P_PA_DEBUG_MODE = 'Y' THEN
885: pa_debug.write('Copy_Elements: ' || l_module_name,SQLERRM,4);
886: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.G_Err_Stack,4);
887: END IF;
888: pa_debug.reset_err_stack;
889:
890: raise FND_API.G_EXC_UNEXPECTED_ERROR;
884: IF P_PA_DEBUG_MODE = 'Y' THEN
885: pa_debug.write('Copy_Elements: ' || l_module_name,SQLERRM,4);
886: pa_debug.write('Copy_Elements: ' || l_module_name,pa_debug.G_Err_Stack,4);
887: END IF;
888: pa_debug.reset_err_stack;
889:
890: raise FND_API.G_EXC_UNEXPECTED_ERROR;
891: END Copy_Elements;
892:
1014: AND task_id = top_task_id;
1015:
1016: BEGIN
1017:
1018: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Insert_Default');
1019: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1020: l_debug_mode := NVL(l_debug_mode, 'Y');
1021: IF P_PA_DEBUG_MODE = 'Y' THEN
1022: pa_debug.set_process('Insert_Default: ' || 'PLSQL','LOG',l_debug_mode);
1015:
1016: BEGIN
1017:
1018: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Insert_Default');
1019: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1020: l_debug_mode := NVL(l_debug_mode, 'Y');
1021: IF P_PA_DEBUG_MODE = 'Y' THEN
1022: pa_debug.set_process('Insert_Default: ' || 'PLSQL','LOG',l_debug_mode);
1023: END IF;
1017:
1018: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Insert_Default');
1019: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1020: l_debug_mode := NVL(l_debug_mode, 'Y');
1021: IF P_PA_DEBUG_MODE = 'Y' THEN
1022: pa_debug.set_process('Insert_Default: ' || 'PLSQL','LOG',l_debug_mode);
1023: END IF;
1024:
1025: x_return_status := FND_API.G_RET_STS_SUCCESS;
1018: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Insert_Default');
1019: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1020: l_debug_mode := NVL(l_debug_mode, 'Y');
1021: IF P_PA_DEBUG_MODE = 'Y' THEN
1022: pa_debug.set_process('Insert_Default: ' || 'PLSQL','LOG',l_debug_mode);
1023: END IF;
1024:
1025: x_return_status := FND_API.G_RET_STS_SUCCESS;
1026:
1025: x_return_status := FND_API.G_RET_STS_SUCCESS;
1026:
1027: /* Check for the input parameters not being NULL. */
1028: IF (p_proj_fp_options_id IS NULL) THEN
1029: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Proj FP Option ID cannot be NULL.';
1030: IF P_PA_DEBUG_MODE = 'Y' THEN
1031: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,5);
1032: END IF;
1033: IF (p_element_type IS NULL) THEN
1026:
1027: /* Check for the input parameters not being NULL. */
1028: IF (p_proj_fp_options_id IS NULL) THEN
1029: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Proj FP Option ID cannot be NULL.';
1030: IF P_PA_DEBUG_MODE = 'Y' THEN
1031: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,5);
1032: END IF;
1033: IF (p_element_type IS NULL) THEN
1034: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Element Type cannot be NULL.';
1027: /* Check for the input parameters not being NULL. */
1028: IF (p_proj_fp_options_id IS NULL) THEN
1029: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Proj FP Option ID cannot be NULL.';
1030: IF P_PA_DEBUG_MODE = 'Y' THEN
1031: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,5);
1032: END IF;
1033: IF (p_element_type IS NULL) THEN
1034: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Element Type cannot be NULL.';
1035: IF P_PA_DEBUG_MODE = 'Y' THEN
1030: IF P_PA_DEBUG_MODE = 'Y' THEN
1031: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,5);
1032: END IF;
1033: IF (p_element_type IS NULL) THEN
1034: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Element Type cannot be NULL.';
1035: IF P_PA_DEBUG_MODE = 'Y' THEN
1036: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,5);
1037: END IF;
1038: END IF;
1031: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,5);
1032: END IF;
1033: IF (p_element_type IS NULL) THEN
1034: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Element Type cannot be NULL.';
1035: IF P_PA_DEBUG_MODE = 'Y' THEN
1036: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,5);
1037: END IF;
1038: END IF;
1039: x_return_status := FND_API.G_RET_STS_ERROR;
1032: END IF;
1033: IF (p_element_type IS NULL) THEN
1034: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Element Type cannot be NULL.';
1035: IF P_PA_DEBUG_MODE = 'Y' THEN
1036: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,5);
1037: END IF;
1038: END IF;
1039: x_return_status := FND_API.G_RET_STS_ERROR;
1040: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
1045: l_stage :=200;
1046: /* If the Planning Level parameter is not passed, get the value of the planning level
1047: from the table pa_proj_fp_options depending on the Element_Type. */
1048:
1049: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Getting the value of Planning Level.';
1050: IF P_PA_DEBUG_MODE = 'Y' THEN
1051: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1052: END IF;
1053:
1046: /* If the Planning Level parameter is not passed, get the value of the planning level
1047: from the table pa_proj_fp_options depending on the Element_Type. */
1048:
1049: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Getting the value of Planning Level.';
1050: IF P_PA_DEBUG_MODE = 'Y' THEN
1051: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1052: END IF;
1053:
1054: IF (p_planning_level IS NOT NULL) THEN
1047: from the table pa_proj_fp_options depending on the Element_Type. */
1048:
1049: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Getting the value of Planning Level.';
1050: IF P_PA_DEBUG_MODE = 'Y' THEN
1051: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1052: END IF;
1053:
1054: IF (p_planning_level IS NOT NULL) THEN
1055: /* Planning Level is passed to the procedure, if Proj FP Option records
1076: /* Resource List ID is passed to the procedure, if Proj FP Option records
1077: have not been saved to the Database. */
1078: l_resource_list_id := p_resource_list_id;
1079: ELSE
1080: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Resource List ID not passed getting from option.';
1081: IF P_PA_DEBUG_MODE = 'Y' THEN
1082: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1083: END IF;
1084:
1077: have not been saved to the Database. */
1078: l_resource_list_id := p_resource_list_id;
1079: ELSE
1080: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Resource List ID not passed getting from option.';
1081: IF P_PA_DEBUG_MODE = 'Y' THEN
1082: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1083: END IF;
1084:
1085: SELECT decode(p_element_type,PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_COST,cost_resource_list_id
1078: l_resource_list_id := p_resource_list_id;
1079: ELSE
1080: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Resource List ID not passed getting from option.';
1081: IF P_PA_DEBUG_MODE = 'Y' THEN
1082: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1083: END IF;
1084:
1085: SELECT decode(p_element_type,PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_COST,cost_resource_list_id
1086: ,PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_REVENUE,revenue_resource_list_id,
1095:
1096: IF (p_select_res_auto_flag IS NULL) AND (p_res_planning_level IS NULL)
1097: THEN
1098:
1099: IF P_PA_DEBUG_MODE = 'Y' THEN
1100: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Auto res addition params not passed getting from option.';
1101: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1102: END IF;
1103:
1096: IF (p_select_res_auto_flag IS NULL) AND (p_res_planning_level IS NULL)
1097: THEN
1098:
1099: IF P_PA_DEBUG_MODE = 'Y' THEN
1100: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Auto res addition params not passed getting from option.';
1101: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1102: END IF;
1103:
1104: SELECT decode(p_element_type,PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_COST, select_cost_res_auto_flag
1097: THEN
1098:
1099: IF P_PA_DEBUG_MODE = 'Y' THEN
1100: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Auto res addition params not passed getting from option.';
1101: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1102: END IF;
1103:
1104: SELECT decode(p_element_type,PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_COST, select_cost_res_auto_flag
1105: ,PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_REVENUE,select_rev_res_auto_flag
1122: l_select_res_auto_flag := p_select_res_auto_flag;
1123: l_res_planning_level := p_res_planning_level ;
1124: END IF;
1125:
1126: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': getting project id plan type id and plan version id from option.';
1127: IF P_PA_DEBUG_MODE = 'Y' THEN
1128: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1129: END IF;
1130:
1123: l_res_planning_level := p_res_planning_level ;
1124: END IF;
1125:
1126: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': getting project id plan type id and plan version id from option.';
1127: IF P_PA_DEBUG_MODE = 'Y' THEN
1128: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1129: END IF;
1130:
1131: SELECT project_id, fin_plan_type_id, fin_plan_version_id
1124: END IF;
1125:
1126: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': getting project id plan type id and plan version id from option.';
1127: IF P_PA_DEBUG_MODE = 'Y' THEN
1128: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1129: END IF;
1130:
1131: SELECT project_id, fin_plan_type_id, fin_plan_version_id
1132: INTO l_project_id, l_fin_plan_type_id, l_fin_plan_version_id
1134: WHERE proj_fp_options_id = p_proj_fp_options_id;
1135:
1136: /* Get the value of the Resource Planning Level. The value is NULL if the resource_list_id of the
1137: element_type is Uncategorised, else it is "RESOURCE". */
1138: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': getting resource planning level from resource list.';
1139: IF P_PA_DEBUG_MODE = 'Y' THEN
1140: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1141: END IF;
1142:
1135:
1136: /* Get the value of the Resource Planning Level. The value is NULL if the resource_list_id of the
1137: element_type is Uncategorised, else it is "RESOURCE". */
1138: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': getting resource planning level from resource list.';
1139: IF P_PA_DEBUG_MODE = 'Y' THEN
1140: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1141: END IF;
1142:
1143: /* SELECT decode(uncategorized_flag,'Y',NULL,PA_FP_CONSTANTS_PKG.G_RESOURCE_PLANNING_LEVEL_R)
1136: /* Get the value of the Resource Planning Level. The value is NULL if the resource_list_id of the
1137: element_type is Uncategorised, else it is "RESOURCE". */
1138: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': getting resource planning level from resource list.';
1139: IF P_PA_DEBUG_MODE = 'Y' THEN
1140: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1141: END IF;
1142:
1143: /* SELECT decode(uncategorized_flag,'Y',NULL,PA_FP_CONSTANTS_PKG.G_RESOURCE_PLANNING_LEVEL_R)
1144: INTO l_res_planning_level
1187: -- References to PA_FP_ELEMENTS table have been commented as records are no longer inserted in it
1188: --Comment START.
1189:
1190: /*
1191: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Bulk Inserting records into PA_FP_Elements';
1192: IF P_PA_DEBUG_MODE = 'Y' THEN
1193: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1194: END IF;
1195: IF l_planning_level IN (PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_LOWEST,PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_M)
1188: --Comment START.
1189:
1190: /*
1191: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Bulk Inserting records into PA_FP_Elements';
1192: IF P_PA_DEBUG_MODE = 'Y' THEN
1193: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1194: END IF;
1195: IF l_planning_level IN (PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_LOWEST,PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_M)
1196: THEN --Planning Level is Top and Lowest Task (OR) Lowest Task
1189:
1190: /*
1191: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Bulk Inserting records into PA_FP_Elements';
1192: IF P_PA_DEBUG_MODE = 'Y' THEN
1193: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1194: END IF;
1195: IF l_planning_level IN (PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_LOWEST,PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_M)
1196: THEN --Planning Level is Top and Lowest Task (OR) Lowest Task
1197: l_stage := 500;
1194: END IF;
1195: IF l_planning_level IN (PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_LOWEST,PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_M)
1196: THEN --Planning Level is Top and Lowest Task (OR) Lowest Task
1197: l_stage := 500;
1198: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Fetching records for Top and Lowest Tasks.';
1199: IF P_PA_DEBUG_MODE = 'Y' THEN
1200: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1201: END IF;
1202:
1195: IF l_planning_level IN (PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_LOWEST,PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_M)
1196: THEN --Planning Level is Top and Lowest Task (OR) Lowest Task
1197: l_stage := 500;
1198: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Fetching records for Top and Lowest Tasks.';
1199: IF P_PA_DEBUG_MODE = 'Y' THEN
1200: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1201: END IF;
1202:
1203: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': opening top and lowest task cur';
1196: THEN --Planning Level is Top and Lowest Task (OR) Lowest Task
1197: l_stage := 500;
1198: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Fetching records for Top and Lowest Tasks.';
1199: IF P_PA_DEBUG_MODE = 'Y' THEN
1200: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1201: END IF;
1202:
1203: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': opening top and lowest task cur';
1204: IF P_PA_DEBUG_MODE = 'Y' THEN
1199: IF P_PA_DEBUG_MODE = 'Y' THEN
1200: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1201: END IF;
1202:
1203: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': opening top and lowest task cur';
1204: IF P_PA_DEBUG_MODE = 'Y' THEN
1205: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1206: END IF;
1207:
1200: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1201: END IF;
1202:
1203: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': opening top and lowest task cur';
1204: IF P_PA_DEBUG_MODE = 'Y' THEN
1205: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1206: END IF;
1207:
1208: OPEN top_low_tasks_cur(l_project_id);
1201: END IF;
1202:
1203: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': opening top and lowest task cur';
1204: IF P_PA_DEBUG_MODE = 'Y' THEN
1205: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1206: END IF;
1207:
1208: OPEN top_low_tasks_cur(l_project_id);
1209: LOOP
1213: ,l_top_plan_level_tbl
1214: ,l_plannable_flag_tbl
1215: LIMIT l_plsql_max_array_size;
1216:
1217: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': fetched ' || sql%rowcount || ' records';
1218: IF P_PA_DEBUG_MODE = 'Y' THEN
1219: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1220: END IF;
1221:
1214: ,l_plannable_flag_tbl
1215: LIMIT l_plsql_max_array_size;
1216:
1217: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': fetched ' || sql%rowcount || ' records';
1218: IF P_PA_DEBUG_MODE = 'Y' THEN
1219: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1220: END IF;
1221:
1222: IF nvl(l_task_id_tbl.last,0) >= 1 THEN -- only if something is fetched
1215: LIMIT l_plsql_max_array_size;
1216:
1217: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': fetched ' || sql%rowcount || ' records';
1218: IF P_PA_DEBUG_MODE = 'Y' THEN
1219: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1220: END IF;
1221:
1222: IF nvl(l_task_id_tbl.last,0) >= 1 THEN -- only if something is fetched
1223:
1220: END IF;
1221:
1222: IF nvl(l_task_id_tbl.last,0) >= 1 THEN -- only if something is fetched
1223:
1224: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Inserting records for Top and Lowest Tasks.';
1225: IF P_PA_DEBUG_MODE = 'Y' THEN
1226: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1227: END IF;
1228:
1221:
1222: IF nvl(l_task_id_tbl.last,0) >= 1 THEN -- only if something is fetched
1223:
1224: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Inserting records for Top and Lowest Tasks.';
1225: IF P_PA_DEBUG_MODE = 'Y' THEN
1226: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1227: END IF;
1228:
1229: FORALL i in l_task_id_tbl.first..l_task_id_tbl.last
1222: IF nvl(l_task_id_tbl.last,0) >= 1 THEN -- only if something is fetched
1223:
1224: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Inserting records for Top and Lowest Tasks.';
1225: IF P_PA_DEBUG_MODE = 'Y' THEN
1226: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1227: END IF;
1228:
1229: FORALL i in l_task_id_tbl.first..l_task_id_tbl.last
1230: -- Bulk Insert records into PA_FP_ELEMENTS table for the details fetched
1275: ,sysdate
1276: ,fnd_global.user_id
1277: ,fnd_global.login_id);
1278:
1279: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': inserted ' || sql%rowcount || ' records';
1280: IF P_PA_DEBUG_MODE = 'Y' THEN
1281: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1282: END IF;
1283:
1276: ,fnd_global.user_id
1277: ,fnd_global.login_id);
1278:
1279: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': inserted ' || sql%rowcount || ' records';
1280: IF P_PA_DEBUG_MODE = 'Y' THEN
1281: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1282: END IF;
1283:
1284:
1277: ,fnd_global.login_id);
1278:
1279: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': inserted ' || sql%rowcount || ' records';
1280: IF P_PA_DEBUG_MODE = 'Y' THEN
1281: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1282: END IF;
1283:
1284:
1285: END IF;
1290: CLOSE top_low_tasks_cur;
1291:
1292: ELSIF l_planning_level = PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_TOP THEN -- Planning Level is Top Task
1293: l_stage := 600;
1294: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Fetching records for Top Tasks only.';
1295: IF P_PA_DEBUG_MODE = 'Y' THEN
1296: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1297: END IF;
1298:
1291:
1292: ELSIF l_planning_level = PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_TOP THEN -- Planning Level is Top Task
1293: l_stage := 600;
1294: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Fetching records for Top Tasks only.';
1295: IF P_PA_DEBUG_MODE = 'Y' THEN
1296: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1297: END IF;
1298:
1299: OPEN top_tasks_cur(l_project_id);
1292: ELSIF l_planning_level = PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_TOP THEN -- Planning Level is Top Task
1293: l_stage := 600;
1294: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Fetching records for Top Tasks only.';
1295: IF P_PA_DEBUG_MODE = 'Y' THEN
1296: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1297: END IF;
1298:
1299: OPEN top_tasks_cur(l_project_id);
1300: LOOP
1305: ,l_plannable_flag_tbl
1306: LIMIT l_plsql_max_array_size;
1307:
1308: IF nvl(l_task_id_tbl.last,0) >= 1 THEN -- only if something is fetched
1309: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Inserting records for Top Tasks only.';
1310: IF P_PA_DEBUG_MODE = 'Y' THEN
1311: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1312: END IF;
1313:
1306: LIMIT l_plsql_max_array_size;
1307:
1308: IF nvl(l_task_id_tbl.last,0) >= 1 THEN -- only if something is fetched
1309: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Inserting records for Top Tasks only.';
1310: IF P_PA_DEBUG_MODE = 'Y' THEN
1311: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1312: END IF;
1313:
1314: FORALL i in l_task_id_tbl.first..l_task_id_tbl.last
1307:
1308: IF nvl(l_task_id_tbl.last,0) >= 1 THEN -- only if something is fetched
1309: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Inserting records for Top Tasks only.';
1310: IF P_PA_DEBUG_MODE = 'Y' THEN
1311: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,3);
1312: END IF;
1313:
1314: FORALL i in l_task_id_tbl.first..l_task_id_tbl.last
1315: -- Bulk Insert records into PA_FP_ELEMENTS table for the details fetched
1373: l_stage := 700;
1374:
1375: -- No records will be inserted into pa_fp_elements if the Planning Level is 'Project'
1376:
1377: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Nothing to be done for Planning Level at PROJECT';
1378: IF P_PA_DEBUG_MODE = 'Y' THEN
1379: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1380: END IF;
1381: NULL;
1374:
1375: -- No records will be inserted into pa_fp_elements if the Planning Level is 'Project'
1376:
1377: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Nothing to be done for Planning Level at PROJECT';
1378: IF P_PA_DEBUG_MODE = 'Y' THEN
1379: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1380: END IF;
1381: NULL;
1382:
1375: -- No records will be inserted into pa_fp_elements if the Planning Level is 'Project'
1376:
1377: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Nothing to be done for Planning Level at PROJECT';
1378: IF P_PA_DEBUG_MODE = 'Y' THEN
1379: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1380: END IF;
1381: NULL;
1382:
1383: END IF; -- End of check for l_planning_level
1393:
1394: IF l_select_res_auto_flag = 'Y'
1395: THEN
1396:
1397: IF P_PA_DEBUG_MODE = 'Y' THEN
1398: pa_debug.g_err_stage := TO_CHAR(l_stage)||'Calling add_resources_automatically';
1399: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1400: END IF;
1401:
1394: IF l_select_res_auto_flag = 'Y'
1395: THEN
1396:
1397: IF P_PA_DEBUG_MODE = 'Y' THEN
1398: pa_debug.g_err_stage := TO_CHAR(l_stage)||'Calling add_resources_automatically';
1399: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1400: END IF;
1401:
1402: PA_FP_ELEMENTS_PUB.Add_resources_automatically
1395: THEN
1396:
1397: IF P_PA_DEBUG_MODE = 'Y' THEN
1398: pa_debug.g_err_stage := TO_CHAR(l_stage)||'Calling add_resources_automatically';
1399: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1400: END IF;
1401:
1402: PA_FP_ELEMENTS_PUB.Add_resources_automatically
1403: ( p_proj_fp_options_id => p_proj_fp_options_id
1412: ,x_msg_data => x_msg_data
1413: );
1414: END IF;
1415:
1416: pa_debug.g_err_stage := TO_CHAR(l_stage)||': End of Insert_Default';
1417: IF P_PA_DEBUG_MODE = 'Y' THEN
1418: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1419: END IF;
1420: pa_debug.reset_err_stack;
1413: );
1414: END IF;
1415:
1416: pa_debug.g_err_stage := TO_CHAR(l_stage)||': End of Insert_Default';
1417: IF P_PA_DEBUG_MODE = 'Y' THEN
1418: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1419: END IF;
1420: pa_debug.reset_err_stack;
1421:
1414: END IF;
1415:
1416: pa_debug.g_err_stage := TO_CHAR(l_stage)||': End of Insert_Default';
1417: IF P_PA_DEBUG_MODE = 'Y' THEN
1418: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1419: END IF;
1420: pa_debug.reset_err_stack;
1421:
1422: EXCEPTION
1416: pa_debug.g_err_stage := TO_CHAR(l_stage)||': End of Insert_Default';
1417: IF P_PA_DEBUG_MODE = 'Y' THEN
1418: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.g_err_stage,1);
1419: END IF;
1420: pa_debug.reset_err_stack;
1421:
1422: EXCEPTION
1423: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
1424: l_msg_count := FND_MSG_PUB.count_msg;
1434: x_msg_count := l_msg_count;
1435: ELSE
1436: x_msg_count := l_msg_count;
1437: END IF;
1438: pa_debug.reset_err_stack;
1439: RAISE;
1440: WHEN OTHERS THEN
1441: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1442: x_msg_count := 1;
1442: x_msg_count := 1;
1443: x_msg_data := SQLERRM;
1444: FND_MSG_PUB.add_exc_msg
1445: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Insert_Default'
1446: ,p_procedure_name => pa_debug.G_Err_Stack );
1447: IF P_PA_DEBUG_MODE = 'Y' THEN
1448: pa_debug.write('Insert_Default: ' || l_module_name,SQLERRM,4);
1449: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.G_Err_Stack,4);
1450: END IF;
1443: x_msg_data := SQLERRM;
1444: FND_MSG_PUB.add_exc_msg
1445: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Insert_Default'
1446: ,p_procedure_name => pa_debug.G_Err_Stack );
1447: IF P_PA_DEBUG_MODE = 'Y' THEN
1448: pa_debug.write('Insert_Default: ' || l_module_name,SQLERRM,4);
1449: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.G_Err_Stack,4);
1450: END IF;
1451: pa_debug.reset_err_stack;
1444: FND_MSG_PUB.add_exc_msg
1445: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Insert_Default'
1446: ,p_procedure_name => pa_debug.G_Err_Stack );
1447: IF P_PA_DEBUG_MODE = 'Y' THEN
1448: pa_debug.write('Insert_Default: ' || l_module_name,SQLERRM,4);
1449: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.G_Err_Stack,4);
1450: END IF;
1451: pa_debug.reset_err_stack;
1452:
1445: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Insert_Default'
1446: ,p_procedure_name => pa_debug.G_Err_Stack );
1447: IF P_PA_DEBUG_MODE = 'Y' THEN
1448: pa_debug.write('Insert_Default: ' || l_module_name,SQLERRM,4);
1449: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.G_Err_Stack,4);
1450: END IF;
1451: pa_debug.reset_err_stack;
1452:
1453: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1447: IF P_PA_DEBUG_MODE = 'Y' THEN
1448: pa_debug.write('Insert_Default: ' || l_module_name,SQLERRM,4);
1449: pa_debug.write('Insert_Default: ' || l_module_name,pa_debug.G_Err_Stack,4);
1450: END IF;
1451: pa_debug.reset_err_stack;
1452:
1453: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1454: END Insert_Default;
1455:
1479: l_debug_mode VARCHAR2(30);
1480:
1481: BEGIN
1482:
1483: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Delete_Elements');
1484: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1485: l_debug_mode := NVL(l_debug_mode, 'Y');
1486: IF P_PA_DEBUG_MODE = 'Y' THEN
1487: pa_debug.set_process('Delete_Elements: ' || 'PLSQL','LOG',l_debug_mode);
1480:
1481: BEGIN
1482:
1483: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Delete_Elements');
1484: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1485: l_debug_mode := NVL(l_debug_mode, 'Y');
1486: IF P_PA_DEBUG_MODE = 'Y' THEN
1487: pa_debug.set_process('Delete_Elements: ' || 'PLSQL','LOG',l_debug_mode);
1488: END IF;
1482:
1483: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Delete_Elements');
1484: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1485: l_debug_mode := NVL(l_debug_mode, 'Y');
1486: IF P_PA_DEBUG_MODE = 'Y' THEN
1487: pa_debug.set_process('Delete_Elements: ' || 'PLSQL','LOG',l_debug_mode);
1488: END IF;
1489:
1490: x_return_status := FND_API.G_RET_STS_SUCCESS;
1483: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Delete_Elements');
1484: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1485: l_debug_mode := NVL(l_debug_mode, 'Y');
1486: IF P_PA_DEBUG_MODE = 'Y' THEN
1487: pa_debug.set_process('Delete_Elements: ' || 'PLSQL','LOG',l_debug_mode);
1488: END IF;
1489:
1490: x_return_status := FND_API.G_RET_STS_SUCCESS;
1491:
1492: /* Delete the records from the table PA_FP_Elements based on the Element_Type and
1493: the Element_Level. If the Element_Type is 'BOTH' then both the COST and
1494: REVENUE Planning Elements have to be deleted. */
1495:
1496: pa_debug.g_err_stage := 'Deleting Elements from PA_FP_Elements';
1497: IF P_PA_DEBUG_MODE = 'Y' THEN
1498: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
1499: END IF;
1500:
1493: the Element_Level. If the Element_Type is 'BOTH' then both the COST and
1494: REVENUE Planning Elements have to be deleted. */
1495:
1496: pa_debug.g_err_stage := 'Deleting Elements from PA_FP_Elements';
1497: IF P_PA_DEBUG_MODE = 'Y' THEN
1498: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
1499: END IF;
1500:
1501: IF (p_element_level = PA_FP_CONSTANTS_PKG.G_ELEMENT_LEVEL_TASK) THEN
1494: REVENUE Planning Elements have to be deleted. */
1495:
1496: pa_debug.g_err_stage := 'Deleting Elements from PA_FP_Elements';
1497: IF P_PA_DEBUG_MODE = 'Y' THEN
1498: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
1499: END IF;
1500:
1501: IF (p_element_level = PA_FP_CONSTANTS_PKG.G_ELEMENT_LEVEL_TASK) THEN
1502:
1501: IF (p_element_level = PA_FP_CONSTANTS_PKG.G_ELEMENT_LEVEL_TASK) THEN
1502:
1503: /* If Element Level is 'TASK', then delete FP Elements with Level as 'TASK' */
1504:
1505: pa_debug.g_err_stage := 'Deleting Elements for the Element Level as TASK';
1506: IF P_PA_DEBUG_MODE = 'Y' THEN
1507: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
1508: END IF;
1509:
1502:
1503: /* If Element Level is 'TASK', then delete FP Elements with Level as 'TASK' */
1504:
1505: pa_debug.g_err_stage := 'Deleting Elements for the Element Level as TASK';
1506: IF P_PA_DEBUG_MODE = 'Y' THEN
1507: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
1508: END IF;
1509:
1510: DELETE FROM pa_fp_elements
1503: /* If Element Level is 'TASK', then delete FP Elements with Level as 'TASK' */
1504:
1505: pa_debug.g_err_stage := 'Deleting Elements for the Element Level as TASK';
1506: IF P_PA_DEBUG_MODE = 'Y' THEN
1507: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
1508: END IF;
1509:
1510: DELETE FROM pa_fp_elements
1511: WHERE proj_fp_options_id = p_proj_fp_options_id
1523:
1524: /* If Element Level is 'RESOURCE', then delete FP Elements with Level as
1525: 'RESOURCE' and where the resource_list_memeber_id is not 0 */
1526:
1527: pa_debug.g_err_stage := 'Deleting Elements for the Element Level as RESOURCE';
1528: IF P_PA_DEBUG_MODE = 'Y' THEN
1529: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
1530: END IF;
1531:
1524: /* If Element Level is 'RESOURCE', then delete FP Elements with Level as
1525: 'RESOURCE' and where the resource_list_memeber_id is not 0 */
1526:
1527: pa_debug.g_err_stage := 'Deleting Elements for the Element Level as RESOURCE';
1528: IF P_PA_DEBUG_MODE = 'Y' THEN
1529: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
1530: END IF;
1531:
1532: DELETE FROM pa_fp_elements
1525: 'RESOURCE' and where the resource_list_memeber_id is not 0 */
1526:
1527: pa_debug.g_err_stage := 'Deleting Elements for the Element Level as RESOURCE';
1528: IF P_PA_DEBUG_MODE = 'Y' THEN
1529: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
1530: END IF;
1531:
1532: DELETE FROM pa_fp_elements
1533: WHERE proj_fp_options_id = p_proj_fp_options_id
1535: AND p_element_level = PA_FP_CONSTANTS_PKG.G_ELEMENT_LEVEL_RESOURCE
1536: AND resource_list_member_id <> 0;
1537: END IF;
1538:
1539: pa_debug.g_err_stage := 'End of Delete_Elements';
1540: IF P_PA_DEBUG_MODE = 'Y' THEN
1541: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
1542: END IF;
1543: pa_debug.reset_err_stack;
1536: AND resource_list_member_id <> 0;
1537: END IF;
1538:
1539: pa_debug.g_err_stage := 'End of Delete_Elements';
1540: IF P_PA_DEBUG_MODE = 'Y' THEN
1541: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
1542: END IF;
1543: pa_debug.reset_err_stack;
1544:
1537: END IF;
1538:
1539: pa_debug.g_err_stage := 'End of Delete_Elements';
1540: IF P_PA_DEBUG_MODE = 'Y' THEN
1541: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
1542: END IF;
1543: pa_debug.reset_err_stack;
1544:
1545: EXCEPTION
1539: pa_debug.g_err_stage := 'End of Delete_Elements';
1540: IF P_PA_DEBUG_MODE = 'Y' THEN
1541: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.g_err_stage,1);
1542: END IF;
1543: pa_debug.reset_err_stack;
1544:
1545: EXCEPTION
1546: WHEN OTHERS THEN
1547: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1548: x_msg_count := 1;
1549: x_msg_data := SQLERRM;
1550: FND_MSG_PUB.add_exc_msg
1551: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Delete_Elements'
1552: ,p_procedure_name => pa_debug.G_Err_Stack );
1553: IF P_PA_DEBUG_MODE = 'Y' THEN
1554: pa_debug.write('Delete_Elements: ' || l_module_name,SQLERRM,4);
1555: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.G_Err_Stack,4);
1556: END IF;
1549: x_msg_data := SQLERRM;
1550: FND_MSG_PUB.add_exc_msg
1551: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Delete_Elements'
1552: ,p_procedure_name => pa_debug.G_Err_Stack );
1553: IF P_PA_DEBUG_MODE = 'Y' THEN
1554: pa_debug.write('Delete_Elements: ' || l_module_name,SQLERRM,4);
1555: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.G_Err_Stack,4);
1556: END IF;
1557: pa_debug.reset_err_stack;
1550: FND_MSG_PUB.add_exc_msg
1551: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Delete_Elements'
1552: ,p_procedure_name => pa_debug.G_Err_Stack );
1553: IF P_PA_DEBUG_MODE = 'Y' THEN
1554: pa_debug.write('Delete_Elements: ' || l_module_name,SQLERRM,4);
1555: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.G_Err_Stack,4);
1556: END IF;
1557: pa_debug.reset_err_stack;
1558:
1551: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Delete_Elements'
1552: ,p_procedure_name => pa_debug.G_Err_Stack );
1553: IF P_PA_DEBUG_MODE = 'Y' THEN
1554: pa_debug.write('Delete_Elements: ' || l_module_name,SQLERRM,4);
1555: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.G_Err_Stack,4);
1556: END IF;
1557: pa_debug.reset_err_stack;
1558:
1559: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1553: IF P_PA_DEBUG_MODE = 'Y' THEN
1554: pa_debug.write('Delete_Elements: ' || l_module_name,SQLERRM,4);
1555: pa_debug.write('Delete_Elements: ' || l_module_name,pa_debug.G_Err_Stack,4);
1556: END IF;
1557: pa_debug.reset_err_stack;
1558:
1559: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1560: END Delete_Elements;
1561:
1598: l_row_update_count NUMBER;
1599:
1600: BEGIN
1601:
1602: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Delete_Element');
1603: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1604: l_debug_mode := NVL(l_debug_mode, 'Y');
1605: IF P_PA_DEBUG_MODE = 'Y' THEN
1606: pa_debug.set_process('Delete_Element: ' || 'PLSQL','LOG',l_debug_mode);
1599:
1600: BEGIN
1601:
1602: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Delete_Element');
1603: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1604: l_debug_mode := NVL(l_debug_mode, 'Y');
1605: IF P_PA_DEBUG_MODE = 'Y' THEN
1606: pa_debug.set_process('Delete_Element: ' || 'PLSQL','LOG',l_debug_mode);
1607: END IF;
1601:
1602: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Delete_Element');
1603: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1604: l_debug_mode := NVL(l_debug_mode, 'Y');
1605: IF P_PA_DEBUG_MODE = 'Y' THEN
1606: pa_debug.set_process('Delete_Element: ' || 'PLSQL','LOG',l_debug_mode);
1607: END IF;
1608:
1609: x_return_status := FND_API.G_RET_STS_SUCCESS;
1602: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Delete_Element');
1603: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1604: l_debug_mode := NVL(l_debug_mode, 'Y');
1605: IF P_PA_DEBUG_MODE = 'Y' THEN
1606: pa_debug.set_process('Delete_Element: ' || 'PLSQL','LOG',l_debug_mode);
1607: END IF;
1608:
1609: x_return_status := FND_API.G_RET_STS_SUCCESS;
1610:
1607: END IF;
1608:
1609: x_return_status := FND_API.G_RET_STS_SUCCESS;
1610:
1611: pa_debug.g_err_stage := 'calling pa_get_resource.get_uncateg_resource_info';
1612: IF P_PA_DEBUG_MODE = 'Y' THEN
1613: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1614: END IF;
1615:
1608:
1609: x_return_status := FND_API.G_RET_STS_SUCCESS;
1610:
1611: pa_debug.g_err_stage := 'calling pa_get_resource.get_uncateg_resource_info';
1612: IF P_PA_DEBUG_MODE = 'Y' THEN
1613: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1614: END IF;
1615:
1616: pa_get_resource.get_uncateg_resource_info(p_resource_list_id => l_uncat_res_list_id
1609: x_return_status := FND_API.G_RET_STS_SUCCESS;
1610:
1611: pa_debug.g_err_stage := 'calling pa_get_resource.get_uncateg_resource_info';
1612: IF P_PA_DEBUG_MODE = 'Y' THEN
1613: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1614: END IF;
1615:
1616: pa_get_resource.get_uncateg_resource_info(p_resource_list_id => l_uncat_res_list_id
1617: ,p_resource_list_member_id => l_uncat_res_list_mem_id
1633:
1634: /* If its an uncategorized resource then task level record needs to be deleted.
1635: task level records in pa_fp_elements always have resource list member id as zero. */
1636:
1637: pa_debug.g_err_stage := 'Deleting Elements for the task';
1638: IF P_PA_DEBUG_MODE = 'Y' THEN
1639: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1640: END IF;
1641:
1634: /* If its an uncategorized resource then task level record needs to be deleted.
1635: task level records in pa_fp_elements always have resource list member id as zero. */
1636:
1637: pa_debug.g_err_stage := 'Deleting Elements for the task';
1638: IF P_PA_DEBUG_MODE = 'Y' THEN
1639: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1640: END IF;
1641:
1642: DELETE FROM pa_fp_elements
1635: task level records in pa_fp_elements always have resource list member id as zero. */
1636:
1637: pa_debug.g_err_stage := 'Deleting Elements for the task';
1638: IF P_PA_DEBUG_MODE = 'Y' THEN
1639: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1640: END IF;
1641:
1642: DELETE FROM pa_fp_elements
1643: WHERE proj_fp_options_id = l_proj_fp_options_id
1668: and proj_fp_options_id = l_proj_fp_options_id
1669: and nvl(plan_amount_exists_flag,'N') = 'Y'
1670: );
1671:
1672: IF P_PA_DEBUG_MODE = 'Y' THEN
1673: pa_debug.g_err_stage := 'Number of rows updated for plan amount exists flag : '||sql%rowcount;
1674: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,3);
1675: END IF;
1676: END IF;
1669: and nvl(plan_amount_exists_flag,'N') = 'Y'
1670: );
1671:
1672: IF P_PA_DEBUG_MODE = 'Y' THEN
1673: pa_debug.g_err_stage := 'Number of rows updated for plan amount exists flag : '||sql%rowcount;
1674: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,3);
1675: END IF;
1676: END IF;
1677:
1670: );
1671:
1672: IF P_PA_DEBUG_MODE = 'Y' THEN
1673: pa_debug.g_err_stage := 'Number of rows updated for plan amount exists flag : '||sql%rowcount;
1674: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,3);
1675: END IF;
1676: END IF;
1677:
1678: ELSE
1679:
1680: /* If its a normal resource from a resource list then we need to delete the resource
1681: level element from fp elements. */
1682:
1683: pa_debug.g_err_stage := 'Deleting Elements for the RESOURCE';
1684: IF P_PA_DEBUG_MODE = 'Y' THEN
1685: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1686: END IF;
1687:
1680: /* If its a normal resource from a resource list then we need to delete the resource
1681: level element from fp elements. */
1682:
1683: pa_debug.g_err_stage := 'Deleting Elements for the RESOURCE';
1684: IF P_PA_DEBUG_MODE = 'Y' THEN
1685: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1686: END IF;
1687:
1688: DELETE FROM pa_fp_elements
1681: level element from fp elements. */
1682:
1683: pa_debug.g_err_stage := 'Deleting Elements for the RESOURCE';
1684: IF P_PA_DEBUG_MODE = 'Y' THEN
1685: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1686: END IF;
1687:
1688: DELETE FROM pa_fp_elements
1689: WHERE proj_fp_options_id = l_proj_fp_options_id -- included for Bug 3062798
1716: and nvl(plan_amount_exists_flag,'N') = 'Y'
1717: );
1718:
1719: l_row_update_count := sql%rowcount;
1720: IF P_PA_DEBUG_MODE = 'Y' THEN
1721: pa_debug.g_err_stage := 'Number of rows updated for plan amount exists flag : '|| l_row_update_count;
1722: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,3);
1723: END IF;
1724:
1717: );
1718:
1719: l_row_update_count := sql%rowcount;
1720: IF P_PA_DEBUG_MODE = 'Y' THEN
1721: pa_debug.g_err_stage := 'Number of rows updated for plan amount exists flag : '|| l_row_update_count;
1722: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,3);
1723: END IF;
1724:
1725:
1718:
1719: l_row_update_count := sql%rowcount;
1720: IF P_PA_DEBUG_MODE = 'Y' THEN
1721: pa_debug.g_err_stage := 'Number of rows updated for plan amount exists flag : '|| l_row_update_count;
1722: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,3);
1723: END IF;
1724:
1725:
1726: IF p_task_id <> l_top_task_id and l_row_update_count > 0 then
1743: and resource_list_member_id <> 0
1744: and nvl(plan_amount_exists_flag,'N') = 'Y'
1745: );
1746:
1747: IF P_PA_DEBUG_MODE = 'Y' THEN
1748: pa_debug.g_err_stage := 'Number of rows updated for plan amount exists flag : '||sql%rowcount;
1749: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,3);
1750: END IF;
1751:
1744: and nvl(plan_amount_exists_flag,'N') = 'Y'
1745: );
1746:
1747: IF P_PA_DEBUG_MODE = 'Y' THEN
1748: pa_debug.g_err_stage := 'Number of rows updated for plan amount exists flag : '||sql%rowcount;
1749: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,3);
1750: END IF;
1751:
1752: END IF;
1745: );
1746:
1747: IF P_PA_DEBUG_MODE = 'Y' THEN
1748: pa_debug.g_err_stage := 'Number of rows updated for plan amount exists flag : '||sql%rowcount;
1749: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,3);
1750: END IF;
1751:
1752: END IF;
1753:
1755: /* now need to set the resources_planned_for_task flag. In case the task has no more resources
1756: defined under it then set this to 'N'
1757: */
1758:
1759: pa_debug.g_err_stage := 'Checking for more resources under the task';
1760: IF P_PA_DEBUG_MODE = 'Y' THEN
1761: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1762: END IF;
1763:
1756: defined under it then set this to 'N'
1757: */
1758:
1759: pa_debug.g_err_stage := 'Checking for more resources under the task';
1760: IF P_PA_DEBUG_MODE = 'Y' THEN
1761: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1762: END IF;
1763:
1764: l_resource_exists_flag := 'N';
1757: */
1758:
1759: pa_debug.g_err_stage := 'Checking for more resources under the task';
1760: IF P_PA_DEBUG_MODE = 'Y' THEN
1761: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1762: END IF;
1763:
1764: l_resource_exists_flag := 'N';
1765: BEGIN
1777: END;
1778:
1779: IF l_resource_exists_flag = 'N' THEN
1780:
1781: pa_debug.g_err_stage := 'setting resource planning level to N';
1782: IF P_PA_DEBUG_MODE = 'Y' THEN
1783: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1784: END IF;
1785:
1778:
1779: IF l_resource_exists_flag = 'N' THEN
1780:
1781: pa_debug.g_err_stage := 'setting resource planning level to N';
1782: IF P_PA_DEBUG_MODE = 'Y' THEN
1783: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1784: END IF;
1785:
1786: UPDATE pa_fp_elements
1779: IF l_resource_exists_flag = 'N' THEN
1780:
1781: pa_debug.g_err_stage := 'setting resource planning level to N';
1782: IF P_PA_DEBUG_MODE = 'Y' THEN
1783: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1784: END IF;
1785:
1786: UPDATE pa_fp_elements
1787: SET resources_planned_for_task = 'N',
1795: END IF;
1796:
1797: END IF;
1798:
1799: pa_debug.g_err_stage := 'End of Delete_Elements';
1800: IF P_PA_DEBUG_MODE = 'Y' THEN
1801: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1802: END IF;
1803: pa_debug.reset_err_stack;
1796:
1797: END IF;
1798:
1799: pa_debug.g_err_stage := 'End of Delete_Elements';
1800: IF P_PA_DEBUG_MODE = 'Y' THEN
1801: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1802: END IF;
1803: pa_debug.reset_err_stack;
1804:
1797: END IF;
1798:
1799: pa_debug.g_err_stage := 'End of Delete_Elements';
1800: IF P_PA_DEBUG_MODE = 'Y' THEN
1801: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1802: END IF;
1803: pa_debug.reset_err_stack;
1804:
1805: EXCEPTION
1799: pa_debug.g_err_stage := 'End of Delete_Elements';
1800: IF P_PA_DEBUG_MODE = 'Y' THEN
1801: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.g_err_stage,1);
1802: END IF;
1803: pa_debug.reset_err_stack;
1804:
1805: EXCEPTION
1806: WHEN OTHERS THEN
1807: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1808: x_msg_count := 1;
1809: x_msg_data := SQLERRM;
1810: FND_MSG_PUB.add_exc_msg
1811: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Delete_Element'
1812: ,p_procedure_name => pa_debug.G_Err_Stack );
1813: IF P_PA_DEBUG_MODE = 'Y' THEN
1814: pa_debug.write('Delete_Element: ' || l_module_name,SQLERRM,4);
1815: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.G_Err_Stack,4);
1816: END IF;
1809: x_msg_data := SQLERRM;
1810: FND_MSG_PUB.add_exc_msg
1811: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Delete_Element'
1812: ,p_procedure_name => pa_debug.G_Err_Stack );
1813: IF P_PA_DEBUG_MODE = 'Y' THEN
1814: pa_debug.write('Delete_Element: ' || l_module_name,SQLERRM,4);
1815: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.G_Err_Stack,4);
1816: END IF;
1817: pa_debug.reset_err_stack;
1810: FND_MSG_PUB.add_exc_msg
1811: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Delete_Element'
1812: ,p_procedure_name => pa_debug.G_Err_Stack );
1813: IF P_PA_DEBUG_MODE = 'Y' THEN
1814: pa_debug.write('Delete_Element: ' || l_module_name,SQLERRM,4);
1815: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.G_Err_Stack,4);
1816: END IF;
1817: pa_debug.reset_err_stack;
1818:
1811: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Delete_Element'
1812: ,p_procedure_name => pa_debug.G_Err_Stack );
1813: IF P_PA_DEBUG_MODE = 'Y' THEN
1814: pa_debug.write('Delete_Element: ' || l_module_name,SQLERRM,4);
1815: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.G_Err_Stack,4);
1816: END IF;
1817: pa_debug.reset_err_stack;
1818:
1819: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1813: IF P_PA_DEBUG_MODE = 'Y' THEN
1814: pa_debug.write('Delete_Element: ' || l_module_name,SQLERRM,4);
1815: pa_debug.write('Delete_Element: ' || l_module_name,pa_debug.G_Err_Stack,4);
1816: END IF;
1817: pa_debug.reset_err_stack;
1818:
1819: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1820:
1821: END Delete_Element;
1850:
1851: BEGIN
1852:
1853: -- Set the error stack.
1854: pa_debug.set_err_stack('PA_FP_ELELEMNTS_PUB.Insert_Bulk_Rows');
1855:
1856: -- Get the Debug mode into local variable and set it to 'Y' if its NULL
1857: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1858: l_debug_mode := NVL(l_debug_mode, 'Y');
1853: -- Set the error stack.
1854: pa_debug.set_err_stack('PA_FP_ELELEMNTS_PUB.Insert_Bulk_Rows');
1855:
1856: -- Get the Debug mode into local variable and set it to 'Y' if its NULL
1857: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1858: l_debug_mode := NVL(l_debug_mode, 'Y');
1859:
1860: -- Initialize the return status to success
1861: x_return_status := FND_API.G_RET_STS_SUCCESS;
1859:
1860: -- Initialize the return status to success
1861: x_return_status := FND_API.G_RET_STS_SUCCESS;
1862:
1863: IF P_PA_DEBUG_MODE = 'Y' THEN
1864: pa_debug.set_process('Insert_Bulk_Rows: ' || 'PLSQL','LOG',l_debug_mode);
1865: END IF;
1866:
1867: pa_debug.g_err_stage := TO_CHAR(l_stage)||':In PA_FP_ELELEMNTS_PUB.Insert_Bulk_Rows ';
1860: -- Initialize the return status to success
1861: x_return_status := FND_API.G_RET_STS_SUCCESS;
1862:
1863: IF P_PA_DEBUG_MODE = 'Y' THEN
1864: pa_debug.set_process('Insert_Bulk_Rows: ' || 'PLSQL','LOG',l_debug_mode);
1865: END IF;
1866:
1867: pa_debug.g_err_stage := TO_CHAR(l_stage)||':In PA_FP_ELELEMNTS_PUB.Insert_Bulk_Rows ';
1868: IF P_PA_DEBUG_MODE = 'Y' THEN
1863: IF P_PA_DEBUG_MODE = 'Y' THEN
1864: pa_debug.set_process('Insert_Bulk_Rows: ' || 'PLSQL','LOG',l_debug_mode);
1865: END IF;
1866:
1867: pa_debug.g_err_stage := TO_CHAR(l_stage)||':In PA_FP_ELELEMNTS_PUB.Insert_Bulk_Rows ';
1868: IF P_PA_DEBUG_MODE = 'Y' THEN
1869: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
1870: END IF;
1871:
1864: pa_debug.set_process('Insert_Bulk_Rows: ' || 'PLSQL','LOG',l_debug_mode);
1865: END IF;
1866:
1867: pa_debug.g_err_stage := TO_CHAR(l_stage)||':In PA_FP_ELELEMNTS_PUB.Insert_Bulk_Rows ';
1868: IF P_PA_DEBUG_MODE = 'Y' THEN
1869: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
1870: END IF;
1871:
1872: /*
1865: END IF;
1866:
1867: pa_debug.g_err_stage := TO_CHAR(l_stage)||':In PA_FP_ELELEMNTS_PUB.Insert_Bulk_Rows ';
1868: IF P_PA_DEBUG_MODE = 'Y' THEN
1869: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
1870: END IF;
1871:
1872: /*
1873: * Bulk Insert records into PA_FP_ELEMENTS table for the records fetched
1872: /*
1873: * Bulk Insert records into PA_FP_ELEMENTS table for the records fetched
1874: * from cursor top_task_cur.
1875: */
1876: pa_debug.g_err_stage := TO_CHAR(l_stage)||': In Insert_Bulk_Rows';
1877: IF P_PA_DEBUG_MODE = 'Y' THEN
1878: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
1879: END IF;
1880:
1873: * Bulk Insert records into PA_FP_ELEMENTS table for the records fetched
1874: * from cursor top_task_cur.
1875: */
1876: pa_debug.g_err_stage := TO_CHAR(l_stage)||': In Insert_Bulk_Rows';
1877: IF P_PA_DEBUG_MODE = 'Y' THEN
1878: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
1879: END IF;
1880:
1881: pa_debug.g_err_stage := TO_CHAR(l_stage)||': Bulk inserting into PA_FP_ELEMENTS';
1874: * from cursor top_task_cur.
1875: */
1876: pa_debug.g_err_stage := TO_CHAR(l_stage)||': In Insert_Bulk_Rows';
1877: IF P_PA_DEBUG_MODE = 'Y' THEN
1878: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
1879: END IF;
1880:
1881: pa_debug.g_err_stage := TO_CHAR(l_stage)||': Bulk inserting into PA_FP_ELEMENTS';
1882: IF P_PA_DEBUG_MODE = 'Y' THEN
1877: IF P_PA_DEBUG_MODE = 'Y' THEN
1878: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
1879: END IF;
1880:
1881: pa_debug.g_err_stage := TO_CHAR(l_stage)||': Bulk inserting into PA_FP_ELEMENTS';
1882: IF P_PA_DEBUG_MODE = 'Y' THEN
1883: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
1884: END IF;
1885:
1878: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
1879: END IF;
1880:
1881: pa_debug.g_err_stage := TO_CHAR(l_stage)||': Bulk inserting into PA_FP_ELEMENTS';
1882: IF P_PA_DEBUG_MODE = 'Y' THEN
1883: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
1884: END IF;
1885:
1886: FORALL i in p_top_task_id_tbl.first..p_top_task_id_tbl.last
1879: END IF;
1880:
1881: pa_debug.g_err_stage := TO_CHAR(l_stage)||': Bulk inserting into PA_FP_ELEMENTS';
1882: IF P_PA_DEBUG_MODE = 'Y' THEN
1883: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
1884: END IF;
1885:
1886: FORALL i in p_top_task_id_tbl.first..p_top_task_id_tbl.last
1887:
1931: ,sysdate
1932: ,fnd_global.user_id
1933: ,fnd_global.login_id);
1934:
1935: pa_debug.reset_err_stack;
1936: EXCEPTION
1937: WHEN OTHERS THEN
1938: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1939: x_msg_count := 1;
1939: x_msg_count := 1;
1940: x_msg_data := SQLERRM;
1941: FND_MSG_PUB.add_exc_msg
1942: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Insert_Bulk_Rows'
1943: ,p_procedure_name => pa_debug.G_Err_Stack );
1944: IF P_PA_DEBUG_MODE = 'Y' THEN
1945: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,SQLERRM,4);
1946: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.G_Err_Stack,4);
1947: END IF;
1940: x_msg_data := SQLERRM;
1941: FND_MSG_PUB.add_exc_msg
1942: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Insert_Bulk_Rows'
1943: ,p_procedure_name => pa_debug.G_Err_Stack );
1944: IF P_PA_DEBUG_MODE = 'Y' THEN
1945: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,SQLERRM,4);
1946: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.G_Err_Stack,4);
1947: END IF;
1948: pa_debug.reset_err_stack;
1941: FND_MSG_PUB.add_exc_msg
1942: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Insert_Bulk_Rows'
1943: ,p_procedure_name => pa_debug.G_Err_Stack );
1944: IF P_PA_DEBUG_MODE = 'Y' THEN
1945: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,SQLERRM,4);
1946: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.G_Err_Stack,4);
1947: END IF;
1948: pa_debug.reset_err_stack;
1949:
1942: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Insert_Bulk_Rows'
1943: ,p_procedure_name => pa_debug.G_Err_Stack );
1944: IF P_PA_DEBUG_MODE = 'Y' THEN
1945: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,SQLERRM,4);
1946: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.G_Err_Stack,4);
1947: END IF;
1948: pa_debug.reset_err_stack;
1949:
1950: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1944: IF P_PA_DEBUG_MODE = 'Y' THEN
1945: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,SQLERRM,4);
1946: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.G_Err_Stack,4);
1947: END IF;
1948: pa_debug.reset_err_stack;
1949:
1950: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1951:
1952: END Insert_Bulk_Rows;
1971:
1972: BEGIN
1973:
1974: -- Set the error stack.
1975: pa_debug.set_err_stack('PA_FP_ELELEMNTS_PUB.Insert_Bulk_Rows_Res');
1976:
1977: -- Get the Debug mode into local variable and set it to 'Y' if its NULL
1978: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1979: l_debug_mode := NVL(l_debug_mode, 'Y');
1974: -- Set the error stack.
1975: pa_debug.set_err_stack('PA_FP_ELELEMNTS_PUB.Insert_Bulk_Rows_Res');
1976:
1977: -- Get the Debug mode into local variable and set it to 'Y' if its NULL
1978: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1979: l_debug_mode := NVL(l_debug_mode, 'Y');
1980:
1981: -- Initialize the return status to success
1982: x_return_status := FND_API.G_RET_STS_SUCCESS;
1980:
1981: -- Initialize the return status to success
1982: x_return_status := FND_API.G_RET_STS_SUCCESS;
1983:
1984: IF P_PA_DEBUG_MODE = 'Y' THEN
1985: pa_debug.set_process('Insert_Bulk_Rows: ' || 'PLSQL','LOG',l_debug_mode);
1986: END IF;
1987:
1988: pa_debug.g_err_stage := TO_CHAR(l_stage)||':In PA_FP_ELELEMNTS_PUB.Insert_Bulk_Rows_Res ';
1981: -- Initialize the return status to success
1982: x_return_status := FND_API.G_RET_STS_SUCCESS;
1983:
1984: IF P_PA_DEBUG_MODE = 'Y' THEN
1985: pa_debug.set_process('Insert_Bulk_Rows: ' || 'PLSQL','LOG',l_debug_mode);
1986: END IF;
1987:
1988: pa_debug.g_err_stage := TO_CHAR(l_stage)||':In PA_FP_ELELEMNTS_PUB.Insert_Bulk_Rows_Res ';
1989: IF P_PA_DEBUG_MODE = 'Y' THEN
1984: IF P_PA_DEBUG_MODE = 'Y' THEN
1985: pa_debug.set_process('Insert_Bulk_Rows: ' || 'PLSQL','LOG',l_debug_mode);
1986: END IF;
1987:
1988: pa_debug.g_err_stage := TO_CHAR(l_stage)||':In PA_FP_ELELEMNTS_PUB.Insert_Bulk_Rows_Res ';
1989: IF P_PA_DEBUG_MODE = 'Y' THEN
1990: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
1991: END IF;
1992:
1985: pa_debug.set_process('Insert_Bulk_Rows: ' || 'PLSQL','LOG',l_debug_mode);
1986: END IF;
1987:
1988: pa_debug.g_err_stage := TO_CHAR(l_stage)||':In PA_FP_ELELEMNTS_PUB.Insert_Bulk_Rows_Res ';
1989: IF P_PA_DEBUG_MODE = 'Y' THEN
1990: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
1991: END IF;
1992:
1993:
1986: END IF;
1987:
1988: pa_debug.g_err_stage := TO_CHAR(l_stage)||':In PA_FP_ELELEMNTS_PUB.Insert_Bulk_Rows_Res ';
1989: IF P_PA_DEBUG_MODE = 'Y' THEN
1990: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
1991: END IF;
1992:
1993:
1994: /*
1994: /*
1995: * Bulk Insert records into PA_FP_ELEMENTS table for the records fetched
1996: * from cursor top_task_cur.
1997: */
1998: pa_debug.g_err_stage := TO_CHAR(l_stage)||': In Insert_Bulk_Rows_Res';
1999: IF P_PA_DEBUG_MODE = 'Y' THEN
2000: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
2001: END IF;
2002:
1995: * Bulk Insert records into PA_FP_ELEMENTS table for the records fetched
1996: * from cursor top_task_cur.
1997: */
1998: pa_debug.g_err_stage := TO_CHAR(l_stage)||': In Insert_Bulk_Rows_Res';
1999: IF P_PA_DEBUG_MODE = 'Y' THEN
2000: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
2001: END IF;
2002:
2003: pa_debug.g_err_stage := TO_CHAR(l_stage)||': Bulk inserting into PA_RESOURCE_ASSIGNMENTS';
1996: * from cursor top_task_cur.
1997: */
1998: pa_debug.g_err_stage := TO_CHAR(l_stage)||': In Insert_Bulk_Rows_Res';
1999: IF P_PA_DEBUG_MODE = 'Y' THEN
2000: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
2001: END IF;
2002:
2003: pa_debug.g_err_stage := TO_CHAR(l_stage)||': Bulk inserting into PA_RESOURCE_ASSIGNMENTS';
2004: IF P_PA_DEBUG_MODE = 'Y' THEN
1999: IF P_PA_DEBUG_MODE = 'Y' THEN
2000: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
2001: END IF;
2002:
2003: pa_debug.g_err_stage := TO_CHAR(l_stage)||': Bulk inserting into PA_RESOURCE_ASSIGNMENTS';
2004: IF P_PA_DEBUG_MODE = 'Y' THEN
2005: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
2006: END IF;
2007:
2000: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
2001: END IF;
2002:
2003: pa_debug.g_err_stage := TO_CHAR(l_stage)||': Bulk inserting into PA_RESOURCE_ASSIGNMENTS';
2004: IF P_PA_DEBUG_MODE = 'Y' THEN
2005: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
2006: END IF;
2007:
2008: FORALL i in p_task_id_tbl.first..p_task_id_tbl.last
2001: END IF;
2002:
2003: pa_debug.g_err_stage := TO_CHAR(l_stage)||': Bulk inserting into PA_RESOURCE_ASSIGNMENTS';
2004: IF P_PA_DEBUG_MODE = 'Y' THEN
2005: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.g_err_stage,2);
2006: END IF;
2007:
2008: FORALL i in p_task_id_tbl.first..p_task_id_tbl.last
2009:
2037: ,p_track_as_labor_flag_tbl(i) -- TRACK_AS_LABOR_FLAG
2038: ,-1 -- PROJECT_ASSIGNMENT_ID
2039: ,PA_FP_CONSTANTS_PKG.G_USER_ENTERED) ; -- RESOURCE_ASSIGNMENT_TYPE
2040:
2041: pa_debug.reset_err_stack;
2042:
2043: EXCEPTION
2044: WHEN OTHERS THEN
2045: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2046: x_msg_count := 1;
2047: x_msg_data := SQLERRM;
2048: FND_MSG_PUB.add_exc_msg
2049: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Insert_Bulk_Rows_Res'
2050: ,p_procedure_name => pa_debug.G_Err_Stack );
2051: IF P_PA_DEBUG_MODE = 'Y' THEN
2052: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,SQLERRM,4);
2053: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.G_Err_Stack,4);
2054: END IF;
2047: x_msg_data := SQLERRM;
2048: FND_MSG_PUB.add_exc_msg
2049: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Insert_Bulk_Rows_Res'
2050: ,p_procedure_name => pa_debug.G_Err_Stack );
2051: IF P_PA_DEBUG_MODE = 'Y' THEN
2052: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,SQLERRM,4);
2053: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.G_Err_Stack,4);
2054: END IF;
2055: pa_debug.reset_err_stack;
2048: FND_MSG_PUB.add_exc_msg
2049: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Insert_Bulk_Rows_Res'
2050: ,p_procedure_name => pa_debug.G_Err_Stack );
2051: IF P_PA_DEBUG_MODE = 'Y' THEN
2052: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,SQLERRM,4);
2053: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.G_Err_Stack,4);
2054: END IF;
2055: pa_debug.reset_err_stack;
2056:
2049: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.Insert_Bulk_Rows_Res'
2050: ,p_procedure_name => pa_debug.G_Err_Stack );
2051: IF P_PA_DEBUG_MODE = 'Y' THEN
2052: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,SQLERRM,4);
2053: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.G_Err_Stack,4);
2054: END IF;
2055: pa_debug.reset_err_stack;
2056:
2057: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2051: IF P_PA_DEBUG_MODE = 'Y' THEN
2052: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,SQLERRM,4);
2053: pa_debug.write('Insert_Bulk_Rows: ' || l_module_name,pa_debug.G_Err_Stack,4);
2054: END IF;
2055: pa_debug.reset_err_stack;
2056:
2057: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2058:
2059: END Insert_Bulk_Rows_Res;
2180: BEGIN
2181:
2182: x_msg_count := 0;
2183: x_return_status := FND_API.G_RET_STS_SUCCESS;
2184: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Create_Enterable_Resources');
2185: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2186: l_debug_mode := NVL(l_debug_mode, 'Y');
2187: IF P_PA_DEBUG_MODE = 'Y' THEN
2188: pa_debug.set_process('create_enterable_resources: ' || 'PLSQL','LOG',l_debug_mode);
2181:
2182: x_msg_count := 0;
2183: x_return_status := FND_API.G_RET_STS_SUCCESS;
2184: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Create_Enterable_Resources');
2185: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2186: l_debug_mode := NVL(l_debug_mode, 'Y');
2187: IF P_PA_DEBUG_MODE = 'Y' THEN
2188: pa_debug.set_process('create_enterable_resources: ' || 'PLSQL','LOG',l_debug_mode);
2189: END IF;
2183: x_return_status := FND_API.G_RET_STS_SUCCESS;
2184: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Create_Enterable_Resources');
2185: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2186: l_debug_mode := NVL(l_debug_mode, 'Y');
2187: IF P_PA_DEBUG_MODE = 'Y' THEN
2188: pa_debug.set_process('create_enterable_resources: ' || 'PLSQL','LOG',l_debug_mode);
2189: END IF;
2190:
2191:
2184: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Create_Enterable_Resources');
2185: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2186: l_debug_mode := NVL(l_debug_mode, 'Y');
2187: IF P_PA_DEBUG_MODE = 'Y' THEN
2188: pa_debug.set_process('create_enterable_resources: ' || 'PLSQL','LOG',l_debug_mode);
2189: END IF;
2190:
2191:
2192: -- Check for business rules violations
2190:
2191:
2192: -- Check for business rules violations
2193:
2194: pa_debug.g_err_stage:= 'validating input parameters';
2195: IF P_PA_DEBUG_MODE = 'Y' THEN
2196: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2197: END IF;
2198:
2191:
2192: -- Check for business rules violations
2193:
2194: pa_debug.g_err_stage:= 'validating input parameters';
2195: IF P_PA_DEBUG_MODE = 'Y' THEN
2196: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2197: END IF;
2198:
2199: --Check if plan version id is null
2192: -- Check for business rules violations
2193:
2194: pa_debug.g_err_stage:= 'validating input parameters';
2195: IF P_PA_DEBUG_MODE = 'Y' THEN
2196: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2197: END IF;
2198:
2199: --Check if plan version id is null
2200:
2199: --Check if plan version id is null
2200:
2201: IF p_plan_version_id is NULL THEN
2202:
2203: pa_debug.g_err_stage:= 'plan version id is null';
2204: IF P_PA_DEBUG_MODE = 'Y' THEN
2205: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,5);
2206: END IF;
2207:
2200:
2201: IF p_plan_version_id is NULL THEN
2202:
2203: pa_debug.g_err_stage:= 'plan version id is null';
2204: IF P_PA_DEBUG_MODE = 'Y' THEN
2205: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,5);
2206: END IF;
2207:
2208: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
2201: IF p_plan_version_id is NULL THEN
2202:
2203: pa_debug.g_err_stage:= 'plan version id is null';
2204: IF P_PA_DEBUG_MODE = 'Y' THEN
2205: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,5);
2206: END IF;
2207:
2208: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
2209: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
2211: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
2212:
2213: END IF;
2214:
2215: pa_debug.g_err_stage:='fetching resource_list_id, project_id';
2216: IF P_PA_DEBUG_MODE = 'Y' THEN
2217: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2218: END IF;
2219:
2212:
2213: END IF;
2214:
2215: pa_debug.g_err_stage:='fetching resource_list_id, project_id';
2216: IF P_PA_DEBUG_MODE = 'Y' THEN
2217: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2218: END IF;
2219:
2220: SELECT resource_list_id
2213: END IF;
2214:
2215: pa_debug.g_err_stage:='fetching resource_list_id, project_id';
2216: IF P_PA_DEBUG_MODE = 'Y' THEN
2217: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2218: END IF;
2219:
2220: SELECT resource_list_id
2221: ,project_id
2231: INTO l_proj_fp_options_id
2232: FROM pa_proj_fp_options
2233: WHERE fin_plan_version_id = p_plan_version_id;
2234:
2235: pa_debug.g_err_stage:='checking if resource list is uncategorised';
2236: IF P_PA_DEBUG_MODE = 'Y' THEN
2237: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2238: END IF;
2239:
2232: FROM pa_proj_fp_options
2233: WHERE fin_plan_version_id = p_plan_version_id;
2234:
2235: pa_debug.g_err_stage:='checking if resource list is uncategorised';
2236: IF P_PA_DEBUG_MODE = 'Y' THEN
2237: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2238: END IF;
2239:
2240: SELECT NVL(uncategorized_flag,'N')
2233: WHERE fin_plan_version_id = p_plan_version_id;
2234:
2235: pa_debug.g_err_stage:='checking if resource list is uncategorised';
2236: IF P_PA_DEBUG_MODE = 'Y' THEN
2237: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2238: END IF;
2239:
2240: SELECT NVL(uncategorized_flag,'N')
2241: INTO l_uncat_flag
2250: IF l_uncat_flag = 'Y' THEN
2251:
2252: -- Fetch resource_list_member_id and track_as_labor_flag and unit of measure
2253:
2254: pa_debug.g_err_stage:='resource_list is uncategorised ';
2255: IF P_PA_DEBUG_MODE = 'Y' THEN
2256: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2257: END IF;
2258:
2251:
2252: -- Fetch resource_list_member_id and track_as_labor_flag and unit of measure
2253:
2254: pa_debug.g_err_stage:='resource_list is uncategorised ';
2255: IF P_PA_DEBUG_MODE = 'Y' THEN
2256: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2257: END IF;
2258:
2259: pa_debug.g_err_stage:=' fetching resource_list_member_id,track_as_labor_flag';
2252: -- Fetch resource_list_member_id and track_as_labor_flag and unit of measure
2253:
2254: pa_debug.g_err_stage:='resource_list is uncategorised ';
2255: IF P_PA_DEBUG_MODE = 'Y' THEN
2256: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2257: END IF;
2258:
2259: pa_debug.g_err_stage:=' fetching resource_list_member_id,track_as_labor_flag';
2260: IF P_PA_DEBUG_MODE = 'Y' THEN
2255: IF P_PA_DEBUG_MODE = 'Y' THEN
2256: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2257: END IF;
2258:
2259: pa_debug.g_err_stage:=' fetching resource_list_member_id,track_as_labor_flag';
2260: IF P_PA_DEBUG_MODE = 'Y' THEN
2261: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2262: END IF;
2263:
2256: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2257: END IF;
2258:
2259: pa_debug.g_err_stage:=' fetching resource_list_member_id,track_as_labor_flag';
2260: IF P_PA_DEBUG_MODE = 'Y' THEN
2261: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2262: END IF;
2263:
2264: DECLARE
2257: END IF;
2258:
2259: pa_debug.g_err_stage:=' fetching resource_list_member_id,track_as_labor_flag';
2260: IF P_PA_DEBUG_MODE = 'Y' THEN
2261: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2262: END IF;
2263:
2264: DECLARE
2265: l_dummy_res_list_id PA_RESOURCE_LISTS_ALL_BG.resource_list_id%TYPE;
2274: ,x_msg_count => x_msg_count
2275: ,x_msg_data => x_msg_data);
2276:
2277: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2278: pa_debug.g_err_stage := 'Error while fetching uncat res list id info ...';
2279: IF P_PA_DEBUG_MODE = 'Y' THEN
2280: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,5);
2281: END IF;
2282: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
2275: ,x_msg_data => x_msg_data);
2276:
2277: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2278: pa_debug.g_err_stage := 'Error while fetching uncat res list id info ...';
2279: IF P_PA_DEBUG_MODE = 'Y' THEN
2280: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,5);
2281: END IF;
2282: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
2283: END IF;
2276:
2277: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2278: pa_debug.g_err_stage := 'Error while fetching uncat res list id info ...';
2279: IF P_PA_DEBUG_MODE = 'Y' THEN
2280: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,5);
2281: END IF;
2282: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
2283: END IF;
2284:
2286:
2287: END IF;
2288:
2289:
2290: pa_debug.g_err_stage:= 'parameter validation complete';
2291: IF P_PA_DEBUG_MODE = 'Y' THEN
2292: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2293: END IF;
2294:
2287: END IF;
2288:
2289:
2290: pa_debug.g_err_stage:= 'parameter validation complete';
2291: IF P_PA_DEBUG_MODE = 'Y' THEN
2292: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2293: END IF;
2294:
2295: --Fetching the finplan planning level
2288:
2289:
2290: pa_debug.g_err_stage:= 'parameter validation complete';
2291: IF P_PA_DEBUG_MODE = 'Y' THEN
2292: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2293: END IF;
2294:
2295: --Fetching the finplan planning level
2296:
2322:
2323: IF (l_fp_level_code = PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_PROJECT AND
2324: l_uncat_flag = 'Y' ) THEN
2325:
2326: pa_debug.g_err_stage:= 'Deleting resource assignments';
2327: IF P_PA_DEBUG_MODE = 'Y' THEN
2328: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2329: END IF;
2330:
2323: IF (l_fp_level_code = PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_PROJECT AND
2324: l_uncat_flag = 'Y' ) THEN
2325:
2326: pa_debug.g_err_stage:= 'Deleting resource assignments';
2327: IF P_PA_DEBUG_MODE = 'Y' THEN
2328: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2329: END IF;
2330:
2331: DELETE FROM pa_resource_assignments
2324: l_uncat_flag = 'Y' ) THEN
2325:
2326: pa_debug.g_err_stage:= 'Deleting resource assignments';
2327: IF P_PA_DEBUG_MODE = 'Y' THEN
2328: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2329: END IF;
2330:
2331: DELETE FROM pa_resource_assignments
2332: WHERE budget_version_id = p_plan_version_id
2336:
2337: /* In all other cases, records have to be deleted from pa_resource_assignments
2338: which do not exist in pa_fp_elements. */
2339:
2340: pa_debug.g_err_stage:= 'fetching resource assignments that should be deleted';
2341: IF P_PA_DEBUG_MODE = 'Y' THEN
2342: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2343: END IF;
2344:
2337: /* In all other cases, records have to be deleted from pa_resource_assignments
2338: which do not exist in pa_fp_elements. */
2339:
2340: pa_debug.g_err_stage:= 'fetching resource assignments that should be deleted';
2341: IF P_PA_DEBUG_MODE = 'Y' THEN
2342: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2343: END IF;
2344:
2345: OPEN l_cur_for_res_del;
2338: which do not exist in pa_fp_elements. */
2339:
2340: pa_debug.g_err_stage:= 'fetching resource assignments that should be deleted';
2341: IF P_PA_DEBUG_MODE = 'Y' THEN
2342: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2343: END IF;
2344:
2345: OPEN l_cur_for_res_del;
2346: pa_debug.g_err_stage:= 'Deleting records from Resource Assignments.';
2342: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2343: END IF;
2344:
2345: OPEN l_cur_for_res_del;
2346: pa_debug.g_err_stage:= 'Deleting records from Resource Assignments.';
2347: IF P_PA_DEBUG_MODE = 'Y' THEN
2348: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2349: END IF;
2350:
2343: END IF;
2344:
2345: OPEN l_cur_for_res_del;
2346: pa_debug.g_err_stage:= 'Deleting records from Resource Assignments.';
2347: IF P_PA_DEBUG_MODE = 'Y' THEN
2348: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2349: END IF;
2350:
2351: FETCH l_cur_for_res_del BULK COLLECT INTO
2344:
2345: OPEN l_cur_for_res_del;
2346: pa_debug.g_err_stage:= 'Deleting records from Resource Assignments.';
2347: IF P_PA_DEBUG_MODE = 'Y' THEN
2348: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2349: END IF;
2350:
2351: FETCH l_cur_for_res_del BULK COLLECT INTO
2352: l_ra_id_tbl;
2350:
2351: FETCH l_cur_for_res_del BULK COLLECT INTO
2352: l_ra_id_tbl;
2353:
2354: pa_debug.g_err_stage := 'Fetched ' || sql%rowcount || ' records';
2355: IF P_PA_DEBUG_MODE = 'Y' THEN
2356: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2357: END IF;
2358:
2351: FETCH l_cur_for_res_del BULK COLLECT INTO
2352: l_ra_id_tbl;
2353:
2354: pa_debug.g_err_stage := 'Fetched ' || sql%rowcount || ' records';
2355: IF P_PA_DEBUG_MODE = 'Y' THEN
2356: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2357: END IF;
2358:
2359: IF (nvl(l_ra_id_tbl.last,0) > 0) THEN
2352: l_ra_id_tbl;
2353:
2354: pa_debug.g_err_stage := 'Fetched ' || sql%rowcount || ' records';
2355: IF P_PA_DEBUG_MODE = 'Y' THEN
2356: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2357: END IF;
2358:
2359: IF (nvl(l_ra_id_tbl.last,0) > 0) THEN
2360:
2362:
2363: DELETE FROM pa_resource_assignments
2364: WHERE resource_assignment_id = l_ra_id_tbl(i);
2365:
2366: pa_debug.g_err_stage := 'Deleted ' || sql%rowcount || ' records';
2367: IF P_PA_DEBUG_MODE = 'Y' THEN
2368: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2369: END IF;
2370: END IF;
2363: DELETE FROM pa_resource_assignments
2364: WHERE resource_assignment_id = l_ra_id_tbl(i);
2365:
2366: pa_debug.g_err_stage := 'Deleted ' || sql%rowcount || ' records';
2367: IF P_PA_DEBUG_MODE = 'Y' THEN
2368: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2369: END IF;
2370: END IF;
2371: CLOSE l_cur_for_res_del;
2364: WHERE resource_assignment_id = l_ra_id_tbl(i);
2365:
2366: pa_debug.g_err_stage := 'Deleted ' || sql%rowcount || ' records';
2367: IF P_PA_DEBUG_MODE = 'Y' THEN
2368: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2369: END IF;
2370: END IF;
2371: CLOSE l_cur_for_res_del;
2372:
2379: IF l_fp_level_code = PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_PROJECT THEN
2380:
2381: -- CASE:planning level 'project' and 'uncategorised resource_list'
2382:
2383: pa_debug.g_err_stage:='project level planning and resource_list uncategorised';
2384: IF P_PA_DEBUG_MODE = 'Y' THEN
2385: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2386: END IF;
2387: pa_debug.g_err_stage:='opening l_cur_for_uncat_project_level';
2380:
2381: -- CASE:planning level 'project' and 'uncategorised resource_list'
2382:
2383: pa_debug.g_err_stage:='project level planning and resource_list uncategorised';
2384: IF P_PA_DEBUG_MODE = 'Y' THEN
2385: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2386: END IF;
2387: pa_debug.g_err_stage:='opening l_cur_for_uncat_project_level';
2388: IF P_PA_DEBUG_MODE = 'Y' THEN
2381: -- CASE:planning level 'project' and 'uncategorised resource_list'
2382:
2383: pa_debug.g_err_stage:='project level planning and resource_list uncategorised';
2384: IF P_PA_DEBUG_MODE = 'Y' THEN
2385: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2386: END IF;
2387: pa_debug.g_err_stage:='opening l_cur_for_uncat_project_level';
2388: IF P_PA_DEBUG_MODE = 'Y' THEN
2389: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2383: pa_debug.g_err_stage:='project level planning and resource_list uncategorised';
2384: IF P_PA_DEBUG_MODE = 'Y' THEN
2385: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2386: END IF;
2387: pa_debug.g_err_stage:='opening l_cur_for_uncat_project_level';
2388: IF P_PA_DEBUG_MODE = 'Y' THEN
2389: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2390: END IF;
2391:
2384: IF P_PA_DEBUG_MODE = 'Y' THEN
2385: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2386: END IF;
2387: pa_debug.g_err_stage:='opening l_cur_for_uncat_project_level';
2388: IF P_PA_DEBUG_MODE = 'Y' THEN
2389: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2390: END IF;
2391:
2392: OPEN l_cur_for_uncat_project_level;
2385: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2386: END IF;
2387: pa_debug.g_err_stage:='opening l_cur_for_uncat_project_level';
2388: IF P_PA_DEBUG_MODE = 'Y' THEN
2389: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2390: END IF;
2391:
2392: OPEN l_cur_for_uncat_project_level;
2393:
2390: END IF;
2391:
2392: OPEN l_cur_for_uncat_project_level;
2393:
2394: pa_debug.g_err_stage:= 'fetching cursor values and doing bulk insert';
2395: IF P_PA_DEBUG_MODE = 'Y' THEN
2396: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2397: END IF;
2398:
2391:
2392: OPEN l_cur_for_uncat_project_level;
2393:
2394: pa_debug.g_err_stage:= 'fetching cursor values and doing bulk insert';
2395: IF P_PA_DEBUG_MODE = 'Y' THEN
2396: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2397: END IF;
2398:
2399: LOOP
2392: OPEN l_cur_for_uncat_project_level;
2393:
2394: pa_debug.g_err_stage:= 'fetching cursor values and doing bulk insert';
2395: IF P_PA_DEBUG_MODE = 'Y' THEN
2396: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2397: END IF;
2398:
2399: LOOP
2400:
2432: ELSIF l_fp_level_code <> PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_PROJECT THEN
2433:
2434: -- CASE: planning level 'task' and uncategorised resource_list
2435:
2436: pa_debug.g_err_stage:='task level planning and Uncategorised resource_list';
2437: IF P_PA_DEBUG_MODE = 'Y' THEN
2438: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2439: END IF;
2440:
2433:
2434: -- CASE: planning level 'task' and uncategorised resource_list
2435:
2436: pa_debug.g_err_stage:='task level planning and Uncategorised resource_list';
2437: IF P_PA_DEBUG_MODE = 'Y' THEN
2438: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2439: END IF;
2440:
2441: pa_debug.g_err_stage:='opening l_elements_cur';
2434: -- CASE: planning level 'task' and uncategorised resource_list
2435:
2436: pa_debug.g_err_stage:='task level planning and Uncategorised resource_list';
2437: IF P_PA_DEBUG_MODE = 'Y' THEN
2438: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2439: END IF;
2440:
2441: pa_debug.g_err_stage:='opening l_elements_cur';
2442: IF P_PA_DEBUG_MODE = 'Y' THEN
2437: IF P_PA_DEBUG_MODE = 'Y' THEN
2438: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2439: END IF;
2440:
2441: pa_debug.g_err_stage:='opening l_elements_cur';
2442: IF P_PA_DEBUG_MODE = 'Y' THEN
2443: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2444: END IF;
2445:
2438: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2439: END IF;
2440:
2441: pa_debug.g_err_stage:='opening l_elements_cur';
2442: IF P_PA_DEBUG_MODE = 'Y' THEN
2443: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2444: END IF;
2445:
2446: OPEN l_cur_for_uncat_task_level;
2439: END IF;
2440:
2441: pa_debug.g_err_stage:='opening l_elements_cur';
2442: IF P_PA_DEBUG_MODE = 'Y' THEN
2443: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2444: END IF;
2445:
2446: OPEN l_cur_for_uncat_task_level;
2447:
2444: END IF;
2445:
2446: OPEN l_cur_for_uncat_task_level;
2447:
2448: pa_debug.g_err_stage:= 'fetching cursor values and doing bulk insert';
2449: IF P_PA_DEBUG_MODE = 'Y' THEN
2450: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2451: END IF;
2452:
2445:
2446: OPEN l_cur_for_uncat_task_level;
2447:
2448: pa_debug.g_err_stage:= 'fetching cursor values and doing bulk insert';
2449: IF P_PA_DEBUG_MODE = 'Y' THEN
2450: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2451: END IF;
2452:
2453: LOOP
2446: OPEN l_cur_for_uncat_task_level;
2447:
2448: pa_debug.g_err_stage:= 'fetching cursor values and doing bulk insert';
2449: IF P_PA_DEBUG_MODE = 'Y' THEN
2450: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2451: END IF;
2452:
2453: LOOP
2454:
2487: ELSIF l_uncat_flag = 'N' THEN
2488:
2489: -- CASE: resource_list is categorised
2490:
2491: pa_debug.g_err_stage:='Categorised resource_list';
2492: IF P_PA_DEBUG_MODE = 'Y' THEN
2493: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2494: END IF;
2495:
2488:
2489: -- CASE: resource_list is categorised
2490:
2491: pa_debug.g_err_stage:='Categorised resource_list';
2492: IF P_PA_DEBUG_MODE = 'Y' THEN
2493: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2494: END IF;
2495:
2496: pa_debug.g_err_stage:='opening l_cur_for_cat_res_list';
2489: -- CASE: resource_list is categorised
2490:
2491: pa_debug.g_err_stage:='Categorised resource_list';
2492: IF P_PA_DEBUG_MODE = 'Y' THEN
2493: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2494: END IF;
2495:
2496: pa_debug.g_err_stage:='opening l_cur_for_cat_res_list';
2497: IF P_PA_DEBUG_MODE = 'Y' THEN
2492: IF P_PA_DEBUG_MODE = 'Y' THEN
2493: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2494: END IF;
2495:
2496: pa_debug.g_err_stage:='opening l_cur_for_cat_res_list';
2497: IF P_PA_DEBUG_MODE = 'Y' THEN
2498: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2499: END IF;
2500:
2493: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2494: END IF;
2495:
2496: pa_debug.g_err_stage:='opening l_cur_for_cat_res_list';
2497: IF P_PA_DEBUG_MODE = 'Y' THEN
2498: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2499: END IF;
2500:
2501: OPEN l_cur_for_cat_res_list;
2494: END IF;
2495:
2496: pa_debug.g_err_stage:='opening l_cur_for_cat_res_list';
2497: IF P_PA_DEBUG_MODE = 'Y' THEN
2498: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2499: END IF;
2500:
2501: OPEN l_cur_for_cat_res_list;
2502:
2499: END IF;
2500:
2501: OPEN l_cur_for_cat_res_list;
2502:
2503: pa_debug.g_err_stage:= 'fetching cursor values and doing bulk insert';
2504: IF P_PA_DEBUG_MODE = 'Y' THEN
2505: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2506: END IF;
2507:
2500:
2501: OPEN l_cur_for_cat_res_list;
2502:
2503: pa_debug.g_err_stage:= 'fetching cursor values and doing bulk insert';
2504: IF P_PA_DEBUG_MODE = 'Y' THEN
2505: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2506: END IF;
2507:
2508: LOOP
2501: OPEN l_cur_for_cat_res_list;
2502:
2503: pa_debug.g_err_stage:= 'fetching cursor values and doing bulk insert';
2504: IF P_PA_DEBUG_MODE = 'Y' THEN
2505: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2506: END IF;
2507:
2508: LOOP
2509:
2538: CLOSE l_cur_for_cat_res_list;
2539:
2540: END IF; --l_uncat_flag
2541:
2542: pa_debug.g_err_stage:= 'Exiting Create_Enterable_Resources';
2543: IF P_PA_DEBUG_MODE = 'Y' THEN
2544: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2545: END IF;
2546:
2539:
2540: END IF; --l_uncat_flag
2541:
2542: pa_debug.g_err_stage:= 'Exiting Create_Enterable_Resources';
2543: IF P_PA_DEBUG_MODE = 'Y' THEN
2544: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2545: END IF;
2546:
2547: pa_debug.reset_err_stack;
2540: END IF; --l_uncat_flag
2541:
2542: pa_debug.g_err_stage:= 'Exiting Create_Enterable_Resources';
2543: IF P_PA_DEBUG_MODE = 'Y' THEN
2544: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2545: END IF;
2546:
2547: pa_debug.reset_err_stack;
2548:
2543: IF P_PA_DEBUG_MODE = 'Y' THEN
2544: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,3);
2545: END IF;
2546:
2547: pa_debug.reset_err_stack;
2548:
2549: EXCEPTION
2550:
2551: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
2564: ELSE
2565: x_msg_count := l_msg_count;
2566: END IF;
2567:
2568: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
2569: IF P_PA_DEBUG_MODE = 'Y' THEN
2570: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,5);
2571: END IF;
2572:
2565: x_msg_count := l_msg_count;
2566: END IF;
2567:
2568: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
2569: IF P_PA_DEBUG_MODE = 'Y' THEN
2570: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,5);
2571: END IF;
2572:
2573: x_return_status := FND_API.G_RET_STS_ERROR;
2566: END IF;
2567:
2568: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
2569: IF P_PA_DEBUG_MODE = 'Y' THEN
2570: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,5);
2571: END IF;
2572:
2573: x_return_status := FND_API.G_RET_STS_ERROR;
2574: pa_debug.reset_err_stack;
2570: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,5);
2571: END IF;
2572:
2573: x_return_status := FND_API.G_RET_STS_ERROR;
2574: pa_debug.reset_err_stack;
2575: RAISE;
2576:
2577: WHEN others THEN
2578:
2580: x_msg_count := 1;
2581: x_msg_data := SQLERRM;
2582: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_FP_ELEMENTS_PUB'
2583: ,p_procedure_name => 'CREATE_ENTERABLE_RESOURCES');
2584: pa_debug.g_err_stage:= 'Unexpected Error'||SQLERRM;
2585: IF P_PA_DEBUG_MODE = 'Y' THEN
2586: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,5);
2587: END IF;
2588: pa_debug.reset_err_stack;
2581: x_msg_data := SQLERRM;
2582: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_FP_ELEMENTS_PUB'
2583: ,p_procedure_name => 'CREATE_ENTERABLE_RESOURCES');
2584: pa_debug.g_err_stage:= 'Unexpected Error'||SQLERRM;
2585: IF P_PA_DEBUG_MODE = 'Y' THEN
2586: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,5);
2587: END IF;
2588: pa_debug.reset_err_stack;
2589: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2582: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_FP_ELEMENTS_PUB'
2583: ,p_procedure_name => 'CREATE_ENTERABLE_RESOURCES');
2584: pa_debug.g_err_stage:= 'Unexpected Error'||SQLERRM;
2585: IF P_PA_DEBUG_MODE = 'Y' THEN
2586: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,5);
2587: END IF;
2588: pa_debug.reset_err_stack;
2589: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2590:
2584: pa_debug.g_err_stage:= 'Unexpected Error'||SQLERRM;
2585: IF P_PA_DEBUG_MODE = 'Y' THEN
2586: pa_debug.write('create_enterable_resources: ' || l_module_name,pa_debug.g_err_stage,5);
2587: END IF;
2588: pa_debug.reset_err_stack;
2589: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2590:
2591: END create_enterable_resources;
2592:
2984:
2985: x_msg_count := 0;
2986: x_return_status := FND_API.G_RET_STS_SUCCESS;
2987:
2988: pa_debug.set_err_stack('Create_elements_from_version');
2989: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2990: l_debug_mode := NVL(l_debug_mode, 'Y');
2991: pa_debug.set_process('PLSQL','LOG',l_debug_mode);
2992:
2985: x_msg_count := 0;
2986: x_return_status := FND_API.G_RET_STS_SUCCESS;
2987:
2988: pa_debug.set_err_stack('Create_elements_from_version');
2989: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2990: l_debug_mode := NVL(l_debug_mode, 'Y');
2991: pa_debug.set_process('PLSQL','LOG',l_debug_mode);
2992:
2993: IF p_pa_debug_mode = 'Y' THEN
2987:
2988: pa_debug.set_err_stack('Create_elements_from_version');
2989: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2990: l_debug_mode := NVL(l_debug_mode, 'Y');
2991: pa_debug.set_process('PLSQL','LOG',l_debug_mode);
2992:
2993: IF p_pa_debug_mode = 'Y' THEN
2994: pa_debug.g_err_stage := 'Entered Create_elements_from_version';
2995: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
2989: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2990: l_debug_mode := NVL(l_debug_mode, 'Y');
2991: pa_debug.set_process('PLSQL','LOG',l_debug_mode);
2992:
2993: IF p_pa_debug_mode = 'Y' THEN
2994: pa_debug.g_err_stage := 'Entered Create_elements_from_version';
2995: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
2996: END IF;
2997:
2990: l_debug_mode := NVL(l_debug_mode, 'Y');
2991: pa_debug.set_process('PLSQL','LOG',l_debug_mode);
2992:
2993: IF p_pa_debug_mode = 'Y' THEN
2994: pa_debug.g_err_stage := 'Entered Create_elements_from_version';
2995: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
2996: END IF;
2997:
2998: -- Check for not null parameters
2991: pa_debug.set_process('PLSQL','LOG',l_debug_mode);
2992:
2993: IF p_pa_debug_mode = 'Y' THEN
2994: pa_debug.g_err_stage := 'Entered Create_elements_from_version';
2995: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
2996: END IF;
2997:
2998: -- Check for not null parameters
2999:
2996: END IF;
2997:
2998: -- Check for not null parameters
2999:
3000: IF p_pa_debug_mode = 'Y' THEN
3001: pa_debug.g_err_stage := 'Checking for valid parameters:';
3002: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3003: END IF;
3004:
2997:
2998: -- Check for not null parameters
2999:
3000: IF p_pa_debug_mode = 'Y' THEN
3001: pa_debug.g_err_stage := 'Checking for valid parameters:';
3002: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3003: END IF;
3004:
3005: IF (p_proj_fp_options_id IS NULL) OR
2998: -- Check for not null parameters
2999:
3000: IF p_pa_debug_mode = 'Y' THEN
3001: pa_debug.g_err_stage := 'Checking for valid parameters:';
3002: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3003: END IF;
3004:
3005: IF (p_proj_fp_options_id IS NULL) OR
3006: (p_element_type IS NULL) OR
3006: (p_element_type IS NULL) OR
3007: (p_from_version_id IS NULL) OR
3008: (p_resource_list_id IS NULL)
3009: THEN
3010: IF p_pa_debug_mode = 'Y' THEN
3011: pa_debug.g_err_stage := 'p_proj_fp_options_id = '||p_proj_fp_options_id;
3012: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3013: pa_debug.g_err_stage := 'p_element_type = '||p_element_type;
3014: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3007: (p_from_version_id IS NULL) OR
3008: (p_resource_list_id IS NULL)
3009: THEN
3010: IF p_pa_debug_mode = 'Y' THEN
3011: pa_debug.g_err_stage := 'p_proj_fp_options_id = '||p_proj_fp_options_id;
3012: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3013: pa_debug.g_err_stage := 'p_element_type = '||p_element_type;
3014: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3015: pa_debug.g_err_stage := 'p_from_version_id = '||p_from_version_id;
3008: (p_resource_list_id IS NULL)
3009: THEN
3010: IF p_pa_debug_mode = 'Y' THEN
3011: pa_debug.g_err_stage := 'p_proj_fp_options_id = '||p_proj_fp_options_id;
3012: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3013: pa_debug.g_err_stage := 'p_element_type = '||p_element_type;
3014: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3015: pa_debug.g_err_stage := 'p_from_version_id = '||p_from_version_id;
3016: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3009: THEN
3010: IF p_pa_debug_mode = 'Y' THEN
3011: pa_debug.g_err_stage := 'p_proj_fp_options_id = '||p_proj_fp_options_id;
3012: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3013: pa_debug.g_err_stage := 'p_element_type = '||p_element_type;
3014: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3015: pa_debug.g_err_stage := 'p_from_version_id = '||p_from_version_id;
3016: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3017: pa_debug.g_err_stage := 'p_resource_list_id = '||p_resource_list_id;
3010: IF p_pa_debug_mode = 'Y' THEN
3011: pa_debug.g_err_stage := 'p_proj_fp_options_id = '||p_proj_fp_options_id;
3012: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3013: pa_debug.g_err_stage := 'p_element_type = '||p_element_type;
3014: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3015: pa_debug.g_err_stage := 'p_from_version_id = '||p_from_version_id;
3016: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3017: pa_debug.g_err_stage := 'p_resource_list_id = '||p_resource_list_id;
3018: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3011: pa_debug.g_err_stage := 'p_proj_fp_options_id = '||p_proj_fp_options_id;
3012: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3013: pa_debug.g_err_stage := 'p_element_type = '||p_element_type;
3014: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3015: pa_debug.g_err_stage := 'p_from_version_id = '||p_from_version_id;
3016: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3017: pa_debug.g_err_stage := 'p_resource_list_id = '||p_resource_list_id;
3018: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3019: END IF;
3012: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3013: pa_debug.g_err_stage := 'p_element_type = '||p_element_type;
3014: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3015: pa_debug.g_err_stage := 'p_from_version_id = '||p_from_version_id;
3016: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3017: pa_debug.g_err_stage := 'p_resource_list_id = '||p_resource_list_id;
3018: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3019: END IF;
3020: PA_UTILS.ADD_MESSAGE(p_app_short_name=> 'PA',
3013: pa_debug.g_err_stage := 'p_element_type = '||p_element_type;
3014: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3015: pa_debug.g_err_stage := 'p_from_version_id = '||p_from_version_id;
3016: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3017: pa_debug.g_err_stage := 'p_resource_list_id = '||p_resource_list_id;
3018: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3019: END IF;
3020: PA_UTILS.ADD_MESSAGE(p_app_short_name=> 'PA',
3021: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
3014: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3015: pa_debug.g_err_stage := 'p_from_version_id = '||p_from_version_id;
3016: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3017: pa_debug.g_err_stage := 'p_resource_list_id = '||p_resource_list_id;
3018: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3019: END IF;
3020: PA_UTILS.ADD_MESSAGE(p_app_short_name=> 'PA',
3021: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
3022:
3023: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
3024:
3025: END IF;
3026:
3027: IF p_pa_debug_mode = 'Y' THEN
3028: pa_debug.g_err_stage := 'Parameter validation complete';
3029: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3030: pa_debug.g_err_stage := 'p_proj_fp_options_id = '||p_proj_fp_options_id;
3031: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3024:
3025: END IF;
3026:
3027: IF p_pa_debug_mode = 'Y' THEN
3028: pa_debug.g_err_stage := 'Parameter validation complete';
3029: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3030: pa_debug.g_err_stage := 'p_proj_fp_options_id = '||p_proj_fp_options_id;
3031: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3032: pa_debug.g_err_stage := 'p_from_version_id = '||p_from_version_id;
3025: END IF;
3026:
3027: IF p_pa_debug_mode = 'Y' THEN
3028: pa_debug.g_err_stage := 'Parameter validation complete';
3029: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3030: pa_debug.g_err_stage := 'p_proj_fp_options_id = '||p_proj_fp_options_id;
3031: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3032: pa_debug.g_err_stage := 'p_from_version_id = '||p_from_version_id;
3033: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3026:
3027: IF p_pa_debug_mode = 'Y' THEN
3028: pa_debug.g_err_stage := 'Parameter validation complete';
3029: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3030: pa_debug.g_err_stage := 'p_proj_fp_options_id = '||p_proj_fp_options_id;
3031: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3032: pa_debug.g_err_stage := 'p_from_version_id = '||p_from_version_id;
3033: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3034: pa_debug.g_err_stage := 'p_resource_list_id = '||p_resource_list_id;
3027: IF p_pa_debug_mode = 'Y' THEN
3028: pa_debug.g_err_stage := 'Parameter validation complete';
3029: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3030: pa_debug.g_err_stage := 'p_proj_fp_options_id = '||p_proj_fp_options_id;
3031: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3032: pa_debug.g_err_stage := 'p_from_version_id = '||p_from_version_id;
3033: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3034: pa_debug.g_err_stage := 'p_resource_list_id = '||p_resource_list_id;
3035: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3028: pa_debug.g_err_stage := 'Parameter validation complete';
3029: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3030: pa_debug.g_err_stage := 'p_proj_fp_options_id = '||p_proj_fp_options_id;
3031: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3032: pa_debug.g_err_stage := 'p_from_version_id = '||p_from_version_id;
3033: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3034: pa_debug.g_err_stage := 'p_resource_list_id = '||p_resource_list_id;
3035: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3036: END IF;
3029: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3030: pa_debug.g_err_stage := 'p_proj_fp_options_id = '||p_proj_fp_options_id;
3031: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3032: pa_debug.g_err_stage := 'p_from_version_id = '||p_from_version_id;
3033: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3034: pa_debug.g_err_stage := 'p_resource_list_id = '||p_resource_list_id;
3035: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3036: END IF;
3037:
3030: pa_debug.g_err_stage := 'p_proj_fp_options_id = '||p_proj_fp_options_id;
3031: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3032: pa_debug.g_err_stage := 'p_from_version_id = '||p_from_version_id;
3033: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3034: pa_debug.g_err_stage := 'p_resource_list_id = '||p_resource_list_id;
3035: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3036: END IF;
3037:
3038: --Get the required fp options info using p_proj_fp_options_id
3031: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3032: pa_debug.g_err_stage := 'p_from_version_id = '||p_from_version_id;
3033: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3034: pa_debug.g_err_stage := 'p_resource_list_id = '||p_resource_list_id;
3035: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3036: END IF;
3037:
3038: --Get the required fp options info using p_proj_fp_options_id
3039:
3068: -- Case:- project level planning and categorised resource list
3069:
3070: --Fetch and insert resource level records into pa_fp_elements.
3071:
3072: IF p_pa_debug_mode = 'Y' THEN
3073: pa_debug.g_err_stage := 'Opening resources_for_proj_level_cur';
3074: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3075: END IF;
3076:
3069:
3070: --Fetch and insert resource level records into pa_fp_elements.
3071:
3072: IF p_pa_debug_mode = 'Y' THEN
3073: pa_debug.g_err_stage := 'Opening resources_for_proj_level_cur';
3074: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3075: END IF;
3076:
3077: OPEN resources_for_proj_level_cur(p_from_version_id);
3070: --Fetch and insert resource level records into pa_fp_elements.
3071:
3072: IF p_pa_debug_mode = 'Y' THEN
3073: pa_debug.g_err_stage := 'Opening resources_for_proj_level_cur';
3074: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3075: END IF;
3076:
3077: OPEN resources_for_proj_level_cur(p_from_version_id);
3078: LOOP
3111: END IF;
3112: -- If there are no mixed resoruce planning level records insert elements
3113:
3114: IF NVL(l_task_id_tbl.last,0) >= 1 THEN
3115: pa_debug.g_err_stage := 'Calling call_insert_bulk_rows_elements';
3116: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3117: Call_Insert_Bulk_Rows_Elements;
3118: END IF;
3119:
3112: -- If there are no mixed resoruce planning level records insert elements
3113:
3114: IF NVL(l_task_id_tbl.last,0) >= 1 THEN
3115: pa_debug.g_err_stage := 'Calling call_insert_bulk_rows_elements';
3116: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3117: Call_Insert_Bulk_Rows_Elements;
3118: END IF;
3119:
3120: EXIT WHEN NVL(l_task_id_tbl.last,0) < l_plsql_max_array_size;
3120: EXIT WHEN NVL(l_task_id_tbl.last,0) < l_plsql_max_array_size;
3121: END LOOP;
3122: CLOSE resources_for_proj_level_cur;
3123:
3124: IF p_pa_debug_mode = 'Y' THEN
3125: pa_debug.g_err_stage := 'Closed resources_for_proj_level_cur';
3126: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3127: END IF;
3128:
3121: END LOOP;
3122: CLOSE resources_for_proj_level_cur;
3123:
3124: IF p_pa_debug_mode = 'Y' THEN
3125: pa_debug.g_err_stage := 'Closed resources_for_proj_level_cur';
3126: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3127: END IF;
3128:
3129: END IF;
3122: CLOSE resources_for_proj_level_cur;
3123:
3124: IF p_pa_debug_mode = 'Y' THEN
3125: pa_debug.g_err_stage := 'Closed resources_for_proj_level_cur';
3126: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3127: END IF;
3128:
3129: END IF;
3130:
3134:
3135: --CASE :- task level planning and categorised resource list
3136: --Fetch and insert resource level records into pa_fp_elements.
3137:
3138: IF p_pa_debug_mode = 'Y' THEN
3139: pa_debug.g_err_stage := 'Opening resources_for_task_level_cur';
3140: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3141: END IF;
3142:
3135: --CASE :- task level planning and categorised resource list
3136: --Fetch and insert resource level records into pa_fp_elements.
3137:
3138: IF p_pa_debug_mode = 'Y' THEN
3139: pa_debug.g_err_stage := 'Opening resources_for_task_level_cur';
3140: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3141: END IF;
3142:
3143: OPEN resources_for_task_level_cur(p_from_version_id);
3136: --Fetch and insert resource level records into pa_fp_elements.
3137:
3138: IF p_pa_debug_mode = 'Y' THEN
3139: pa_debug.g_err_stage := 'Opening resources_for_task_level_cur';
3140: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3141: END IF;
3142:
3143: OPEN resources_for_task_level_cur(p_from_version_id);
3144: LOOP
3163: l_prev_task_id IS NULL OR
3164: l_prev_task_id <> l_task_id_tbl(i)
3165: THEN
3166:
3167: IF p_pa_debug_mode = 'Y' THEN
3168: pa_debug.g_err_stage := 'previous task = '||l_prev_task_id;
3169: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3170: END IF;
3171:
3164: l_prev_task_id <> l_task_id_tbl(i)
3165: THEN
3166:
3167: IF p_pa_debug_mode = 'Y' THEN
3168: pa_debug.g_err_stage := 'previous task = '||l_prev_task_id;
3169: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3170: END IF;
3171:
3172: -- we are at the first record fetched or the task has changed
3165: THEN
3166:
3167: IF p_pa_debug_mode = 'Y' THEN
3168: pa_debug.g_err_stage := 'previous task = '||l_prev_task_id;
3169: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3170: END IF;
3171:
3172: -- we are at the first record fetched or the task has changed
3173: -- So initialise l_prev_res_level, l_prev_task_id with the
3194: EXIT WHEN NVL(l_task_id_tbl.last,0) < l_plsql_max_array_size;
3195: END LOOP;
3196: CLOSE resources_for_task_level_cur;
3197:
3198: IF p_pa_debug_mode = 'Y' THEN
3199: pa_debug.g_err_stage := 'Closed resources_for_task_level_cur';
3200: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3201: END IF;
3202: END IF;
3195: END LOOP;
3196: CLOSE resources_for_task_level_cur;
3197:
3198: IF p_pa_debug_mode = 'Y' THEN
3199: pa_debug.g_err_stage := 'Closed resources_for_task_level_cur';
3200: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3201: END IF;
3202: END IF;
3203:
3196: CLOSE resources_for_task_level_cur;
3197:
3198: IF p_pa_debug_mode = 'Y' THEN
3199: pa_debug.g_err_stage := 'Closed resources_for_task_level_cur';
3200: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3201: END IF;
3202: END IF;
3203:
3204: --Fetch and insert task level records into pa_fp_elements
3202: END IF;
3203:
3204: --Fetch and insert task level records into pa_fp_elements
3205:
3206: IF p_pa_debug_mode = 'Y' THEN
3207: pa_debug.g_err_stage := 'Opening task_level_elements_cur';
3208: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3209: END IF;
3210:
3203:
3204: --Fetch and insert task level records into pa_fp_elements
3205:
3206: IF p_pa_debug_mode = 'Y' THEN
3207: pa_debug.g_err_stage := 'Opening task_level_elements_cur';
3208: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3209: END IF;
3210:
3211: OPEN task_level_elements_cur(p_from_version_id);
3204: --Fetch and insert task level records into pa_fp_elements
3205:
3206: IF p_pa_debug_mode = 'Y' THEN
3207: pa_debug.g_err_stage := 'Opening task_level_elements_cur';
3208: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3209: END IF;
3210:
3211: OPEN task_level_elements_cur(p_from_version_id);
3212: LOOP
3230: CLOSE task_level_elements_cur;
3231:
3232: --Fetch and insert top task level records if they aren't already inserted.
3233:
3234: IF p_pa_debug_mode = 'Y' THEN
3235: pa_debug.g_err_stage := 'Closed task_level_elements_cur';
3236: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3237: pa_debug.g_err_stage := 'Opening top_task_level_elements_cur';
3238: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3231:
3232: --Fetch and insert top task level records if they aren't already inserted.
3233:
3234: IF p_pa_debug_mode = 'Y' THEN
3235: pa_debug.g_err_stage := 'Closed task_level_elements_cur';
3236: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3237: pa_debug.g_err_stage := 'Opening top_task_level_elements_cur';
3238: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3239: END IF;
3232: --Fetch and insert top task level records if they aren't already inserted.
3233:
3234: IF p_pa_debug_mode = 'Y' THEN
3235: pa_debug.g_err_stage := 'Closed task_level_elements_cur';
3236: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3237: pa_debug.g_err_stage := 'Opening top_task_level_elements_cur';
3238: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3239: END IF;
3240:
3233:
3234: IF p_pa_debug_mode = 'Y' THEN
3235: pa_debug.g_err_stage := 'Closed task_level_elements_cur';
3236: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3237: pa_debug.g_err_stage := 'Opening top_task_level_elements_cur';
3238: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3239: END IF;
3240:
3241: OPEN top_task_level_elements_cur(p_proj_fp_options_id);
3234: IF p_pa_debug_mode = 'Y' THEN
3235: pa_debug.g_err_stage := 'Closed task_level_elements_cur';
3236: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3237: pa_debug.g_err_stage := 'Opening top_task_level_elements_cur';
3238: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3239: END IF;
3240:
3241: OPEN top_task_level_elements_cur(p_proj_fp_options_id);
3242: LOOP
3258: EXIT WHEN NVL(l_task_id_tbl.last,0) < l_plsql_max_array_size;
3259: END LOOP;
3260: CLOSE top_task_level_elements_cur;
3261:
3262: IF p_pa_debug_mode = 'Y' THEN
3263: pa_debug.g_err_stage := 'Closed top_task_level_elements_cur';
3264: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3265: END IF;
3266: END IF;
3259: END LOOP;
3260: CLOSE top_task_level_elements_cur;
3261:
3262: IF p_pa_debug_mode = 'Y' THEN
3263: pa_debug.g_err_stage := 'Closed top_task_level_elements_cur';
3264: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3265: END IF;
3266: END IF;
3267: IF p_pa_debug_mode = 'Y' THEN
3260: CLOSE top_task_level_elements_cur;
3261:
3262: IF p_pa_debug_mode = 'Y' THEN
3263: pa_debug.g_err_stage := 'Closed top_task_level_elements_cur';
3264: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3265: END IF;
3266: END IF;
3267: IF p_pa_debug_mode = 'Y' THEN
3268: pa_debug.g_err_stage := 'Exiting Create_elements_from_version';
3263: pa_debug.g_err_stage := 'Closed top_task_level_elements_cur';
3264: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3265: END IF;
3266: END IF;
3267: IF p_pa_debug_mode = 'Y' THEN
3268: pa_debug.g_err_stage := 'Exiting Create_elements_from_version';
3269: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3270: END IF;
3271: pa_debug.reset_err_stack;
3264: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3265: END IF;
3266: END IF;
3267: IF p_pa_debug_mode = 'Y' THEN
3268: pa_debug.g_err_stage := 'Exiting Create_elements_from_version';
3269: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3270: END IF;
3271: pa_debug.reset_err_stack;
3272: EXCEPTION
3265: END IF;
3266: END IF;
3267: IF p_pa_debug_mode = 'Y' THEN
3268: pa_debug.g_err_stage := 'Exiting Create_elements_from_version';
3269: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3270: END IF;
3271: pa_debug.reset_err_stack;
3272: EXCEPTION
3273:
3267: IF p_pa_debug_mode = 'Y' THEN
3268: pa_debug.g_err_stage := 'Exiting Create_elements_from_version';
3269: pa_debug.write(l_module_name,pa_debug.g_err_stage,3);
3270: END IF;
3271: pa_debug.reset_err_stack;
3272: EXCEPTION
3273:
3274: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
3275:
3286: x_msg_count := l_msg_count;
3287: ELSE
3288: x_msg_count := l_msg_count;
3289: END IF;
3290: IF p_pa_debug_mode = 'Y' THEN
3291: pa_debug.g_err_stage:='Invalid Arguments Passed';
3292: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3293: END IF;
3294: x_return_status:= FND_API.G_RET_STS_ERROR;
3287: ELSE
3288: x_msg_count := l_msg_count;
3289: END IF;
3290: IF p_pa_debug_mode = 'Y' THEN
3291: pa_debug.g_err_stage:='Invalid Arguments Passed';
3292: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3293: END IF;
3294: x_return_status:= FND_API.G_RET_STS_ERROR;
3295: pa_debug.reset_err_stack;
3288: x_msg_count := l_msg_count;
3289: END IF;
3290: IF p_pa_debug_mode = 'Y' THEN
3291: pa_debug.g_err_stage:='Invalid Arguments Passed';
3292: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3293: END IF;
3294: x_return_status:= FND_API.G_RET_STS_ERROR;
3295: pa_debug.reset_err_stack;
3296: RAISE;
3291: pa_debug.g_err_stage:='Invalid Arguments Passed';
3292: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3293: END IF;
3294: x_return_status:= FND_API.G_RET_STS_ERROR;
3295: pa_debug.reset_err_stack;
3296: RAISE;
3297:
3298: WHEN Mixed_Res_Plan_Level_Exc THEN
3299:
3305: END IF;
3306:
3307: x_mixed_resource_planned_flag := 'Y';
3308: x_return_status:= FND_API.G_RET_STS_ERROR;
3309: IF p_pa_debug_mode = 'Y' THEN
3310: pa_debug.g_err_stage:='Budget_Version '||p_from_version_id ||' has mixed planning level';
3311: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3312: END IF;
3313: pa_debug.reset_err_stack;
3306:
3307: x_mixed_resource_planned_flag := 'Y';
3308: x_return_status:= FND_API.G_RET_STS_ERROR;
3309: IF p_pa_debug_mode = 'Y' THEN
3310: pa_debug.g_err_stage:='Budget_Version '||p_from_version_id ||' has mixed planning level';
3311: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3312: END IF;
3313: pa_debug.reset_err_stack;
3314: RETURN;
3307: x_mixed_resource_planned_flag := 'Y';
3308: x_return_status:= FND_API.G_RET_STS_ERROR;
3309: IF p_pa_debug_mode = 'Y' THEN
3310: pa_debug.g_err_stage:='Budget_Version '||p_from_version_id ||' has mixed planning level';
3311: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3312: END IF;
3313: pa_debug.reset_err_stack;
3314: RETURN;
3315:
3309: IF p_pa_debug_mode = 'Y' THEN
3310: pa_debug.g_err_stage:='Budget_Version '||p_from_version_id ||' has mixed planning level';
3311: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3312: END IF;
3313: pa_debug.reset_err_stack;
3314: RETURN;
3315:
3316: WHEN Others THEN
3317:
3332: x_msg_count := 1;
3333: x_msg_data := SQLERRM;
3334: FND_MSG_PUB.add_exc_msg( p_pkg_name=> 'PA_FP_UPGRADE_PKG'
3335: ,p_procedure_name => 'Create_elements_from_version');
3336: IF p_pa_debug_mode = 'Y' THEN
3337: pa_debug.g_err_stage:='Unexpected Error'||SQLERRM;
3338: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3339: END IF;
3340: pa_debug.reset_err_stack;
3333: x_msg_data := SQLERRM;
3334: FND_MSG_PUB.add_exc_msg( p_pkg_name=> 'PA_FP_UPGRADE_PKG'
3335: ,p_procedure_name => 'Create_elements_from_version');
3336: IF p_pa_debug_mode = 'Y' THEN
3337: pa_debug.g_err_stage:='Unexpected Error'||SQLERRM;
3338: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3339: END IF;
3340: pa_debug.reset_err_stack;
3341: RAISE;
3334: FND_MSG_PUB.add_exc_msg( p_pkg_name=> 'PA_FP_UPGRADE_PKG'
3335: ,p_procedure_name => 'Create_elements_from_version');
3336: IF p_pa_debug_mode = 'Y' THEN
3337: pa_debug.g_err_stage:='Unexpected Error'||SQLERRM;
3338: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3339: END IF;
3340: pa_debug.reset_err_stack;
3341: RAISE;
3342: END Create_elements_from_version;
3336: IF p_pa_debug_mode = 'Y' THEN
3337: pa_debug.g_err_stage:='Unexpected Error'||SQLERRM;
3338: pa_debug.write(l_module_name,pa_debug.g_err_stage,5);
3339: END IF;
3340: pa_debug.reset_err_stack;
3341: RAISE;
3342: END Create_elements_from_version;
3343:
3344: /*==================================================================================================
3386: l_dummy_task_id_tbl pa_fp_elements_pub.l_task_id_tbl_typ;
3387:
3388: BEGIN
3389:
3390: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.refresh_res_list_changes');
3391: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
3392: l_debug_mode := NVL(l_debug_mode, 'Y');
3393: IF P_PA_DEBUG_MODE = 'Y' THEN
3394: pa_debug.set_process('refresh_res_list_changes: ' || 'PLSQL','LOG',l_debug_mode);
3387:
3388: BEGIN
3389:
3390: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.refresh_res_list_changes');
3391: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
3392: l_debug_mode := NVL(l_debug_mode, 'Y');
3393: IF P_PA_DEBUG_MODE = 'Y' THEN
3394: pa_debug.set_process('refresh_res_list_changes: ' || 'PLSQL','LOG',l_debug_mode);
3395: END IF;
3389:
3390: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.refresh_res_list_changes');
3391: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
3392: l_debug_mode := NVL(l_debug_mode, 'Y');
3393: IF P_PA_DEBUG_MODE = 'Y' THEN
3394: pa_debug.set_process('refresh_res_list_changes: ' || 'PLSQL','LOG',l_debug_mode);
3395: END IF;
3396:
3397: x_return_status := FND_API.G_RET_STS_SUCCESS;
3390: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.refresh_res_list_changes');
3391: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
3392: l_debug_mode := NVL(l_debug_mode, 'Y');
3393: IF P_PA_DEBUG_MODE = 'Y' THEN
3394: pa_debug.set_process('refresh_res_list_changes: ' || 'PLSQL','LOG',l_debug_mode);
3395: END IF;
3396:
3397: x_return_status := FND_API.G_RET_STS_SUCCESS;
3398:
3397: x_return_status := FND_API.G_RET_STS_SUCCESS;
3398:
3399: IF (p_proj_fp_options_id IS NULL) or (p_element_type IS NULL) THEN
3400:
3401: IF P_PA_DEBUG_MODE = 'Y' THEN
3402: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Proj FP Options ID is .'
3403: || p_proj_fp_options_id ||': Err- Element Type is .' || p_element_type;
3404: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3405: END IF;
3398:
3399: IF (p_proj_fp_options_id IS NULL) or (p_element_type IS NULL) THEN
3400:
3401: IF P_PA_DEBUG_MODE = 'Y' THEN
3402: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Proj FP Options ID is .'
3403: || p_proj_fp_options_id ||': Err- Element Type is .' || p_element_type;
3404: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3405: END IF;
3406:
3400:
3401: IF P_PA_DEBUG_MODE = 'Y' THEN
3402: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Proj FP Options ID is .'
3403: || p_proj_fp_options_id ||': Err- Element Type is .' || p_element_type;
3404: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3405: END IF;
3406:
3407: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
3408: p_msg_name => 'PA_FP_INV_PARAM_PASSED' );
3408: p_msg_name => 'PA_FP_INV_PARAM_PASSED' );
3409: x_return_status := FND_API.G_RET_STS_ERROR;
3410: ELSE
3411:
3412: IF P_PA_DEBUG_MODE = 'Y' THEN
3413: pa_debug.g_err_stage := TO_CHAR(l_Stage)||'Input parameters are valid ';
3414: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3415: END IF;
3416:
3409: x_return_status := FND_API.G_RET_STS_ERROR;
3410: ELSE
3411:
3412: IF P_PA_DEBUG_MODE = 'Y' THEN
3413: pa_debug.g_err_stage := TO_CHAR(l_Stage)||'Input parameters are valid ';
3414: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3415: END IF;
3416:
3417: END IF;
3410: ELSE
3411:
3412: IF P_PA_DEBUG_MODE = 'Y' THEN
3413: pa_debug.g_err_stage := TO_CHAR(l_Stage)||'Input parameters are valid ';
3414: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3415: END IF;
3416:
3417: END IF;
3418:
3425:
3426: /* Delete the records from the table PA_FP_Elements based on the Element_Type and
3427: for Element level RESOURCE. */
3428:
3429: pa_debug.g_err_stage := 'Deleting Elements from PA_FP_Elements';
3430: IF P_PA_DEBUG_MODE = 'Y' THEN
3431: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3432: END IF;
3433:
3426: /* Delete the records from the table PA_FP_Elements based on the Element_Type and
3427: for Element level RESOURCE. */
3428:
3429: pa_debug.g_err_stage := 'Deleting Elements from PA_FP_Elements';
3430: IF P_PA_DEBUG_MODE = 'Y' THEN
3431: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3432: END IF;
3433:
3434: delete_elements(p_proj_fp_options_id => p_proj_fp_options_id
3427: for Element level RESOURCE. */
3428:
3429: pa_debug.g_err_stage := 'Deleting Elements from PA_FP_Elements';
3430: IF P_PA_DEBUG_MODE = 'Y' THEN
3431: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3432: END IF;
3433:
3434: delete_elements(p_proj_fp_options_id => p_proj_fp_options_id
3435: ,p_element_type => p_element_type
3446: p_element_type =PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_BOTH) THEN
3447:
3448:
3449: IF (p_cost_resource_list_id IS NULL) THEN
3450: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Cost Resource List Id is NULL.';
3451: IF P_PA_DEBUG_MODE = 'Y' THEN
3452: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3453: END IF;
3454:
3447:
3448:
3449: IF (p_cost_resource_list_id IS NULL) THEN
3450: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Cost Resource List Id is NULL.';
3451: IF P_PA_DEBUG_MODE = 'Y' THEN
3452: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3453: END IF;
3454:
3455: x_return_status := FND_API.G_RET_STS_ERROR;
3448:
3449: IF (p_cost_resource_list_id IS NULL) THEN
3450: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Cost Resource List Id is NULL.';
3451: IF P_PA_DEBUG_MODE = 'Y' THEN
3452: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3453: END IF;
3454:
3455: x_return_status := FND_API.G_RET_STS_ERROR;
3456: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
3457: p_msg_name => 'PA_FP_INV_PARAM_PASSED' );
3458: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
3459: END IF;
3460:
3461: IF P_PA_DEBUG_MODE = 'Y' THEN
3462: pa_debug.g_err_stage := 'Element Type is Cost ';
3463: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3464: END IF;
3465:
3458: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
3459: END IF;
3460:
3461: IF P_PA_DEBUG_MODE = 'Y' THEN
3462: pa_debug.g_err_stage := 'Element Type is Cost ';
3463: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3464: END IF;
3465:
3466: IF p_select_cost_res_auto_flag = 'Y'
3459: END IF;
3460:
3461: IF P_PA_DEBUG_MODE = 'Y' THEN
3462: pa_debug.g_err_stage := 'Element Type is Cost ';
3463: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3464: END IF;
3465:
3466: IF p_select_cost_res_auto_flag = 'Y'
3467: THEN /* Bug 2920954 */
3468: /* p_cost_res_planning_level should be either 'R'/'G' */
3469:
3470: IF p_cost_res_planning_level NOT IN ('R','G')
3471: THEN
3472: IF P_PA_DEBUG_MODE = 'Y' THEN
3473: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Cost Auto Res Plan Level is Invalid';
3474: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3475: END IF;
3476:
3469:
3470: IF p_cost_res_planning_level NOT IN ('R','G')
3471: THEN
3472: IF P_PA_DEBUG_MODE = 'Y' THEN
3473: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Cost Auto Res Plan Level is Invalid';
3474: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3475: END IF;
3476:
3477: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
3470: IF p_cost_res_planning_level NOT IN ('R','G')
3471: THEN
3472: IF P_PA_DEBUG_MODE = 'Y' THEN
3473: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Cost Auto Res Plan Level is Invalid';
3474: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3475: END IF;
3476:
3477: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
3478: p_msg_name => 'PA_FP_INV_PARAM_PASSED' );
3514: l_res_planning_level := NULL;
3515: END IF;
3516:
3517:
3518: pa_debug.g_err_stage := 'Resource Planning Level is '||l_res_planning_level;
3519: IF P_PA_DEBUG_MODE = 'Y' THEN
3520: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3521: END IF;
3522:
3515: END IF;
3516:
3517:
3518: pa_debug.g_err_stage := 'Resource Planning Level is '||l_res_planning_level;
3519: IF P_PA_DEBUG_MODE = 'Y' THEN
3520: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3521: END IF;
3522:
3523: /*Added the condition resources_planned_for_task = 'N' for bug 2676456 so that
3516:
3517:
3518: pa_debug.g_err_stage := 'Resource Planning Level is '||l_res_planning_level;
3519: IF P_PA_DEBUG_MODE = 'Y' THEN
3520: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3521: END IF;
3522:
3523: /*Added the condition resources_planned_for_task = 'N' for bug 2676456 so that
3524: the resource plannned for task column in planning elements page shows correct value
3539: IF (p_element_type =PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_REVENUE OR
3540: p_element_type =PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_BOTH) THEN
3541:
3542: IF (p_rev_resource_list_id IS NULL) THEN
3543: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Revenue Resource List Id is NULL.';
3544: IF P_PA_DEBUG_MODE = 'Y' THEN
3545: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3546: END IF;
3547:
3540: p_element_type =PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_BOTH) THEN
3541:
3542: IF (p_rev_resource_list_id IS NULL) THEN
3543: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Revenue Resource List Id is NULL.';
3544: IF P_PA_DEBUG_MODE = 'Y' THEN
3545: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3546: END IF;
3547:
3548: x_return_status := FND_API.G_RET_STS_ERROR;
3541:
3542: IF (p_rev_resource_list_id IS NULL) THEN
3543: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Revenue Resource List Id is NULL.';
3544: IF P_PA_DEBUG_MODE = 'Y' THEN
3545: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3546: END IF;
3547:
3548: x_return_status := FND_API.G_RET_STS_ERROR;
3549: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
3550: p_msg_name => 'PA_FP_INV_PARAM_PASSED' );
3551: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
3552: END IF;
3553:
3554: pa_debug.g_err_stage := 'Element Type is REVENUE ';
3555: IF P_PA_DEBUG_MODE = 'Y' THEN
3556: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3557: END IF;
3558:
3551: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
3552: END IF;
3553:
3554: pa_debug.g_err_stage := 'Element Type is REVENUE ';
3555: IF P_PA_DEBUG_MODE = 'Y' THEN
3556: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3557: END IF;
3558:
3559: IF p_select_rev_res_auto_flag = 'Y'
3552: END IF;
3553:
3554: pa_debug.g_err_stage := 'Element Type is REVENUE ';
3555: IF P_PA_DEBUG_MODE = 'Y' THEN
3556: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3557: END IF;
3558:
3559: IF p_select_rev_res_auto_flag = 'Y'
3560: THEN /* Bug 2920954 */
3561: /* p_revenue_res_planning_level should be either 'R'/'G' */
3562:
3563: IF p_revenue_res_planning_level NOT IN ('R','G')
3564: THEN
3565: IF P_PA_DEBUG_MODE = 'Y' THEN
3566: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Revenue Auto Res Plan Level is Invalid';
3567: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3568: END IF;
3569:
3562:
3563: IF p_revenue_res_planning_level NOT IN ('R','G')
3564: THEN
3565: IF P_PA_DEBUG_MODE = 'Y' THEN
3566: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Revenue Auto Res Plan Level is Invalid';
3567: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3568: END IF;
3569:
3570: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
3563: IF p_revenue_res_planning_level NOT IN ('R','G')
3564: THEN
3565: IF P_PA_DEBUG_MODE = 'Y' THEN
3566: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- Revenue Auto Res Plan Level is Invalid';
3567: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3568: END IF;
3569:
3570: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
3571: p_msg_name => 'PA_FP_INV_PARAM_PASSED' );
3605: ELSE
3606: l_res_planning_level := NULL;
3607: END IF;
3608:
3609: pa_debug.g_err_stage := 'Resource Planning Level is '||l_res_planning_level;
3610: IF P_PA_DEBUG_MODE = 'Y' THEN
3611: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3612: END IF;
3613:
3606: l_res_planning_level := NULL;
3607: END IF;
3608:
3609: pa_debug.g_err_stage := 'Resource Planning Level is '||l_res_planning_level;
3610: IF P_PA_DEBUG_MODE = 'Y' THEN
3611: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3612: END IF;
3613:
3614: UPDATE pa_fp_elements
3607: END IF;
3608:
3609: pa_debug.g_err_stage := 'Resource Planning Level is '||l_res_planning_level;
3610: IF P_PA_DEBUG_MODE = 'Y' THEN
3611: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3612: END IF;
3613:
3614: UPDATE pa_fp_elements
3615: SET resource_planning_level = l_res_planning_level
3626:
3627: IF (p_element_type =PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_ALL ) THEN
3628:
3629: IF (p_all_resource_list_id IS NULL) THEN
3630: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- All Resource List Id is NULL.';
3631: IF P_PA_DEBUG_MODE = 'Y' THEN
3632: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3633: END IF;
3634:
3627: IF (p_element_type =PA_FP_CONSTANTS_PKG.G_ELEMENT_TYPE_ALL ) THEN
3628:
3629: IF (p_all_resource_list_id IS NULL) THEN
3630: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- All Resource List Id is NULL.';
3631: IF P_PA_DEBUG_MODE = 'Y' THEN
3632: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3633: END IF;
3634:
3635: x_return_status := FND_API.G_RET_STS_ERROR;
3628:
3629: IF (p_all_resource_list_id IS NULL) THEN
3630: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- All Resource List Id is NULL.';
3631: IF P_PA_DEBUG_MODE = 'Y' THEN
3632: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3633: END IF;
3634:
3635: x_return_status := FND_API.G_RET_STS_ERROR;
3636: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
3637: p_msg_name => 'PA_FP_INV_PARAM_PASSED' );
3638: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
3639: END IF;
3640:
3641: pa_debug.g_err_stage := 'Element Type is ALL ';
3642: IF P_PA_DEBUG_MODE = 'Y' THEN
3643: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3644: END IF;
3645:
3638: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
3639: END IF;
3640:
3641: pa_debug.g_err_stage := 'Element Type is ALL ';
3642: IF P_PA_DEBUG_MODE = 'Y' THEN
3643: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3644: END IF;
3645:
3646: IF p_select_all_res_auto_flag = 'Y'
3639: END IF;
3640:
3641: pa_debug.g_err_stage := 'Element Type is ALL ';
3642: IF P_PA_DEBUG_MODE = 'Y' THEN
3643: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3644: END IF;
3645:
3646: IF p_select_all_res_auto_flag = 'Y'
3647: THEN /* Bug 2920954 */
3648: /* p_all_res_planning_level should be either 'R'/'G' */
3649:
3650: IF p_all_res_planning_level NOT IN ('R','G')
3651: THEN
3652: IF P_PA_DEBUG_MODE = 'Y' THEN
3653: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- All Auto Res Plan Level is Invalid';
3654: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3655: END IF;
3656:
3649:
3650: IF p_all_res_planning_level NOT IN ('R','G')
3651: THEN
3652: IF P_PA_DEBUG_MODE = 'Y' THEN
3653: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- All Auto Res Plan Level is Invalid';
3654: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3655: END IF;
3656:
3657: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
3650: IF p_all_res_planning_level NOT IN ('R','G')
3651: THEN
3652: IF P_PA_DEBUG_MODE = 'Y' THEN
3653: pa_debug.g_err_stage := TO_CHAR(l_Stage)||': Err- All Auto Res Plan Level is Invalid';
3654: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,5);
3655: END IF;
3656:
3657: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
3658: p_msg_name => 'PA_FP_INV_PARAM_PASSED' );
3692: ELSE
3693: l_res_planning_level := NULL;
3694: END IF;
3695:
3696: pa_debug.g_err_stage := 'Resource Planning Level is '||l_res_planning_level;
3697: IF P_PA_DEBUG_MODE = 'Y' THEN
3698: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3699: END IF;
3700:
3693: l_res_planning_level := NULL;
3694: END IF;
3695:
3696: pa_debug.g_err_stage := 'Resource Planning Level is '||l_res_planning_level;
3697: IF P_PA_DEBUG_MODE = 'Y' THEN
3698: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3699: END IF;
3700:
3701: UPDATE pa_fp_elements
3694: END IF;
3695:
3696: pa_debug.g_err_stage := 'Resource Planning Level is '||l_res_planning_level;
3697: IF P_PA_DEBUG_MODE = 'Y' THEN
3698: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.g_err_stage,3);
3699: END IF;
3700:
3701: UPDATE pa_fp_elements
3702: SET resource_planning_level = l_res_planning_level
3709: AND element_type = p_element_type;
3710: END IF; /* Bug 2920954 */
3711:
3712: END IF;
3713: pa_debug.reset_err_stack;
3714:
3715: EXCEPTION
3716: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
3717: l_msg_count := FND_MSG_PUB.count_msg;
3727: x_msg_count := l_msg_count;
3728: ELSE
3729: x_msg_count := l_msg_count;
3730: END IF;
3731: pa_debug.reset_err_stack;
3732: RETURN;
3733:
3734: WHEN OTHERS THEN
3735: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3736: x_msg_count := 1;
3737: x_msg_data := SQLERRM;
3738: FND_MSG_PUB.add_exc_msg
3739: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.refresh_res_list_changes'
3740: ,p_procedure_name => pa_debug.G_Err_Stack );
3741: IF P_PA_DEBUG_MODE = 'Y' THEN
3742: pa_debug.write('refresh_res_list_changes: ' || l_module_name,SQLERRM,4);
3743: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.G_Err_Stack,4);
3744: END IF;
3737: x_msg_data := SQLERRM;
3738: FND_MSG_PUB.add_exc_msg
3739: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.refresh_res_list_changes'
3740: ,p_procedure_name => pa_debug.G_Err_Stack );
3741: IF P_PA_DEBUG_MODE = 'Y' THEN
3742: pa_debug.write('refresh_res_list_changes: ' || l_module_name,SQLERRM,4);
3743: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.G_Err_Stack,4);
3744: END IF;
3745: pa_debug.reset_err_stack;
3738: FND_MSG_PUB.add_exc_msg
3739: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.refresh_res_list_changes'
3740: ,p_procedure_name => pa_debug.G_Err_Stack );
3741: IF P_PA_DEBUG_MODE = 'Y' THEN
3742: pa_debug.write('refresh_res_list_changes: ' || l_module_name,SQLERRM,4);
3743: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.G_Err_Stack,4);
3744: END IF;
3745: pa_debug.reset_err_stack;
3746:
3739: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB.refresh_res_list_changes'
3740: ,p_procedure_name => pa_debug.G_Err_Stack );
3741: IF P_PA_DEBUG_MODE = 'Y' THEN
3742: pa_debug.write('refresh_res_list_changes: ' || l_module_name,SQLERRM,4);
3743: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.G_Err_Stack,4);
3744: END IF;
3745: pa_debug.reset_err_stack;
3746:
3747: raise FND_API.G_EXC_UNEXPECTED_ERROR;
3741: IF P_PA_DEBUG_MODE = 'Y' THEN
3742: pa_debug.write('refresh_res_list_changes: ' || l_module_name,SQLERRM,4);
3743: pa_debug.write('refresh_res_list_changes: ' || l_module_name,pa_debug.G_Err_Stack,4);
3744: END IF;
3745: pa_debug.reset_err_stack;
3746:
3747: raise FND_API.G_EXC_UNEXPECTED_ERROR;
3748: END refresh_res_list_changes;
3749:
3849: BEGIN
3850:
3851: x_msg_count := 0;
3852: x_return_status := FND_API.G_RET_STS_SUCCESS;
3853: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.CREATE_ASSGMT_FROM_ROLLUPTMP');
3854: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
3855: l_debug_mode := NVL(l_debug_mode, 'Y');
3856: IF P_PA_DEBUG_MODE = 'Y' THEN
3857: pa_debug.set_process('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || 'PLSQL','LOG',l_debug_mode);
3850:
3851: x_msg_count := 0;
3852: x_return_status := FND_API.G_RET_STS_SUCCESS;
3853: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.CREATE_ASSGMT_FROM_ROLLUPTMP');
3854: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
3855: l_debug_mode := NVL(l_debug_mode, 'Y');
3856: IF P_PA_DEBUG_MODE = 'Y' THEN
3857: pa_debug.set_process('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || 'PLSQL','LOG',l_debug_mode);
3858: END IF;
3852: x_return_status := FND_API.G_RET_STS_SUCCESS;
3853: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.CREATE_ASSGMT_FROM_ROLLUPTMP');
3854: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
3855: l_debug_mode := NVL(l_debug_mode, 'Y');
3856: IF P_PA_DEBUG_MODE = 'Y' THEN
3857: pa_debug.set_process('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || 'PLSQL','LOG',l_debug_mode);
3858: END IF;
3859:
3860: -- Check for business rules violations
3853: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.CREATE_ASSGMT_FROM_ROLLUPTMP');
3854: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
3855: l_debug_mode := NVL(l_debug_mode, 'Y');
3856: IF P_PA_DEBUG_MODE = 'Y' THEN
3857: pa_debug.set_process('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || 'PLSQL','LOG',l_debug_mode);
3858: END IF;
3859:
3860: -- Check for business rules violations
3861:
3858: END IF;
3859:
3860: -- Check for business rules violations
3861:
3862: pa_debug.g_err_stage:= 'Validating input parameters';
3863: IF P_PA_DEBUG_MODE = 'Y' THEN
3864: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3865: END IF;
3866:
3859:
3860: -- Check for business rules violations
3861:
3862: pa_debug.g_err_stage:= 'Validating input parameters';
3863: IF P_PA_DEBUG_MODE = 'Y' THEN
3864: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3865: END IF;
3866:
3867: --Validate plan version id
3860: -- Check for business rules violations
3861:
3862: pa_debug.g_err_stage:= 'Validating input parameters';
3863: IF P_PA_DEBUG_MODE = 'Y' THEN
3864: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3865: END IF;
3866:
3867: --Validate plan version id
3868:
3868:
3869: IF (p_fin_plan_version_id IS NULL)
3870: THEN
3871:
3872: pa_debug.g_err_stage:= 'fin_plan_version_id = '|| p_fin_plan_version_id;
3873: IF P_PA_DEBUG_MODE = 'Y' THEN
3874: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
3875: END IF;
3876:
3869: IF (p_fin_plan_version_id IS NULL)
3870: THEN
3871:
3872: pa_debug.g_err_stage:= 'fin_plan_version_id = '|| p_fin_plan_version_id;
3873: IF P_PA_DEBUG_MODE = 'Y' THEN
3874: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
3875: END IF;
3876:
3877: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
3870: THEN
3871:
3872: pa_debug.g_err_stage:= 'fin_plan_version_id = '|| p_fin_plan_version_id;
3873: IF P_PA_DEBUG_MODE = 'Y' THEN
3874: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
3875: END IF;
3876:
3877: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
3878: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
3879:
3880: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
3881: END IF;
3882:
3883: pa_debug.g_err_stage:= 'Obtain the relevant parameters for the version';
3884: IF P_PA_DEBUG_MODE = 'Y' THEN
3885: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3886: END IF;
3887:
3880: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
3881: END IF;
3882:
3883: pa_debug.g_err_stage:= 'Obtain the relevant parameters for the version';
3884: IF P_PA_DEBUG_MODE = 'Y' THEN
3885: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3886: END IF;
3887:
3888: BEGIN
3881: END IF;
3882:
3883: pa_debug.g_err_stage:= 'Obtain the relevant parameters for the version';
3884: IF P_PA_DEBUG_MODE = 'Y' THEN
3885: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3886: END IF;
3887:
3888: BEGIN
3889: select opt.project_id,
3899: where opt.fin_plan_version_id = pbv.budget_version_id
3900: and pbv.budget_version_id = p_fin_plan_version_id;
3901: EXCEPTION
3902: WHEN NO_DATA_FOUND THEN
3903: pa_debug.g_err_stage:= 'Could not get the details of the plan version option';
3904: IF P_PA_DEBUG_MODE = 'Y' THEN
3905: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3906: END IF;
3907: RAISE;
3900: and pbv.budget_version_id = p_fin_plan_version_id;
3901: EXCEPTION
3902: WHEN NO_DATA_FOUND THEN
3903: pa_debug.g_err_stage:= 'Could not get the details of the plan version option';
3904: IF P_PA_DEBUG_MODE = 'Y' THEN
3905: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3906: END IF;
3907: RAISE;
3908: END;
3901: EXCEPTION
3902: WHEN NO_DATA_FOUND THEN
3903: pa_debug.g_err_stage:= 'Could not get the details of the plan version option';
3904: IF P_PA_DEBUG_MODE = 'Y' THEN
3905: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3906: END IF;
3907: RAISE;
3908: END;
3909:
3906: END IF;
3907: RAISE;
3908: END;
3909:
3910: pa_debug.g_err_stage:= 'Create resource assignments - Bulk collect into the plsql tables';
3911: IF P_PA_DEBUG_MODE = 'Y' THEN
3912: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3913: END IF;
3914:
3907: RAISE;
3908: END;
3909:
3910: pa_debug.g_err_stage:= 'Create resource assignments - Bulk collect into the plsql tables';
3911: IF P_PA_DEBUG_MODE = 'Y' THEN
3912: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3913: END IF;
3914:
3915: /*Bug # 3622551 -- Get the value of l_parent_structure_version_id */
3908: END;
3909:
3910: pa_debug.g_err_stage:= 'Create resource assignments - Bulk collect into the plsql tables';
3911: IF P_PA_DEBUG_MODE = 'Y' THEN
3912: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3913: END IF;
3914:
3915: /*Bug # 3622551 -- Get the value of l_parent_structure_version_id */
3916: l_parent_structure_version_id := pa_project_structure_utils.get_fin_struc_ver_id(l_project_id);
3932: -- ,l_projfunc_revenue_tbl
3933: -- ,l_quantity_tbl
3934: LIMIT g_plsql_max_array_size;
3935:
3936: pa_debug.g_err_stage:= 'Create resource assignments - Call the API';
3937: IF P_PA_DEBUG_MODE = 'Y' THEN
3938: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3939: END IF;
3940:
3933: -- ,l_quantity_tbl
3934: LIMIT g_plsql_max_array_size;
3935:
3936: pa_debug.g_err_stage:= 'Create resource assignments - Call the API';
3937: IF P_PA_DEBUG_MODE = 'Y' THEN
3938: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3939: END IF;
3940:
3941: -- getting the context
3934: LIMIT g_plsql_max_array_size;
3935:
3936: pa_debug.g_err_stage:= 'Create resource assignments - Call the API';
3937: IF P_PA_DEBUG_MODE = 'Y' THEN
3938: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3939: END IF;
3940:
3941: -- getting the context
3942: OPEN get_context_csr ;
3978: where ra.budget_version_id = p_fin_plan_version_id
3979: and ra.task_id = rollup.system_reference1
3980: and ra.resource_list_member_id = system_reference2
3981: );
3982: pa_debug.g_err_stage:= 'No of records updated in rollup tmp-> ' || sql%rowcount;
3983: IF P_PA_DEBUG_MODE = 'Y' THEN
3984: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3985: END IF;
3986:
3979: and ra.task_id = rollup.system_reference1
3980: and ra.resource_list_member_id = system_reference2
3981: );
3982: pa_debug.g_err_stage:= 'No of records updated in rollup tmp-> ' || sql%rowcount;
3983: IF P_PA_DEBUG_MODE = 'Y' THEN
3984: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3985: END IF;
3986:
3987:
3980: and ra.resource_list_member_id = system_reference2
3981: );
3982: pa_debug.g_err_stage:= 'No of records updated in rollup tmp-> ' || sql%rowcount;
3983: IF P_PA_DEBUG_MODE = 'Y' THEN
3984: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
3985: END IF;
3986:
3987:
3988: EXCEPTION
4004: ELSE
4005: x_msg_count := l_msg_count;
4006: END IF;
4007:
4008: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
4009: IF P_PA_DEBUG_MODE = 'Y' THEN
4010: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4011: END IF;
4012: pa_debug.reset_err_stack;
4005: x_msg_count := l_msg_count;
4006: END IF;
4007:
4008: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
4009: IF P_PA_DEBUG_MODE = 'Y' THEN
4010: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4011: END IF;
4012: pa_debug.reset_err_stack;
4013: RAISE;
4006: END IF;
4007:
4008: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
4009: IF P_PA_DEBUG_MODE = 'Y' THEN
4010: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4011: END IF;
4012: pa_debug.reset_err_stack;
4013: RAISE;
4014:
4008: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
4009: IF P_PA_DEBUG_MODE = 'Y' THEN
4010: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4011: END IF;
4012: pa_debug.reset_err_stack;
4013: RAISE;
4014:
4015: WHEN others THEN
4016:
4018: x_msg_count := 1;
4019: x_msg_data := SQLERRM;
4020: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_FP_ELEMENTS_PUB'
4021: ,p_procedure_name => 'CREATE_ASSGMT_FROM_ROLLUPTMP');
4022: pa_debug.g_err_stage:= 'Unexpected Error'||SQLERRM;
4023: IF P_PA_DEBUG_MODE = 'Y' THEN
4024: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4025: END IF;
4026: pa_debug.reset_err_stack;
4019: x_msg_data := SQLERRM;
4020: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_FP_ELEMENTS_PUB'
4021: ,p_procedure_name => 'CREATE_ASSGMT_FROM_ROLLUPTMP');
4022: pa_debug.g_err_stage:= 'Unexpected Error'||SQLERRM;
4023: IF P_PA_DEBUG_MODE = 'Y' THEN
4024: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4025: END IF;
4026: pa_debug.reset_err_stack;
4027: RAISE;
4020: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_FP_ELEMENTS_PUB'
4021: ,p_procedure_name => 'CREATE_ASSGMT_FROM_ROLLUPTMP');
4022: pa_debug.g_err_stage:= 'Unexpected Error'||SQLERRM;
4023: IF P_PA_DEBUG_MODE = 'Y' THEN
4024: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4025: END IF;
4026: pa_debug.reset_err_stack;
4027: RAISE;
4028:
4022: pa_debug.g_err_stage:= 'Unexpected Error'||SQLERRM;
4023: IF P_PA_DEBUG_MODE = 'Y' THEN
4024: pa_debug.write('CREATE_ASSGMT_FROM_ROLLUPTMP: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4025: END IF;
4026: pa_debug.reset_err_stack;
4027: RAISE;
4028:
4029: END CREATE_ASSGMT_FROM_ROLLUPTMP;
4030:
4089: ,x_row_id => l_row_id
4090: ,x_return_status => l_return_status);
4091:
4092: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4093: pa_debug.g_err_stage:= 'Exception while inserting a row into pa_resource_assignments;';
4094: IF P_PA_DEBUG_MODE = 'Y' THEN
4095: pa_debug.write('Insert_Resource_Assignment: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4096: END IF;
4097: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4090: ,x_return_status => l_return_status);
4091:
4092: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4093: pa_debug.g_err_stage:= 'Exception while inserting a row into pa_resource_assignments;';
4094: IF P_PA_DEBUG_MODE = 'Y' THEN
4095: pa_debug.write('Insert_Resource_Assignment: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4096: END IF;
4097: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4098: END IF;
4091:
4092: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4093: pa_debug.g_err_stage:= 'Exception while inserting a row into pa_resource_assignments;';
4094: IF P_PA_DEBUG_MODE = 'Y' THEN
4095: pa_debug.write('Insert_Resource_Assignment: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4096: END IF;
4097: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4098: END IF;
4099: END Insert_Resource_Assignment;
4206: BEGIN
4207:
4208: x_msg_count := 0;
4209: x_return_status := FND_API.G_RET_STS_SUCCESS;
4210: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Create_CI_Resource_Assignments');
4211: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
4212: l_debug_mode := NVL(l_debug_mode, 'Y');
4213: IF P_PA_DEBUG_MODE = 'Y' THEN
4214: pa_debug.set_process('Create_CI_Resource_Assignments: ' || 'PLSQL','LOG',l_debug_mode);
4207:
4208: x_msg_count := 0;
4209: x_return_status := FND_API.G_RET_STS_SUCCESS;
4210: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Create_CI_Resource_Assignments');
4211: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
4212: l_debug_mode := NVL(l_debug_mode, 'Y');
4213: IF P_PA_DEBUG_MODE = 'Y' THEN
4214: pa_debug.set_process('Create_CI_Resource_Assignments: ' || 'PLSQL','LOG',l_debug_mode);
4215: END IF;
4209: x_return_status := FND_API.G_RET_STS_SUCCESS;
4210: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Create_CI_Resource_Assignments');
4211: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
4212: l_debug_mode := NVL(l_debug_mode, 'Y');
4213: IF P_PA_DEBUG_MODE = 'Y' THEN
4214: pa_debug.set_process('Create_CI_Resource_Assignments: ' || 'PLSQL','LOG',l_debug_mode);
4215: END IF;
4216:
4217: -- Check for business rules violations
4210: pa_debug.set_err_stack('PA_FP_ELEMENTS_PUB.Create_CI_Resource_Assignments');
4211: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
4212: l_debug_mode := NVL(l_debug_mode, 'Y');
4213: IF P_PA_DEBUG_MODE = 'Y' THEN
4214: pa_debug.set_process('Create_CI_Resource_Assignments: ' || 'PLSQL','LOG',l_debug_mode);
4215: END IF;
4216:
4217: -- Check for business rules violations
4218:
4215: END IF;
4216:
4217: -- Check for business rules violations
4218:
4219: IF P_PA_DEBUG_MODE = 'Y' THEN
4220: pa_debug.g_err_stage:= 'Validating input parameters';
4221: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4222: END IF;
4223:
4216:
4217: -- Check for business rules violations
4218:
4219: IF P_PA_DEBUG_MODE = 'Y' THEN
4220: pa_debug.g_err_stage:= 'Validating input parameters';
4221: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4222: END IF;
4223:
4224: --Check if plan version id is null
4217: -- Check for business rules violations
4218:
4219: IF P_PA_DEBUG_MODE = 'Y' THEN
4220: pa_debug.g_err_stage:= 'Validating input parameters';
4221: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4222: END IF;
4223:
4224: --Check if plan version id is null
4225:
4227: (p_budget_version_id IS NULL) OR
4228: (p_impacted_task_id IS NULL) OR
4229: (p_version_type IS NULL)
4230: THEN
4231: IF P_PA_DEBUG_MODE = 'Y' THEN
4232: pa_debug.g_err_stage:= 'p_project_id = '||p_project_id;
4233: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4234:
4235: pa_debug.g_err_stage:= 'p_budget_version_id = '||p_budget_version_id;
4228: (p_impacted_task_id IS NULL) OR
4229: (p_version_type IS NULL)
4230: THEN
4231: IF P_PA_DEBUG_MODE = 'Y' THEN
4232: pa_debug.g_err_stage:= 'p_project_id = '||p_project_id;
4233: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4234:
4235: pa_debug.g_err_stage:= 'p_budget_version_id = '||p_budget_version_id;
4236: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4229: (p_version_type IS NULL)
4230: THEN
4231: IF P_PA_DEBUG_MODE = 'Y' THEN
4232: pa_debug.g_err_stage:= 'p_project_id = '||p_project_id;
4233: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4234:
4235: pa_debug.g_err_stage:= 'p_budget_version_id = '||p_budget_version_id;
4236: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4237:
4231: IF P_PA_DEBUG_MODE = 'Y' THEN
4232: pa_debug.g_err_stage:= 'p_project_id = '||p_project_id;
4233: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4234:
4235: pa_debug.g_err_stage:= 'p_budget_version_id = '||p_budget_version_id;
4236: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4237:
4238: pa_debug.g_err_stage:= 'p_impacted_task_id = '||p_impacted_task_id;
4239: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4232: pa_debug.g_err_stage:= 'p_project_id = '||p_project_id;
4233: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4234:
4235: pa_debug.g_err_stage:= 'p_budget_version_id = '||p_budget_version_id;
4236: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4237:
4238: pa_debug.g_err_stage:= 'p_impacted_task_id = '||p_impacted_task_id;
4239: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4240:
4234:
4235: pa_debug.g_err_stage:= 'p_budget_version_id = '||p_budget_version_id;
4236: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4237:
4238: pa_debug.g_err_stage:= 'p_impacted_task_id = '||p_impacted_task_id;
4239: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4240:
4241: pa_debug.g_err_stage:= 'p_version_type = '||p_version_type;
4242: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4235: pa_debug.g_err_stage:= 'p_budget_version_id = '||p_budget_version_id;
4236: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4237:
4238: pa_debug.g_err_stage:= 'p_impacted_task_id = '||p_impacted_task_id;
4239: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4240:
4241: pa_debug.g_err_stage:= 'p_version_type = '||p_version_type;
4242: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4243: END IF;
4237:
4238: pa_debug.g_err_stage:= 'p_impacted_task_id = '||p_impacted_task_id;
4239: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4240:
4241: pa_debug.g_err_stage:= 'p_version_type = '||p_version_type;
4242: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4243: END IF;
4244:
4245: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
4238: pa_debug.g_err_stage:= 'p_impacted_task_id = '||p_impacted_task_id;
4239: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4240:
4241: pa_debug.g_err_stage:= 'p_version_type = '||p_version_type;
4242: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4243: END IF;
4244:
4245: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
4246: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
4256: FROM pa_budget_versions bv
4257: WHERE budget_version_id = p_budget_version_id;
4258: EXCEPTION
4259: WHEN OTHERS THEN
4260: pa_debug.g_err_stage:= 'Failed to fetch plan type and resource list for given budget version';
4261: IF P_PA_DEBUG_MODE = 'Y' THEN
4262: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4263: END IF;
4264: RAISE;
4257: WHERE budget_version_id = p_budget_version_id;
4258: EXCEPTION
4259: WHEN OTHERS THEN
4260: pa_debug.g_err_stage:= 'Failed to fetch plan type and resource list for given budget version';
4261: IF P_PA_DEBUG_MODE = 'Y' THEN
4262: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4263: END IF;
4264: RAISE;
4265: END;
4258: EXCEPTION
4259: WHEN OTHERS THEN
4260: pa_debug.g_err_stage:= 'Failed to fetch plan type and resource list for given budget version';
4261: IF P_PA_DEBUG_MODE = 'Y' THEN
4262: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4263: END IF;
4264: RAISE;
4265: END;
4266:
4290: */
4291:
4292: IF l_plan_version_planning_level = PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_PROJECT THEN
4293:
4294: pa_debug.g_err_stage := 'Planning level of the plan version is project ..';
4295: IF P_PA_DEBUG_MODE = 'Y' THEN
4296: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4297: END IF;
4298:
4291:
4292: IF l_plan_version_planning_level = PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_PROJECT THEN
4293:
4294: pa_debug.g_err_stage := 'Planning level of the plan version is project ..';
4295: IF P_PA_DEBUG_MODE = 'Y' THEN
4296: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4297: END IF;
4298:
4299: OPEN cur_elements_for_project;
4292: IF l_plan_version_planning_level = PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_PROJECT THEN
4293:
4294: pa_debug.g_err_stage := 'Planning level of the plan version is project ..';
4295: IF P_PA_DEBUG_MODE = 'Y' THEN
4296: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4297: END IF;
4298:
4299: OPEN cur_elements_for_project;
4300: FETCH cur_elements_for_project BULK COLLECT INTO
4310: CLOSE cur_elements_for_project;
4311:
4312: IF l_src_ra_id_tbl.count > 0 THEN
4313:
4314: IF P_PA_DEBUG_MODE = 'Y' THEN
4315: pa_debug.g_err_stage := 'Calling create_res_task_map';
4316: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4317: END IF;
4318:
4311:
4312: IF l_src_ra_id_tbl.count > 0 THEN
4313:
4314: IF P_PA_DEBUG_MODE = 'Y' THEN
4315: pa_debug.g_err_stage := 'Calling create_res_task_map';
4316: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4317: END IF;
4318:
4319: pa_fp_copy_from_pkg.create_res_task_maps(
4312: IF l_src_ra_id_tbl.count > 0 THEN
4313:
4314: IF P_PA_DEBUG_MODE = 'Y' THEN
4315: pa_debug.g_err_stage := 'Calling create_res_task_map';
4316: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4317: END IF;
4318:
4319: pa_fp_copy_from_pkg.create_res_task_maps(
4320: p_context => 'BUDGET'
4331: ,x_msg_count => l_msg_count
4332: ,x_msg_data => l_msg_data );
4333:
4334: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4335: IF P_PA_DEBUG_MODE = 'Y' THEN
4336: pa_debug.g_err_stage := 'The call to create_res_task_map returned with error';
4337: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4338: END IF;
4339: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4332: ,x_msg_data => l_msg_data );
4333:
4334: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4335: IF P_PA_DEBUG_MODE = 'Y' THEN
4336: pa_debug.g_err_stage := 'The call to create_res_task_map returned with error';
4337: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4338: END IF;
4339: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4340: END IF;
4333:
4334: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4335: IF P_PA_DEBUG_MODE = 'Y' THEN
4336: pa_debug.g_err_stage := 'The call to create_res_task_map returned with error';
4337: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4338: END IF;
4339: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4340: END IF;
4341:
4338: END IF;
4339: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4340: END IF;
4341:
4342: IF P_PA_DEBUG_MODE = 'Y' THEN
4343: pa_debug.g_err_stage := 'copy_resource_assignments';
4344: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4345: END IF;
4346: pa_fp_copy_from_pkg.copy_resource_assignments(
4339: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4340: END IF;
4341:
4342: IF P_PA_DEBUG_MODE = 'Y' THEN
4343: pa_debug.g_err_stage := 'copy_resource_assignments';
4344: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4345: END IF;
4346: pa_fp_copy_from_pkg.copy_resource_assignments(
4347: p_source_plan_version_id => l_ci_apprv_cw_bv_id
4340: END IF;
4341:
4342: IF P_PA_DEBUG_MODE = 'Y' THEN
4343: pa_debug.g_err_stage := 'copy_resource_assignments';
4344: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4345: END IF;
4346: pa_fp_copy_from_pkg.copy_resource_assignments(
4347: p_source_plan_version_id => l_ci_apprv_cw_bv_id
4348: ,p_target_plan_version_id => p_budget_version_id
4353: ,x_msg_count => l_msg_count
4354: ,x_msg_data => l_msg_data );
4355:
4356: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4357: IF P_PA_DEBUG_MODE = 'Y' THEN
4358: pa_debug.g_err_stage := 'The call to copy_resource_assignments returned with error';
4359: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4360: END IF;
4361: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4354: ,x_msg_data => l_msg_data );
4355:
4356: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4357: IF P_PA_DEBUG_MODE = 'Y' THEN
4358: pa_debug.g_err_stage := 'The call to copy_resource_assignments returned with error';
4359: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4360: END IF;
4361: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4362: END IF;
4355:
4356: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4357: IF P_PA_DEBUG_MODE = 'Y' THEN
4358: pa_debug.g_err_stage := 'The call to copy_resource_assignments returned with error';
4359: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4360: END IF;
4361: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4362: END IF;
4363: END IF; /* l_src_ra_id_tbl.count > 0 */
4409: /* No record are there to be inserted. Ideally, control should never come here since
4410: * is_create_ci_version_Allowed should have caught this case and thrown an error! */
4411: null;
4412: ELSE
4413: IF P_PA_DEBUG_MODE = 'Y' THEN
4414: pa_debug.g_err_stage := 'Calling create_res_task_map';
4415: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4416: END IF;
4417:
4410: * is_create_ci_version_Allowed should have caught this case and thrown an error! */
4411: null;
4412: ELSE
4413: IF P_PA_DEBUG_MODE = 'Y' THEN
4414: pa_debug.g_err_stage := 'Calling create_res_task_map';
4415: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4416: END IF;
4417:
4418: pa_fp_copy_from_pkg.create_res_task_maps(
4411: null;
4412: ELSE
4413: IF P_PA_DEBUG_MODE = 'Y' THEN
4414: pa_debug.g_err_stage := 'Calling create_res_task_map';
4415: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4416: END IF;
4417:
4418: pa_fp_copy_from_pkg.create_res_task_maps(
4419: p_context => 'BUDGET'
4430: ,x_msg_count => l_msg_count
4431: ,x_msg_data => l_msg_data );
4432:
4433: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4434: IF P_PA_DEBUG_MODE = 'Y' THEN
4435: pa_debug.g_err_stage := 'The call to create_res_task_map returned with error';
4436: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4437: END IF;
4438: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4431: ,x_msg_data => l_msg_data );
4432:
4433: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4434: IF P_PA_DEBUG_MODE = 'Y' THEN
4435: pa_debug.g_err_stage := 'The call to create_res_task_map returned with error';
4436: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4437: END IF;
4438: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4439: END IF;
4432:
4433: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4434: IF P_PA_DEBUG_MODE = 'Y' THEN
4435: pa_debug.g_err_stage := 'The call to create_res_task_map returned with error';
4436: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4437: END IF;
4438: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4439: END IF;
4440:
4437: END IF;
4438: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4439: END IF;
4440:
4441: IF P_PA_DEBUG_MODE = 'Y' THEN
4442: pa_debug.g_err_stage := 'copy_resource_assignments';
4443: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4444: END IF;
4445: pa_fp_copy_from_pkg.copy_resource_assignments(
4438: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4439: END IF;
4440:
4441: IF P_PA_DEBUG_MODE = 'Y' THEN
4442: pa_debug.g_err_stage := 'copy_resource_assignments';
4443: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4444: END IF;
4445: pa_fp_copy_from_pkg.copy_resource_assignments(
4446: p_source_plan_version_id => l_ci_apprv_cw_bv_id
4439: END IF;
4440:
4441: IF P_PA_DEBUG_MODE = 'Y' THEN
4442: pa_debug.g_err_stage := 'copy_resource_assignments';
4443: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4444: END IF;
4445: pa_fp_copy_from_pkg.copy_resource_assignments(
4446: p_source_plan_version_id => l_ci_apprv_cw_bv_id
4447: ,p_target_plan_version_id => p_budget_version_id
4452: ,x_msg_count => l_msg_count
4453: ,x_msg_data => l_msg_data );
4454:
4455: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4456: IF P_PA_DEBUG_MODE = 'Y' THEN
4457: pa_debug.g_err_stage := 'The call to copy_resource_assignments returned with error';
4458: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4459: END IF;
4460: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4453: ,x_msg_data => l_msg_data );
4454:
4455: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4456: IF P_PA_DEBUG_MODE = 'Y' THEN
4457: pa_debug.g_err_stage := 'The call to copy_resource_assignments returned with error';
4458: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4459: END IF;
4460: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4461: END IF;
4454:
4455: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4456: IF P_PA_DEBUG_MODE = 'Y' THEN
4457: pa_debug.g_err_stage := 'The call to copy_resource_assignments returned with error';
4458: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,3);
4459: END IF;
4460: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
4461: END IF;
4462: END IF; /* l_src_ra_id_tbl.count > 0 */
4462: END IF; /* l_src_ra_id_tbl.count > 0 */
4463:
4464: END IF;
4465:
4466: IF P_PA_DEBUG_MODE = 'Y' THEN
4467: pa_debug.g_err_stage:= 'Exiting Create_CI_Resource_Assignments';
4468: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4469: END IF;
4470: pa_debug.reset_err_stack;
4463:
4464: END IF;
4465:
4466: IF P_PA_DEBUG_MODE = 'Y' THEN
4467: pa_debug.g_err_stage:= 'Exiting Create_CI_Resource_Assignments';
4468: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4469: END IF;
4470: pa_debug.reset_err_stack;
4471:
4464: END IF;
4465:
4466: IF P_PA_DEBUG_MODE = 'Y' THEN
4467: pa_debug.g_err_stage:= 'Exiting Create_CI_Resource_Assignments';
4468: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4469: END IF;
4470: pa_debug.reset_err_stack;
4471:
4472: EXCEPTION
4466: IF P_PA_DEBUG_MODE = 'Y' THEN
4467: pa_debug.g_err_stage:= 'Exiting Create_CI_Resource_Assignments';
4468: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4469: END IF;
4470: pa_debug.reset_err_stack;
4471:
4472: EXCEPTION
4473:
4474: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
4488: ELSE
4489: x_msg_count := l_msg_count;
4490: END IF;
4491:
4492: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
4493: IF P_PA_DEBUG_MODE = 'Y' THEN
4494: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4495: END IF;
4496: pa_debug.reset_err_stack;
4489: x_msg_count := l_msg_count;
4490: END IF;
4491:
4492: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
4493: IF P_PA_DEBUG_MODE = 'Y' THEN
4494: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4495: END IF;
4496: pa_debug.reset_err_stack;
4497: RAISE;
4490: END IF;
4491:
4492: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
4493: IF P_PA_DEBUG_MODE = 'Y' THEN
4494: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4495: END IF;
4496: pa_debug.reset_err_stack;
4497: RAISE;
4498:
4492: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
4493: IF P_PA_DEBUG_MODE = 'Y' THEN
4494: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4495: END IF;
4496: pa_debug.reset_err_stack;
4497: RAISE;
4498:
4499: WHEN others THEN
4500:
4502: x_msg_count := 1;
4503: x_msg_data := SQLERRM;
4504: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_FP_ELEMENTS_PUB'
4505: ,p_procedure_name => 'Create_CI_Resource_Assignments');
4506: pa_debug.g_err_stage:= 'Unexpected Error'||SQLERRM;
4507: IF P_PA_DEBUG_MODE = 'Y' THEN
4508: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4509: END IF;
4510: pa_debug.reset_err_stack;
4503: x_msg_data := SQLERRM;
4504: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_FP_ELEMENTS_PUB'
4505: ,p_procedure_name => 'Create_CI_Resource_Assignments');
4506: pa_debug.g_err_stage:= 'Unexpected Error'||SQLERRM;
4507: IF P_PA_DEBUG_MODE = 'Y' THEN
4508: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4509: END IF;
4510: pa_debug.reset_err_stack;
4511: RAISE;
4504: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_FP_ELEMENTS_PUB'
4505: ,p_procedure_name => 'Create_CI_Resource_Assignments');
4506: pa_debug.g_err_stage:= 'Unexpected Error'||SQLERRM;
4507: IF P_PA_DEBUG_MODE = 'Y' THEN
4508: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4509: END IF;
4510: pa_debug.reset_err_stack;
4511: RAISE;
4512: END Create_CI_Resource_Assignments;
4506: pa_debug.g_err_stage:= 'Unexpected Error'||SQLERRM;
4507: IF P_PA_DEBUG_MODE = 'Y' THEN
4508: pa_debug.write('Create_CI_Resource_Assignments: ' || l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4509: END IF;
4510: pa_debug.reset_err_stack;
4511: RAISE;
4512: END Create_CI_Resource_Assignments;
4513:
4514: /*==================================================================
4650:
4651: BEGIN
4652: x_msg_count := 0;
4653: x_return_status := FND_API.G_RET_STS_SUCCESS;
4654: PA_DEBUG.Set_Curr_Function( p_function => 'Add_resources_automatically',
4655: p_debug_mode => p_pa_debug_mode );
4656:
4657: -- Check for NOT NULL parameters
4658: IF (p_proj_fp_options_id IS NULL) OR
4651: BEGIN
4652: x_msg_count := 0;
4653: x_return_status := FND_API.G_RET_STS_SUCCESS;
4654: PA_DEBUG.Set_Curr_Function( p_function => 'Add_resources_automatically',
4655: p_debug_mode => p_pa_debug_mode );
4656:
4657: -- Check for NOT NULL parameters
4658: IF (p_proj_fp_options_id IS NULL) OR
4659: (p_element_type IS NULL) OR
4661: (p_resource_list_id IS NULL) OR
4662: (p_res_planning_level IS NULL) OR
4663: (p_entire_option IS NULL)
4664: THEN
4665: IF p_pa_debug_mode = 'Y' THEN
4666: pa_debug.g_err_stage:= 'p_proj_fp_options_id = '|| p_proj_fp_options_id;
4667: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4668: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
4669: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4662: (p_res_planning_level IS NULL) OR
4663: (p_entire_option IS NULL)
4664: THEN
4665: IF p_pa_debug_mode = 'Y' THEN
4666: pa_debug.g_err_stage:= 'p_proj_fp_options_id = '|| p_proj_fp_options_id;
4667: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4668: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
4669: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4670: pa_debug.g_err_stage:= 'p_fin_plan_level_code = '|| p_fin_plan_level_code;
4663: (p_entire_option IS NULL)
4664: THEN
4665: IF p_pa_debug_mode = 'Y' THEN
4666: pa_debug.g_err_stage:= 'p_proj_fp_options_id = '|| p_proj_fp_options_id;
4667: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4668: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
4669: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4670: pa_debug.g_err_stage:= 'p_fin_plan_level_code = '|| p_fin_plan_level_code;
4671: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4664: THEN
4665: IF p_pa_debug_mode = 'Y' THEN
4666: pa_debug.g_err_stage:= 'p_proj_fp_options_id = '|| p_proj_fp_options_id;
4667: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4668: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
4669: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4670: pa_debug.g_err_stage:= 'p_fin_plan_level_code = '|| p_fin_plan_level_code;
4671: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4672: pa_debug.g_err_stage:= 'p_resource_list_id = '|| p_resource_list_id;
4665: IF p_pa_debug_mode = 'Y' THEN
4666: pa_debug.g_err_stage:= 'p_proj_fp_options_id = '|| p_proj_fp_options_id;
4667: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4668: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
4669: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4670: pa_debug.g_err_stage:= 'p_fin_plan_level_code = '|| p_fin_plan_level_code;
4671: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4672: pa_debug.g_err_stage:= 'p_resource_list_id = '|| p_resource_list_id;
4673: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4666: pa_debug.g_err_stage:= 'p_proj_fp_options_id = '|| p_proj_fp_options_id;
4667: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4668: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
4669: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4670: pa_debug.g_err_stage:= 'p_fin_plan_level_code = '|| p_fin_plan_level_code;
4671: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4672: pa_debug.g_err_stage:= 'p_resource_list_id = '|| p_resource_list_id;
4673: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4674: pa_debug.g_err_stage:= 'p_res_planning_level = '|| p_res_planning_level;
4667: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4668: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
4669: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4670: pa_debug.g_err_stage:= 'p_fin_plan_level_code = '|| p_fin_plan_level_code;
4671: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4672: pa_debug.g_err_stage:= 'p_resource_list_id = '|| p_resource_list_id;
4673: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4674: pa_debug.g_err_stage:= 'p_res_planning_level = '|| p_res_planning_level;
4675: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4668: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
4669: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4670: pa_debug.g_err_stage:= 'p_fin_plan_level_code = '|| p_fin_plan_level_code;
4671: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4672: pa_debug.g_err_stage:= 'p_resource_list_id = '|| p_resource_list_id;
4673: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4674: pa_debug.g_err_stage:= 'p_res_planning_level = '|| p_res_planning_level;
4675: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4676: pa_debug.g_err_stage:= 'p_entire_option = '|| p_entire_option;
4669: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4670: pa_debug.g_err_stage:= 'p_fin_plan_level_code = '|| p_fin_plan_level_code;
4671: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4672: pa_debug.g_err_stage:= 'p_resource_list_id = '|| p_resource_list_id;
4673: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4674: pa_debug.g_err_stage:= 'p_res_planning_level = '|| p_res_planning_level;
4675: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4676: pa_debug.g_err_stage:= 'p_entire_option = '|| p_entire_option;
4677: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4670: pa_debug.g_err_stage:= 'p_fin_plan_level_code = '|| p_fin_plan_level_code;
4671: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4672: pa_debug.g_err_stage:= 'p_resource_list_id = '|| p_resource_list_id;
4673: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4674: pa_debug.g_err_stage:= 'p_res_planning_level = '|| p_res_planning_level;
4675: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4676: pa_debug.g_err_stage:= 'p_entire_option = '|| p_entire_option;
4677: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4678: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
4671: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4672: pa_debug.g_err_stage:= 'p_resource_list_id = '|| p_resource_list_id;
4673: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4674: pa_debug.g_err_stage:= 'p_res_planning_level = '|| p_res_planning_level;
4675: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4676: pa_debug.g_err_stage:= 'p_entire_option = '|| p_entire_option;
4677: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4678: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
4679: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4672: pa_debug.g_err_stage:= 'p_resource_list_id = '|| p_resource_list_id;
4673: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4674: pa_debug.g_err_stage:= 'p_res_planning_level = '|| p_res_planning_level;
4675: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4676: pa_debug.g_err_stage:= 'p_entire_option = '|| p_entire_option;
4677: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4678: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
4679: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4680: END IF;
4673: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4674: pa_debug.g_err_stage:= 'p_res_planning_level = '|| p_res_planning_level;
4675: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4676: pa_debug.g_err_stage:= 'p_entire_option = '|| p_entire_option;
4677: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4678: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
4679: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4680: END IF;
4681: PA_UTILS.ADD_MESSAGE
4674: pa_debug.g_err_stage:= 'p_res_planning_level = '|| p_res_planning_level;
4675: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4676: pa_debug.g_err_stage:= 'p_entire_option = '|| p_entire_option;
4677: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4678: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
4679: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4680: END IF;
4681: PA_UTILS.ADD_MESSAGE
4682: (p_app_short_name => 'PA',
4675: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4676: pa_debug.g_err_stage:= 'p_entire_option = '|| p_entire_option;
4677: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4678: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
4679: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4680: END IF;
4681: PA_UTILS.ADD_MESSAGE
4682: (p_app_short_name => 'PA',
4683: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
4690: FETCH proj_fp_options_info_cur INTO proj_fp_options_info_rec;
4691:
4692: IF proj_fp_options_info_cur%NOTFOUND
4693: THEN
4694: IF p_pa_debug_mode = 'Y' THEN
4695: pa_debug.g_err_stage:= 'Unexpected error while fetching option_id Info for the option: '
4696: ||p_proj_fp_options_id||'the error message is: '||sqlerrm;
4697: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4698: END IF;
4691:
4692: IF proj_fp_options_info_cur%NOTFOUND
4693: THEN
4694: IF p_pa_debug_mode = 'Y' THEN
4695: pa_debug.g_err_stage:= 'Unexpected error while fetching option_id Info for the option: '
4696: ||p_proj_fp_options_id||'the error message is: '||sqlerrm;
4697: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4698: END IF;
4699: PA_UTILS.ADD_MESSAGE
4693: THEN
4694: IF p_pa_debug_mode = 'Y' THEN
4695: pa_debug.g_err_stage:= 'Unexpected error while fetching option_id Info for the option: '
4696: ||p_proj_fp_options_id||'the error message is: '||sqlerrm;
4697: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4698: END IF;
4699: PA_UTILS.ADD_MESSAGE
4700: (p_app_short_name => 'PA',
4701: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
4722: THEN
4723: l_task_id_tbl(1) := 0;
4724: l_top_task_id_tbl(1) := 0;
4725: ELSE
4726: IF p_pa_debug_mode = 'Y' THEN
4727: pa_debug.g_err_stage:= 'Cursor all_plannable_tasks_cur is opened';
4728: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4729: END IF;
4730:
4723: l_task_id_tbl(1) := 0;
4724: l_top_task_id_tbl(1) := 0;
4725: ELSE
4726: IF p_pa_debug_mode = 'Y' THEN
4727: pa_debug.g_err_stage:= 'Cursor all_plannable_tasks_cur is opened';
4728: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4729: END IF;
4730:
4731: OPEN all_plannable_tasks_cur(p_proj_fp_options_id,p_element_type);
4724: l_top_task_id_tbl(1) := 0;
4725: ELSE
4726: IF p_pa_debug_mode = 'Y' THEN
4727: pa_debug.g_err_stage:= 'Cursor all_plannable_tasks_cur is opened';
4728: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4729: END IF;
4730:
4731: OPEN all_plannable_tasks_cur(p_proj_fp_options_id,p_element_type);
4732: FETCH all_plannable_tasks_cur
4743: l_task_id_tbl := p_element_task_id_tbl;
4744:
4745: IF l_task_id_tbl.count = 0
4746: THEN
4747: IF p_pa_debug_mode = 'Y' THEN
4748: pa_debug.g_err_stage:= 'l_task_id_Tbl is empty. Returning...';
4749: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4750: END IF;
4751: pa_debug.reset_curr_function;
4744:
4745: IF l_task_id_tbl.count = 0
4746: THEN
4747: IF p_pa_debug_mode = 'Y' THEN
4748: pa_debug.g_err_stage:= 'l_task_id_Tbl is empty. Returning...';
4749: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4750: END IF;
4751: pa_debug.reset_curr_function;
4752: RETURN; -- as no tasks are to be processed.
4745: IF l_task_id_tbl.count = 0
4746: THEN
4747: IF p_pa_debug_mode = 'Y' THEN
4748: pa_debug.g_err_stage:= 'l_task_id_Tbl is empty. Returning...';
4749: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4750: END IF;
4751: pa_debug.reset_curr_function;
4752: RETURN; -- as no tasks are to be processed.
4753: END IF;
4747: IF p_pa_debug_mode = 'Y' THEN
4748: pa_debug.g_err_stage:= 'l_task_id_Tbl is empty. Returning...';
4749: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4750: END IF;
4751: pa_debug.reset_curr_function;
4752: RETURN; -- as no tasks are to be processed.
4753: END IF;
4754:
4755: /*
4765: l_task_tbl_index := l_task_id_tbl.first;
4766:
4767: IF (l_task_id_tbl.count <> 1) OR (l_task_id_tbl(l_task_tbl_index) <> 0)
4768: THEN
4769: IF p_pa_debug_mode = 'Y' THEN
4770: pa_debug.g_err_stage:= 'Invalid task(s) passed for project plan level case';
4771: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4772: END IF;
4773: PA_UTILS.ADD_MESSAGE
4766:
4767: IF (l_task_id_tbl.count <> 1) OR (l_task_id_tbl(l_task_tbl_index) <> 0)
4768: THEN
4769: IF p_pa_debug_mode = 'Y' THEN
4770: pa_debug.g_err_stage:= 'Invalid task(s) passed for project plan level case';
4771: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4772: END IF;
4773: PA_UTILS.ADD_MESSAGE
4774: (p_app_short_name => 'PA',
4767: IF (l_task_id_tbl.count <> 1) OR (l_task_id_tbl(l_task_tbl_index) <> 0)
4768: THEN
4769: IF p_pa_debug_mode = 'Y' THEN
4770: pa_debug.g_err_stage:= 'Invalid task(s) passed for project plan level case';
4771: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
4772: END IF;
4773: PA_UTILS.ADD_MESSAGE
4774: (p_app_short_name => 'PA',
4775: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
4782:
4783: FOR l_task_tbl_index IN l_task_id_tbl.first .. l_task_id_tbl.last
4784: LOOP
4785:
4786: IF p_pa_debug_mode = 'Y' THEN
4787: pa_debug.g_err_stage:= 'Fetching top task for each task_id';
4788: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4789: END IF;
4790:
4783: FOR l_task_tbl_index IN l_task_id_tbl.first .. l_task_id_tbl.last
4784: LOOP
4785:
4786: IF p_pa_debug_mode = 'Y' THEN
4787: pa_debug.g_err_stage:= 'Fetching top task for each task_id';
4788: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4789: END IF;
4790:
4791: BEGIN
4784: LOOP
4785:
4786: IF p_pa_debug_mode = 'Y' THEN
4787: pa_debug.g_err_stage:= 'Fetching top task for each task_id';
4788: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4789: END IF;
4790:
4791: BEGIN
4792: SELECT top_task_id
4799: AND plannable_flag = 'Y';
4800: EXCEPTION
4801: WHEN NO_DATA_FOUND THEN
4802:
4803: IF p_pa_debug_mode = 'Y' THEN
4804: pa_debug.g_err_stage:= 'While fetching top_task for the task: '
4805: ||l_task_id_tbl(l_task_tbl_index)|| 'Error is: '||sqlerrm;
4806: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4807: END IF;
4800: EXCEPTION
4801: WHEN NO_DATA_FOUND THEN
4802:
4803: IF p_pa_debug_mode = 'Y' THEN
4804: pa_debug.g_err_stage:= 'While fetching top_task for the task: '
4805: ||l_task_id_tbl(l_task_tbl_index)|| 'Error is: '||sqlerrm;
4806: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4807: END IF;
4808: PA_UTILS.ADD_MESSAGE
4802:
4803: IF p_pa_debug_mode = 'Y' THEN
4804: pa_debug.g_err_stage:= 'While fetching top_task for the task: '
4805: ||l_task_id_tbl(l_task_tbl_index)|| 'Error is: '||sqlerrm;
4806: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4807: END IF;
4808: PA_UTILS.ADD_MESSAGE
4809: (p_app_short_name => 'PA',
4810: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
4834:
4835: /* return if resource list is uncategorized as no resources are to be added in this case*/
4836: IF l_res_uncategorized_flag = 'Y'
4837: THEN
4838: IF p_pa_debug_mode = 'Y' THEN
4839: pa_debug.g_err_stage:= 'l_res_uncategorized_flag is Y. Returning...';
4840: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4841: pa_debug.reset_curr_function;
4842: END IF;
4835: /* return if resource list is uncategorized as no resources are to be added in this case*/
4836: IF l_res_uncategorized_flag = 'Y'
4837: THEN
4838: IF p_pa_debug_mode = 'Y' THEN
4839: pa_debug.g_err_stage:= 'l_res_uncategorized_flag is Y. Returning...';
4840: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4841: pa_debug.reset_curr_function;
4842: END IF;
4843: RETURN;
4836: IF l_res_uncategorized_flag = 'Y'
4837: THEN
4838: IF p_pa_debug_mode = 'Y' THEN
4839: pa_debug.g_err_stage:= 'l_res_uncategorized_flag is Y. Returning...';
4840: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4841: pa_debug.reset_curr_function;
4842: END IF;
4843: RETURN;
4844: END IF;
4837: THEN
4838: IF p_pa_debug_mode = 'Y' THEN
4839: pa_debug.g_err_stage:= 'l_res_uncategorized_flag is Y. Returning...';
4840: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4841: pa_debug.reset_curr_function;
4842: END IF;
4843: RETURN;
4844: END IF;
4845:
4852:
4853: IF l_is_resource_list_grouped = 'N'
4854: THEN
4855:
4856: IF p_pa_debug_mode = 'Y' THEN
4857: pa_debug.g_err_stage:= 'ungrouped_res_cur is opened';
4858: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4859: END IF;
4860:
4853: IF l_is_resource_list_grouped = 'N'
4854: THEN
4855:
4856: IF p_pa_debug_mode = 'Y' THEN
4857: pa_debug.g_err_stage:= 'ungrouped_res_cur is opened';
4858: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4859: END IF;
4860:
4861: OPEN ungrouped_res_cur (p_resource_list_id);
4854: THEN
4855:
4856: IF p_pa_debug_mode = 'Y' THEN
4857: pa_debug.g_err_stage:= 'ungrouped_res_cur is opened';
4858: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4859: END IF;
4860:
4861: OPEN ungrouped_res_cur (p_resource_list_id);
4862: FETCH ungrouped_res_cur BULK COLLECT INTO
4865: ELSE
4866: IF p_res_planning_level = PA_FP_CONSTANTS_PKG.G_RESOURCE_PLANNING_LEVEL_R
4867: THEN
4868:
4869: IF p_pa_debug_mode = 'Y' THEN
4870: pa_debug.g_err_stage:= 'grouped_res_level_res_cur is opened';
4871: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4872: END IF;
4873:
4866: IF p_res_planning_level = PA_FP_CONSTANTS_PKG.G_RESOURCE_PLANNING_LEVEL_R
4867: THEN
4868:
4869: IF p_pa_debug_mode = 'Y' THEN
4870: pa_debug.g_err_stage:= 'grouped_res_level_res_cur is opened';
4871: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4872: END IF;
4873:
4874: OPEN grouped_res_level_res_cur(p_resource_list_id);
4867: THEN
4868:
4869: IF p_pa_debug_mode = 'Y' THEN
4870: pa_debug.g_err_stage:= 'grouped_res_level_res_cur is opened';
4871: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4872: END IF;
4873:
4874: OPEN grouped_res_level_res_cur(p_resource_list_id);
4875: FETCH grouped_res_level_res_cur BULK COLLECT INTO
4878:
4879: ELSIF p_res_planning_level = PA_FP_CONSTANTS_PKG.G_RESOURCE_PLANNING_LEVEL_G
4880: THEN
4881:
4882: IF p_pa_debug_mode = 'Y' THEN
4883: pa_debug.g_err_stage:= 'grouped_resgrp_level_res_cur is opened';
4884: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4885: END IF;
4886:
4879: ELSIF p_res_planning_level = PA_FP_CONSTANTS_PKG.G_RESOURCE_PLANNING_LEVEL_G
4880: THEN
4881:
4882: IF p_pa_debug_mode = 'Y' THEN
4883: pa_debug.g_err_stage:= 'grouped_resgrp_level_res_cur is opened';
4884: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4885: END IF;
4886:
4887: OPEN grouped_resgrp_level_res_cur(p_resource_list_id);
4880: THEN
4881:
4882: IF p_pa_debug_mode = 'Y' THEN
4883: pa_debug.g_err_stage:= 'grouped_resgrp_level_res_cur is opened';
4884: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4885: END IF;
4886:
4887: OPEN grouped_resgrp_level_res_cur(p_resource_list_id);
4888: FETCH grouped_resgrp_level_res_cur BULK COLLECT INTO
4895: For each task_id in the task_id table we need to insert
4896: all the resource_list_memebers fetched in pa_fp_elements table.
4897: */
4898:
4899: IF p_pa_debug_mode = 'Y' THEN
4900: pa_debug.g_err_stage:= 'for each task in task_id_tbl inserting all the rlmids fetched';
4901: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4902: END IF;
4903:
4896: all the resource_list_memebers fetched in pa_fp_elements table.
4897: */
4898:
4899: IF p_pa_debug_mode = 'Y' THEN
4900: pa_debug.g_err_stage:= 'for each task in task_id_tbl inserting all the rlmids fetched';
4901: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4902: END IF;
4903:
4904: FOR l_task_tbl_index IN l_task_id_tbl.first .. l_task_id_tbl.last
4897: */
4898:
4899: IF p_pa_debug_mode = 'Y' THEN
4900: pa_debug.g_err_stage:= 'for each task in task_id_tbl inserting all the rlmids fetched';
4901: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4902: END IF;
4903:
4904: FOR l_task_tbl_index IN l_task_id_tbl.first .. l_task_id_tbl.last
4905: LOOP
4956: END LOOP;
4957:
4958: -- Bulk update all the task records to reflect that resources selection is done
4959:
4960: IF p_pa_debug_mode = 'Y' THEN
4961: pa_debug.g_err_stage:= 'Bulk updating all the tasks to reflect resource selection status';
4962: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4963: END IF;
4964:
4957:
4958: -- Bulk update all the task records to reflect that resources selection is done
4959:
4960: IF p_pa_debug_mode = 'Y' THEN
4961: pa_debug.g_err_stage:= 'Bulk updating all the tasks to reflect resource selection status';
4962: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4963: END IF;
4964:
4965: IF l_res_list_mem_id_tbl.count > 0
4958: -- Bulk update all the task records to reflect that resources selection is done
4959:
4960: IF p_pa_debug_mode = 'Y' THEN
4961: pa_debug.g_err_stage:= 'Bulk updating all the tasks to reflect resource selection status';
4962: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4963: END IF;
4964:
4965: IF l_res_list_mem_id_tbl.count > 0
4966: THEN
4977: AND task_id = l_task_id_tbl(l_task_tbl_index)
4978: AND resource_list_member_id = 0;
4979: END IF;
4980:
4981: IF p_pa_debug_mode = 'Y' THEN
4982: pa_debug.g_err_stage:= 'Exiting Add_resources_automatically';
4983: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4984: END IF;
4985: pa_debug.reset_curr_function;
4978: AND resource_list_member_id = 0;
4979: END IF;
4980:
4981: IF p_pa_debug_mode = 'Y' THEN
4982: pa_debug.g_err_stage:= 'Exiting Add_resources_automatically';
4983: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4984: END IF;
4985: pa_debug.reset_curr_function;
4986: EXCEPTION
4979: END IF;
4980:
4981: IF p_pa_debug_mode = 'Y' THEN
4982: pa_debug.g_err_stage:= 'Exiting Add_resources_automatically';
4983: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4984: END IF;
4985: pa_debug.reset_curr_function;
4986: EXCEPTION
4987:
4981: IF p_pa_debug_mode = 'Y' THEN
4982: pa_debug.g_err_stage:= 'Exiting Add_resources_automatically';
4983: pa_debug.write(l_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL3);
4984: END IF;
4985: pa_debug.reset_curr_function;
4986: EXCEPTION
4987:
4988: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
4989:
5001: x_msg_count := l_msg_count;
5002: ELSE
5003: x_msg_count := l_msg_count;
5004: END IF;
5005: pa_debug.reset_curr_function;
5006: RETURN;
5007: WHEN others THEN
5008:
5009: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5012: FND_MSG_PUB.add_exc_msg
5013: ( p_pkg_name => 'PA_FP_ELEMENTS_PUB'
5014: ,p_procedure_name => 'ADD_RESOURCES_AUTOMATICALLY'
5015: ,p_error_text => sqlerrm);
5016: pa_debug.reset_curr_function;
5017: RAISE;
5018: END Add_resources_automatically;
5019:
5020: /* Bug 2920954 - This procedure deletes all the planning elements
5051: BEGIN
5052:
5053: x_msg_count := 0;
5054: x_return_status := FND_API.G_RET_STS_SUCCESS;
5055: l_debug_mode := NVL(FND_PROFILE.value('PA_DEBUG_MODE'),'N');
5056:
5057: pa_debug.set_curr_function( p_function => 'delete_task_elements',
5058: p_debug_mode => l_debug_mode );
5059:
5053: x_msg_count := 0;
5054: x_return_status := FND_API.G_RET_STS_SUCCESS;
5055: l_debug_mode := NVL(FND_PROFILE.value('PA_DEBUG_MODE'),'N');
5056:
5057: pa_debug.set_curr_function( p_function => 'delete_task_elements',
5058: p_debug_mode => l_debug_mode );
5059:
5060: -- Check for business rules violations
5061:
5059:
5060: -- Check for business rules violations
5061:
5062: IF l_debug_mode = 'Y' THEN
5063: pa_debug.g_err_stage:= 'Validating input parameters';
5064: pa_debug.write(l_module_name,pa_debug.g_err_stage,
5065: L_DEBUG_LEVEL3);
5066: END IF;
5067:
5060: -- Check for business rules violations
5061:
5062: IF l_debug_mode = 'Y' THEN
5063: pa_debug.g_err_stage:= 'Validating input parameters';
5064: pa_debug.write(l_module_name,pa_debug.g_err_stage,
5065: L_DEBUG_LEVEL3);
5066: END IF;
5067:
5068: IF (p_task_id IS NULL)
5067:
5068: IF (p_task_id IS NULL)
5069: THEN
5070: IF l_debug_mode = 'Y' THEN
5071: pa_debug.g_err_stage:= 'p_task_id = '|| p_task_id;
5072: pa_debug.write(l_module_name,pa_debug.g_err_stage,
5073: L_DEBUG_LEVEL5);
5074: END IF;
5075: PA_UTILS.ADD_MESSAGE
5068: IF (p_task_id IS NULL)
5069: THEN
5070: IF l_debug_mode = 'Y' THEN
5071: pa_debug.g_err_stage:= 'p_task_id = '|| p_task_id;
5072: pa_debug.write(l_module_name,pa_debug.g_err_stage,
5073: L_DEBUG_LEVEL5);
5074: END IF;
5075: PA_UTILS.ADD_MESSAGE
5076: (p_app_short_name => 'PA',
5078: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
5079: END IF;
5080:
5081: IF l_debug_mode = 'Y' THEN
5082: pa_debug.g_err_stage:= 'Deleting from pa_resource_assignments for task id ' || to_char(p_task_id);
5083: pa_debug.write(l_module_name,pa_debug.g_err_stage,
5084: L_DEBUG_LEVEL3);
5085: END IF;
5086:
5079: END IF;
5080:
5081: IF l_debug_mode = 'Y' THEN
5082: pa_debug.g_err_stage:= 'Deleting from pa_resource_assignments for task id ' || to_char(p_task_id);
5083: pa_debug.write(l_module_name,pa_debug.g_err_stage,
5084: L_DEBUG_LEVEL3);
5085: END IF;
5086:
5087: DELETE FROM pa_resource_assignments r
5092:
5093: l_records_deleted := sql%rowcount;
5094:
5095: IF l_debug_mode = 'Y' THEN
5096: pa_debug.g_err_stage:= To_char(l_records_deleted) || ' records deleted.';
5097: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5098: END IF;
5099:
5100: IF l_debug_mode = 'Y' THEN
5093: l_records_deleted := sql%rowcount;
5094:
5095: IF l_debug_mode = 'Y' THEN
5096: pa_debug.g_err_stage:= To_char(l_records_deleted) || ' records deleted.';
5097: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5098: END IF;
5099:
5100: IF l_debug_mode = 'Y' THEN
5101: pa_debug.g_err_stage:= 'Exiting delete_task_elements';
5097: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5098: END IF;
5099:
5100: IF l_debug_mode = 'Y' THEN
5101: pa_debug.g_err_stage:= 'Exiting delete_task_elements';
5102: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5103: END IF;
5104:
5105: pa_debug.reset_curr_function;
5098: END IF;
5099:
5100: IF l_debug_mode = 'Y' THEN
5101: pa_debug.g_err_stage:= 'Exiting delete_task_elements';
5102: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5103: END IF;
5104:
5105: pa_debug.reset_curr_function;
5106:
5101: pa_debug.g_err_stage:= 'Exiting delete_task_elements';
5102: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5103: END IF;
5104:
5105: pa_debug.reset_curr_function;
5106:
5107: EXCEPTION
5108:
5109: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
5123: x_msg_count := l_msg_count;
5124: ELSE
5125: x_msg_count := l_msg_count;
5126: END IF;
5127: pa_debug.reset_curr_function;
5128: RETURN;
5129:
5130: WHEN others THEN
5131:
5138: ,p_procedure_name => 'delete_task_elements'
5139: ,p_error_text => x_msg_data);
5140:
5141: IF l_debug_mode = 'Y' THEN
5142: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
5143: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5144: END IF;
5145: pa_debug.reset_curr_function;
5146: RAISE;
5139: ,p_error_text => x_msg_data);
5140:
5141: IF l_debug_mode = 'Y' THEN
5142: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
5143: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5144: END IF;
5145: pa_debug.reset_curr_function;
5146: RAISE;
5147: END delete_task_elements;
5141: IF l_debug_mode = 'Y' THEN
5142: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
5143: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5144: END IF;
5145: pa_debug.reset_curr_function;
5146: RAISE;
5147: END delete_task_elements;
5148: /*
5149: For bug 2976168.
5217:
5218: BEGIN
5219: x_msg_count := 0;
5220: x_return_status := FND_API.G_RET_STS_SUCCESS;
5221: l_debug_mode := NVL(FND_PROFILE.value('PA_DEBUG_MODE'),'N');
5222:
5223: IF l_debug_mode = 'Y' THEN
5224: pa_debug.set_curr_function( p_function => 'Get_Task_Element_Attributes',
5225: p_debug_mode => l_debug_mode );
5220: x_return_status := FND_API.G_RET_STS_SUCCESS;
5221: l_debug_mode := NVL(FND_PROFILE.value('PA_DEBUG_MODE'),'N');
5222:
5223: IF l_debug_mode = 'Y' THEN
5224: pa_debug.set_curr_function( p_function => 'Get_Task_Element_Attributes',
5225: p_debug_mode => l_debug_mode );
5226: END IF;
5227:
5228: IF l_debug_mode = 'Y' THEN
5225: p_debug_mode => l_debug_mode );
5226: END IF;
5227:
5228: IF l_debug_mode = 'Y' THEN
5229: pa_debug.g_err_stage:= 'Validating input parameters';
5230: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5231: END IF;
5232:
5233: IF p_proj_fp_options_id IS NULL OR
5226: END IF;
5227:
5228: IF l_debug_mode = 'Y' THEN
5229: pa_debug.g_err_stage:= 'Validating input parameters';
5230: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5231: END IF;
5232:
5233: IF p_proj_fp_options_id IS NULL OR
5234: p_element_type IS NULL OR
5238: p_option_plan_level_code IS NULL
5239: THEN
5240:
5241: IF l_debug_mode = 'Y' THEN
5242: pa_debug.g_err_stage:= 'p_proj_fp_options_id = '|| p_proj_fp_options_id;
5243: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5244:
5245: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
5246: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5239: THEN
5240:
5241: IF l_debug_mode = 'Y' THEN
5242: pa_debug.g_err_stage:= 'p_proj_fp_options_id = '|| p_proj_fp_options_id;
5243: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5244:
5245: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
5246: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5247:
5241: IF l_debug_mode = 'Y' THEN
5242: pa_debug.g_err_stage:= 'p_proj_fp_options_id = '|| p_proj_fp_options_id;
5243: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5244:
5245: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
5246: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5247:
5248: pa_debug.g_err_stage:= 'p_task_id = '|| p_task_id;
5249: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5242: pa_debug.g_err_stage:= 'p_proj_fp_options_id = '|| p_proj_fp_options_id;
5243: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5244:
5245: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
5246: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5247:
5248: pa_debug.g_err_stage:= 'p_task_id = '|| p_task_id;
5249: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5250:
5244:
5245: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
5246: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5247:
5248: pa_debug.g_err_stage:= 'p_task_id = '|| p_task_id;
5249: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5250:
5251: pa_debug.g_err_stage:= 'p_top_task_id = '|| p_top_task_id;
5252: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5245: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
5246: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5247:
5248: pa_debug.g_err_stage:= 'p_task_id = '|| p_task_id;
5249: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5250:
5251: pa_debug.g_err_stage:= 'p_top_task_id = '|| p_top_task_id;
5252: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5253:
5247:
5248: pa_debug.g_err_stage:= 'p_task_id = '|| p_task_id;
5249: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5250:
5251: pa_debug.g_err_stage:= 'p_top_task_id = '|| p_top_task_id;
5252: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5253:
5254: pa_debug.g_err_stage:= 'p_task_level = '|| p_task_level;
5255: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5248: pa_debug.g_err_stage:= 'p_task_id = '|| p_task_id;
5249: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5250:
5251: pa_debug.g_err_stage:= 'p_top_task_id = '|| p_top_task_id;
5252: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5253:
5254: pa_debug.g_err_stage:= 'p_task_level = '|| p_task_level;
5255: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5256:
5250:
5251: pa_debug.g_err_stage:= 'p_top_task_id = '|| p_top_task_id;
5252: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5253:
5254: pa_debug.g_err_stage:= 'p_task_level = '|| p_task_level;
5255: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5256:
5257: pa_debug.g_err_stage:= 'p_option_plan_level_code = '|| p_option_plan_level_code;
5258: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5251: pa_debug.g_err_stage:= 'p_top_task_id = '|| p_top_task_id;
5252: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5253:
5254: pa_debug.g_err_stage:= 'p_task_level = '|| p_task_level;
5255: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5256:
5257: pa_debug.g_err_stage:= 'p_option_plan_level_code = '|| p_option_plan_level_code;
5258: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5259:
5253:
5254: pa_debug.g_err_stage:= 'p_task_level = '|| p_task_level;
5255: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5256:
5257: pa_debug.g_err_stage:= 'p_option_plan_level_code = '|| p_option_plan_level_code;
5258: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5259:
5260: END IF;
5261: PA_UTILS.ADD_MESSAGE
5254: pa_debug.g_err_stage:= 'p_task_level = '|| p_task_level;
5255: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5256:
5257: pa_debug.g_err_stage:= 'p_option_plan_level_code = '|| p_option_plan_level_code;
5258: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5259:
5260: END IF;
5261: PA_UTILS.ADD_MESSAGE
5262: (p_app_short_name => 'PA',
5266: END IF;
5267:
5268: --Check if the task is already included as a plannable element.
5269: IF l_debug_mode = 'Y' THEN
5270: pa_debug.g_err_stage:= 'Check if task is already plannable(existence in pa_fp_elements)';
5271: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5272: END IF;
5273:
5274: -- If p_task_id already exists in pa_fp_elements for the option_id and element_type, no further
5267:
5268: --Check if the task is already included as a plannable element.
5269: IF l_debug_mode = 'Y' THEN
5270: pa_debug.g_err_stage:= 'Check if task is already plannable(existence in pa_fp_elements)';
5271: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5272: END IF;
5273:
5274: -- If p_task_id already exists in pa_fp_elements for the option_id and element_type, no further
5275: -- processing is required.
5278: FETCH task_element_info_cur INTO task_element_info_rec;
5279: IF task_element_info_cur%NOTFOUND THEN
5280: l_continue_processing := 'Y';
5281: IF l_debug_mode = 'Y' THEN
5282: pa_debug.g_err_stage:= 'task doesnt exists in pa_fp_elements. Proceeding further..';
5283: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5284: END IF;
5285: ELSE
5286: l_continue_processing := 'N';
5279: IF task_element_info_cur%NOTFOUND THEN
5280: l_continue_processing := 'Y';
5281: IF l_debug_mode = 'Y' THEN
5282: pa_debug.g_err_stage:= 'task doesnt exists in pa_fp_elements. Proceeding further..';
5283: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5284: END IF;
5285: ELSE
5286: l_continue_processing := 'N';
5287: x_task_inclusion_flag := 'N';
5285: ELSE
5286: l_continue_processing := 'N';
5287: x_task_inclusion_flag := 'N';
5288: IF l_debug_mode = 'Y' THEN
5289: pa_debug.g_err_stage:= 'task is already plannable and exists in pa_fp_elements. No processing required...';
5290: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5291: END IF;
5292: END IF;
5293: CLOSE task_element_info_cur;
5286: l_continue_processing := 'N';
5287: x_task_inclusion_flag := 'N';
5288: IF l_debug_mode = 'Y' THEN
5289: pa_debug.g_err_stage:= 'task is already plannable and exists in pa_fp_elements. No processing required...';
5290: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5291: END IF;
5292: END IF;
5293: CLOSE task_element_info_cur;
5294:
5301: IF excluded_task_cur%FOUND THEN
5302: l_continue_processing := 'N';
5303: x_task_inclusion_flag := 'N';
5304: IF l_debug_mode = 'Y' THEN
5305: pa_debug.g_err_stage:= 'Task ' ||p_task_id ||' is not processed as it exists in pa_fp_excluded_elements';
5306: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5307: END IF;
5308: END IF;
5309: CLOSE excluded_task_cur;
5302: l_continue_processing := 'N';
5303: x_task_inclusion_flag := 'N';
5304: IF l_debug_mode = 'Y' THEN
5305: pa_debug.g_err_stage:= 'Task ' ||p_task_id ||' is not processed as it exists in pa_fp_excluded_elements';
5306: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5307: END IF;
5308: END IF;
5309: CLOSE excluded_task_cur;
5310: END IF;
5311:
5312: --Continue processing if the task is not either made plannable or unplannable.
5313: IF l_continue_processing='Y' THEN
5314: IF l_debug_mode = 'Y' THEN
5315: pa_debug.g_err_stage := 'Continuing with the processing of task ' || p_task_id;
5316: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5317: END IF;
5318:
5319: -- Planning level for the options is top task
5312: --Continue processing if the task is not either made plannable or unplannable.
5313: IF l_continue_processing='Y' THEN
5314: IF l_debug_mode = 'Y' THEN
5315: pa_debug.g_err_stage := 'Continuing with the processing of task ' || p_task_id;
5316: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5317: END IF;
5318:
5319: -- Planning level for the options is top task
5320: IF p_option_plan_level_code = PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_TOP THEN
5334:
5335: END IF; /* p_task_id = p_top_task_id */
5336:
5337: IF l_debug_mode = 'Y' THEN
5338: pa_debug.g_err_stage:= 'Option planned at Top Task and x_task_inclusion_flag = ' ||
5339: x_task_inclusion_flag || ' x_task_plannable_flag =' || x_task_plannable_flag ||
5340: ' x_top_task_planning_level ' || x_top_task_planning_level;
5341: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5342: END IF;
5337: IF l_debug_mode = 'Y' THEN
5338: pa_debug.g_err_stage:= 'Option planned at Top Task and x_task_inclusion_flag = ' ||
5339: x_task_inclusion_flag || ' x_task_plannable_flag =' || x_task_plannable_flag ||
5340: ' x_top_task_planning_level ' || x_top_task_planning_level;
5341: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5342: END IF;
5343:
5344: --Planning level of the options is either LOWEST or TOP AND LOWEST
5345:
5346: ELSIF p_option_plan_level_code IN (PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_LOWEST,
5347: PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_M) THEN
5348:
5349: IF l_debug_mode = 'Y' THEN
5350: pa_debug.g_err_stage:= 'Option planned at Lowest Task or Top and Lowest Task';
5351: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5352: END IF;
5353:
5354: --The task is a top task
5347: PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_M) THEN
5348:
5349: IF l_debug_mode = 'Y' THEN
5350: pa_debug.g_err_stage:= 'Option planned at Lowest Task or Top and Lowest Task';
5351: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5352: END IF;
5353:
5354: --The task is a top task
5355: IF p_task_level = L_TASK_LEVEL_TOP THEN
5367: x_task_plannable_flag := 'N' ;
5368: x_top_task_planning_level := PA_FP_CONSTANTS_PKG.G_TASK_PLAN_LEVEL_LOWEST;
5369:
5370: IF l_debug_mode = 'Y' THEN
5371: pa_debug.g_err_stage:= 'Task is a TOP TASK and x_task_inclusion_flag = '
5372: || x_task_inclusion_flag || ' x_task_plannable_flag ='
5373: ||x_task_plannable_flag || ' and x_top_task_planning_level =' ||
5374: x_top_task_planning_level;
5375: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5371: pa_debug.g_err_stage:= 'Task is a TOP TASK and x_task_inclusion_flag = '
5372: || x_task_inclusion_flag || ' x_task_plannable_flag ='
5373: ||x_task_plannable_flag || ' and x_top_task_planning_level =' ||
5374: x_top_task_planning_level;
5375: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5376: END IF;
5377:
5378: --The task is both top and lowest
5379: ELSIF l_child_task_exists = 0 THEN
5385: x_task_plannable_flag := 'Y' ;
5386: x_top_task_planning_level := PA_FP_CONSTANTS_PKG.G_TASK_PLAN_LEVEL_LOWEST;
5387:
5388: IF l_debug_mode = 'Y' THEN
5389: pa_debug.g_err_stage:= 'Task is a TOP and LOWEST TASK and x_task_inclusion_flag = '
5390: || x_task_inclusion_flag || ' x_task_plannable_flag ='
5391: ||x_task_plannable_flag || ' and x_top_task_planning_level =' ||
5392: x_top_task_planning_level;
5393:
5390: || x_task_inclusion_flag || ' x_task_plannable_flag ='
5391: ||x_task_plannable_flag || ' and x_top_task_planning_level =' ||
5392: x_top_task_planning_level;
5393:
5394: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5395: END IF;
5396:
5397: ELSE
5398:
5396:
5397: ELSE
5398:
5399: IF l_debug_mode = 'Y' THEN
5400: pa_debug.g_err_stage:= 'Error returned by pa_task_utils.check_child_exists. Sqlerrcode ' || to_char(l_child_task_exists);
5401: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5402: END IF;
5403:
5404: RAISE FND_API.G_Exc_Unexpected_Error;
5397: ELSE
5398:
5399: IF l_debug_mode = 'Y' THEN
5400: pa_debug.g_err_stage:= 'Error returned by pa_task_utils.check_child_exists. Sqlerrcode ' || to_char(l_child_task_exists);
5401: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5402: END IF;
5403:
5404: RAISE FND_API.G_Exc_Unexpected_Error;
5405:
5410: /* p_task_id is a sub task.
5411: We need to check if the top task of p_task_id is marked plannable */
5412:
5413: IF l_debug_mode = 'Y' THEN
5414: pa_debug.g_err_stage:= 'Task is a sub task';
5415: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5416: END IF;
5417:
5418: OPEN task_element_info_cur(p_top_task_id);
5411: We need to check if the top task of p_task_id is marked plannable */
5412:
5413: IF l_debug_mode = 'Y' THEN
5414: pa_debug.g_err_stage:= 'Task is a sub task';
5415: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5416: END IF;
5417:
5418: OPEN task_element_info_cur(p_top_task_id);
5419: FETCH task_element_info_cur INTO task_element_info_rec;
5432:
5433: CLOSE task_element_info_cur;
5434:
5435: IF l_debug_mode = 'Y' THEN
5436: pa_debug.g_err_stage:= 'Top Task not found in pa_fp_elements and hence x_task_inclusion_flag ' || x_task_inclusion_flag;
5437: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5438: END IF;
5439:
5440: ELSE
5433: CLOSE task_element_info_cur;
5434:
5435: IF l_debug_mode = 'Y' THEN
5436: pa_debug.g_err_stage:= 'Top Task not found in pa_fp_elements and hence x_task_inclusion_flag ' || x_task_inclusion_flag;
5437: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5438: END IF;
5439:
5440: ELSE
5441:
5449: x_task_plannable_flag := 'Y';
5450:
5451:
5452: IF l_debug_mode = 'Y' THEN
5453: pa_debug.g_err_stage:= 'Top task is planned at lowest task level and x_task_inclusion_flag = ' || x_task_inclusion_flag
5454: ||' x_task_plannable_flag = ' ||x_task_plannable_flag;
5455: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5456: END IF;
5457:
5451:
5452: IF l_debug_mode = 'Y' THEN
5453: pa_debug.g_err_stage:= 'Top task is planned at lowest task level and x_task_inclusion_flag = ' || x_task_inclusion_flag
5454: ||' x_task_plannable_flag = ' ||x_task_plannable_flag;
5455: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5456: END IF;
5457:
5458: ELSE
5459:
5462:
5463: x_task_inclusion_flag := 'N';
5464:
5465: IF l_debug_mode = 'Y' THEN
5466: pa_debug.g_err_stage:= 'Top task is NOT planned at lowest task and so x_task_inclusion_flag = ' || x_task_inclusion_flag;
5467: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5468: END IF;
5469:
5470: END IF; /* task_element_info_rec.top_task_planning_level = 'LOWEST' */
5463: x_task_inclusion_flag := 'N';
5464:
5465: IF l_debug_mode = 'Y' THEN
5466: pa_debug.g_err_stage:= 'Top task is NOT planned at lowest task and so x_task_inclusion_flag = ' || x_task_inclusion_flag;
5467: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5468: END IF;
5469:
5470: END IF; /* task_element_info_rec.top_task_planning_level = 'LOWEST' */
5471:
5477:
5478: END IF;/* If l_continue_processing = 'Y' */
5479:
5480: IF l_debug_mode = 'Y' THEN
5481: pa_debug.g_err_stage:= 'Exiting Get_Task_Element_Attributes';
5482: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5483: pa_debug.reset_curr_function;
5484: END IF;
5485:
5478: END IF;/* If l_continue_processing = 'Y' */
5479:
5480: IF l_debug_mode = 'Y' THEN
5481: pa_debug.g_err_stage:= 'Exiting Get_Task_Element_Attributes';
5482: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5483: pa_debug.reset_curr_function;
5484: END IF;
5485:
5486: EXCEPTION
5479:
5480: IF l_debug_mode = 'Y' THEN
5481: pa_debug.g_err_stage:= 'Exiting Get_Task_Element_Attributes';
5482: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5483: pa_debug.reset_curr_function;
5484: END IF;
5485:
5486: EXCEPTION
5487:
5503: ELSE
5504: x_msg_count := l_msg_count;
5505: END IF;
5506: IF l_debug_mode = 'Y' THEN
5507: pa_debug.reset_curr_function;
5508: END IF;
5509:
5510: RETURN;
5511:
5520: ,p_procedure_name => 'Get_Task_Element_Attributes'
5521: ,p_error_text => x_msg_data);
5522:
5523: IF l_debug_mode = 'Y' THEN
5524: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
5525: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5526: pa_debug.reset_curr_function;
5527: END IF;
5528: RAISE;
5521: ,p_error_text => x_msg_data);
5522:
5523: IF l_debug_mode = 'Y' THEN
5524: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
5525: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5526: pa_debug.reset_curr_function;
5527: END IF;
5528: RAISE;
5529: END Get_Task_Element_Attributes;
5522:
5523: IF l_debug_mode = 'Y' THEN
5524: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
5525: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5526: pa_debug.reset_curr_function;
5527: END IF;
5528: RAISE;
5529: END Get_Task_Element_Attributes;
5530:
5629:
5630: BEGIN
5631: x_msg_count := 0;
5632: x_return_status := FND_API.G_RET_STS_SUCCESS;
5633: l_debug_mode := NVL(FND_PROFILE.value('PA_DEBUG_MODE'),'N');
5634:
5635:
5636: -- Check for business rules violations
5637:
5635:
5636: -- Check for business rules violations
5637:
5638: IF l_debug_mode = 'Y' THEN
5639: pa_debug.set_curr_function( p_function => 'add_task_to_option',
5640: p_debug_mode => l_debug_mode );
5641: pa_debug.g_err_stage:= 'Validating input parameters';
5642: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5643: END IF;
5637:
5638: IF l_debug_mode = 'Y' THEN
5639: pa_debug.set_curr_function( p_function => 'add_task_to_option',
5640: p_debug_mode => l_debug_mode );
5641: pa_debug.g_err_stage:= 'Validating input parameters';
5642: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5643: END IF;
5644:
5645: IF (p_proj_fp_options_id IS NULL) OR
5638: IF l_debug_mode = 'Y' THEN
5639: pa_debug.set_curr_function( p_function => 'add_task_to_option',
5640: p_debug_mode => l_debug_mode );
5641: pa_debug.g_err_stage:= 'Validating input parameters';
5642: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5643: END IF;
5644:
5645: IF (p_proj_fp_options_id IS NULL) OR
5646: (p_element_type IS NULL) THEN
5645: IF (p_proj_fp_options_id IS NULL) OR
5646: (p_element_type IS NULL) THEN
5647:
5648: IF l_debug_mode = 'Y' THEN
5649: pa_debug.g_err_stage:= 'p_proj_fp_options_id = '|| p_proj_fp_options_id;
5650: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5651: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
5652: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5653: END IF;
5646: (p_element_type IS NULL) THEN
5647:
5648: IF l_debug_mode = 'Y' THEN
5649: pa_debug.g_err_stage:= 'p_proj_fp_options_id = '|| p_proj_fp_options_id;
5650: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5651: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
5652: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5653: END IF;
5654: PA_UTILS.ADD_MESSAGE
5647:
5648: IF l_debug_mode = 'Y' THEN
5649: pa_debug.g_err_stage:= 'p_proj_fp_options_id = '|| p_proj_fp_options_id;
5650: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5651: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
5652: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5653: END IF;
5654: PA_UTILS.ADD_MESSAGE
5655: (p_app_short_name => 'PA',
5648: IF l_debug_mode = 'Y' THEN
5649: pa_debug.g_err_stage:= 'p_proj_fp_options_id = '|| p_proj_fp_options_id;
5650: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5651: pa_debug.g_err_stage:= 'p_element_type = '|| p_element_type;
5652: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5653: END IF;
5654: PA_UTILS.ADD_MESSAGE
5655: (p_app_short_name => 'PA',
5656: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
5658:
5659: END IF;
5660:
5661: IF l_debug_mode = 'Y' THEN
5662: pa_debug.g_err_stage:= 'Opening proj_fp_options_cur.';
5663: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5664: END IF;
5665:
5666: OPEN proj_fp_options_cur;
5659: END IF;
5660:
5661: IF l_debug_mode = 'Y' THEN
5662: pa_debug.g_err_stage:= 'Opening proj_fp_options_cur.';
5663: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5664: END IF;
5665:
5666: OPEN proj_fp_options_cur;
5667: FETCH proj_fp_options_cur INTO proj_fp_options_rec;
5672: OPEN ci_version_info_cur(proj_fp_options_rec.fin_plan_version_id);
5673: FETCH ci_version_info_cur INTO ci_version_info_rec;
5674: IF ci_version_info_cur%NOTFOUND THEN
5675: IF l_debug_mode = 'Y' THEN
5676: pa_debug.g_err_stage:= 'The Option does not correspond to a CI Version';
5677: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5678: END IF;
5679: ELSE
5680: IF l_debug_mode = 'Y' THEN
5673: FETCH ci_version_info_cur INTO ci_version_info_rec;
5674: IF ci_version_info_cur%NOTFOUND THEN
5675: IF l_debug_mode = 'Y' THEN
5676: pa_debug.g_err_stage:= 'The Option does not correspond to a CI Version';
5677: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5678: END IF;
5679: ELSE
5680: IF l_debug_mode = 'Y' THEN
5681: pa_debug.g_err_stage:= 'The Option corresponds to a CI Version';
5677: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5678: END IF;
5679: ELSE
5680: IF l_debug_mode = 'Y' THEN
5681: pa_debug.g_err_stage:= 'The Option corresponds to a CI Version';
5682: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5683: END IF;
5684:
5685: --Check whether an impacted task id exists or not. If it exists store all the tasks
5678: END IF;
5679: ELSE
5680: IF l_debug_mode = 'Y' THEN
5681: pa_debug.g_err_stage:= 'The Option corresponds to a CI Version';
5682: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5683: END IF;
5684:
5685: --Check whether an impacted task id exists or not. If it exists store all the tasks
5686: --below that task in wbs in a pl/sql table so that only those tasks are processed.
5686: --below that task in wbs in a pl/sql table so that only those tasks are processed.
5687:
5688: IF ci_version_info_rec.impacted_task_id IS NOT NULL THEN
5689: IF l_debug_mode = 'Y' THEN
5690: pa_debug.g_err_stage:= 'The impacted task id is '
5691: ||ci_version_info_rec.impacted_task_id;
5692: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5693: END IF;
5694:
5688: IF ci_version_info_rec.impacted_task_id IS NOT NULL THEN
5689: IF l_debug_mode = 'Y' THEN
5690: pa_debug.g_err_stage:= 'The impacted task id is '
5691: ||ci_version_info_rec.impacted_task_id;
5692: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5693: END IF;
5694:
5695: FOR ci_impacted_tasks_rec IN ci_impacted_tasks_cur( proj_fp_options_rec.project_id
5696: ,ci_version_info_rec.impacted_task_id) LOOP
5727:
5728: l_continue_processing := 'N';
5729:
5730: IF l_debug_mode = 'Y' THEN
5731: pa_debug.g_err_stage:= 'The task '||p_tasks_tbl(i).task_id
5732: ||' is not under the impacted task '
5733: ||ci_version_info_rec.impacted_task_id;
5734: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5735: END IF;
5730: IF l_debug_mode = 'Y' THEN
5731: pa_debug.g_err_stage:= 'The task '||p_tasks_tbl(i).task_id
5732: ||' is not under the impacted task '
5733: ||ci_version_info_rec.impacted_task_id;
5734: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5735: END IF;
5736:
5737: END IF;
5738:
5762:
5763: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5764:
5765: IF l_debug_mode = 'Y' THEN
5766: pa_debug.g_err_stage := 'Error in Get_Task_Element_Attributes for task'
5767: || p_tasks_tbl(i).task_id ;
5768: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5769: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
5770:
5764:
5765: IF l_debug_mode = 'Y' THEN
5766: pa_debug.g_err_stage := 'Error in Get_Task_Element_Attributes for task'
5767: || p_tasks_tbl(i).task_id ;
5768: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5769: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
5770:
5771: END IF;
5772:
5792: AND pfe.task_id = p_tasks_tbl(i).parent_task_id
5793: AND pfe.resource_list_member_id <> 0;
5794:
5795: IF l_debug_mode = 'Y' THEN
5796: pa_debug.g_err_stage:= to_char(sql%rowcount) || ' records deleted from pa_fp_elements';
5797: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5798: END IF;
5799:
5800: UPDATE pa_fp_elements pfe
5793: AND pfe.resource_list_member_id <> 0;
5794:
5795: IF l_debug_mode = 'Y' THEN
5796: pa_debug.g_err_stage:= to_char(sql%rowcount) || ' records deleted from pa_fp_elements';
5797: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5798: END IF;
5799:
5800: UPDATE pa_fp_elements pfe
5801: SET pfe.plannable_flag = 'N',
5810: AND pfe.task_id = p_tasks_tbl(i).parent_task_id
5811: AND pfe.resource_list_member_id = 0;
5812:
5813: IF l_debug_mode = 'Y' THEN
5814: pa_debug.g_err_stage:= to_char(sql%rowcount) || ' records updated in pa_fp_elements';
5815: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5816: END IF;
5817:
5818: IF proj_fp_options_rec.fin_plan_option_level_code = PA_FP_CONSTANTS_PKG.G_OPTION_LEVEL_PLAN_VERSION THEN
5811: AND pfe.resource_list_member_id = 0;
5812:
5813: IF l_debug_mode = 'Y' THEN
5814: pa_debug.g_err_stage:= to_char(sql%rowcount) || ' records updated in pa_fp_elements';
5815: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5816: END IF;
5817:
5818: IF proj_fp_options_rec.fin_plan_option_level_code = PA_FP_CONSTANTS_PKG.G_OPTION_LEVEL_PLAN_VERSION THEN
5819:
5825: AND pra.task_id = p_tasks_tbl(i).parent_task_id
5826: AND pra.resource_assignment_type = PA_FP_CONSTANTS_PKG.G_USER_ENTERED;
5827:
5828: IF l_debug_mode = 'Y' THEN
5829: pa_debug.g_err_stage:= 'PLAN_VERSION option. ' || to_char(sql%rowcount) || ' records deleted from pa_resource_assignments';
5830: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5831: END IF;
5832:
5833: END IF; /* Option is PLAN_VERSION */
5826: AND pra.resource_assignment_type = PA_FP_CONSTANTS_PKG.G_USER_ENTERED;
5827:
5828: IF l_debug_mode = 'Y' THEN
5829: pa_debug.g_err_stage:= 'PLAN_VERSION option. ' || to_char(sql%rowcount) || ' records deleted from pa_resource_assignments';
5830: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5831: END IF;
5832:
5833: END IF; /* Option is PLAN_VERSION */
5834:
5899: /* If automatic resource selection is 'Y' for the proj_fp_option/element type,
5900: then resource elements need to be added */
5901:
5902: IF l_debug_mode = 'Y' THEN
5903: pa_debug.g_err_stage:= 'Calling add_resources_automatically...';
5904: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5905: END IF;
5906:
5907: l_task_id_tbl(1) := p_tasks_tbl(i).task_id;
5900: then resource elements need to be added */
5901:
5902: IF l_debug_mode = 'Y' THEN
5903: pa_debug.g_err_stage:= 'Calling add_resources_automatically...';
5904: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5905: END IF;
5906:
5907: l_task_id_tbl(1) := p_tasks_tbl(i).task_id;
5908:
5919: ,x_msg_data => x_msg_data);
5920:
5921: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5922:
5923: pa_debug.g_err_stage := 'Error while adding resoruces to task id ' || p_tasks_tbl(i).task_id ||
5924: 'for ' || p_element_type || ' option id ' || p_proj_fp_options_id;
5925: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5926:
5927: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
5921: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5922:
5923: pa_debug.g_err_stage := 'Error while adding resoruces to task id ' || p_tasks_tbl(i).task_id ||
5924: 'for ' || p_element_type || ' option id ' || p_proj_fp_options_id;
5925: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5926:
5927: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
5928:
5929: END IF;
5944:
5945: IF proj_fp_options_rec.fin_plan_option_level_code = PA_FP_CONSTANTS_PKG.G_OPTION_LEVEL_PLAN_VERSION THEN
5946:
5947: IF l_debug_mode = 'Y' THEN
5948: pa_debug.g_err_stage:= 'Calling create_enterable_resources...';
5949: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5950: END IF;
5951:
5952: PA_FP_ELEMENTS_PUB.create_enterable_resources
5945: IF proj_fp_options_rec.fin_plan_option_level_code = PA_FP_CONSTANTS_PKG.G_OPTION_LEVEL_PLAN_VERSION THEN
5946:
5947: IF l_debug_mode = 'Y' THEN
5948: pa_debug.g_err_stage:= 'Calling create_enterable_resources...';
5949: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5950: END IF;
5951:
5952: PA_FP_ELEMENTS_PUB.create_enterable_resources
5953: ( p_plan_version_id => proj_fp_options_rec.fin_plan_version_id
5957: ,x_msg_data => x_msg_data);
5958:
5959: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5960:
5961: pa_debug.g_err_stage := 'Error calling create enterable resoruces for version id'
5962: || proj_fp_options_rec.fin_plan_version_id;
5963: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5964:
5965: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
5959: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5960:
5961: pa_debug.g_err_stage := 'Error calling create enterable resoruces for version id'
5962: || proj_fp_options_rec.fin_plan_version_id;
5963: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
5964:
5965: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
5966: END IF;
5967:
5967:
5968: END IF; /* IF proj_fp_options_rec.fin_plan_option_level_code = PLAN_VERSION */
5969:
5970: IF l_debug_mode = 'Y' THEN
5971: pa_debug.g_err_stage:= 'Exiting add_task_to_option';
5972: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5973: pa_debug.reset_curr_function;
5974: END IF;
5975:
5968: END IF; /* IF proj_fp_options_rec.fin_plan_option_level_code = PLAN_VERSION */
5969:
5970: IF l_debug_mode = 'Y' THEN
5971: pa_debug.g_err_stage:= 'Exiting add_task_to_option';
5972: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5973: pa_debug.reset_curr_function;
5974: END IF;
5975:
5976: EXCEPTION
5969:
5970: IF l_debug_mode = 'Y' THEN
5971: pa_debug.g_err_stage:= 'Exiting add_task_to_option';
5972: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
5973: pa_debug.reset_curr_function;
5974: END IF;
5975:
5976: EXCEPTION
5977:
5993: ELSE
5994: x_msg_count := l_msg_count;
5995: END IF;
5996: IF l_debug_mode = 'Y' THEN
5997: pa_debug.reset_curr_function;
5998: END IF;
5999: RETURN;
6000:
6001: WHEN others THEN
6009: ,p_procedure_name => 'add_task_to_option'
6010: ,p_error_text => x_msg_data);
6011:
6012: IF l_debug_mode = 'Y' THEN
6013: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
6014: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6015: pa_debug.reset_curr_function;
6016: END IF;
6017: RAISE;
6010: ,p_error_text => x_msg_data);
6011:
6012: IF l_debug_mode = 'Y' THEN
6013: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
6014: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6015: pa_debug.reset_curr_function;
6016: END IF;
6017: RAISE;
6018: END add_tasks_to_option;
6011:
6012: IF l_debug_mode = 'Y' THEN
6013: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
6014: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6015: pa_debug.reset_curr_function;
6016: END IF;
6017: RAISE;
6018: END add_tasks_to_option;
6019:
6069: BEGIN
6070:
6071: x_msg_count := 0;
6072: x_return_status := FND_API.G_RET_STS_SUCCESS;
6073: l_debug_mode := NVL(FND_PROFILE.value('PA_DEBUG_MODE'),'N');
6074:
6075:
6076: -- Check for business rules violations
6077:
6075:
6076: -- Check for business rules violations
6077:
6078: IF l_debug_mode = 'Y' THEN
6079: pa_debug.set_curr_function( p_function => 'make_new_tasks_plannable',
6080: p_debug_mode => l_debug_mode );
6081: pa_debug.g_err_stage:= 'Validating input parameters';
6082: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6083: END IF;
6077:
6078: IF l_debug_mode = 'Y' THEN
6079: pa_debug.set_curr_function( p_function => 'make_new_tasks_plannable',
6080: p_debug_mode => l_debug_mode );
6081: pa_debug.g_err_stage:= 'Validating input parameters';
6082: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6083: END IF;
6084:
6085: IF (p_project_id IS NULL)
6078: IF l_debug_mode = 'Y' THEN
6079: pa_debug.set_curr_function( p_function => 'make_new_tasks_plannable',
6080: p_debug_mode => l_debug_mode );
6081: pa_debug.g_err_stage:= 'Validating input parameters';
6082: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6083: END IF;
6084:
6085: IF (p_project_id IS NULL)
6086: THEN
6084:
6085: IF (p_project_id IS NULL)
6086: THEN
6087: IF l_debug_mode = 'Y' THEN
6088: pa_debug.g_err_stage:= 'p_project_id = '|| p_project_id;
6089: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6090: END IF;
6091: PA_UTILS.ADD_MESSAGE
6092: (p_app_short_name => 'PA',
6085: IF (p_project_id IS NULL)
6086: THEN
6087: IF l_debug_mode = 'Y' THEN
6088: pa_debug.g_err_stage:= 'p_project_id = '|| p_project_id;
6089: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6090: END IF;
6091: PA_UTILS.ADD_MESSAGE
6092: (p_app_short_name => 'PA',
6093: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
6100: IF NVL(p_tasks_tbl.last,0) = 0 OR
6101: NVL(p_refresh_fp_options_tbl.last,0) = 0 THEN
6102:
6103: IF l_debug_mode = 'Y' THEN
6104: pa_debug.g_err_stage:= 'task table/proj fp options table have no records. Returning from make_new_tasks_plannable ';
6105: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6106: END IF;
6107:
6108: RETURN;
6101: NVL(p_refresh_fp_options_tbl.last,0) = 0 THEN
6102:
6103: IF l_debug_mode = 'Y' THEN
6104: pa_debug.g_err_stage:= 'task table/proj fp options table have no records. Returning from make_new_tasks_plannable ';
6105: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6106: END IF;
6107:
6108: RETURN;
6109:
6109:
6110: END IF;
6111:
6112: IF l_debug_mode = 'Y' THEN
6113: pa_debug.g_err_stage:= 'task table has records.';
6114: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6115: END IF;
6116:
6117: /* Loop through the table and process the task records */
6110: END IF;
6111:
6112: IF l_debug_mode = 'Y' THEN
6113: pa_debug.g_err_stage:= 'task table has records.';
6114: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6115: END IF;
6116:
6117: /* Loop through the table and process the task records */
6118:
6121: /* If the task is a middle level task delete all the references of that task from
6122: pa_fp_elements and pa_resource_assignments */
6123:
6124: IF l_debug_mode = 'Y' THEN
6125: pa_debug.g_err_stage:= 'task_id ' || p_tasks_tbl(i).task_id;
6126: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6127: pa_debug.g_err_stage:= 'task_level ' || p_tasks_tbl(i).task_level;
6128: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6129: END IF;
6122: pa_fp_elements and pa_resource_assignments */
6123:
6124: IF l_debug_mode = 'Y' THEN
6125: pa_debug.g_err_stage:= 'task_id ' || p_tasks_tbl(i).task_id;
6126: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6127: pa_debug.g_err_stage:= 'task_level ' || p_tasks_tbl(i).task_level;
6128: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6129: END IF;
6130:
6123:
6124: IF l_debug_mode = 'Y' THEN
6125: pa_debug.g_err_stage:= 'task_id ' || p_tasks_tbl(i).task_id;
6126: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6127: pa_debug.g_err_stage:= 'task_level ' || p_tasks_tbl(i).task_level;
6128: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6129: END IF;
6130:
6131: IF p_tasks_tbl(i).task_level = L_TASK_LEVEL_MIDDLE THEN
6124: IF l_debug_mode = 'Y' THEN
6125: pa_debug.g_err_stage:= 'task_id ' || p_tasks_tbl(i).task_id;
6126: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6127: pa_debug.g_err_stage:= 'task_level ' || p_tasks_tbl(i).task_level;
6128: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6129: END IF;
6130:
6131: IF p_tasks_tbl(i).task_level = L_TASK_LEVEL_MIDDLE THEN
6132:
6137: WHERE task_id = p_tasks_tbl(i).task_id
6138: AND proj_fp_options_id = p_refresh_fp_options_tbl(k); /* We are deleting irrespective of element_type */
6139:
6140: IF l_debug_mode = 'Y' THEN
6141: pa_debug.g_err_stage:= 'No of records deleted from pa_fp_elements ' ||SQL%ROWCOUNT;
6142: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6143: END IF;
6144:
6145: --Delete the task references from pa_resource_assignments
6138: AND proj_fp_options_id = p_refresh_fp_options_tbl(k); /* We are deleting irrespective of element_type */
6139:
6140: IF l_debug_mode = 'Y' THEN
6141: pa_debug.g_err_stage:= 'No of records deleted from pa_fp_elements ' ||SQL%ROWCOUNT;
6142: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6143: END IF;
6144:
6145: --Delete the task references from pa_resource_assignments
6146: FORALL k IN p_refresh_fp_options_tbl.first .. p_refresh_fp_options_tbl.last
6153: p_refresh_fp_options_tbl(k))
6154: AND pra.resource_assignment_type = PA_FP_CONSTANTS_PKG.G_USER_ENTERED;
6155:
6156: IF l_debug_mode = 'Y' THEN
6157: pa_debug.g_err_stage:= 'No of records deleted from pa_resource_assignments ' ||SQL%ROWCOUNT;
6158: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6159: END IF;
6160:
6161: END IF; /* IF p_tasks_tbl(i).task_level = M */
6154: AND pra.resource_assignment_type = PA_FP_CONSTANTS_PKG.G_USER_ENTERED;
6155:
6156: IF l_debug_mode = 'Y' THEN
6157: pa_debug.g_err_stage:= 'No of records deleted from pa_resource_assignments ' ||SQL%ROWCOUNT;
6158: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6159: END IF;
6160:
6161: END IF; /* IF p_tasks_tbl(i).task_level = M */
6162:
6165: --Loop through the table and process the option records
6166: FOR j IN p_refresh_fp_options_tbl.first .. p_refresh_fp_options_tbl.last LOOP
6167:
6168: IF l_debug_mode = 'Y' THEN
6169: pa_debug.g_err_stage:= 'Opening fp_options_info_cur';
6170: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6171: END IF;
6172:
6173: OPEN fp_options_info_cur(p_refresh_fp_options_tbl(j));
6166: FOR j IN p_refresh_fp_options_tbl.first .. p_refresh_fp_options_tbl.last LOOP
6167:
6168: IF l_debug_mode = 'Y' THEN
6169: pa_debug.g_err_stage:= 'Opening fp_options_info_cur';
6170: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6171: END IF;
6172:
6173: OPEN fp_options_info_cur(p_refresh_fp_options_tbl(j));
6174: FETCH fp_options_info_cur INTO fp_options_info_rec;
6174: FETCH fp_options_info_cur INTO fp_options_info_rec;
6175: IF fp_options_info_cur%NOTFOUND THEN
6176:
6177: IF l_debug_mode = 'Y' THEN
6178: pa_debug.g_err_stage:= 'fp_options_info_cur did not return rows for option id '||p_refresh_fp_options_tbl(j);
6179: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6180: END IF;
6181: CLOSE fp_options_info_cur;
6182: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
6175: IF fp_options_info_cur%NOTFOUND THEN
6176:
6177: IF l_debug_mode = 'Y' THEN
6178: pa_debug.g_err_stage:= 'fp_options_info_cur did not return rows for option id '||p_refresh_fp_options_tbl(j);
6179: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6180: END IF;
6181: CLOSE fp_options_info_cur;
6182: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
6183:
6188:
6189: IF l_process_option= 'Y' THEN
6190:
6191: IF l_debug_mode = 'Y' THEN
6192: pa_debug.g_err_stage:= 'About to process the option id '||p_refresh_fp_options_tbl(j);
6193: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6194: END IF;
6195:
6196: IF fp_options_info_rec.fin_plan_preference_code IN
6189: IF l_process_option= 'Y' THEN
6190:
6191: IF l_debug_mode = 'Y' THEN
6192: pa_debug.g_err_stage:= 'About to process the option id '||p_refresh_fp_options_tbl(j);
6193: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6194: END IF;
6195:
6196: IF fp_options_info_rec.fin_plan_preference_code IN
6197: (PA_FP_CONSTANTS_PKG.G_PREF_COST_ONLY,
6208: ,x_msg_data => x_msg_data);
6209:
6210: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
6211:
6212: pa_debug.g_err_stage := 'Error while adding tasks to cost option id ' || p_refresh_fp_options_tbl(j);
6213: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6214:
6215: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
6216:
6209:
6210: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
6211:
6212: pa_debug.g_err_stage := 'Error while adding tasks to cost option id ' || p_refresh_fp_options_tbl(j);
6213: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6214:
6215: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
6216:
6217: END IF;
6235: ,x_msg_data => x_msg_data);
6236:
6237: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
6238:
6239: pa_debug.g_err_stage := 'Error while adding task id to revenue option id '
6240: || p_refresh_fp_options_tbl(j);
6241: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6242: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
6243:
6237: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
6238:
6239: pa_debug.g_err_stage := 'Error while adding task id to revenue option id '
6240: || p_refresh_fp_options_tbl(j);
6241: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6242: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
6243:
6244: END IF;
6245:
6260: ,x_msg_data => x_msg_data);
6261:
6262: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
6263:
6264: pa_debug.g_err_stage := 'Error while adding task id to ALL option id '
6265: || p_refresh_fp_options_tbl(j);
6266: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6267:
6268: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
6262: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
6263:
6264: pa_debug.g_err_stage := 'Error while adding task id to ALL option id '
6265: || p_refresh_fp_options_tbl(j);
6266: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6267:
6268: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
6269:
6270: END IF;
6277:
6278: END LOOP; /* FOR j IN p_refresh_fp_options_tbl.first .. p_refresh_fp_options_tbl.last */
6279:
6280: IF l_debug_mode = 'Y' THEN
6281: pa_debug.g_err_stage:= 'Exiting make_new_tasks_plannable';
6282: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6283: pa_debug.reset_curr_function;
6284: END IF;
6285:
6278: END LOOP; /* FOR j IN p_refresh_fp_options_tbl.first .. p_refresh_fp_options_tbl.last */
6279:
6280: IF l_debug_mode = 'Y' THEN
6281: pa_debug.g_err_stage:= 'Exiting make_new_tasks_plannable';
6282: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6283: pa_debug.reset_curr_function;
6284: END IF;
6285:
6286:
6279:
6280: IF l_debug_mode = 'Y' THEN
6281: pa_debug.g_err_stage:= 'Exiting make_new_tasks_plannable';
6282: pa_debug.write(L_PROCEDURE_NAME,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6283: pa_debug.reset_curr_function;
6284: END IF;
6285:
6286:
6287: EXCEPTION
6304: ELSE
6305: x_msg_count := l_msg_count;
6306: END IF;
6307: IF l_debug_mode = 'Y' THEN
6308: pa_debug.reset_curr_function;
6309: END IF;
6310: RETURN;
6311:
6312: WHEN others THEN
6320: ,p_procedure_name => 'make_new_tasks_plannable'
6321: ,p_error_text => x_msg_data);
6322:
6323: IF l_debug_mode = 'Y' THEN
6324: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
6325: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6326: pa_debug.reset_curr_function;
6327: END IF;
6328:
6321: ,p_error_text => x_msg_data);
6322:
6323: IF l_debug_mode = 'Y' THEN
6324: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
6325: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6326: pa_debug.reset_curr_function;
6327: END IF;
6328:
6329: RAISE;
6322:
6323: IF l_debug_mode = 'Y' THEN
6324: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
6325: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6326: pa_debug.reset_curr_function;
6327: END IF;
6328:
6329: RAISE;
6330: END make_new_tasks_plannable;
6538: /* Oracle error returned */
6539:
6540: IF l_debug_mode = 'Y' THEN
6541:
6542: pa_debug.g_err_stage:= 'Oracle error occurred while calling check_child_exists. Sqlerrcode ' || to_char(l_child_task_exists);
6543: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6544:
6545: END IF;
6546:
6539:
6540: IF l_debug_mode = 'Y' THEN
6541:
6542: pa_debug.g_err_stage:= 'Oracle error occurred while calling check_child_exists. Sqlerrcode ' || to_char(l_child_task_exists);
6543: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6544:
6545: END IF;
6546:
6547: RAISE FND_API.G_Exc_Unexpected_Error;
6557: BEGIN
6558:
6559: x_msg_count := 0;
6560: x_return_status := FND_API.G_RET_STS_SUCCESS;
6561: l_debug_mode := NVL(FND_PROFILE.value('PA_DEBUG_MODE'),'N');
6562:
6563: IF l_debug_mode = 'Y' THEN
6564: pa_debug.set_curr_function( p_function => 'maintain_plannable_tasks',
6565: p_debug_mode => l_debug_mode );
6560: x_return_status := FND_API.G_RET_STS_SUCCESS;
6561: l_debug_mode := NVL(FND_PROFILE.value('PA_DEBUG_MODE'),'N');
6562:
6563: IF l_debug_mode = 'Y' THEN
6564: pa_debug.set_curr_function( p_function => 'maintain_plannable_tasks',
6565: p_debug_mode => l_debug_mode );
6566: END IF;
6567:
6568: -- Check for business rules violations
6567:
6568: -- Check for business rules violations
6569:
6570: IF l_debug_mode = 'Y' THEN
6571: pa_debug.g_err_stage:= 'Validating input parameters';
6572: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6573: L_DEBUG_LEVEL3);
6574: END IF;
6575:
6568: -- Check for business rules violations
6569:
6570: IF l_debug_mode = 'Y' THEN
6571: pa_debug.g_err_stage:= 'Validating input parameters';
6572: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6573: L_DEBUG_LEVEL3);
6574: END IF;
6575:
6576: IF (p_project_id IS NULL) THEN
6575:
6576: IF (p_project_id IS NULL) THEN
6577:
6578: IF l_debug_mode = 'Y' THEN
6579: pa_debug.g_err_stage:= 'p_project_id = '|| p_project_id;
6580: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6581: L_DEBUG_LEVEL5);
6582: END IF;
6583: PA_UTILS.ADD_MESSAGE
6576: IF (p_project_id IS NULL) THEN
6577:
6578: IF l_debug_mode = 'Y' THEN
6579: pa_debug.g_err_stage:= 'p_project_id = '|| p_project_id;
6580: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6581: L_DEBUG_LEVEL5);
6582: END IF;
6583: PA_UTILS.ADD_MESSAGE
6584: (p_app_short_name => 'PA',
6600: END IF;
6601: CLOSE check_options_exists_cur;
6602: /* end of bug 3342975 */
6603: IF l_debug_mode = 'Y' THEN
6604: pa_debug.g_err_stage:= 'Option Exists for project id: '
6605: || to_char(p_project_id) || ' is '
6606: || l_option_exists;
6607: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6608: L_DEBUG_LEVEL3);
6603: IF l_debug_mode = 'Y' THEN
6604: pa_debug.g_err_stage:= 'Option Exists for project id: '
6605: || to_char(p_project_id) || ' is '
6606: || l_option_exists;
6607: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6608: L_DEBUG_LEVEL3);
6609: pa_debug.g_err_stage:= 'Number of tasks to be processed: '
6610: || to_char(p_impacted_tasks_tbl.count);
6611: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6605: || to_char(p_project_id) || ' is '
6606: || l_option_exists;
6607: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6608: L_DEBUG_LEVEL3);
6609: pa_debug.g_err_stage:= 'Number of tasks to be processed: '
6610: || to_char(p_impacted_tasks_tbl.count);
6611: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6612: L_DEBUG_LEVEL3);
6613: END IF;
6607: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6608: L_DEBUG_LEVEL3);
6609: pa_debug.g_err_stage:= 'Number of tasks to be processed: '
6610: || to_char(p_impacted_tasks_tbl.count);
6611: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6612: L_DEBUG_LEVEL3);
6613: END IF;
6614:
6615: /* No processing is required if financial planning options
6636:
6637: /* Unexpected oracle error */
6638:
6639: IF l_debug_mode = 'Y' THEN
6640: pa_debug.g_err_stage:= 'Check_Proj_Fp_Options_Exists returned oracle error ' ||
6641: to_char(l_option_exists);
6642: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6643: L_DEBUG_LEVEL5);
6644: END IF;
6638:
6639: IF l_debug_mode = 'Y' THEN
6640: pa_debug.g_err_stage:= 'Check_Proj_Fp_Options_Exists returned oracle error ' ||
6641: to_char(l_option_exists);
6642: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6643: L_DEBUG_LEVEL5);
6644: END IF;
6645:
6646: Raise PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
6663: entry for a task id, only then we refer the database to check if the task is a
6664: middle level task and if so, cache it in the plsql table. */
6665:
6666: IF l_debug_mode = 'Y' THEN
6667: pa_debug.g_err_stage:= 'Identifying middle level tasks by looping the p_impacted_tasks_tbl';
6668: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6669: L_DEBUG_LEVEL3);
6670: END IF;
6671:
6664: middle level task and if so, cache it in the plsql table. */
6665:
6666: IF l_debug_mode = 'Y' THEN
6667: pa_debug.g_err_stage:= 'Identifying middle level tasks by looping the p_impacted_tasks_tbl';
6668: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6669: L_DEBUG_LEVEL3);
6670: END IF;
6671:
6672: FOR I in p_impacted_tasks_tbl.first .. p_impacted_tasks_tbl.last LOOP
6687: FOR I in p_impacted_tasks_tbl.first .. p_impacted_tasks_tbl.last LOOP
6688:
6689: IF l_debug_mode = 'Y' THEN
6690:
6691: pa_debug.g_err_stage:= 'impacted task id is ' || p_impacted_tasks_tbl(i).impacted_task_id;
6692: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6693: pa_debug.g_err_stage:= 'old parent task id is ' || p_impacted_tasks_tbl(i).old_parent_task_id;
6694: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6695: pa_debug.g_err_stage:= 'new parent task id is ' || p_impacted_tasks_tbl(i).new_parent_task_id;
6688:
6689: IF l_debug_mode = 'Y' THEN
6690:
6691: pa_debug.g_err_stage:= 'impacted task id is ' || p_impacted_tasks_tbl(i).impacted_task_id;
6692: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6693: pa_debug.g_err_stage:= 'old parent task id is ' || p_impacted_tasks_tbl(i).old_parent_task_id;
6694: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6695: pa_debug.g_err_stage:= 'new parent task id is ' || p_impacted_tasks_tbl(i).new_parent_task_id;
6696: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6689: IF l_debug_mode = 'Y' THEN
6690:
6691: pa_debug.g_err_stage:= 'impacted task id is ' || p_impacted_tasks_tbl(i).impacted_task_id;
6692: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6693: pa_debug.g_err_stage:= 'old parent task id is ' || p_impacted_tasks_tbl(i).old_parent_task_id;
6694: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6695: pa_debug.g_err_stage:= 'new parent task id is ' || p_impacted_tasks_tbl(i).new_parent_task_id;
6696: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6697: pa_debug.g_err_stage:= 'top task id is ' || p_impacted_tasks_tbl(i).top_task_id;
6690:
6691: pa_debug.g_err_stage:= 'impacted task id is ' || p_impacted_tasks_tbl(i).impacted_task_id;
6692: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6693: pa_debug.g_err_stage:= 'old parent task id is ' || p_impacted_tasks_tbl(i).old_parent_task_id;
6694: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6695: pa_debug.g_err_stage:= 'new parent task id is ' || p_impacted_tasks_tbl(i).new_parent_task_id;
6696: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6697: pa_debug.g_err_stage:= 'top task id is ' || p_impacted_tasks_tbl(i).top_task_id;
6698: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6691: pa_debug.g_err_stage:= 'impacted task id is ' || p_impacted_tasks_tbl(i).impacted_task_id;
6692: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6693: pa_debug.g_err_stage:= 'old parent task id is ' || p_impacted_tasks_tbl(i).old_parent_task_id;
6694: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6695: pa_debug.g_err_stage:= 'new parent task id is ' || p_impacted_tasks_tbl(i).new_parent_task_id;
6696: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6697: pa_debug.g_err_stage:= 'top task id is ' || p_impacted_tasks_tbl(i).top_task_id;
6698: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6699: pa_debug.g_err_stage:= 'action is ' || p_impacted_tasks_tbl(i).action;
6692: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6693: pa_debug.g_err_stage:= 'old parent task id is ' || p_impacted_tasks_tbl(i).old_parent_task_id;
6694: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6695: pa_debug.g_err_stage:= 'new parent task id is ' || p_impacted_tasks_tbl(i).new_parent_task_id;
6696: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6697: pa_debug.g_err_stage:= 'top task id is ' || p_impacted_tasks_tbl(i).top_task_id;
6698: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6699: pa_debug.g_err_stage:= 'action is ' || p_impacted_tasks_tbl(i).action;
6700: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6693: pa_debug.g_err_stage:= 'old parent task id is ' || p_impacted_tasks_tbl(i).old_parent_task_id;
6694: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6695: pa_debug.g_err_stage:= 'new parent task id is ' || p_impacted_tasks_tbl(i).new_parent_task_id;
6696: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6697: pa_debug.g_err_stage:= 'top task id is ' || p_impacted_tasks_tbl(i).top_task_id;
6698: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6699: pa_debug.g_err_stage:= 'action is ' || p_impacted_tasks_tbl(i).action;
6700: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6701:
6694: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6695: pa_debug.g_err_stage:= 'new parent task id is ' || p_impacted_tasks_tbl(i).new_parent_task_id;
6696: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6697: pa_debug.g_err_stage:= 'top task id is ' || p_impacted_tasks_tbl(i).top_task_id;
6698: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6699: pa_debug.g_err_stage:= 'action is ' || p_impacted_tasks_tbl(i).action;
6700: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6701:
6702: END IF;
6695: pa_debug.g_err_stage:= 'new parent task id is ' || p_impacted_tasks_tbl(i).new_parent_task_id;
6696: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6697: pa_debug.g_err_stage:= 'top task id is ' || p_impacted_tasks_tbl(i).top_task_id;
6698: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6699: pa_debug.g_err_stage:= 'action is ' || p_impacted_tasks_tbl(i).action;
6700: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6701:
6702: END IF;
6703:
6696: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6697: pa_debug.g_err_stage:= 'top task id is ' || p_impacted_tasks_tbl(i).top_task_id;
6698: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6699: pa_debug.g_err_stage:= 'action is ' || p_impacted_tasks_tbl(i).action;
6700: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6701:
6702: END IF;
6703:
6704: l_make_task_plannable := Null;
6710: p_impacted_tasks_tbl(i).new_parent_task_id IS NULL) OR
6711: p_impacted_tasks_tbl(i).top_task_id IS NULL THEN
6712:
6713: IF l_debug_mode = 'Y' THEN
6714: pa_debug.g_err_stage:= 'For INSERT action : ' ||
6715: 'Impacted_task_id, New_parent_task_id, Top_task_id should be passed';
6716: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6717: END IF;
6718: PA_UTILS.ADD_MESSAGE
6712:
6713: IF l_debug_mode = 'Y' THEN
6714: pa_debug.g_err_stage:= 'For INSERT action : ' ||
6715: 'Impacted_task_id, New_parent_task_id, Top_task_id should be passed';
6716: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6717: END IF;
6718: PA_UTILS.ADD_MESSAGE
6719: (p_app_short_name => 'PA',
6720: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
6735: p_top_task_id => p_impacted_tasks_tbl(i).top_task_id);
6736:
6737: IF l_debug_mode = 'Y' THEN
6738:
6739: pa_debug.g_err_stage:= 'l_make_task_plannable = ' || l_make_task_plannable;
6740: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6741:
6742: END IF;
6743:
6736:
6737: IF l_debug_mode = 'Y' THEN
6738:
6739: pa_debug.g_err_stage:= 'l_make_task_plannable = ' || l_make_task_plannable;
6740: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6741:
6742: END IF;
6743:
6744: IF l_make_task_plannable = 'Y' THEN
6747: adding it once again */
6748:
6749: IF l_debug_mode = 'Y' THEN
6750:
6751: pa_debug.g_err_stage:= 'Calling make_new_tasks_plannable for impacted task id';
6752: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6753:
6754: END IF;
6755:
6748:
6749: IF l_debug_mode = 'Y' THEN
6750:
6751: pa_debug.g_err_stage:= 'Calling make_new_tasks_plannable for impacted task id';
6752: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6753:
6754: END IF;
6755:
6756: /* Calling pa_fp_elements_pub.make_new_tasks_plannable for impacted task id */
6786:
6787: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
6788:
6789: IF l_debug_mode = 'Y' THEN
6790: pa_debug.g_err_stage:= 'Error returned by make_new_tasks_plannable for task_id ' ||
6791: p_impacted_tasks_tbl(i).impacted_task_id;
6792: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6793: END IF;
6794:
6788:
6789: IF l_debug_mode = 'Y' THEN
6790: pa_debug.g_err_stage:= 'Error returned by make_new_tasks_plannable for task_id ' ||
6791: p_impacted_tasks_tbl(i).impacted_task_id;
6792: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6793: END IF;
6794:
6795: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
6796:
6812: p_impacted_tasks_tbl(i).old_parent_task_id IS NULL OR
6813: p_impacted_tasks_tbl(i).top_task_id IS NULL THEN
6814:
6815: IF l_debug_mode = 'Y' THEN
6816: pa_debug.g_err_stage:= 'For REPARENT action : ' ||
6817: 'Impacted_task_id, New_parent_task_id, old_parent_task_id, Top_task_id should be passed';
6818: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6819: END IF;
6820: PA_UTILS.ADD_MESSAGE
6814:
6815: IF l_debug_mode = 'Y' THEN
6816: pa_debug.g_err_stage:= 'For REPARENT action : ' ||
6817: 'Impacted_task_id, New_parent_task_id, old_parent_task_id, Top_task_id should be passed';
6818: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6819: END IF;
6820: PA_UTILS.ADD_MESSAGE
6821: (p_app_short_name => 'PA',
6822: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
6841: p_top_task_id => pa_task_utils.get_top_task_id(x_task_id => p_impacted_tasks_tbl(i).old_parent_task_id));
6842:
6843: IF l_debug_mode = 'Y' THEN
6844:
6845: pa_debug.g_err_stage:= 'l_make_task_plannable = ' || l_make_task_plannable;
6846: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6847:
6848: END IF;
6849:
6842:
6843: IF l_debug_mode = 'Y' THEN
6844:
6845: pa_debug.g_err_stage:= 'l_make_task_plannable = ' || l_make_task_plannable;
6846: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6847:
6848: END IF;
6849:
6850: /* If old task is a middle level task then
6853: IF l_make_task_plannable = 'Y' THEN
6854:
6855: IF l_debug_mode = 'Y' THEN
6856:
6857: pa_debug.g_err_stage:= 'Calling make_new_tasks_plannable for old parent task id';
6858: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6859:
6860: END IF;
6861:
6854:
6855: IF l_debug_mode = 'Y' THEN
6856:
6857: pa_debug.g_err_stage:= 'Calling make_new_tasks_plannable for old parent task id';
6858: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6859:
6860: END IF;
6861:
6862: /* Calling pa_fp_elements_pub.make_new_tasks_plannable for old parent task id */
6890:
6891: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
6892:
6893: IF l_debug_mode = 'Y' THEN
6894: pa_debug.g_err_stage:= 'Error returned by make_new_tasks_plannable for task_id ' ||
6895: p_impacted_tasks_tbl(i).old_parent_task_id;
6896: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6897: END IF;
6898:
6892:
6893: IF l_debug_mode = 'Y' THEN
6894: pa_debug.g_err_stage:= 'Error returned by make_new_tasks_plannable for task_id ' ||
6895: p_impacted_tasks_tbl(i).old_parent_task_id;
6896: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6897: END IF;
6898:
6899: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
6900:
6931: plannable impacted task also from pa_fp_elements and pa_resource_assignments */
6932:
6933: IF l_debug_mode = 'Y' THEN
6934:
6935: pa_debug.g_err_stage:= 'Deleting task fp elements for new parent task id';
6936: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6937:
6938: END IF;
6939:
6932:
6933: IF l_debug_mode = 'Y' THEN
6934:
6935: pa_debug.g_err_stage:= 'Deleting task fp elements for new parent task id';
6936: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
6937:
6938: END IF;
6939:
6940: DELETE FROM pa_fp_elements e
6942:
6943: l_records_deleted := sql%rowcount;
6944:
6945: IF l_debug_mode = 'Y' THEN
6946: pa_debug.g_err_stage:= To_char(l_records_deleted) || ' records deleted.';
6947: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6948: L_DEBUG_LEVEL3);
6949: END IF;
6950:
6943: l_records_deleted := sql%rowcount;
6944:
6945: IF l_debug_mode = 'Y' THEN
6946: pa_debug.g_err_stage:= To_char(l_records_deleted) || ' records deleted.';
6947: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6948: L_DEBUG_LEVEL3);
6949: END IF;
6950:
6951: IF l_records_deleted <> 0 THEN
6950:
6951: IF l_records_deleted <> 0 THEN
6952:
6953: IF l_debug_mode = 'Y' THEN
6954: pa_debug.g_err_stage:= 'Deleting from pa_resource_assignments for task id ' || to_char(p_impacted_tasks_tbl(i).new_parent_task_id);
6955: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6956: L_DEBUG_LEVEL3);
6957: END IF;
6958:
6951: IF l_records_deleted <> 0 THEN
6952:
6953: IF l_debug_mode = 'Y' THEN
6954: pa_debug.g_err_stage:= 'Deleting from pa_resource_assignments for task id ' || to_char(p_impacted_tasks_tbl(i).new_parent_task_id);
6955: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6956: L_DEBUG_LEVEL3);
6957: END IF;
6958:
6959: DELETE FROM pa_resource_assignments r
6961:
6962: l_records_deleted := sql%rowcount;
6963:
6964: IF l_debug_mode = 'Y' THEN
6965: pa_debug.g_err_stage:= To_char(l_records_deleted) || ' records deleted.';
6966: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6967: L_DEBUG_LEVEL3);
6968: END IF;
6969:
6962: l_records_deleted := sql%rowcount;
6963:
6964: IF l_debug_mode = 'Y' THEN
6965: pa_debug.g_err_stage:= To_char(l_records_deleted) || ' records deleted.';
6966: pa_debug.write(l_module_name,pa_debug.g_err_stage,
6967: L_DEBUG_LEVEL3);
6968: END IF;
6969:
6970: END IF;
6987: p_impacted_tasks_tbl(i).old_parent_task_id IS NULL) OR
6988: p_impacted_tasks_tbl(i).top_task_id IS NULL THEN
6989:
6990: IF l_debug_mode = 'Y' THEN
6991: pa_debug.g_err_stage:= 'For DELETE action : ' ||
6992: 'Impacted_task_id, old_parent_task_id, Top_task_id should be passed';
6993: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6994: END IF;
6995: PA_UTILS.ADD_MESSAGE
6989:
6990: IF l_debug_mode = 'Y' THEN
6991: pa_debug.g_err_stage:= 'For DELETE action : ' ||
6992: 'Impacted_task_id, old_parent_task_id, Top_task_id should be passed';
6993: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
6994: END IF;
6995: PA_UTILS.ADD_MESSAGE
6996: (p_app_short_name => 'PA',
6997: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
7005: IF NOT(l_tasks_removed_tbl.exists(p_impacted_tasks_tbl(i).impacted_task_id)) THEN
7006:
7007: IF l_debug_mode = 'Y' THEN
7008:
7009: pa_debug.g_err_stage:= 'Calling delete_task_elements for impacted task id';
7010: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
7011:
7012: END IF;
7013:
7006:
7007: IF l_debug_mode = 'Y' THEN
7008:
7009: pa_debug.g_err_stage:= 'Calling delete_task_elements for impacted task id';
7010: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
7011:
7012: END IF;
7013:
7014: /* Calling pa_fp_elements_pub.delete_task_elements for impacted task id */
7020:
7021: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
7022:
7023: IF l_debug_mode = 'Y' THEN
7024: pa_debug.g_err_stage:= 'Error returned by delete_task_elements for task_id ' ||
7025: p_impacted_tasks_tbl(i).impacted_task_id;
7026: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
7027: END IF;
7028:
7022:
7023: IF l_debug_mode = 'Y' THEN
7024: pa_debug.g_err_stage:= 'Error returned by delete_task_elements for task_id ' ||
7025: p_impacted_tasks_tbl(i).impacted_task_id;
7026: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
7027: END IF;
7028:
7029: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
7030:
7061: END;
7062:
7063: IF l_debug_mode = 'Y' THEN
7064:
7065: pa_debug.g_err_stage:= 'l_make_task_plannable = ' || l_make_task_plannable;
7066: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
7067:
7068: END IF;
7069:
7062:
7063: IF l_debug_mode = 'Y' THEN
7064:
7065: pa_debug.g_err_stage:= 'l_make_task_plannable = ' || l_make_task_plannable;
7066: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
7067:
7068: END IF;
7069:
7070: /* We need to call make new task plannable to add the old parent task id as plannable */
7072: IF l_make_task_plannable = 'Y' THEN
7073:
7074: IF l_debug_mode = 'Y' THEN
7075:
7076: pa_debug.g_err_stage:= 'Calling make_new_tasks_plannable for old parent task id';
7077: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
7078:
7079: END IF;
7080:
7073:
7074: IF l_debug_mode = 'Y' THEN
7075:
7076: pa_debug.g_err_stage:= 'Calling make_new_tasks_plannable for old parent task id';
7077: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
7078:
7079: END IF;
7080:
7081: /*
7108:
7109: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
7110:
7111: IF l_debug_mode = 'Y' THEN
7112: pa_debug.g_err_stage:= 'Error returned by make_new_tasks_plannable for task_id ' ||
7113: p_impacted_tasks_tbl(i).old_parent_task_id;
7114: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
7115: END IF;
7116:
7110:
7111: IF l_debug_mode = 'Y' THEN
7112: pa_debug.g_err_stage:= 'Error returned by make_new_tasks_plannable for task_id ' ||
7113: p_impacted_tasks_tbl(i).old_parent_task_id;
7114: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
7115: END IF;
7116:
7117: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
7118:
7129:
7130: /* Invalid action passed */
7131:
7132: IF l_debug_mode = 'Y' THEN
7133: pa_debug.g_err_stage:= 'Invalid value for action passed. Action passed is ' ||
7134: p_impacted_tasks_tbl(i).action;
7135: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
7136: END IF;
7137:
7131:
7132: IF l_debug_mode = 'Y' THEN
7133: pa_debug.g_err_stage:= 'Invalid value for action passed. Action passed is ' ||
7134: p_impacted_tasks_tbl(i).action;
7135: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL5);
7136: END IF;
7137:
7138: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
7139:
7145: we need to increase the record_version_number */
7146:
7147: IF nvl(l_all_fp_options_tbl.last,0) >= 1 THEN /* only if something is fetched */
7148:
7149: IF P_PA_DEBUG_MODE = 'Y' THEN
7150: pa_debug.g_err_stage := 'Updating pa_proj_fp_options with RVN and who columns.';
7151: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
7152: END IF;
7153:
7146:
7147: IF nvl(l_all_fp_options_tbl.last,0) >= 1 THEN /* only if something is fetched */
7148:
7149: IF P_PA_DEBUG_MODE = 'Y' THEN
7150: pa_debug.g_err_stage := 'Updating pa_proj_fp_options with RVN and who columns.';
7151: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
7152: END IF;
7153:
7154: FORALL i in l_all_fp_options_tbl.first..l_all_fp_options_tbl.last
7147: IF nvl(l_all_fp_options_tbl.last,0) >= 1 THEN /* only if something is fetched */
7148:
7149: IF P_PA_DEBUG_MODE = 'Y' THEN
7150: pa_debug.g_err_stage := 'Updating pa_proj_fp_options with RVN and who columns.';
7151: pa_debug.write(l_module_name,pa_debug.g_err_stage,L_DEBUG_LEVEL3);
7152: END IF;
7153:
7154: FORALL i in l_all_fp_options_tbl.first..l_all_fp_options_tbl.last
7155: UPDATE pa_proj_fp_options pfo
7177:
7178: END IF; /* l_continue_processing_flag = 'Y' */
7179:
7180: IF l_debug_mode = 'Y' THEN
7181: pa_debug.g_err_stage:= 'Exiting maintain_plannable_tasks';
7182: pa_debug.write(l_module_name,pa_debug.g_err_stage,
7183: L_DEBUG_LEVEL3);
7184: pa_debug.reset_curr_function;
7185: END IF;
7178: END IF; /* l_continue_processing_flag = 'Y' */
7179:
7180: IF l_debug_mode = 'Y' THEN
7181: pa_debug.g_err_stage:= 'Exiting maintain_plannable_tasks';
7182: pa_debug.write(l_module_name,pa_debug.g_err_stage,
7183: L_DEBUG_LEVEL3);
7184: pa_debug.reset_curr_function;
7185: END IF;
7186:
7180: IF l_debug_mode = 'Y' THEN
7181: pa_debug.g_err_stage:= 'Exiting maintain_plannable_tasks';
7182: pa_debug.write(l_module_name,pa_debug.g_err_stage,
7183: L_DEBUG_LEVEL3);
7184: pa_debug.reset_curr_function;
7185: END IF;
7186:
7187: EXCEPTION
7188:
7205: x_msg_count := l_msg_count;
7206: END IF;
7207:
7208: IF l_debug_mode = 'Y' THEN
7209: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
7210: pa_debug.write(l_module_name,pa_debug.g_err_stage,
7211: L_DEBUG_LEVEL5);
7212: pa_debug.reset_curr_function;
7213: END IF;
7206: END IF;
7207:
7208: IF l_debug_mode = 'Y' THEN
7209: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
7210: pa_debug.write(l_module_name,pa_debug.g_err_stage,
7211: L_DEBUG_LEVEL5);
7212: pa_debug.reset_curr_function;
7213: END IF;
7214:
7208: IF l_debug_mode = 'Y' THEN
7209: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
7210: pa_debug.write(l_module_name,pa_debug.g_err_stage,
7211: L_DEBUG_LEVEL5);
7212: pa_debug.reset_curr_function;
7213: END IF;
7214:
7215: RETURN;
7216:
7225: ,p_procedure_name => 'maintain_plannable_tasks'
7226: ,p_error_text => x_msg_data);
7227:
7228: IF l_debug_mode = 'Y' THEN
7229: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
7230: pa_debug.write(l_module_name,pa_debug.g_err_stage,
7231: L_DEBUG_LEVEL5);
7232: pa_debug.reset_curr_function;
7233: END IF;
7226: ,p_error_text => x_msg_data);
7227:
7228: IF l_debug_mode = 'Y' THEN
7229: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
7230: pa_debug.write(l_module_name,pa_debug.g_err_stage,
7231: L_DEBUG_LEVEL5);
7232: pa_debug.reset_curr_function;
7233: END IF;
7234: RAISE;
7228: IF l_debug_mode = 'Y' THEN
7229: pa_debug.g_err_stage:= 'Unexpected Error'||x_msg_data;
7230: pa_debug.write(l_module_name,pa_debug.g_err_stage,
7231: L_DEBUG_LEVEL5);
7232: pa_debug.reset_curr_function;
7233: END IF;
7234: RAISE;
7235: END maintain_plannable_tasks;
7236: