48: where terr_type_id = -9
49: and created_by = 9
50: and rownum < 2;
51: EXCEPTION
52: when FND_API.G_EXC_ERROR then
53: -- Add proper error logging
54: -- dbms_output.put_line('21' || sqlerrm );
55: NULL;
56: when FND_API.G_EXC_UNEXPECTED_ERROR then
52: when FND_API.G_EXC_ERROR then
53: -- Add proper error logging
54: -- dbms_output.put_line('21' || sqlerrm );
55: NULL;
56: when FND_API.G_EXC_UNEXPECTED_ERROR then
57: -- Add proper error logging
58: -- dbms_output.put_line('22' || sqlerrm );
59: NULL;
60: when others then
105: from dual;
106:
107:
108: EXCEPTION
109: when FND_API.G_EXC_ERROR then
110: -- Add proper error logging
111: -- dbms_output.put_line('28' || sqlerrm );
112: NULL;
113: when FND_API.G_EXC_UNEXPECTED_ERROR then
109: when FND_API.G_EXC_ERROR then
110: -- Add proper error logging
111: -- dbms_output.put_line('28' || sqlerrm );
112: NULL;
113: when FND_API.G_EXC_UNEXPECTED_ERROR then
114: -- Add proper error logging
115: -- dbms_output.put_line('29' || sqlerrm );
116: NULL;
117: when others then
148: and terr_type_id = -9
149: and CREATED_BY = 9;
150:
151: EXCEPTION
152: when FND_API.G_EXC_ERROR then
153: -- Add proper error logging
154: -- dbms_output.put_line('31' || sqlerrm );
155: NULL;
156: when FND_API.G_EXC_UNEXPECTED_ERROR then
152: when FND_API.G_EXC_ERROR then
153: -- Add proper error logging
154: -- dbms_output.put_line('31' || sqlerrm );
155: NULL;
156: when FND_API.G_EXC_UNEXPECTED_ERROR then
157: -- Add proper error logging
158: -- dbms_output.put_line('32' || sqlerrm );
159: NULL;
160: when others then
197: and jqtu.qual_type_usg_id <> -1005 -- Exclude service account transaction type
198: and jttu.created_by = 9;
199:
200: EXCEPTION
201: when FND_API.G_EXC_ERROR then
202: -- Add proper error logging
203: -- dbms_output.put_line('34' || sqlerrm );
204: NULL;
205: when FND_API.G_EXC_UNEXPECTED_ERROR then
201: when FND_API.G_EXC_ERROR then
202: -- Add proper error logging
203: -- dbms_output.put_line('34' || sqlerrm );
204: NULL;
205: when FND_API.G_EXC_UNEXPECTED_ERROR then
206: -- Add proper error logging
207: -- dbms_output.put_line('35' || sqlerrm );
208: NULL;
209: when others then
248: and jttu.terr_type_id <> -1 ;-- For NA territories this table is not populated
249: --and jqu.ENABLED_FLAG = 'Y';
250:
251: EXCEPTION
252: when FND_API.G_EXC_ERROR then
253: -- Add proper error logging
254: -- dbms_output.put_line('37' || sqlerrm );
255: NULL;
256: when FND_API.G_EXC_UNEXPECTED_ERROR then
252: when FND_API.G_EXC_ERROR then
253: -- Add proper error logging
254: -- dbms_output.put_line('37' || sqlerrm );
255: NULL;
256: when FND_API.G_EXC_UNEXPECTED_ERROR then
257: -- Add proper error logging
258: -- dbms_output.put_line('38' || sqlerrm );
259: NULL;
260: when others then
266: commit;
267: end if;
268:
269: EXCEPTION
270: when FND_API.G_EXC_ERROR then
271: -- Add proper error logging
272: -- dbms_output.put_line('13' || sqlerrm );
273: NULL;
274: when FND_API.G_EXC_UNEXPECTED_ERROR then
270: when FND_API.G_EXC_ERROR then
271: -- Add proper error logging
272: -- dbms_output.put_line('13' || sqlerrm );
273: NULL;
274: when FND_API.G_EXC_UNEXPECTED_ERROR then
275: -- Add proper error logging
276: -- dbms_output.put_line('14' || sqlerrm );
277: NULL;
278: when others then
297:
298: commit;
299:
300: EXCEPTION
301: when FND_API.G_EXC_ERROR then
302: -- Add proper error logging
303: -- dbms_output.put_line('16' || sqlerrm );
304: NULL;
305: when FND_API.G_EXC_UNEXPECTED_ERROR then
301: when FND_API.G_EXC_ERROR then
302: -- Add proper error logging
303: -- dbms_output.put_line('16' || sqlerrm );
304: NULL;
305: when FND_API.G_EXC_UNEXPECTED_ERROR then
306: -- Add proper error logging
307: -- dbms_output.put_line('17' || sqlerrm );
308: NULL;
309: when others then
322: -- notes :
323: --
324: PROCEDURE process_match_terr_spares
325: ( p_api_version_number IN number,
326: p_init_msg_list IN varchar2 := fnd_api.g_false,
327: p_TerrServReq_Rec IN JTF_TERRITORY_PUB.JTF_Serv_Req_rec_type,
328: p_Resource_Type IN varchar2,
329: p_Role IN varchar2,
330: p_plan_start_date IN DATE DEFAULT NULL,
349: 'Start of the procedure jtf_terr_service_pub.process_match_terr_spares');
350: END IF;
351:
352: -- Standard call to check for call compatibility.
353: IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
354: p_api_version_number,
355: l_api_name,
356: G_PKG_NAME)
357: THEN
354: p_api_version_number,
355: l_api_name,
356: G_PKG_NAME)
357: THEN
358: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
359: END IF;
360:
361: -- Initialize message list if p_init_msg_list is set to TRUE.
362: IF FND_API.to_Boolean( p_init_msg_list )
358: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
359: END IF;
360:
361: -- Initialize message list if p_init_msg_list is set to TRUE.
362: IF FND_API.to_Boolean( p_init_msg_list )
363: THEN
364: FND_MSG_PUB.initialize;
365: END IF;
366:
365: END IF;
366:
367: --
368: -- API body
369: x_return_status := FND_API.G_RET_STS_SUCCESS;
370:
371: -- debug message
372: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
373: FND_LOG.string(FND_LOG.LEVEL_STATEMENT,
633: UNION ALL
634: SELECT 'DAY_OF_WEEK' attribute_name
635: ,null num_value
636: --,p_TerrServReq_Rec.DAY_OF_WEEK char_value
637: , DECODE(p_TerrServReq_Rec.DAY_OF_WEEK,FND_API.G_MISS_CHAR,null,
638: p_TerrServReq_Rec.DAY_OF_WEEK) char_value
639: ,null date_value
640: FROM DUAL
641: UNION ALL
641: UNION ALL
642: SELECT 'TIME_OF_DAY' attribute_name
643: , null num_value
644: --, p_TerrServReq_Rec.TIME_OF_DAY char_value
645: , DECODE(p_TerrServReq_Rec.TIME_OF_DAY,FND_API.G_MISS_CHAR,null,
646: p_TerrServReq_Rec.TIME_OF_DAY) char_value
647: ,null date_value
648: FROM DUAL
649:
658: ,x_return_status => x_return_status
659: ,x_msg_count => x_msg_count
660: ,x_msg_data => x_msg_data);
661:
662: IF (x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
663: IF (FND_LOG.LEVEL_EXCEPTION >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
664: FND_LOG.string(FND_LOG.LEVEL_EXCEPTION,
665: 'jtf.plsql.JTY_TERR_SPARES_PVT.process_match_terr_spares.process_match',
666: 'API JTY_ASSIGN_REALTIME_PUB.process_match has failed');
664: FND_LOG.string(FND_LOG.LEVEL_EXCEPTION,
665: 'jtf.plsql.JTY_TERR_SPARES_PVT.process_match_terr_spares.process_match',
666: 'API JTY_ASSIGN_REALTIME_PUB.process_match has failed');
667: END IF;
668: RAISE FND_API.G_EXC_ERROR;
669: END IF;
670:
671: -- debug message
672: IF (FND_LOG.LEVEL_EVENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
679:
680: EXCEPTION
681:
682: WHEN OTHERS THEN
683: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
684: x_msg_data := SQLCODE || ' : ' || SQLERRM;
685: x_msg_count := 1;
686: IF (FND_LOG.LEVEL_EXCEPTION >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
687: FND_LOG.string(FND_LOG.LEVEL_EXCEPTION,