1 PACKAGE BODY gme_eres_utils AS
2 /* $Header: GMEERESB.pls 120.2 2005/07/17 21:32:52 jsrivast noship $ */
3 /*
4 REM **********************************************************************
5 REM * *
6 REM * FILE: GMEERESB.pls *
7 REM * PURPOSE: Package Body for the GME ERES_UTILS routines *
8 REM * It contens all the routines to support the ERES output *
9 REM * during XML mapping, used by gateway product. *
10 REM * AUTHOR: Shrikant Nene, OPM Development *
11 REM * DATE: August 18th 2002 *
12 REM **********************************************************************
13 * This file contains the procedure for create batch steps in Oracle *
14 * Process Manufacturing (OPM). Each procedure has a common set of *
15 * parameters to which API-specific parameters are appended. *
16 *************************************************************************/
17
18 PROCEDURE get_phantom_or_not (p_batch_id IN NUMBER, x_phantom OUT NOCOPY VARCHAR2)
19 IS
20 CURSOR cur_get_phant IS
21 SELECT count(1)
22 FROM gme_material_details
23 WHERE phantom_id = p_batch_id
24 AND ROWNUM = 1;
25
26 l_exists NUMBER;
27 BEGIN
28 OPEN cur_get_phant;
29 FETCH cur_get_phant INTO l_exists;
30 CLOSE cur_get_phant;
31
32 IF l_exists > 0 THEN
33 x_phantom := fnd_message.get_string('GME','GME_PHANTOM');
34 ELSE
35 x_phantom := NULL;
36 END IF;
37 END get_phantom_or_not;
38
39 /* This procedure returns the plant code and batch number for a
40 given batch_id */
41 PROCEDURE get_batch_number (
42 p_batch_id IN NUMBER
43 ,x_batch_number OUT NOCOPY VARCHAR2)
44 IS
45 CURSOR get_doc_number (v_batch_id IN NUMBER)
46 IS
47 SELECT organization_code || ' ' || batch_no
48 FROM gme_batch_header_vw
49 WHERE batch_id = v_batch_id;
50 BEGIN
51 OPEN get_doc_number (p_batch_id);
52 FETCH get_doc_number INTO x_batch_number;
53 CLOSE get_doc_number;
54 END get_batch_number;
55 END gme_eres_utils;