DBA Data[Home] [Help]

PACKAGE BODY: APPS.INV_CHECK_PRODUCT_INSTALL

Source


1 PACKAGE BODY INV_CHECK_PRODUCT_INSTALL  AS
2 /* $Header: INVNLINB.pls 120.0 2005/05/25 05:45:13 appldev noship $ */
3 
4 -- Global constant holding package name
5 g_pkg_name constant varchar2(50) := 'INV_CHECK_PRODUCT_INSTALL';
6 
7 /*
8 ** -------------------------------------------------------------------------
9 ** Function:    check_cse_install
10 ** Description: Checks to see if CSE is installed
11 ** Output:
12 **      x_return_status
13 **              return status indicating success, error, unexpected error
14 **      x_msg_count
15 **              number of messages in message list
16 **      x_msg_data
17 **              if the number of messages in message list is 1, contains
18 **              message text
19 ** Input:
20 ** Returns:
21 **	'Y' if CSE installed, else 'N'
22 **
23 **      Please use return value to determine if WMS is installed or not.
24 **      Do not use x_return_status for this purpose as
25 **      . x_return_status could be success and yet WMS not be installed.
26 **      . x_return_status is set to error when an error(such as SQL error)
27 **        occurs.
28 ** --------------------------------------------------------------------------
29 */
30 
31 PROCEDURE check_install
32          (p_application_id              IN  VARCHAR2
33         , p_dep_application_id          IN  VARCHAR2
34         , x_product_installed           OUT NOCOPY VARCHAR2
35         , x_industry                    OUT NOCOPY VARCHAR2
36         , x_return_status               OUT NOCOPY VARCHAR2
37         , x_msg_count                   OUT NOCOPY NUMBER
38         , x_msg_data                    OUT NOCOPY VARCHAR2) IS
39 l_installed	    BOOLEAN;
40 BEGIN
41       x_return_status := FND_API.G_RET_STS_SUCCESS ;
42       l_installed := fnd_installation.get(appl_id     => p_application_id,
43                                           dep_appl_id => p_dep_application_id,
44                                           status      => x_product_installed,
45                                           industry    => x_industry);
46 
47       IF NOT l_installed  THEN
48          x_return_status := FND_API.G_RET_STS_ERROR;
49          x_product_installed := 'N';
50       END IF;
51 EXCEPTION
52    WHEN OTHERS THEN
53         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
54 END check_install;
55 
56 FUNCTION check_cse_install (
57   x_return_status               OUT NOCOPY VARCHAR2
58 , x_msg_count                   OUT NOCOPY NUMBER
59 , x_msg_data                    OUT NOCOPY VARCHAR2
60  ) RETURN BOOLEAN IS
61 
62 -- constants
63 c_api_name		constant varchar(30) := 'check_cse_install';
64 
65 l_return_val         boolean := FALSE;
66 l_status VARCHAR2(1);
67 l_industry VARCHAR2(30);
68 l_schema VARCHAR2(30);
69 
70 begin
71     x_return_status := fnd_api.g_ret_sts_success ;
72 
73     if (g_cse_installation_status is not null) then
74         l_status := INV_CHECK_PRODUCT_INSTALL.g_cse_installation_status;
75     else
76         l_return_val := fnd_installation.get_app_info(application_short_name => 'CSE',
77 						status  => l_status,
78 						Industry => l_industry,
79 						oracle_schema => l_schema);
80     end if;
81     if (l_status='I') then return TRUE;
82     else return FALSE;
83     end if;
84     exception
85       when others then
86      	x_return_status := fnd_api.g_ret_sts_unexp_error ;
87 
88       	if (fnd_msg_pub.check_msg_level
89        	    (fnd_msg_pub.g_msg_lvl_unexp_error)) then
90 	    fnd_msg_pub.add_exc_msg(g_pkg_name, c_api_name);
91       	end if;
92 
93 	return FALSE;
94 end check_cse_install;
95 
96 FUNCTION check_cse_install return varchar2 is
97 l_return_val         boolean := FALSE;
98 l_status VARCHAR2(1);
99 l_industry VARCHAR2(30);
100 l_schema VARCHAR2(30);
101 
102 BEGIN
103 if (g_cse_installation_status is not null) then
104     l_status := inv_check_product_install.g_cse_installation_status;
105 else
106     l_return_val := fnd_installation.get_app_info(application_short_name => 'CSE',
107                                                 status  => l_status,
108                                                 Industry => l_industry,
109                                                 oracle_schema => l_schema);
110     INV_CHECK_PRODUCT_INSTALL.g_cse_installation_status := l_status;
111 end if;
112     if (l_status='I') then return 'Y';
113     else return 'N';
114     end if;
115 EXCEPTION
116       when others then
117           return 'N';
118 END check_cse_install;
119 
120 PROCEDURE check_eam_installed
121          (x_eam_installed               OUT NOCOPY VARCHAR2
122         , x_industry                    OUT NOCOPY VARCHAR2
123         , x_return_status               OUT NOCOPY VARCHAR2
124         , x_msg_count                   OUT NOCOPY NUMBER
125         , x_msg_data                    OUT NOCOPY VARCHAR2) IS
126 BEGIN
127    x_return_status := FND_API.G_RET_STS_SUCCESS ;
128    IF inv_check_product_install.g_eam_installed is NULL THEN
129       check_install
130                       (p_application_id              => 426
131                      , p_dep_application_id          => 426
132                      , x_product_installed           => x_eam_installed
133                      , x_industry                    => x_industry
134                      , x_return_status               => x_return_status
135                      , x_msg_count                   => x_msg_count
136                      , x_msg_data                    => x_msg_data ) ;
137       g_eam_installed := x_eam_installed;
138    ELSE
139       x_eam_installed := g_eam_installed;
140    END IF;
141 
142 EXCEPTION
143    WHEN OTHERS THEN
144         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
145 END check_eam_installed;
146 
147 PROCEDURE check_fte_installed
148          (x_fte_installed               OUT NOCOPY VARCHAR2
149         , x_industry                    OUT NOCOPY VARCHAR2
150         , x_return_status               OUT NOCOPY VARCHAR2
151         , x_msg_count                   OUT NOCOPY NUMBER
152         , x_msg_data                    OUT NOCOPY VARCHAR2) IS
153 BEGIN
154    x_return_status := FND_API.G_RET_STS_SUCCESS ;
155    IF inv_check_product_install.g_fte_installed is NULL THEN
156       check_install(p_application_id              => 716
157 		    , p_dep_application_id          => 716
158 		    , x_product_installed           => x_fte_installed
159 		    , x_industry                    => x_industry
160 		    , x_return_status               => x_return_status
161 		    , x_msg_count                   => x_msg_count
162 		    , x_msg_data                    => x_msg_data ) ;
163       g_fte_installed := x_fte_installed;
164    ELSE
165       x_fte_installed := g_fte_installed;
166    END IF;
167 
168 EXCEPTION
169    WHEN OTHERS THEN
170         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
171 END check_fte_installed;
172 
173 END INV_CHECK_PRODUCT_INSTALL;