DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_SETUP_S1

Source


1 PACKAGE BODY PO_SETUP_S1 as
2 /* $Header: POXSES2B.pls 115.8 2004/01/09 22:34:30 anhuang ship $*/
3 
4 /*=============================  PO_SETUP_S1  ===============================*/
5 
6 g_log_head    CONSTANT VARCHAR2(30) := 'po.plsql.PO_SETUP_S1.';
7 
8 /*===========================================================================
9 
10   PROCEDURE NAME:	get_install_status()
11 
12 ===========================================================================*/
13 PROCEDURE get_install_status(x_inv_status            OUT NOCOPY VARCHAR2,
14                              x_po_status             OUT NOCOPY VARCHAR2,
15                              x_qa_status             OUT NOCOPY VARCHAR2,
16 			     x_wip_status	     OUT NOCOPY VARCHAR2,
17 			     x_oe_status	     OUT NOCOPY VARCHAR2,
18 			     x_pa_status	     OUT NOCOPY VARCHAR2) is
19 
20 x_progress VARCHAR2(3) := NULL;
21 
22 BEGIN
23   x_progress := '010';
24   x_inv_status := po_core_s.get_product_install_status('INV');
25 
26   x_progress := '020';
27   x_po_status := po_core_s.get_product_install_status('PO');
28 
29   x_progress := '030';
30   x_qa_status := po_core_s.get_product_install_status('QA');
31 
32   x_progress := '040';
33   x_wip_status := po_core_s.get_product_install_status('WIP');
34 
35   x_progress := '050';
36   x_oe_status := po_core_s.get_product_install_status('OE');
37 
38   x_progress := '060';
39   x_pa_status := po_core_s.get_product_install_status('PA');
40 
41 
42   EXCEPTION
43   WHEN OTHERS THEN
44   po_message_s.sql_error('po_setup_s1.get_install_status', x_progress, sqlcode);
45   RAISE;
46 
47 END get_install_status;
48 
49 PROCEDURE test_get_install_status IS
50 
51  x_inv_status VARCHAR2 (20);
52  x_po_status VARCHAR2 (20);
53  x_qa_status VARCHAR2 (20);
54  x_wip_status VARCHAR2 (20);
55  x_oe_status VARCHAR2 (20);
56  x_pa_status VARCHAR2 (20);
57 
58 BEGIN
59   po_setup_s1.get_install_status(x_inv_status,
60 		 		x_po_status,
61 				x_qa_status,
62 				x_wip_status,
63 				x_oe_status,
64 				x_pa_status);
65 
66   --togeorge 08/11/2001 Commented out due to source control issues.
67   --dbms_output.put_line('x_po_status = ' || x_po_status);
68   --dbms_output.put_line('x_po_status = ' || x_inv_status);
69   --dbms_output.put_line('x_po_status = ' || x_qa_status);
70 
71 END test_get_install_status;
72 
73 /*===========================================================================
74   PROCEDURE NAME:	get_eam_startup()
75 
76   DESCRIPTION:
77 	                o x_eam_install_status stores the installation stuts of EAM
78 
79 	                o x_eam_profile stores the value of the profile
80 					PO: Enable Direct Delivery To Shop floor
81 
82   REFERENCED BY:	init_po_control_block, POXCOSEU.pld
83 
84 ===========================================================================*/
85 
86 PROCEDURE get_eam_startup    (x_eam_install_status    OUT NOCOPY VARCHAR2,
87                              x_eam_profile           OUT NOCOPY VARCHAR2) is
88 
89 x_progress VARCHAR2(3) := NULL;
90 BEGIN
91   x_progress := '010';
92   x_eam_install_status := po_core_s.get_product_install_status('EAM');
93 
94   x_progress := '020';
95   fnd_profile.get('PO_DIRECT_DELIVERY_TO_SHOPFLOOR',x_eam_profile);
96 
97   EXCEPTION
98   WHEN OTHERS THEN
99   po_message_s.sql_error('po_setup_s1.get_eam_status', x_progress, sqlcode);
100   RAISE;
101 
102 END get_eam_startup;
103 
104 /*===========================================================================
105   PROCEDURE NAME:	get_oke_startup()
106 
107   DESCRIPTION:
108 	                1.x_oke_install_status stores the installation stuts
109 			  of OKE
110 
111   REFERENCED BY:	init_po_control_block, POXCOSEU.pld
112 
113 ===========================================================================*/
114 
115 PROCEDURE get_oke_startup    (x_oke_install_status    OUT NOCOPY VARCHAR2) is
116 
117 x_progress VARCHAR2(3) := NULL;
118 BEGIN
119   x_progress := '010';
120   x_oke_install_status := po_core_s.get_product_install_status('OKE');
121 
122   EXCEPTION
123   WHEN OTHERS THEN
124   po_message_s.sql_error('po_setup_s1.get_oke_status', x_progress, sqlcode);
125   RAISE;
126 
127 END get_oke_startup;
128 
129 /*===========================================================================
130   PROCEDURE NAME:	get_gms_startup()
131 
132   DESCRIPTION:
133 	                1.x_gms_install_status stores the installation stuts
134 			  of GMS
135 
136   REFERENCED BY:	init_po_control_block, POXCOSEU.pld
137 
138 ===========================================================================*/
139 
140 PROCEDURE get_gms_startup    (x_gms_install_status    OUT NOCOPY VARCHAR2) is
141 
142 x_progress VARCHAR2(3) := NULL;
143 BEGIN
144   x_progress := '010';
145   x_gms_install_status := po_core_s.get_product_install_status('GMS');
146 
147   EXCEPTION
148   WHEN OTHERS THEN
149   po_message_s.sql_error('po_setup_s1.get_gms_status', x_progress, sqlcode);
150   RAISE;
151 END get_gms_startup;
152 
153 
154 /*===========================================================================
155   PROCEDURE NAME:       get_sourcing_startup()
156 
157   DESCRIPTION:        x_pon_install_status stores the installation status
158 		      of sourcing product
159                       Requisition To Sourcing FPH
160   REFERENCED BY:        init_po_control_block, POXCOSEU.pld
161 ===========================================================================*/
162 
163 PROCEDURE get_sourcing_startup    (x_pon_install_status    OUT NOCOPY VARCHAR2) is
164 
165 x_progress VARCHAR2(3) := NULL;
166 x_pon_use_profile varchar2(1) := 'N';
167 
168 BEGIN
169   x_progress := '010';
170   x_pon_use_profile := fnd_profile.value('PO_ALLOW_AUTOCREATE_SOURCING_DOCS');
171 
172  /* return the sourcing install status only if the Use Sourcing profile is set to yes
173     Otherwise return the install status as N irrespective of the fnd install status */
174 
175   IF nvl(x_pon_use_profile,'N') = 'Y' THEN
176    x_pon_install_status := po_core_s.get_product_install_status('PON');
177   ELSE
178    x_pon_install_status := 'N';
179   END IF;
180 
181   EXCEPTION
182   WHEN OTHERS THEN
183   po_message_s.sql_error('po_setup_s1.get_pon_status', x_progress, sqlcode);
184   RAISE;
185 END get_sourcing_startup;
186 
187 -----------------------------------------------------------------<SERVICES FPJ>
188 -------------------------------------------------------------------------------
189 --Start of Comments
190 --Name: get_services_enabled_flag
191 --Pre-reqs:
192 --  None.
193 --Modifies:
194 --  None.
195 --Locks:
196 --  None.
197 --Function:
198 --  This function determines whether Services Procurement is enabled for the
199 --  current system. In order for Services Procurement to be enabled...
200 --  (a) Profile Option "PO: Enable Services Procurement" must be turned on, and
201 --  (b) AP must be Family Pack M or higher (11i.AP.M) or not installed at all
202 --Parameters:
203 --  None.
204 --Returns:
205 --  VARCHAR2(1): 'Y' if Services Procurement is enabled for the current setup.
206 --  'N' otherwise.
207 --Testing:
208 --  None.
209 --End of Comments
210 -------------------------------------------------------------------------------
211 -------------------------------------------------------------------------------
212 FUNCTION get_services_enabled_flag
213 RETURN VARCHAR2
214 IS
215 -- <BUG 3248161 START>
216 
217     l_api_name              VARCHAR2(30) := 'get_services_enabled_flag';
218     l_log_head              VARCHAR2(100) := g_log_head || l_api_name;
219     l_progress              VARCHAR2(3);
220 
221     l_profile_value         VARCHAR2(1);
222     l_ap_compatibility_flag VARCHAR2(1);
223     l_result                VARCHAR2(1);
224 
225 BEGIN
226 
227 l_progress := '000'; PO_DEBUG.debug_begin(l_log_head);
228 
229     -- Profile Option ---------------------------------------------------------
230 
231     l_profile_value := FND_PROFILE.value('PO_SERVICES_ENABLED');
232 
233 l_progress := '010'; PO_DEBUG.debug_var ( p_log_head => l_log_head
234                                         , p_progress => l_progress
235                                         , p_name     => 'PO: Enable Services Procurement'
236                                         , p_value    => l_profile_value
237                                         );
238 
239     -- AP Family Pack ---------------------------------------------------------
240 
241     l_ap_compatibility_flag := PO_SERVICES_PVT.get_ap_compatibility_flag;
242 
243 l_progress := '020'; PO_DEBUG.debug_var ( p_log_head => l_log_head
244                                         , p_progress => l_progress
245                                         , p_name     => 'l_is_ap_compatible'
246                                         , p_value    => l_ap_compatibility_flag
247                                         );
248 
249     ---------------------------------------------------------------------------
250 
251     IF (   ( l_profile_value = 'Y' )
252        AND ( l_ap_compatibility_flag = 'Y' ) )
253     THEN
254        l_result := 'Y';
255     ELSE
256        l_result := 'N';
257     END IF;
258 
259 l_progress := '020'; PO_DEBUG.debug_var ( p_log_head => l_log_head
260                                         , p_progress => l_progress
261                                         , p_name     => 'l_result'
262                                         , p_value    => l_result
263                                         );
264 l_progress := '030'; PO_DEBUG.debug_end(l_log_head);
265 
266     return (l_result);
267 
268 EXCEPTION
269 
270     WHEN OTHERS THEN
271         PO_DEBUG.debug_exc ( p_log_head => l_log_head
272                            , p_progress => l_progress);
273         RAISE;
274 
275 -- <BUG 3248161 END>
276 
277 END get_services_enabled_flag;
278 
279 
280 END PO_SETUP_S1;