75: PA_DEBUG.init_err_stack('PA_PROJECT_REQUEST_PUB.create_project_request');
76:
77:
78: -- Initialize the return status to success
79: x_return_status := FND_API.G_RET_STS_SUCCESS;
80:
81: --Issue API savepoint if the transaction is to be committed
82: IF p_commit = FND_API.G_TRUE THEN
83: SAVEPOINT PROJ_REQ_PUB_CREATE_REQ;
78: -- Initialize the return status to success
79: x_return_status := FND_API.G_RET_STS_SUCCESS;
80:
81: --Issue API savepoint if the transaction is to be committed
82: IF p_commit = FND_API.G_TRUE THEN
83: SAVEPOINT PROJ_REQ_PUB_CREATE_REQ;
84: END IF;
85:
86: --Clear the global PL/SQL message table
83: SAVEPOINT PROJ_REQ_PUB_CREATE_REQ;
84: END IF;
85:
86: --Clear the global PL/SQL message table
87: IF FND_API.TO_BOOLEAN( p_init_msg_list ) THEN
88: FND_MSG_PUB.initialize;
89: END IF;
90:
91: -- Validate Status
97: ,x_status_code => l_request_status_code
98: ,x_return_status => x_return_status
99: ,x_error_message_code => l_error_message_code);
100:
101: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
102: RAISE l_check_status_err;
103: END IF;
104:
105:
112: x_msg_count => x_msg_count,
113: x_msg_data => x_msg_data );
114:
115:
116: IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
117:
118:
119: PA_PROJECT_REQUEST_PVT.debug('PA_PROJECT_REQUESTS_PUB.create_project_request: Calling PA_PROJECT_REQUEST_PKG.insert_row');
120:
157: x_msg_count => x_msg_count,
158: x_msg_data => x_msg_data );
159: END IF;
160:
161: IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
162: IF NVL(p_create_rel_flag, 'N') = 'Y' AND
163: p_source_id IS NOT NULL AND
164: p_source_object IS NOT NULL THEN
165:
190: ,x_object_relationship_id => l_new_obj_rel_id
191: ,x_return_status => x_return_status
192: );
193:
194: IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
195: -- Form the relationship: from the created project request to the source opportunity.
196:
197: PA_OBJECT_RELATIONSHIPS_PKG.INSERT_ROW(
198: p_user_id => FND_GLOBAL.USER_ID
229:
230: EXCEPTION
231: WHEN l_check_status_err THEN
232: PA_UTILS.Add_Message('PA', l_error_message_code);
233: x_return_status := FND_API.G_RET_STS_ERROR;
234: x_msg_data := l_error_message_code;
235: x_msg_count := FND_MSG_PUB.Count_Msg;
236: IF x_msg_count = 1 THEN
237: pa_interface_utils_pub.get_messages
234: x_msg_data := l_error_message_code;
235: x_msg_count := FND_MSG_PUB.Count_Msg;
236: IF x_msg_count = 1 THEN
237: pa_interface_utils_pub.get_messages
238: (p_encoded => FND_API.G_TRUE,
239: p_msg_index => 1,
240: p_msg_count => x_msg_count,
241: p_msg_data => x_msg_data,
242: --p_data => x_msg_data, * commented for Bug: 4537865
249:
250: END IF;
251:
252: WHEN OTHERS THEN
253: IF p_commit = FND_API.G_TRUE THEN
254: ROLLBACK TO PROJ_REQ_PUB_CREATE_REQ ;
255: END IF;
256:
257: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
253: IF p_commit = FND_API.G_TRUE THEN
254: ROLLBACK TO PROJ_REQ_PUB_CREATE_REQ ;
255: END IF;
256:
257: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
258: x_msg_count := FND_MSG_PUB.Count_Msg;
259: x_msg_data := substr(SQLERRM,1,240);
260:
261: -- Set the excetption Message and the stack
262: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_PROJECT_REQUEST_PUB.create_project_request'
263: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
264: IF x_msg_count = 1 THEN
265: pa_interface_utils_pub.get_messages
266: (p_encoded => FND_API.G_TRUE,
267: p_msg_index => 1,
268: p_msg_count => x_msg_count,
269: p_msg_data => x_msg_data,
270: --p_data => x_msg_data, * commented for Bug: 4537865
309: -- Initialize the Error Stack
310: PA_DEBUG.init_err_stack('PA_PROJECT_REQUEST_PUB.cancel_project_request');
311:
312: -- Initialize the return status to success
313: x_return_status := FND_API.G_RET_STS_SUCCESS;
314:
315: --Issue API savepoint if the transaction is to be committed
316: IF p_commit = FND_API.G_TRUE THEN
317: SAVEPOINT PROJ_REQ_PUB_CANCEL_REQUEST;
312: -- Initialize the return status to success
313: x_return_status := FND_API.G_RET_STS_SUCCESS;
314:
315: --Issue API savepoint if the transaction is to be committed
316: IF p_commit = FND_API.G_TRUE THEN
317: SAVEPOINT PROJ_REQ_PUB_CANCEL_REQUEST;
318: END IF;
319:
320: --Clear the global PL/SQL message table
317: SAVEPOINT PROJ_REQ_PUB_CANCEL_REQUEST;
318: END IF;
319:
320: --Clear the global PL/SQL message table
321: IF FND_API.TO_BOOLEAN( p_init_msg_list ) THEN
322: FND_MSG_PUB.initialize;
323: END IF;
324:
325: PA_PROJECT_REQUEST_PVT.debug('PA_PROJECT_REQUESTS_PUB.cancel_project_request.begin');
358: EXCEPTION
359: WHEN cancel_req_not_allowed THEN
360: PA_UTILS.add_message(p_app_short_name => 'PA',
361: p_msg_name => 'PA_CANNOT_CANCEL_REQ');
362: x_return_status := FND_API.G_RET_STS_ERROR;
363: x_msg_count := FND_MSG_PUB.Count_Msg;
364: x_msg_data := 'PA_CANNOT_CANCEL_REQ';
365:
366: IF x_msg_count = 1 THEN
364: x_msg_data := 'PA_CANNOT_CANCEL_REQ';
365:
366: IF x_msg_count = 1 THEN
367: pa_interface_utils_pub.get_messages
368: (p_encoded => FND_API.G_TRUE,
369: p_msg_index => 1,
370: p_msg_count => x_msg_count,
371: p_msg_data => x_msg_data,
372: --p_data => x_msg_data, * commented for Bug: 4537865
378: END IF;
379:
380:
381: WHEN OTHERS THEN
382: IF p_commit = FND_API.G_TRUE THEN
383: ROLLBACK TO PROJ_REQ_PUB_CANCEL_REQUEST;
384: END IF;
385:
386: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
382: IF p_commit = FND_API.G_TRUE THEN
383: ROLLBACK TO PROJ_REQ_PUB_CANCEL_REQUEST;
384: END IF;
385:
386: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
387: x_msg_count := FND_MSG_PUB.Count_Msg;
388: x_msg_data := substr(SQLERRM,1,240);
389:
390: -- Set the excetption Message and the stack
391: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_PROJECT_REQUEST_PUB.cancel_project_request'
392: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
393: IF x_msg_count = 1 THEN
394: pa_interface_utils_pub.get_messages
395: (p_encoded => FND_API.G_TRUE,
396: p_msg_index => 1,
397: p_msg_count => x_msg_count,
398: p_msg_data => x_msg_data,
399: --p_data => x_msg_data, * commented for Bug: 4537865
430: ,p_return_status IN OUT nocopy varchar2
431: ) IS
432: BEGIN
433:
434: p_return_status := FND_API.G_RET_STS_SUCCESS;
435:
436: if (p_from_fk_id <> p_to_fk_id) then
437:
438: update PA_PROJECT_REQUESTS