DBA Data[Home] [Help]

PACKAGE BODY: APPS.FTE_COMP_CONSTRAINT_UTIL

Source


1 PACKAGE BODY FTE_COMP_CONSTRAINT_UTIL as
2 /* $Header: FTECCUTB.pls 120.2 2005/07/19 23:25:50 skattama noship $ */
3 
4 
5 G_PKG_NAME CONSTANT VARCHAR2(30) := 'FTE_COMP_CONSTRAINT_UTIL';
6 -- Global Variables
7 
8     g_unexp_char         VARCHAR2(30) := WSH_UTIL_CORE.G_RET_STS_UNEXP_ERROR;
9     g_unexp_num          NUMBER       := -999999;
10 
11 
12     CURSOR  c_meaning(c_lookup_type IN VARCHAR2,c_lookup_code IN VARCHAR2) IS
13       SELECT flv.meaning
14       FROM   fnd_lookup_values flv, fnd_lookup_types flt
15       WHERE  flv.lookup_type = flt.lookup_type
16       AND    flv.lookup_code = c_lookup_code
17       AND    flt.lookup_type = c_lookup_type
18       AND    flv.language   = USERENV('LANG')
19       AND    nvl(flv.start_date_active,sysdate)<=sysdate
20       AND    nvl(flv.end_date_active,sysdate)>=sysdate
21       AND    flv.enabled_flag = 'Y';
22 
23 
24 FUNCTION get_object_name(
25              p_object_type             IN      VARCHAR2,
26              p_object_value_num        IN      NUMBER DEFAULT NULL,
27              p_object_parent_id        IN      NUMBER DEFAULT NULL,
28              p_object_value_char       IN      VARCHAR2 DEFAULT NULL,
29              x_fac_company_name        OUT NOCOPY      VARCHAR2,
30              x_fac_company_type        OUT NOCOPY  VARCHAR2 ) RETURN VARCHAR2
31 IS
32 
33     CURSOR c_get_org_name(c_object_value_num IN NUMBER) IS
34     SELECT HOU.NAME ORGANIZATION_NAME
35     FROM   HR_ORGANIZATION_UNITS HOU, HR_ORGANIZATION_INFORMATION HOI1, MTL_PARAMETERS MP
36     WHERE  HOU.ORGANIZATION_ID = HOI1.ORGANIZATION_ID
37     AND    HOU.ORGANIZATION_ID = MP.ORGANIZATION_ID
38     AND    HOI1.ORG_INFORMATION1 = 'INV'
39     AND    HOI1.ORG_INFORMATION2 = 'Y'
40     AND    ( HOI1.ORG_INFORMATION_CONTEXT || '') = 'CLASS'
41     AND    HOU.ORGANIZATION_ID = c_object_value_num;
42 
43     CURSOR  c_get_cus_name(c_object_value_num IN NUMBER) IS
44     select  hp.party_name
45     from    hz_parties hp ,
46             hz_cust_accounts hcas
47     where   hcas.cust_account_id = c_object_value_num
48     and     hcas.party_id = hp.party_id;
49 
50     CURSOR  c_get_car_name(c_object_value_num IN NUMBER) IS
51     select  hp.party_name
52     from    hz_parties hp , wsh_carriers wc
53     where   wc.carrier_id = c_object_value_num
54     and     wc.carrier_id = hp.party_id;
55 
56     -- Once a constraint for a supplier has been defined,
57     -- knowing party_id is enough to get the supplier name ?
58 
59     CURSOR  c_get_sup_name(c_object_value_num IN NUMBER) IS
60     select  hp.party_name
61     from    hz_parties hp,
62             po_vendors po,
63             hz_relationships rel
64     where   hp.party_id = c_object_value_num
65         AND rel.relationship_type = 'POS_VENDOR_PARTY'
66         and rel.object_id = hp.party_id
67         and rel.object_table_name = 'HZ_PARTIES'
68         and rel.object_type = 'ORGANIZATION'
69         and rel.subject_table_name = 'PO_VENDORS'
70         and rel.subject_id = po.vendor_id
71         and rel.subject_type = 'POS_VENDOR';
72 
73     CURSOR c_get_fac_comp(c_location_id IN NUMBER) IS
74     SELECT  wl.wsh_location_id facility_id,
75             haou.organization_id company_id,
76             haou.name company_name,
77             'ORGANIZATION' company_type,
78             nvl(nvl(flp.facility_code,wl.location_code),to_char(wl.wsh_location_id)) facility_code,
79             nvl(flp.description,wl.ui_location_code) description
80     FROM   HR_ORGANIZATION_UNITS HAOU, HR_ORGANIZATION_INFORMATION HOI1, MTL_PARAMETERS MP,
81            wsh_locations wl, fte_location_parameters flp
82     WHERE  haou.location_id = wl.source_location_id
83     AND    wl.location_source_code = 'HR'
84     AND    HAOU.ORGANIZATION_ID = HOI1.ORGANIZATION_ID
85     AND    HAOU.ORGANIZATION_ID = MP.ORGANIZATION_ID
86     AND    HOI1.ORG_INFORMATION1 = 'INV'
87     AND    HOI1.ORG_INFORMATION2 = 'Y'
88     AND    ( HOI1.ORG_INFORMATION_CONTEXT || '') = 'CLASS'
89     AND     wl.wsh_location_id = flp.location_id (+)
90     AND     wl.wsh_location_id = c_location_id
91     union
92     SELECT  wl.wsh_location_id facility_id,
93             hcas.cust_account_id company_id,
94             hp.party_name company_name,
95             'CUSTOMER' company_type,
96             nvl(nvl(flp.facility_code,wl.location_code),to_char(wl.wsh_location_id)) facility_code,
97             nvl(flp.description,wl.ui_location_code) description
98     from    hz_parties hp , hz_party_sites hps,
99             hz_cust_acct_sites_all hcas,
100             wsh_locations wl,
101             fte_location_parameters flp
102     where   hcas.party_site_id = hps.party_site_id
103     and     hps.party_id = hp.party_id
104     AND     hps.location_id = wl.source_location_id
105     and     wl.location_source_code = 'HZ'
106     and     hp.status='A'
107     AND     wl.wsh_location_id = flp.location_id (+)
108     AND     wl.wsh_location_id = c_location_id
109     union
110     SELECT  wl.wsh_location_id facility_id,
111             wc.carrier_id company_id,
112             wc.carrier_name company_name,
113             'CARRIER' company_type,
114             nvl(nvl(flp.facility_code,wl.location_code),to_char(wl.wsh_location_id)) facility_code,
115             nvl(flp.description,wl.ui_location_code) description
116     from     hz_party_sites hps,
117             wsh_carriers_v wc,
118             wsh_locations wl,
119             fte_location_parameters flp
120     where   hps.party_id = wc.carrier_id
121     AND     hps.location_id = wl.source_location_id
122     and     wl.location_source_code = 'HZ'
123     and     wc.active='A'
124     AND     wl.wsh_location_id = c_location_id
125     AND     wl.wsh_location_id = flp.location_id (+)
126     union
127     SELECT  wl.wsh_location_id facility_id,
128             hp.party_id company_id,
129             hp.party_name company_name,
130             'SUPPLIER' company_type,
131             nvl(nvl(flp.facility_code,wl.location_code),to_char(wl.wsh_location_id)) facility_code,
132             nvl(flp.description,wl.ui_location_code) description
133     FROM    hz_parties hp ,
134             po_vendors po,
135             hz_relationships rel,
136             hz_party_sites hps,
137             wsh_locations wl,
138             fte_location_parameters flp
139     WHERE hps.party_id = hp.party_id
140         AND rel.relationship_type = 'POS_VENDOR_PARTY'
141         and rel.object_id = hp.party_id
142         and rel.object_table_name = 'HZ_PARTIES'
143         and rel.object_type = 'ORGANIZATION'
144         and rel.subject_table_name = 'PO_VENDORS'
145         and rel.subject_id = po.vendor_id
146         and rel.subject_type = 'POS_VENDOR'
147         AND hps.location_id = wl.source_location_id
148         AND wl.location_source_code = 'HZ'
149         AND hp.status='A'
150         AND wl.wsh_location_id = c_location_id
151         AND wl.wsh_location_id = flp.location_id (+);
152 
153     CURSOR c_get_item_name(c_item_id  IN NUMBER) IS
154     SELECT m.concatenated_segments
155     FROM   mtl_system_items_vl m
156     WHERE  m.inventory_item_id = c_item_id
157     AND    m.organization_id in ( select p.master_organization_id
158            from mtl_parameters p)
159     AND rownum = 1;
160 
161     CURSOR c_get_vehicle_det(c_veh_type_id IN NUMBER) IS
162     SELECT inventory_item_id,
163            organization_id,
164            vehicle_class_code
165     FROM   fte_vehicle_types
166     WHERE  vehicle_type_id = c_veh_type_id;
167 
168 
169     --#REG-ZON
170     CURSOR c_get_region_name(c_region_id IN NUMBER) IS
171     SELECT country,
172 	   state,
173 	   city,
174 	   postal_code_from,
175 	   postal_code_to
176     FROM   wsh_regions_v
177     WHERE  region_id = c_region_id;
178 
179     CURSOR c_get_zone_name(c_zone_id IN NUMBER) IS
180     SELECT zone
181     FROM   wsh_regions_v
182     WHERE  region_id = c_zone_id;
183     --#REG-ZON
184 
185 
186     l_shared_fac        BOOLEAN := FALSE;
187     l_result            VARCHAR2(2000);
188     l_facility_id       NUMBER;
189     l_company_id        NUMBER;
190     l_facility_code     VARCHAR2(100);
191     l_company_name      VARCHAR2(200);
192     l_company_type      VARCHAR2(30);
193     l_description       VARCHAR2(200);
194     l_veh_item_id       NUMBER;
195     l_veh_org_id        NUMBER;
196     l_veh_class_code    VARCHAR2(30);
197     l_vehicle_meaning   VARCHAR2(80);
198     --#REG-ZON
199     l_country           WSH_REGIONS_TL.COUNTRY%TYPE;
200     l_state             WSH_REGIONS_TL.STATE%TYPE;
201     l_city              WSH_REGIONS_TL.CITY%TYPE;
202     l_postal_code_from  WSH_REGIONS_TL.POSTAL_CODE_FROM%TYPE;
203     l_postal_code_to	WSH_REGIONS_TL.POSTAL_CODE_TO%TYPE;
204     --#REG-ZON
205 
206     l_debug_on CONSTANT BOOLEAN := WSH_DEBUG_SV.is_debug_enabled;
207     l_module_name CONSTANT VARCHAR2(100) := 'fte.plsql.' || G_PKG_NAME || '.' || 'get_object_name';
208 
209 BEGIN
210 
211     --
212     IF l_debug_on THEN
213       wsh_debug_sv.push (l_module_name);
214     END IF;
215     --
216     -- object1_type values : ORG CUS FAC CAR MOD ITM SUP
217     -- object2_type values : FAC CAR MOD ITM VHT CUS
218 
219     /*
220     p_object_type is
221     1. either the first/last 3 letters of the comp class code or
222     2. the first 3 letters of the lookup FTE_FACILITY_COMPANY_TYPE
223     3. for vehicle (VEH) it can be VHT
224     */
225 
226     IF p_object_type = 'ORG' THEN
227 
228        OPEN c_get_org_name(p_object_value_num);
229        FETCH c_get_org_name INTO l_result;
230        CLOSE c_get_org_name;
231 
232        x_fac_company_type := 'ORGANIZATION';
233        x_fac_company_name := l_result;
234 
235     ELSIF p_object_type = 'CUS' THEN
236 
237        OPEN c_get_cus_name(p_object_value_num);
238        FETCH c_get_cus_name INTO l_result;
239        CLOSE c_get_cus_name;
240 
241        x_fac_company_type := 'CUSTOMER';
242        x_fac_company_name := l_result;
243 
244     ELSIF p_object_type = 'SUP' THEN
245 
246        OPEN c_get_sup_name(p_object_value_num);
247        FETCH c_get_sup_name INTO l_result;
248        CLOSE c_get_sup_name;
249 
250        x_fac_company_type := 'SUPPLIER';
251        x_fac_company_name := l_result;
252 
253     ELSIF p_object_type = 'CAR' THEN
254 
255        OPEN c_get_car_name(p_object_value_num);
256        FETCH c_get_car_name INTO l_result;
257        CLOSE c_get_car_name;
258 
259        x_fac_company_type := 'CARRIER';
260        x_fac_company_name := l_result;
261 
262     ELSIF p_object_type = 'FAC' THEN
263 
264        OPEN c_get_fac_comp(p_object_value_num);
265        LOOP
266           FETCH c_get_fac_comp INTO l_facility_id, l_company_id, l_company_name, l_company_type,
267                                  l_facility_code, l_description;
268           EXIT WHEN c_get_fac_comp%NOTFOUND;
269           --
270           IF l_debug_on THEN
271              WSH_DEBUG_SV.logmsg(l_module_name,'c_get_fac_comp rowcount '|| c_get_fac_comp%ROWCOUNT);
272           END IF;
273           --
274           IF c_get_fac_comp%ROWCOUNT > 1 THEN
275              l_shared_fac := TRUE;
276              EXIT;
277           END IF;
278        END LOOP;
279        CLOSE c_get_fac_comp;
280 
281        l_result := l_facility_code;
282        -- Can same location_id be share across multiple company types ??
283        -- If yes, this API will return the second company type
284        x_fac_company_type := l_company_type;
285        IF l_shared_fac THEN
286           -- Return "Multiple"
287           x_fac_company_name := fnd_message.get_string('FTE','FTE_DELIVERIES_MULTIPLE_LEGS');
288        ELSE
289           x_fac_company_name := l_company_name;
290        END IF;
291 
292     ELSIF p_object_type = 'ITM' THEN
293 
294       IF WSH_UTIL_CORE.TP_Is_Installed = 'Y' THEN
295 
296          OPEN c_get_item_name(p_object_value_num);
297          FETCH c_get_item_name INTO l_result;
298          CLOSE c_get_item_name;
299 
300       ELSE
301 
302       l_result :=  WSH_UTIL_CORE.Get_Item_Name
303                   (p_item_id              =>   p_object_value_num,
304                    p_organization_id      =>   p_object_parent_id
305                    );
306       END IF;
307 
308     ELSIF p_object_type = 'MOD' THEN
309 
310        OPEN c_meaning('WSH_MODE_OF_TRANSPORT',p_object_value_char);
311        FETCH c_meaning INTO l_result;
312        CLOSE c_meaning;
313 
314     ELSIF p_object_type = 'VHT' THEN -- Vehicle Type
315 
316        OPEN c_get_vehicle_det(p_object_value_num);
317        FETCH c_get_vehicle_det INTO l_veh_item_id,l_veh_org_id,l_veh_class_code;
318        CLOSE c_get_vehicle_det;
319 
320        l_result :=  WSH_UTIL_CORE.Get_Item_Name
321                 (p_item_id              =>   l_veh_item_id,
322                  p_organization_id      =>   l_veh_org_id
323                  );
324 
325        -- IMPORTANT --
326        -- x_fac_company_name parameter is used for
327        -- returning the vehicle class code
328        -- in case of a constraint tied to vehicle type
329        -- IMPORTANT --
330 
331        x_fac_company_name := l_veh_class_code;
332 
333     --#REG-ZON(S)
334     ELSIF p_object_type = 'REG' THEN -- Region
335 
336 	OPEN  c_get_region_name(p_object_value_num);
337 	FETCH c_get_region_name INTO l_country,l_state,l_city,l_postal_code_from,l_postal_code_to;
338 	CLOSE c_get_region_name;
339 
340 	-- Country is Mandatory for a region.
341 	l_result := l_country;
342 
343 	IF l_state IS NOT NULL THEN
344              l_result := l_result||', '||l_state;
345 	END IF;
346 
347 	IF l_city IS NOT NULL THEN
348              l_result := l_result||', '||l_city;
349 	END IF;
350 
351 	IF l_postal_code_from IS NOT NULL THEN
352 	     l_result := l_result||', '||l_postal_code_from;
353 	END IF;
354 
355 	IF l_postal_code_to IS NOT NULL THEN
356 	     l_result := l_result||'-'||l_postal_code_to;
357 	END IF;
358 
359     ELSIF p_object_type = 'ZON' THEN
360 
361 	OPEN  c_get_zone_name(p_object_value_num);
362 	FETCH c_get_zone_name INTO l_result;
363 	CLOSE c_get_zone_name;
364 
365     END IF;
366     --#REG-ZON(E)
367 
368       --
369     IF l_debug_on THEN
370         WSH_DEBUG_SV.logmsg(l_module_name,'Object Type '|| p_object_type);
371         WSH_DEBUG_SV.logmsg(l_module_name,'Object Value Num '|| p_object_value_num);
372         WSH_DEBUG_SV.logmsg(l_module_name,'Object Value Char '|| p_object_value_char);
373         WSH_DEBUG_SV.logmsg(l_module_name,'Object parent id '|| p_object_parent_id);
374         WSH_DEBUG_SV.logmsg(l_module_name,'Object name '|| l_result);
375         WSH_DEBUG_SV.logmsg(l_module_name,'Company type  '|| x_fac_company_type);
376         WSH_DEBUG_SV.logmsg(l_module_name,'Company name  '|| x_fac_company_name);
377         WSH_DEBUG_SV.pop(l_module_name);
378     END IF;
379       --
380 
381     RETURN l_result;
382 
383 EXCEPTION
384     WHEN others THEN
385 
386       --#REG-ZON
387       IF c_get_zone_name%ISOPEN THEN
388          CLOSE c_get_zone_name;
389       END IF;
390 
391       IF c_get_region_name%ISOPEN THEN
392          CLOSE c_get_region_name;
393       END IF;
394       --#REG-ZON
395 
396       --
397       IF l_debug_on THEN
398         WSH_DEBUG_SV.logmsg(l_module_name,'Unexpected error has occured. Oracle error message is '|| SQLERRM,WSH_DEBUG_SV.C_UNEXPEC_ERR_LEVEL);
399         WSH_DEBUG_SV.pop(l_module_name,'EXCEPTION:FND_API.G_EXC_UNEXPECTED_ERROR');
400       END IF;
401       --
402       RETURN g_unexp_char;
403 
404 END get_object_name;
405 
406 
407 PROCEDURE get_facility_display(
408              p_source_location_id      IN VARCHAR2,
409              p_source_location_code    IN VARCHAR2,
410              x_fac_sites               OUT NOCOPY      VARCHAR2,
411              x_fac_company_type        OUT NOCOPY      VARCHAR2,
412              x_fac_company_name        OUT NOCOPY      VARCHAR2,
413              x_return_status           OUT NOCOPY      VARCHAR2,
414 	     x_msg_count               OUT NOCOPY      NUMBER,
415 	     x_msg_data                OUT NOCOPY      VARCHAR2 )
416 IS
417 
418     cursor c_hr_details (p_locid VARCHAR2) is
419     select hou.organization_id company_id, hou.name company_name,
420            hou.name site, 'ORGANIZATION' company_type
421     FROM   HR_ORGANIZATION_UNITS HOU, HR_ORGANIZATION_INFORMATION HOI1, MTL_PARAMETERS MP,
422            wsh_locations wl
423     WHERE  hou.location_id = wl.source_location_id
424     AND    wl.location_source_code = 'HR'
425     AND    HOU.ORGANIZATION_ID = HOI1.ORGANIZATION_ID
426     AND    HOU.ORGANIZATION_ID = MP.ORGANIZATION_ID
427     AND    HOI1.ORG_INFORMATION1 = 'INV'
428     AND    HOI1.ORG_INFORMATION2 = 'Y'
429     AND    ( HOI1.ORG_INFORMATION_CONTEXT || '') = 'CLASS'
430     AND    wl.source_location_id=p_locid;
431 
432     cursor c_hz_details (p_locid VARCHAR2) is
433     select wc.carrier_id company_id, wc.carrier_name company_name,
434            wc.carrier_name||'/'||nvl(hps.party_site_name,hps.party_site_number)
435            site, 'CARRIER' company_type
436     from   wsh_locations wl, hz_party_sites hps,  wsh_carriers_v wc
437     where  wl.source_location_id=hps.location_id
438     and    hps.party_id=wc.carrier_id
439     and    wl.location_source_code='HZ'
440     and    wc.active='A'
441     and    wl.source_location_id=p_locid
442     union all
443     select hcas.cust_account_id company_id, hp.party_name company_name,
444            hp.party_name||'/'||nvl(hps.party_site_name,hps.party_site_number)
445            site, 'CUSTOMER' company_type
446       from wsh_locations wl, hz_party_sites hps, hz_parties hp,
447            hz_cust_acct_sites_all hcas
448      where wl.source_location_id=hps.location_id
449        and hps.party_id=hp.party_id
450        and wl.location_source_code='HZ'
451        and hcas.party_site_id=hps.party_site_id
452        and hp.status='A'
453        and wl.source_location_id=p_locid
454     union all
455     select hp.party_id company_id, hp.party_name company_name,
456            hp.party_name||'/'||nvl(hps.party_site_name,hps.party_site_number)
457            site, 'SUPPLIER' company_type
458     FROM    hz_parties hp ,
459             po_vendors po,
460             hz_relationships rel,
461             hz_party_sites hps,
462             wsh_locations wl
463      where wl.source_location_id=hps.location_id
464        and hps.party_id=hp.party_id
465         AND rel.relationship_type = 'POS_VENDOR_PARTY'
466         and rel.object_id = hp.party_id
467         and rel.object_table_name = 'HZ_PARTIES'
468         and rel.object_type = 'ORGANIZATION'
469         and rel.subject_table_name = 'PO_VENDORS'
470         and rel.subject_id = po.vendor_id
471         and rel.subject_type = 'POS_VENDOR'
472        and wl.location_source_code='HZ'
473        and hp.status='A'
474        and wl.source_location_id=p_locid;
475 
476     l_debug_on CONSTANT BOOLEAN := WSH_DEBUG_SV.is_debug_enabled;
477     l_module_name CONSTANT VARCHAR2(100) := 'fte.plsql.' || G_PKG_NAME || '.' || 'get_facility_display';
478 
479     l_company_id              NUMBER;
480     l_prev_company_id         NUMBER;
481     l_fac_sites               VARCHAR2(2000) := NULL;
482     l_fac_company_type        VARCHAR2(30)   := '';
483     l_fac_company_name        VARCHAR2(2000) := NULL;
484 
485     invalid_loc_src_code EXCEPTION;
486     others               EXCEPTION;
487 
488 BEGIN
489 
490       x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;
491 
492       IF l_debug_on THEN
493          wsh_debug_sv.push(l_module_name);
494       END IF;
495 
496       IF p_source_location_code ='HR' THEN
497          FOR cur IN c_hr_details (p_source_location_id) LOOP
498              IF l_fac_company_name IS NULL THEN
499                 l_fac_company_name := cur.company_name;
500                 l_fac_sites := cur.site;
501              ELSE
502                 l_fac_company_name := fnd_message.get_string('FTE','FTE_DELIVERIES_MULTIPLE_LEGS');
503                 l_fac_sites:=l_fac_sites||', '||cur.site;
504              END IF;
505              l_fac_company_type:=cur.company_type;
506          END LOOP;
507       ELSIF p_source_location_code ='HZ' THEN
508          FOR cur IN c_hz_details (p_source_location_id) LOOP
509              IF l_fac_company_name IS NULL THEN
510                 l_fac_company_name := cur.company_name;
511                 l_fac_sites := cur.site;
512              ELSE
513                 l_fac_company_name := fnd_message.get_string('FTE','FTE_DELIVERIES_MULTIPLE_LEGS');
514                 l_fac_sites:=l_fac_sites||', '||cur.site;
515              END IF;
516              l_fac_company_type:=cur.company_type;
517          END LOOP;
518       ELSE
519          raise invalid_loc_src_code;
520       END IF;
521 
522       x_fac_sites:=l_fac_sites;
523       x_fac_company_type:=l_fac_company_type;
524       x_fac_company_name:=l_fac_company_name;
525 
526       IF l_debug_on THEN
527         wsh_debug_sv.log(l_module_name, 'p_source_location_id ', p_source_location_id);
528         wsh_debug_sv.log(l_module_name, 'p_source_location_code ', p_source_location_code);
529         wsh_debug_sv.log(l_module_name, 'x_fac_sites ', x_fac_sites);
530         wsh_debug_sv.log(l_module_name, 'x_fac_company_name ', x_fac_company_name);
531         wsh_debug_sv.log(l_module_name, 'x_fac_company_type ', x_fac_company_type);
532         WSH_DEBUG_SV.pop(l_module_name);
533       END IF;
534 
535       FND_MSG_PUB.Count_And_Get (
536              p_count => x_msg_count,
537              p_data  => x_msg_data,
538              p_encoded => FND_API.G_FALSE);
539 
540 EXCEPTION
541     WHEN invalid_loc_src_code THEN
542       x_return_status := WSH_UTIL_CORE.G_RET_STS_ERROR ;
543 
544       FND_MSG_PUB.Count_And_Get (
545              p_count => x_msg_count,
546              p_data  => x_msg_data,
547              p_encoded => FND_API.G_FALSE);
548 
549       --
550       IF l_debug_on THEN
551         WSH_DEBUG_SV.log(l_module_name,'Error : Invalid Location Source Code : ', p_source_location_code);
552         WSH_DEBUG_SV.pop(l_module_name,'EXCEPTION:FND_API.G_EXC_ERROR');
553       END IF;
554     WHEN OTHERS THEN
555       x_return_status := WSH_UTIL_CORE.G_RET_STS_UNEXP_ERROR ;
556 
557       FND_MSG_PUB.Count_And_Get (
558              p_count => x_msg_count,
559              p_data  => x_msg_data,
560              p_encoded => FND_API.G_FALSE);
561 
562       --
563       IF l_debug_on THEN
564         WSH_DEBUG_SV.logmsg(l_module_name,'Unexpected error has occured. Oracle error message is '|| SQLERRM,WSH_DEBUG_SV.C_UNEXPEC_ERR_LEVEL);
565         WSH_DEBUG_SV.pop(l_module_name,'EXCEPTION:FND_API.G_EXC_UNEXPECTED_ERROR');
566       END IF;
567       --
568 END get_facility_display;
569 
570 END FTE_COMP_CONSTRAINT_UTIL;
571