DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_OPTIONS_SV

Source


1 PACKAGE BODY po_options_sv AS
2 /* $Header: POXSTDPB.pls 115.3 2002/11/25 22:38:26 sbull ship $*/
3 PROCEDURE get_startup_values (
4 			po_install_status  	IN OUT NOCOPY  VARCHAR2,
5 			oe_install_status	IN OUT NOCOPY  VARCHAR2,
6 			inv_install_status	IN OUT	NOCOPY VARCHAR2,
7 			coa			IN OUT NOCOPY  NUMBER,
8 			inventory_org_id	IN OUT NOCOPY  NUMBER,
9 			currency_code		IN OUT NOCOPY  VARCHAR2,
10 			per_pos_grant_exists	IN OUT NOCOPY  VARCHAR2,
11 			doc_types_grant_exists	IN OUT NOCOPY  VARCHAR2,
12 			order_types_grant_exists 	IN OUT NOCOPY VARCHAR2,
13 			order_sources_grant_exists	IN OUT NOCOPY VARCHAR2,
14 			line_types_grant_exists		IN OUT NOCOPY VARCHAR2,
15 			psp_has_data			IN OUT NOCOPY BOOLEAN)
16 IS
17 	po_id		NUMBER := 0;
18 	oe_id		NUMBER := 0;
19 	inv_id		NUMBER := 0;
20 	data_exists	NUMBER := 0;
21 	dummy_str	VARCHAR2(50);
22         industry	VARCHAR2(255) := NULL;
23         get_rv		BOOLEAN;
24         x_progress      VARCHAR2(3)  :=  NULL;
25 	no_install_status	EXCEPTION;
26 BEGIN
27 
28     -- determine the application_id for PO, OE, and INV.  This
29     -- information is used to determine the installation status of
30     -- these applications.
31 
32     x_progress := '010';
33     SELECT     application_id
34     INTO       po_id
35     FROM       FND_APPLICATION
36     WHERE      application_short_name = 'PO';
37 
38     x_progress := '020';
39     SELECT     application_id
40     INTO       oe_id
41     FROM       FND_APPLICATION
42     WHERE      application_short_name = 'OE';
43 
44     x_progress := '030';
45     SELECT     application_id
46     INTO       inv_id
47     FROM       FND_APPLICATION
48     WHERE      application_short_name = 'INV';
49 
50     --  determine the installation status of PO, INV, and OE.
51 
52     x_progress := '040';
53     get_rv := FND_INSTALLATION.get(po_id, po_id, po_install_status, industry);
54     IF get_rv = FALSE THEN
55 	raise no_install_status;
56     END IF;
57 
58     x_progress := '050';
59     if oe_install.get_active_product() in ('OE', 'ONT') then
60 		oe_install_status := 'I';
61     else
62 		oe_install_status := 'N';
63     end if;
64 
65   /*
66     get_rv := FND_INSTALLATION.get(oe_id, oe_id, oe_install_status, industry);
67     IF get_rv = FALSE THEN
68 	raise no_install_status;
69     END IF;
70  */
71 
72     x_progress := '060';
73     get_rv := FND_INSTALLATION.get(inv_id, inv_id, inv_install_status,
74 	industry);
75     IF get_rv = FALSE THEN
76 	raise no_install_status;
77     END IF;
78 
79     -- determine chart of accounts id, inventory organization
80     -- id, and currency code.
81 
82     x_progress := '080';
83     SELECT 	sob.chart_of_accounts_id,
84 		fsp.inventory_organization_id,
85 		sob.currency_code
86     INTO	coa,
87 		inventory_org_id,
88 		currency_code
89     FROM	gl_sets_of_books sob,
90 		financials_system_parameters fsp
91     WHERE 	sob.set_of_books_id = fsp.set_of_books_id;
92 
93     -- Determine whether current user has permissions to access the
94     -- line_type, security_position_name, order_source_id_dsp,
95     -- order_type_id_dsp fields.
96 
97     x_progress := '100';
98 --
99 -- BUG fix for Bug# 474893
100 -- to display missing Order type on screen
101 -- The following lines of code are replaced by a function security mechanism
102 -- in form POXSTDPO.fmb,in  Built in Package PO_OPTIONS3
103 -- We do not need to select from tables.A parameter DISPLAY_CHECK is either
104 -- set to 'Y' or 'N' when POXSTDPO.fmb form is invoked from the menu,
105 -- depending on the responsibility of person who has signed on. These lines
106 -- have therefore been commented out.
107 
108 --#474893
109 /*
110     BEGIN
111 
112     SELECT 	table_name
113     INTO  	dummy_str
114     FROM	all_tables alt
115     WHERE	alt.table_name = 'PER_POSITION_STRUCTURES';
116 
117     per_pos_grant_exists := 'Y';
118 
119     EXCEPTION
120     WHEN no_data_found THEN
121 	per_pos_grant_exists := 'N';
122     WHEN others THEN
123 	raise;
124     END;
125 
126     x_progress := '110';
127     BEGIN
128 
129     SELECT 	table_name
130     INTO 	dummy_str
131     FROM	all_tables alt
132     WHERE	alt.table_name = 'PO_DOCUMENT_TYPES';
133 
134     doc_types_grant_exists := 'Y';
135 
136     EXCEPTION
137     WHEN no_data_found THEN
138 	doc_types_grant_exists := 'N';
139     WHEN others THEN
140 	raise;
141     END;
142 */
143 
144     x_progress := '120';
145 
146 --#474893
147 /*
148     BEGIN
149 
150     SELECT 	table_name
151     INTO 	dummy_str
152     FROM	all_tables alt
153     WHERE	alt.table_name = 'SO_ORDER_TYPES_ALL';
154 
155     order_types_grant_exists := 'Y';
156 
157     EXCEPTION
158     WHEN no_data_found THEN
159 	order_types_grant_exists := 'N';
160     WHEN others THEN
161 	raise;
162     END;
163 
164     x_progress := '130';
165     BEGIN
166 
167     SELECT 	table_name
168     INTO 	dummy_str
169     FROM	all_tables alt
170     WHERE	alt.table_name = 'SO_ORDER_SOURCES';
171 
172     order_sources_grant_exists := 'Y';
173 
174     EXCEPTION
175     WHEN no_data_found THEN
176         order_sources_grant_exists := 'N';
177     WHEN others THEN
178 	raise;
179     END;
180 
181     x_progress := '140';
182     BEGIN
183 
184     SELECT 	table_name
185     INTO 	dummy_str
186     FROM	all_tables alt
187     WHERE	alt.table_name = 'PO_LINE_TYPES';
188 
189     line_types_grant_exists := 'Y';
190 
191     EXCEPTION
192     WHEN no_data_found THEN
193         line_types_grant_exists := 'N';
194     WHEN others THEN
195 	raise;
196     END;
197 */
198 
199     x_progress := '160';
200 
201     SELECT 	count(*)
202     INTO 	data_exists
203     FROM 	po_system_parameters;
204 
205     IF (data_exists > 0) THEN
206 	psp_has_data := TRUE;
207     ELSE
208 	psp_has_data := FALSE;
209     END IF;
210 
211 EXCEPTION
212     WHEN no_install_status THEN
213 	RAISE;
214     WHEN OTHERS THEN
215 	RAISE;
216 END;
217 
218 END;