[Home] [Help]
PACKAGE BODY: APPS.OKC_CONTRACT_ITEM_PVT
Source
1 package body OKC_CONTRACT_ITEM_PVT as
2 /* $Header: OKCCCIMB.pls 120.0 2005/05/26 09:44:03 appldev noship $ */
3
4 l_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('AFLOG_ENABLED'),'N');
5
6 G_APP_NAME CONSTANT VARCHAR2(3) := OKC_API.G_APP_NAME;
7 G_PKG_NAME CONSTANT VARCHAR2(200) := 'OKC_CONTRACT_ITEM_PVT';
8 G_CHILD_RECORD_FOUND CONSTANT varchar2(200) := 'OKC_CHILD_RECORD_FOUND';
9 G_PARENT_TABLE_TOKEN CONSTANT VARCHAR2(200) := OKC_API.G_PARENT_TABLE_TOKEN;
10 G_CHILD_TABLE_TOKEN CONSTANT VARCHAR2(200) := OKC_API.G_CHILD_TABLE_TOKEN;
11
12 -- Start of comments
13 --
14 -- Procedure Name : create_contract_item
15 -- Description :
16 -- Business Rules :
17 -- Parameters :
18 -- Version : 1.0
19 -- End of comments
20 procedure create_contract_item(p_api_version IN NUMBER,
21 p_init_msg_list IN VARCHAR2 ,
22 x_return_status OUT NOCOPY VARCHAR2,
23 x_msg_count OUT NOCOPY NUMBER,
24 x_msg_data OUT NOCOPY VARCHAR2,
25 p_cimv_rec IN cimv_rec_type,
26 x_cimv_rec OUT NOCOPY cimv_rec_type) is
27 --V
28 l_cvmv_rec OKC_CVM_PVT.cvmv_rec_type;
29 x_out_rec OKC_CVM_PVT.cvmv_rec_type;
30 --V
31 begin
32 okc_cim_pvt.insert_row(p_api_version => p_api_version,
33 p_init_msg_list => p_init_msg_list,
34 x_msg_count => x_msg_count,
35 x_msg_data => x_msg_data,
36 x_return_status => x_return_status,
37 p_cimv_rec => p_cimv_rec,
38 x_cimv_rec => x_cimv_rec);
39 --V
40 if (x_return_status <> OKC_API.G_RET_STS_SUCCESS) then
41 return;
42 end if;
43 l_cvmv_rec.chr_id := p_cimv_rec.DNZ_CHR_ID;
44 OKC_CVM_PVT.update_contract_version(
45 p_api_version => p_api_version,
46 p_init_msg_list => OKC_API.G_FALSE,
47 x_return_status => x_return_status,
48 x_msg_count => x_msg_count,
49 x_msg_data => x_msg_data,
50 p_cvmv_rec => l_cvmv_rec,
51 x_cvmv_rec => x_out_rec);
52 --V
53 end create_contract_item;
54
55 -- Start of comments
56 --
57 -- Procedure Name : update_contract_item
58 -- Description :
59 -- Business Rules :
60 -- Parameters :
61 -- Version : 1.0
62 -- End of comments
63 procedure update_contract_item(p_api_version IN NUMBER,
64 p_init_msg_list IN VARCHAR2 ,
65 x_return_status OUT NOCOPY VARCHAR2,
66 x_msg_count OUT NOCOPY NUMBER,
67 x_msg_data OUT NOCOPY VARCHAR2,
68 p_cimv_rec IN cimv_rec_type,
69 x_cimv_rec OUT NOCOPY cimv_rec_type) is
70 --V
71 l_cvmv_rec OKC_CVM_PVT.cvmv_rec_type;
72 x_out_rec OKC_CVM_PVT.cvmv_rec_type;
73 cursor dnz_csr is
74 select dnz_chr_id
75 from OKC_K_ITEMS_V
76 where id = p_cimv_rec.id;
77 --V
78 begin
79 okc_cim_pvt.update_row(p_api_version => p_api_version,
80 p_init_msg_list => p_init_msg_list,
81 x_msg_count => x_msg_count,
82 x_msg_data => x_msg_data,
83 x_return_status => x_return_status,
84 p_cimv_rec => p_cimv_rec,
85 x_cimv_rec => x_cimv_rec);
86 --V
87 if (x_return_status <> OKC_API.G_RET_STS_SUCCESS) then
88 return;
89 end if;
90 open dnz_csr;
91 fetch dnz_csr into l_cvmv_rec.chr_id;
92 close dnz_csr;
93 OKC_CVM_PVT.update_contract_version(
94 p_api_version => p_api_version,
95 p_init_msg_list => OKC_API.G_FALSE,
96 x_return_status => x_return_status,
97 x_msg_count => x_msg_count,
98 x_msg_data => x_msg_data,
99 p_cvmv_rec => l_cvmv_rec,
100 x_cvmv_rec => x_out_rec);
101 --V
102 end update_contract_item;
103
104 -- Start of comments
105 --
106 -- Procedure Name : delete_contract_item
107 -- Description :
108 -- Business Rules :
109 -- Parameters :
110 -- Version : 1.0
111 -- End of comments
112 procedure delete_contract_item(p_api_version IN NUMBER,
113 p_init_msg_list IN VARCHAR2 ,
114 x_return_status OUT NOCOPY VARCHAR2,
115 x_msg_count OUT NOCOPY NUMBER,
116 x_msg_data OUT NOCOPY VARCHAR2,
117 p_cimv_rec IN cimv_rec_type) is
118 i NUMBER :=0;
119 --V
120 l_cvmv_rec OKC_CVM_PVT.cvmv_rec_type;
121 x_out_rec OKC_CVM_PVT.cvmv_rec_type;
122 cursor dnz_csr is
123 select dnz_chr_id
124 from OKC_K_ITEMS_V
125 where id = p_cimv_rec.id;
126 --V
127 begin
128 --V
129 open dnz_csr;
130 fetch dnz_csr into l_cvmv_rec.chr_id;
131 close dnz_csr;
132 if (l_cvmv_rec.chr_id is NULL) then
133 x_return_status := OKC_API.G_RET_STS_SUCCESS;
134 return;
135 end if;
136 --V
137
138 okc_cim_pvt.delete_row(p_api_version => p_api_version,
139 p_init_msg_list => p_init_msg_list,
140 x_msg_count => x_msg_count,
141 x_msg_data => x_msg_data,
142 x_return_status => x_return_status,
143 p_cimv_rec => p_cimv_rec);
144 --V
145 if (x_return_status <> OKC_API.G_RET_STS_SUCCESS) then
146 return;
147 end if;
148 OKC_CVM_PVT.update_contract_version(
149 p_api_version => p_api_version,
150 p_init_msg_list => OKC_API.G_FALSE,
151 x_return_status => x_return_status,
152 x_msg_count => x_msg_count,
153 x_msg_data => x_msg_data,
154 p_cvmv_rec => l_cvmv_rec,
155 x_cvmv_rec => x_out_rec);
156 --V
157 exception
158 WHEN OTHERS THEN
159 null;
160 end delete_contract_item;
161
162 -- Start of comments
163 --
164 -- Procedure Name : lock_contract_item
165 -- Description :
166 -- Business Rules :
167 -- Parameters :
168 -- Version : 1.0
169 -- End of comments
170 procedure lock_contract_item(p_api_version IN NUMBER,
171 p_init_msg_list IN VARCHAR2 ,
172 x_return_status OUT NOCOPY VARCHAR2,
173 x_msg_count OUT NOCOPY NUMBER,
174 x_msg_data OUT NOCOPY VARCHAR2,
175 p_cimv_rec IN cimv_rec_type) is
176 begin
177 okc_cim_pvt.lock_row(p_api_version => p_api_version,
178 p_init_msg_list => p_init_msg_list,
179 x_msg_count => x_msg_count,
180 x_msg_data => x_msg_data,
181 x_return_status => x_return_status,
182 p_cimv_rec => p_cimv_rec);
183 end lock_contract_item;
184
185 -- Start of comments
186 --
187 -- Procedure Name : validate_contract_item
188 -- Description :
189 -- Business Rules :
190 -- Parameters :
191 -- Version : 1.0
192 -- End of comments
193 procedure validate_contract_item(p_api_version IN NUMBER,
194 p_init_msg_list IN VARCHAR2 ,
195 x_return_status OUT NOCOPY VARCHAR2,
196 x_msg_count OUT NOCOPY NUMBER,
197 x_msg_data OUT NOCOPY VARCHAR2,
198 p_cimv_rec IN cimv_rec_type) is
199 begin
200 okc_cim_pvt.validate_row(p_api_version => p_api_version,
201 p_init_msg_list => p_init_msg_list,
202 x_msg_count => x_msg_count,
203 x_msg_data => x_msg_data,
204 x_return_status => x_return_status,
205 p_cimv_rec => p_cimv_rec);
206 end validate_contract_item;
207
208 end OKC_CONTRACT_ITEM_PVT;