DBA Data[Home] [Help]

PACKAGE BODY: APPS.OKL_VP_STS_PUB

Source


1 PACKAGE BODY OKL_VP_STS_PUB AS
2 /*$Header: OKLPSSCB.pls 115.7 2004/04/13 11:21:13 rnaik noship $*/
3 
4   ---------------------------------------------------------------------------
5   -- PROCEDURE get_listof_new_statuses
6   -- Public wrapper for STATUS PROCESS API
7   ---------------------------------------------------------------------------
8   PROCEDURE get_listof_new_statuses(
9     p_api_version                  IN  NUMBER,
10     p_init_msg_list                IN  VARCHAR2 DEFAULT OKC_API.G_FALSE,
11     x_return_status                OUT NOCOPY VARCHAR2,
12     x_msg_count                    OUT NOCOPY NUMBER,
13     x_msg_data                     OUT NOCOPY VARCHAR2,
14     p_ste_code                     IN  VARCHAR2,
15     p_sts_code                     IN  VARCHAR2,
16     p_start_date                   IN  DATE,
17     p_end_date                     IN  DATE,
18     x_sts_tbl                      OUT NOCOPY sts_tbl_type)
19     IS
20 
21     l_data                            VARCHAR2(100);
22     l_api_name                        CONSTANT VARCHAR2(30)  := 'get_listof_new_statuses';
23     l_count                           NUMBER ;
24     l_return_status                   VARCHAR2(1)    := FND_API.G_RET_STS_SUCCESS;
25     l_contract_id                     NUMBER;
26 BEGIN
27   x_return_status := FND_API.G_RET_STS_SUCCESS;
28 
29 
30 
31 
32   -- call process api to get list of new statuses
33 
34   OKL_VP_STS_PVT.get_listof_new_statuses(
35                       p_api_version,
36                       p_init_msg_list,
37                       x_return_status,
38                       x_msg_count,
39                       x_msg_data,
40                       p_ste_code,
41                       p_sts_code,
42                       p_start_date,
43                       p_end_date,
44                       x_sts_tbl);
45 
46 
47   IF x_return_status = FND_API.G_RET_STS_ERROR THEN
48     RAISE FND_API.G_EXC_ERROR;
49   ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
50     RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
51   END IF;
52 
53 
54 
55 
56 EXCEPTION
57 WHEN FND_API.G_EXC_ERROR THEN
58   -- notify caller of an UNEXPECTED error
59   x_return_status := FND_API.G_RET_STS_ERROR;
60 
61   -- store SQL error message on message stack for caller
62   FND_MSG_PUB.Count_and_get(p_encoded => OKC_API.G_FALSE,
63                             p_count   => x_msg_count,
64                             p_data    => x_msg_data);
65 
66   WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
67   -- notify caller of an UNEXPECTED error
68   x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
69 
70   -- store SQL error message on message stack for caller
71   FND_MSG_PUB.count_and_get(p_encoded => OKC_API.G_FALSE,
72 	                    p_count   => x_msg_count,
73                             p_data    => x_msg_data);
74 
75 WHEN OTHERS THEN
76   -- notify caller of an UNEXPECTED error
77   x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
78   FND_MSG_PUB.ADD_EXC_MSG('OKL_VP_STS_PUB','get_listof_new_statuses');
79 
80   -- store SQL error message on message stack for caller
81   FND_MSG_PUB.count_and_get(p_encoded => OKC_API.G_FALSE,
82                             p_count   => x_msg_count,
83                             p_data    => x_msg_data);
84   END get_listof_new_statuses;
85 
86 
87 
88 PROCEDURE change_agreement_status(
89     p_api_version                  IN  NUMBER,
90     p_init_msg_list                IN  VARCHAR2 DEFAULT OKC_API.G_FALSE,
91     x_return_status                OUT NOCOPY VARCHAR2,
92     x_msg_count                    OUT NOCOPY NUMBER,
93     x_msg_data                     OUT NOCOPY VARCHAR2,
94     p_chr_id                       in number,
95     p_current_sts_code             in VARCHAR2,
96     p_new_sts_code                 in varchar2)
97 
98 IS
99 
100   l_data                            VARCHAR2(100);
101   l_api_name                        CONSTANT VARCHAR2(30)  := 'change_agreement_status';
102   l_count                           NUMBER ;
103   l_return_status                   VARCHAR2(1)    := FND_API.G_RET_STS_SUCCESS;
104   l_contract_id                     NUMBER;
105 BEGIN
106   x_return_status := FND_API.G_RET_STS_SUCCESS;
107 
108 
109 
110   -- call process api to CHANGE Status
111 
112   OKL_VP_STS_PVT.change_agreement_status(
113                         p_api_version,
114                         p_init_msg_list,
115                         x_return_status,
116                         x_msg_count,
117                         x_msg_data,
118                         p_chr_id,
119                         p_current_sts_code,
120                         p_new_sts_code);
121 
122 
123   IF x_return_status = FND_API.G_RET_STS_ERROR THEN
124     RAISE FND_API.G_EXC_ERROR;
125   ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
126     RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
127   END IF;
128 
129 
130 
131 
132 
133 EXCEPTION
134 WHEN FND_API.G_EXC_ERROR THEN
135   -- notify caller of an UNEXPECTED error
136   x_return_status := FND_API.G_RET_STS_ERROR;
137 
138   -- store SQL error message on message stack for caller
139   FND_MSG_PUB.count_and_get(p_encoded => OKC_API.G_FALSE,
140                             p_count   => x_msg_count,
141                             p_data    => x_msg_data);
142 
143 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
144   -- notify caller of an UNEXPECTED error
145   x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
146 
147   -- store SQL error message on message stack for caller
148   FND_MSG_PUB.count_and_get(p_encoded => OKC_API.G_FALSE,
149                             p_count   => x_msg_count,
150                             p_data    => x_msg_data);
151 
152 WHEN OTHERS THEN
153   -- notify caller of an UNEXPECTED error
154   x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
155   FND_MSG_PUB.ADD_EXC_MSG('OKL_VP_STS_PUB','get_listof_new_statuses');
156 
157   -- store SQL error message on message stack for caller
158   FND_MSG_PUB.count_and_get(p_encoded => OKC_API.G_FALSE,
159                             p_count   => x_msg_count,
160                             p_data    => x_msg_data);
161 
162 END change_agreement_status;
163 
164 
165 END OKL_VP_STS_PUB;