1 PACKAGE BODY JG_ZZ_COMPANY_INFO AS
2 /*$Header: jgzzcib.pls 120.1 2005/06/29 01:58:56 sachandr ship $*/
3
4
5 FUNCTION get_location_id RETURN NUMBER IS
6 /*----------------------------------------------------------------------
7 Name: get_location_id
8
9 Description: This function returns a location_id of the organization
10 that the current responsibility is connecting.
11
12 Diffent profile option is refered to obtain the current
13 organization depending on the architecture:
14 "MO: Operating Unit" for Multi-Org
15 "JG: Company" for non Multi-Org.
16
17 This function can be used from Reports, Concurrent Program
18 Forms that need to access company information stored in the
19 HR_LOCATIONS Global FlexFields.
20
21 Arguments: None
22
23 ------------------------------------------------------------------------*/
24 location_id NUMBER(15);
25 BEGIN
26
27 BEGIN
28 SELECT org.location_id
29 INTO location_id
30 FROM hr_organization_units org,
31 fnd_product_groups prod
32 WHERE org.organization_id = to_number(decode(nvl(prod.multi_org_flag,'N'), 'Y',
33 fnd_profile.value_wnps('ORG_ID'),
34 fnd_profile.value_wnps('JGZZ_COMP_ID')));
35 EXCEPTION
36
37 WHEN OTHERS THEN
38 raise;
39 END;
40
41 return(location_id);
42
43 END get_location_id;
44
45 END JG_ZZ_COMPANY_INFO;