1: PACKAGE BODY INV_RMA_SERIAL_PVT AS
2: /* $Header: INVRMASB.pls 120.6 2006/06/02 05:59:02 sgumaste ship $ */
3:
4: G_PKG_NAME CONSTANT VARCHAR2(30) := 'INV_RMA_SERIAL_PVT';
5:
1: PACKAGE BODY INV_RMA_SERIAL_PVT AS
2: /* $Header: INVRMASB.pls 120.6 2006/06/02 05:59:02 sgumaste ship $ */
3:
4: G_PKG_NAME CONSTANT VARCHAR2(30) := 'INV_RMA_SERIAL_PVT';
5:
6: --
7: --Return values for API
8: --1) x_return_status = S, x_errorcode = 0
75: --
76: -- Initialisize API return status to success
77: x_return_status := FND_API.G_RET_STS_SUCCESS;
78: x_errorcode := 0;
79: INV_RMA_SERIAL_PVT.g_return_status := x_return_status; --3572112
80: INV_RMA_SERIAL_PVT.g_error_code := x_errorcode; --3572112
81: INV_RMA_SERIAL_PVT.g_rma_line_id := p_rma_line_id; --3572112
82: --Bug 3363907
83: --We will now check if serials already exist in the temp
76: -- Initialisize API return status to success
77: x_return_status := FND_API.G_RET_STS_SUCCESS;
78: x_errorcode := 0;
79: INV_RMA_SERIAL_PVT.g_return_status := x_return_status; --3572112
80: INV_RMA_SERIAL_PVT.g_error_code := x_errorcode; --3572112
81: INV_RMA_SERIAL_PVT.g_rma_line_id := p_rma_line_id; --3572112
82: --Bug 3363907
83: --We will now check if serials already exist in the temp
84: --table. Only if the serials are not in temp table will
77: x_return_status := FND_API.G_RET_STS_SUCCESS;
78: x_errorcode := 0;
79: INV_RMA_SERIAL_PVT.g_return_status := x_return_status; --3572112
80: INV_RMA_SERIAL_PVT.g_error_code := x_errorcode; --3572112
81: INV_RMA_SERIAL_PVT.g_rma_line_id := p_rma_line_id; --3572112
82: --Bug 3363907
83: --We will now check if serials already exist in the temp
84: --table. Only if the serials are not in temp table will
85: --we continue, else we will return success.
143: --and throw G_EXC_ERROR.
144:
145: IF (l_count = 0) THEN
146: x_errorcode := 1;
147: INV_RMA_SERIAL_PVT.g_error_code := x_errorcode; --3572112
148: RAISE FND_API.G_EXC_ERROR;
149: ELSIF (l_count > 0) THEN
150:
151: OPEN oe_lot_serials(l_orig_line_id);
166: X_ERRORCODE => l_err) THEN
167:
168: BEGIN
169: x_errorcode := to_number(l_err);
170: INV_RMA_SERIAL_PVT.g_error_code := x_errorcode; --3572112
171: RAISE FND_API.G_EXC_ERROR;
172: END;
173: END IF;
174:
205: END LOOP;
206: END LOOP;
207: END IF;
208: x_return_status := FND_API.G_RET_STS_SUCCESS;
209: INV_RMA_SERIAL_PVT.g_return_status := x_return_status;
210:
211: ELSE IF (l_temp_count > 0) THEN
212: --Serials are already populated in the temp table
213: --return error_code = 0 and success.
212: --Serials are already populated in the temp table
213: --return error_code = 0 and success.
214: x_return_status := FND_API.G_RET_STS_SUCCESS;
215: x_errorcode := 0;
216: INV_RMA_SERIAL_PVT.g_return_status := x_return_status; --3572112
217: INV_RMA_SERIAL_PVT.g_error_code := x_errorcode; --3572112
218: END IF;
219:
220: END IF;
213: --return error_code = 0 and success.
214: x_return_status := FND_API.G_RET_STS_SUCCESS;
215: x_errorcode := 0;
216: INV_RMA_SERIAL_PVT.g_return_status := x_return_status; --3572112
217: INV_RMA_SERIAL_PVT.g_error_code := x_errorcode; --3572112
218: END IF;
219:
220: END IF;
221:
221:
222: EXCEPTION
223: WHEN FND_API.G_EXC_ERROR THEN
224: x_return_status := FND_API.G_RET_STS_ERROR;
225: INV_RMA_SERIAL_PVT.g_return_status := x_return_status; --3572112
226:
227: WHEN OTHERS THEN
228: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
229: INV_RMA_SERIAL_PVT.g_return_status := x_return_status; --3572112
225: INV_RMA_SERIAL_PVT.g_return_status := x_return_status; --3572112
226:
227: WHEN OTHERS THEN
228: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
229: INV_RMA_SERIAL_PVT.g_return_status := x_return_status; --3572112
230:
231: END populate_temp_table;
232: -- Added the below function for bug 3572112
233: function validate_serial_required(p_rma_line_id IN NUMBER) return NUMBER IS
231: END populate_temp_table;
232: -- Added the below function for bug 3572112
233: function validate_serial_required(p_rma_line_id IN NUMBER) return NUMBER IS
234: BEGIN
235: IF ( INV_RMA_SERIAL_PVT.g_return_status = 'S' AND
236: INV_RMA_SERIAL_PVT.g_error_code = 0 AND
237: INV_RMA_SERIAL_PVT.g_rma_line_id = p_rma_line_id ) THEN
238: RETURN 0;
239: ELSE
232: -- Added the below function for bug 3572112
233: function validate_serial_required(p_rma_line_id IN NUMBER) return NUMBER IS
234: BEGIN
235: IF ( INV_RMA_SERIAL_PVT.g_return_status = 'S' AND
236: INV_RMA_SERIAL_PVT.g_error_code = 0 AND
237: INV_RMA_SERIAL_PVT.g_rma_line_id = p_rma_line_id ) THEN
238: RETURN 0;
239: ELSE
240: RETURN 1;
233: function validate_serial_required(p_rma_line_id IN NUMBER) return NUMBER IS
234: BEGIN
235: IF ( INV_RMA_SERIAL_PVT.g_return_status = 'S' AND
236: INV_RMA_SERIAL_PVT.g_error_code = 0 AND
237: INV_RMA_SERIAL_PVT.g_rma_line_id = p_rma_line_id ) THEN
238: RETURN 0;
239: ELSE
240: RETURN 1;
241: END IF;
240: RETURN 1;
241: END IF;
242: END validate_serial_required;
243:
244: END INV_RMA_SERIAL_PVT;