1: PACKAGE BODY AHL_LTP_SPACE_ASSIGN_PUB AS
2: /* $Header: AHLPSANB.pls 115.10 2003/09/09 06:05:33 rroy noship $ */
3: --
4: G_PKG_NAME VARCHAR2(30) := 'AHL_LTP_SPACE_ASSIGN_PUB';
5: G_DEBUG VARCHAR2(1) := AHL_DEBUG_PUB.is_log_enabled;
6: --
7: -- PACKAGE
8: -- AHL_LTP_SPACE_ASSIGN_PUB
9: --
58: -- Standard Start of API savepoint
59: SAVEPOINT Assign_Sch_Visit_Spaces;
60: -- Check if API is called in debug mode. If yes, enable debug.
61: IF G_DEBUG='Y' THEN
62: Ahl_Debug_Pub.enable_debug;
63: END IF;
64: -- Debug info.
65: IF G_DEBUG='Y' THEN
66: Ahl_Debug_Pub.debug( 'enter ahl_ltp_space_assign_pub.Assign Sch Visit Spaces','+SPANT+');
62: Ahl_Debug_Pub.enable_debug;
63: END IF;
64: -- Debug info.
65: IF G_DEBUG='Y' THEN
66: Ahl_Debug_Pub.debug( 'enter ahl_ltp_space_assign_pub.Assign Sch Visit Spaces','+SPANT+');
67: END IF;
68: -- Standard call to check for call compatibility.
69: IF Fnd_Api.to_boolean(p_init_msg_list)
70: THEN
84: FOR i IN p_x_space_assignment_tbl.FIRST..p_x_space_assignment_tbl.LAST
85: LOOP
86: --
87: IF G_DEBUG='Y' THEN
88: Ahl_Debug_Pub.debug( 'Schedule flag:'||p_x_schedule_visit_rec.schedule_flag);
89: END IF;
90: --
91: IF p_x_space_assignment_tbl(i).operation_flag = 'C' THEN
92: Ahl_Ltp_Space_Assign_Pvt.CREATE_SPACE_ASSIGNMENT
173: COMMIT;
174: END IF;
175: -- Debug info
176: IF G_DEBUG='Y' THEN
177: Ahl_Debug_Pub.debug( 'End of Public api Assign Sch Visit Spaces','+SPANT+');
178: END IF;
179: -- Check if API is called in debug mode. If yes, disable debug.
180: IF G_DEBUG='Y' THEN
181: Ahl_Debug_Pub.disable_debug;
177: Ahl_Debug_Pub.debug( 'End of Public api Assign Sch Visit Spaces','+SPANT+');
178: END IF;
179: -- Check if API is called in debug mode. If yes, disable debug.
180: IF G_DEBUG='Y' THEN
181: Ahl_Debug_Pub.disable_debug;
182: END IF;
183: EXCEPTION
184: WHEN Fnd_Api.G_EXC_UNEXPECTED_ERROR THEN
185: ROLLBACK TO Assign_Sch_Visit_Spaces;
188: p_count => x_msg_count,
189: p_data => x_msg_data);
190: IF G_DEBUG='Y' THEN
191:
192: Ahl_Debug_Pub.log_app_messages (
193: x_msg_count, x_msg_data, 'ERROR' );
194: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Assign Sch Visit Spaces','+SPANT+');
195: -- Check if API is called in debug mode. If yes, disable debug.
196: Ahl_Debug_Pub.disable_debug;
190: IF G_DEBUG='Y' THEN
191:
192: Ahl_Debug_Pub.log_app_messages (
193: x_msg_count, x_msg_data, 'ERROR' );
194: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Assign Sch Visit Spaces','+SPANT+');
195: -- Check if API is called in debug mode. If yes, disable debug.
196: Ahl_Debug_Pub.disable_debug;
197: END IF;
198: WHEN Fnd_Api.G_EXC_ERROR THEN
192: Ahl_Debug_Pub.log_app_messages (
193: x_msg_count, x_msg_data, 'ERROR' );
194: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Assign Sch Visit Spaces','+SPANT+');
195: -- Check if API is called in debug mode. If yes, disable debug.
196: Ahl_Debug_Pub.disable_debug;
197: END IF;
198: WHEN Fnd_Api.G_EXC_ERROR THEN
199: ROLLBACK TO Assign_Sch_Visit_Spaces;
200: X_return_status := Fnd_Api.G_RET_STS_ERROR;
202: p_count => x_msg_count,
203: p_data => X_msg_data);
204: IF G_DEBUG='Y' THEN
205: -- Debug info.
206: Ahl_Debug_Pub.log_app_messages (
207: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
208: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Assign Sch Visit Spaces','+SPANT+');
209: -- Check if API is called in debug mode. If yes, disable debug.
210: Ahl_Debug_Pub.disable_debug;
204: IF G_DEBUG='Y' THEN
205: -- Debug info.
206: Ahl_Debug_Pub.log_app_messages (
207: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
208: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Assign Sch Visit Spaces','+SPANT+');
209: -- Check if API is called in debug mode. If yes, disable debug.
210: Ahl_Debug_Pub.disable_debug;
211: END IF;
212: WHEN OTHERS THEN
206: Ahl_Debug_Pub.log_app_messages (
207: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
208: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Assign Sch Visit Spaces','+SPANT+');
209: -- Check if API is called in debug mode. If yes, disable debug.
210: Ahl_Debug_Pub.disable_debug;
211: END IF;
212: WHEN OTHERS THEN
213: ROLLBACK TO Assign_Sch_Visit_Spaces;
214: X_return_status := Fnd_Api.G_RET_STS_UNEXP_ERROR;
223: p_data => X_msg_data);
224: IF G_DEBUG='Y' THEN
225:
226: -- Debug info.
227: Ahl_Debug_Pub.log_app_messages (
228: x_msg_count, x_msg_data, 'SQL ERROR' );
229: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Assign Sch Visit Spaces','+SPANT+');
230: -- Check if API is called in debug mode. If yes, disable debug.
231: Ahl_Debug_Pub.disable_debug;
225:
226: -- Debug info.
227: Ahl_Debug_Pub.log_app_messages (
228: x_msg_count, x_msg_data, 'SQL ERROR' );
229: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Assign Sch Visit Spaces','+SPANT+');
230: -- Check if API is called in debug mode. If yes, disable debug.
231: Ahl_Debug_Pub.disable_debug;
232: END IF;
233: END Assign_Sch_Visit_Spaces;
227: Ahl_Debug_Pub.log_app_messages (
228: x_msg_count, x_msg_data, 'SQL ERROR' );
229: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Assign Sch Visit Spaces','+SPANT+');
230: -- Check if API is called in debug mode. If yes, disable debug.
231: Ahl_Debug_Pub.disable_debug;
232: END IF;
233: END Assign_Sch_Visit_Spaces;
234: --
235: -- PROCEDURE
265: -- Standard Start of API savepoint
266: SAVEPOINT schedule_visit;
267: -- Check if API is called in debug mode. If yes, enable debug.
268: IF G_DEBUG='Y' THEN
269: Ahl_Debug_Pub.enable_debug;
270: END IF;
271: -- Debug info.
272: IF G_DEBUG='Y' THEN
273: Ahl_Debug_Pub.debug( 'enter ahl_ltp_space_assign_pub.Schedule Visit','+SPANT+');
269: Ahl_Debug_Pub.enable_debug;
270: END IF;
271: -- Debug info.
272: IF G_DEBUG='Y' THEN
273: Ahl_Debug_Pub.debug( 'enter ahl_ltp_space_assign_pub.Schedule Visit','+SPANT+');
274: END IF;
275: -- Standard call to check for call compatibility.
276: IF Fnd_Api.to_boolean(p_init_msg_list)
277: THEN
315: COMMIT;
316: END IF;
317: -- Debug info
318: IF G_DEBUG='Y' THEN
319: Ahl_Debug_Pub.debug( 'End of Public api Schedule Visit','+SPANT+');
320: END IF;
321: -- Check if API is called in debug mode. If yes, disable debug.
322: IF G_DEBUG='Y' THEN
323: Ahl_Debug_Pub.disable_debug;
319: Ahl_Debug_Pub.debug( 'End of Public api Schedule Visit','+SPANT+');
320: END IF;
321: -- Check if API is called in debug mode. If yes, disable debug.
322: IF G_DEBUG='Y' THEN
323: Ahl_Debug_Pub.disable_debug;
324: END IF;
325:
326: EXCEPTION
327: WHEN Fnd_Api.G_EXC_UNEXPECTED_ERROR THEN
331: p_count => x_msg_count,
332: p_data => x_msg_data);
333: IF G_DEBUG='Y' THEN
334:
335: Ahl_Debug_Pub.log_app_messages (
336: x_msg_count, x_msg_data, 'ERROR' );
337: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Schedule Visit','+SPANT+');
338: -- Check if API is called in debug mode. If yes, disable debug.
339: Ahl_Debug_Pub.disable_debug;
333: IF G_DEBUG='Y' THEN
334:
335: Ahl_Debug_Pub.log_app_messages (
336: x_msg_count, x_msg_data, 'ERROR' );
337: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Schedule Visit','+SPANT+');
338: -- Check if API is called in debug mode. If yes, disable debug.
339: Ahl_Debug_Pub.disable_debug;
340: END IF;
341: WHEN Fnd_Api.G_EXC_ERROR THEN
335: Ahl_Debug_Pub.log_app_messages (
336: x_msg_count, x_msg_data, 'ERROR' );
337: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Schedule Visit','+SPANT+');
338: -- Check if API is called in debug mode. If yes, disable debug.
339: Ahl_Debug_Pub.disable_debug;
340: END IF;
341: WHEN Fnd_Api.G_EXC_ERROR THEN
342: ROLLBACK TO schedule_visit;
343: X_return_status := Fnd_Api.G_RET_STS_ERROR;
345: p_count => x_msg_count,
346: p_data => X_msg_data);
347: IF G_DEBUG='Y' THEN
348: -- Debug info.
349: Ahl_Debug_Pub.log_app_messages (
350: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
351: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Schedule Visit','+SPANT+');
352: -- Check if API is called in debug mode. If yes, disable debug.
353: Ahl_Debug_Pub.disable_debug;
347: IF G_DEBUG='Y' THEN
348: -- Debug info.
349: Ahl_Debug_Pub.log_app_messages (
350: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
351: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Schedule Visit','+SPANT+');
352: -- Check if API is called in debug mode. If yes, disable debug.
353: Ahl_Debug_Pub.disable_debug;
354: END IF;
355: WHEN OTHERS THEN
349: Ahl_Debug_Pub.log_app_messages (
350: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
351: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Schedule Visit','+SPANT+');
352: -- Check if API is called in debug mode. If yes, disable debug.
353: Ahl_Debug_Pub.disable_debug;
354: END IF;
355: WHEN OTHERS THEN
356: ROLLBACK TO schedule_visit;
357: X_return_status := Fnd_Api.G_RET_STS_UNEXP_ERROR;
365: p_count => x_msg_count,
366: p_data => X_msg_data);
367: IF G_DEBUG='Y' THEN
368: -- Debug info.
369: Ahl_Debug_Pub.log_app_messages (
370: x_msg_count, x_msg_data, 'SQL ERROR' );
371: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Schedule Visit','+SPANT+');
372: -- Check if API is called in debug mode. If yes, disable debug.
373: Ahl_Debug_Pub.disable_debug;
367: IF G_DEBUG='Y' THEN
368: -- Debug info.
369: Ahl_Debug_Pub.log_app_messages (
370: x_msg_count, x_msg_data, 'SQL ERROR' );
371: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Schedule Visit','+SPANT+');
372: -- Check if API is called in debug mode. If yes, disable debug.
373: Ahl_Debug_Pub.disable_debug;
374: END IF;
375: END Schedule_Visit;
369: Ahl_Debug_Pub.log_app_messages (
370: x_msg_count, x_msg_data, 'SQL ERROR' );
371: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Schedule Visit','+SPANT+');
372: -- Check if API is called in debug mode. If yes, disable debug.
373: Ahl_Debug_Pub.disable_debug;
374: END IF;
375: END Schedule_Visit;
376: --
377: -- PROCEDURE
409: -- Standard Start of API savepoint
410: SAVEPOINT unschedule_visit;
411: -- Check if API is called in debug mode. If yes, enable debug.
412: IF G_DEBUG='Y' THEN
413: Ahl_Debug_Pub.enable_debug;
414: END IF;
415: -- Debug info.
416: IF G_DEBUG='Y' THEN
417: Ahl_Debug_Pub.debug( 'enter ahl_ltp_space_assign_pub.Unschedule Visit','+SPANT+');
413: Ahl_Debug_Pub.enable_debug;
414: END IF;
415: -- Debug info.
416: IF G_DEBUG='Y' THEN
417: Ahl_Debug_Pub.debug( 'enter ahl_ltp_space_assign_pub.Unschedule Visit','+SPANT+');
418: END IF;
419: -- Standard call to check for call compatibility.
420: IF Fnd_Api.to_boolean(p_init_msg_list)
421: THEN
459: COMMIT;
460: END IF;
461: -- Debug info
462: IF G_DEBUG='Y' THEN
463: Ahl_Debug_Pub.debug( 'End of Public api Unschedule Visit','+SPANT+');
464: END IF;
465: -- Check if API is called in debug mode. If yes, disable debug.
466: IF G_DEBUG='Y' THEN
467: Ahl_Debug_Pub.disable_debug;
463: Ahl_Debug_Pub.debug( 'End of Public api Unschedule Visit','+SPANT+');
464: END IF;
465: -- Check if API is called in debug mode. If yes, disable debug.
466: IF G_DEBUG='Y' THEN
467: Ahl_Debug_Pub.disable_debug;
468: END IF;
469: EXCEPTION
470: WHEN Fnd_Api.G_EXC_UNEXPECTED_ERROR THEN
471: ROLLBACK TO unschedule_visit;
474: p_count => x_msg_count,
475: p_data => x_msg_data);
476: IF G_DEBUG='Y' THEN
477:
478: Ahl_Debug_Pub.log_app_messages (
479: x_msg_count, x_msg_data, 'ERROR' );
480: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Unschedule Visit','+SPANT+');
481: -- Check if API is called in debug mode. If yes, disable debug.
482: Ahl_Debug_Pub.disable_debug;
476: IF G_DEBUG='Y' THEN
477:
478: Ahl_Debug_Pub.log_app_messages (
479: x_msg_count, x_msg_data, 'ERROR' );
480: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Unschedule Visit','+SPANT+');
481: -- Check if API is called in debug mode. If yes, disable debug.
482: Ahl_Debug_Pub.disable_debug;
483: END IF;
484: WHEN Fnd_Api.G_EXC_ERROR THEN
478: Ahl_Debug_Pub.log_app_messages (
479: x_msg_count, x_msg_data, 'ERROR' );
480: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Unschedule Visit','+SPANT+');
481: -- Check if API is called in debug mode. If yes, disable debug.
482: Ahl_Debug_Pub.disable_debug;
483: END IF;
484: WHEN Fnd_Api.G_EXC_ERROR THEN
485: ROLLBACK TO unschedule_visit;
486: X_return_status := Fnd_Api.G_RET_STS_ERROR;
488: p_count => x_msg_count,
489: p_data => X_msg_data);
490: IF G_DEBUG='Y' THEN
491: -- Debug info.
492: Ahl_Debug_Pub.log_app_messages (
493: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
494: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Unschedule Visit','+SPANT+');
495: -- Check if API is called in debug mode. If yes, disable debug.
496: Ahl_Debug_Pub.disable_debug;
490: IF G_DEBUG='Y' THEN
491: -- Debug info.
492: Ahl_Debug_Pub.log_app_messages (
493: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
494: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Unschedule Visit','+SPANT+');
495: -- Check if API is called in debug mode. If yes, disable debug.
496: Ahl_Debug_Pub.disable_debug;
497: END IF;
498: WHEN OTHERS THEN
492: Ahl_Debug_Pub.log_app_messages (
493: x_msg_count, x_msg_data, 'UNEXPECTED ERROR' );
494: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Unschedule Visit','+SPANT+');
495: -- Check if API is called in debug mode. If yes, disable debug.
496: Ahl_Debug_Pub.disable_debug;
497: END IF;
498: WHEN OTHERS THEN
499: ROLLBACK TO unschedule_visit;
500: X_return_status := Fnd_Api.G_RET_STS_UNEXP_ERROR;
509: p_data => X_msg_data);
510: IF G_DEBUG='Y' THEN
511:
512: -- Debug info.
513: Ahl_Debug_Pub.log_app_messages (
514: x_msg_count, x_msg_data, 'SQL ERROR' );
515: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Unschedule Visit','+SPANT+');
516: -- Check if API is called in debug mode. If yes, disable debug.
517: Ahl_Debug_Pub.disable_debug;
511:
512: -- Debug info.
513: Ahl_Debug_Pub.log_app_messages (
514: x_msg_count, x_msg_data, 'SQL ERROR' );
515: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Unschedule Visit','+SPANT+');
516: -- Check if API is called in debug mode. If yes, disable debug.
517: Ahl_Debug_Pub.disable_debug;
518: END IF;
519: END Unschedule_Visit;
513: Ahl_Debug_Pub.log_app_messages (
514: x_msg_count, x_msg_data, 'SQL ERROR' );
515: Ahl_Debug_Pub.debug( 'ahl_ltp_space_assign_pub.Unschedule Visit','+SPANT+');
516: -- Check if API is called in debug mode. If yes, disable debug.
517: Ahl_Debug_Pub.disable_debug;
518: END IF;
519: END Unschedule_Visit;
520: --
521: END AHL_LTP_SPACE_ASSIGN_PUB;