DBA Data[Home] [Help]

PACKAGE BODY: APPS.RCV_PROJECT_GRP

Source


1 PACKAGE BODY RCV_Project_GRP AS
2 /* $Header: RCVGPRJB.pls 115.2 2004/05/11 14:53:58 usethura noship $ */
3 
4 -- Read the profile option that enables/disables the debug log
5 g_fnd_debug CONSTANT VARCHAR2(1) := NVL(FND_PROFILE.VALUE('AFLOG_ENABLED'),'N');
6 
7 g_module_prefix CONSTANT VARCHAR2(50) := 'po.plsql.' || g_pkg_name || '.';
8 
9 /**
10  * Public Procedure: get_project_number
11  * Requires: API message list has been initialized if p_init_msg_list is false.
12  * Modifies: The API message list.
13  * Effects:
14  *   Retrieves the project number based on the transaction_id thats passed
15  *   Appends to API message list on error, and returns null for project id.
16  * Returns:
17  *         - Null if No project number exists or if api errors out
18  *         - Multiple if multiple project numbers exist
19  *         - Project Number if project number exists
20  */
21 
22 FUNCTION get_project_number
23    (p_api_version           IN   NUMBER,
24     p_init_msg_list         IN   VARCHAR2,
25     p_transaction_id	    IN   NUMBER
26    ) RETURN VARCHAR2
27 IS
28 
29 l_api_name CONSTANT VARCHAR2(30) := 'get_project_number';
30 l_api_version CONSTANT NUMBER := 1.0;
31 l_project_number	VARCHAR2(25);
32 
33 BEGIN
34     -- Start standard API initialization
35     IF FND_API.to_boolean(p_init_msg_list) THEN
36         FND_MSG_PUB.initialize;
37     END IF;
38     IF NOT FND_API.compatible_api_call(l_api_version, p_api_version,
39                                        l_api_name, g_pkg_name)
40     THEN
41         IF( FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) THEN
42             FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, g_module_prefix || l_api_name ||
43                            '.invoked', 'Api version Incompatible');
44         END IF;
45         return null;
46     END IF;
47     -- End standard API initialization
48 
49     IF (g_fnd_debug = 'Y') THEN
50        IF( FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) THEN
51            FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, g_module_prefix || l_api_name ||
52                           '.invoked', 'Transaction id: ' || NVL(TO_CHAR(p_transaction_id),'null'));
53        END IF;
54     END IF;
55 
56     -- Check if the transaction_id is null
57     IF p_transaction_id IS NULL THEN
58         IF (g_fnd_debug = 'Y') THEN
59            IF( FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) THEN
60 	       FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, g_module_prefix || l_api_name ||
61                               '.invoked', 'ERROR : transaction_id is NULL');
62            END IF;
63         END IF;
64         l_project_number := null;
65     ELSE
66         -- Check to see if the project number has already been set
67         IF RCV_Project_PVT.g_transaction_id = p_transaction_id THEN
68            l_project_number := RCV_Project_PVT.g_project_number;
69         ELSE
70            RCV_Project_PVT.set_project_task_numbers
71            (
72                 p_api_version,
73                 p_init_msg_list,
74 		p_transaction_id
75            );
76            l_project_number := RCV_Project_PVT.g_project_number;
77 	END IF;
78     END IF;
79     return l_project_number;
80 EXCEPTION
81     WHEN OTHERS THEN
82         IF (g_fnd_debug = 'Y') THEN
83            IF( FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) THEN
84 	       FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, g_module_prefix || l_api_name ||
85                               '.invoked', 'UNEXPECTED ERROR');
86            END IF;
87         END IF;
88 	return null;
89 END get_project_number;
90 
91 /**
92  * Public Procedure: get_task_number
93  * Requires: API message list has been initialized if p_init_msg_list is false.
94  * Modifies: The API message list.
95  * Effects:
96  *   Retrieves the task number based on the transaction_id thats passed
97  *   Appends to API message list on error, and returns null for project id.
98  * Returns:
99  *         - Null if No task number exists or if api errors out
100  *         - Multiple if multiple task numbers exist
101  *         - Task Number if task number exists
102  */
103 
104 FUNCTION get_task_number
105    (p_api_version           IN   NUMBER,
106     p_init_msg_list         IN   VARCHAR2,
107     p_transaction_id	    IN   NUMBER
108    ) RETURN VARCHAR2
109 IS
110 
111 l_api_name CONSTANT VARCHAR2(30) := 'get_task_number';
112 l_api_version CONSTANT NUMBER := 1.0;
113 l_task_number		VARCHAR2(25);
114 
115 BEGIN
116     -- Start standard API initialization
117     IF FND_API.to_boolean(p_init_msg_list) THEN
118         FND_MSG_PUB.initialize;
119     END IF;
120     IF NOT FND_API.compatible_api_call(l_api_version, p_api_version,
121                                        l_api_name, g_pkg_name)
122     THEN
123         IF( FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) THEN
124             FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, g_module_prefix || l_api_name ||
125                            '.invoked', 'Api version Incompatible');
126         END IF;
127         return null;
128     END IF;
129     -- End standard API initialization
130 
131     IF (g_fnd_debug = 'Y') THEN
132        IF( FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) THEN
133            FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, g_module_prefix || l_api_name ||
134                           '.invoked', 'Transaction id: ' || NVL(TO_CHAR(p_transaction_id),'null'));
135        END IF;
136     END IF;
137 
138     -- Check if the transaction_id is null
139     IF p_transaction_id IS NULL THEN
140         IF (g_fnd_debug = 'Y') THEN
141            IF( FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) THEN
142 	       FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, g_module_prefix || l_api_name ||
143                               '.invoked', 'ERROR : transaction_id is NULL');
144            END IF;
145         END IF;
146         l_task_number := null;
147     ELSE
148         -- Check to see if the task number has already been set
149         IF RCV_Project_PVT.g_transaction_id = p_transaction_id THEN
150            l_task_number := RCV_Project_PVT.g_task_number;
151         ELSE
152            RCV_Project_PVT.set_project_task_numbers
153            (
154                 p_api_version,
155                 p_init_msg_list,
156 		p_transaction_id
157            );
158            l_task_number := RCV_Project_PVT.g_task_number;
159 	END IF;
160     END IF;
161     return l_task_number;
162 EXCEPTION
163     WHEN OTHERS THEN
164         IF (g_fnd_debug = 'Y') THEN
165            IF( FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) THEN
166 	       FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, g_module_prefix || l_api_name ||
167                               '.invoked', 'UNEXPECTED ERROR');
168            END IF;
169         END IF;
170 	return null;
171 END get_task_number;
172 
173 END RCV_Project_GRP;