DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_JL_INTERFACE_PVT

Source


1 PACKAGE BODY PO_JL_INTERFACE_PVT AS
2 /* $Header: POXVJLIB.pls 120.1 2005/06/21 02:52:56 vsanjay noship $ */
3 
4 -- Debugging booleans used to bypass logging when turned off
5 g_debug_stmt CONSTANT BOOLEAN := PO_DEBUG.is_debug_stmt_on;
6 g_debug_unexp CONSTANT BOOLEAN := PO_DEBUG.is_debug_unexp_on;
7 
8 g_pkg_name CONSTANT VARCHAR2(20) := 'PO_JL_INTERFACE_PVT';
9 g_module_prefix CONSTANT VARCHAR2(30) := 'po.plsql.' || g_pkg_name || '.';
10 
11 
12 --------------------------------------------------------------------------------
13 --Start of Comments
14 --Name: get_trx_reason_code
15 --Pre-reqs:
16 --  None.
17 --Modifies:
18 --  FND_LOG
19 --  FND_MSG_PUB on error.
20 --Locks:
21 --  None.
22 --Function:
23 --  Derives default transaction reason codes based upon the input parameters
24 --  given. Defaulting logic implemented by JL team. Appends to the API message
25 --  list upon error.
26 --Parameters:
27 --IN:
28 --p_fsp_inv_org_id
29 --  The item validation inventory org ID of p_org_id.
30 --p_inventory_org_id_tbl
31 --  A table of inventory org ID's to derive transaction reason codes for. These
32 --  elements should correspond to p_item_id_tbl.
33 --p_item_id_tbl
34 --  A table of item ID's to derive transaction reason codes for. These elements
35 --  should correpsond to p_inventory_org_id_tbl.
36 --p_org_id
37 --  The operating unit ID to derive defaulting rules.
38 --OUT:
39 --x_return_status
40 --  FND_API.g_ret_sts_success - if the procedure completed successfully
41 --  FND_API.g_ret_sts_unexp_error - unexpected error occurred
42 --x_trx_reason_code_tbl
43 --  A table of transaction reason codes corresponding to the input tables.
44 --x_error_code_tbl
45 --  A table of error codes corresponding to the input tables. A value of zero
46 --  means there is no error for that element in the table.
47 --End of Comments
48 --------------------------------------------------------------------------------
49 
50 /*Bug#4430300 Replaced the references to JLBR data types with the po standard data types
51 and also removed all the JL_BR package references */
52 
53 PROCEDURE get_trx_reason_code
54     ( p_fsp_inv_org_id       IN  NUMBER
55     , p_inventory_org_id_tbl IN  po_tbl_number
56     , p_item_id_tbl          IN  po_tbl_number
57     , p_org_id               IN  NUMBER
58     , x_return_status        OUT NOCOPY VARCHAR2
59     , x_trx_reason_code_tbl  OUT NOCOPY po_tbl_varchar100
60     , x_error_code_tbl       OUT NOCOPY po_tbl_number
61     )
62 IS
63 
64 l_api_name CONSTANT VARCHAR2(30) := 'get_trx_reason_code';
65 l_progress VARCHAR2(3);
66 
67 BEGIN
68 
69     l_progress := '000';
70     x_return_status :=  FND_API.g_ret_sts_success;
71 
72 
73 EXCEPTION
74     WHEN FND_API.g_exc_unexpected_error THEN
75         x_return_status := FND_API.g_ret_sts_unexp_error;
76         IF g_debug_unexp THEN
77             PO_DEBUG.debug_unexp(g_module_prefix||l_api_name,l_progress,
78                                  'Unexpected error from API call');
79         END IF;
80     WHEN OTHERS THEN
81         x_return_status := FND_API.g_ret_sts_unexp_error;
82         FND_MSG_PUB.add_exc_msg(p_pkg_name       => g_pkg_name,
83                                 p_procedure_name => l_api_name||'-'||l_progress);
84         IF g_debug_unexp THEN
85             PO_DEBUG.debug_exc(g_module_prefix||l_api_name,l_progress);
86         END IF;
87 END get_trx_reason_code;
88 
89 
90 --------------------------------------------------------------------------------
91 --Start of Comments
92 --Name: get_trx_reason_code
93 --Pre-reqs:
94 --  None.
95 --Modifies:
96 --  FND_LOG
97 --  FND_MSG_PUB on error.
98 --Locks:
99 --  None.
100 --Function:
101 --  Derives a default transaction reason code based upon the input parameters
102 --  given. Defaulting logic implemented by JL team. Appends to the API message
103 --  list upon error.
104 --Parameters:
105 --IN:
106 --p_fsp_inv_org_id
107 --  The item validation inventory org ID of p_org_id.
108 --p_inventory_org_id
109 --  The inventory org ID to derive a transaction reason code for.
110 --p_item_id
111 --  The item ID to derive a transaction reason code for.
112 --p_org_id
113 --  The operating unit ID to derive defaulting rules.
114 --OUT:
115 --x_return_status
116 --  FND_API.g_ret_sts_success - if the procedure completed successfully
117 --  FND_API.g_ret_sts_unexp_error - an error occurred
118 --  FND_API.g_ret_sts_unexp_error - unexpected error occurred
119 --x_trx_reason_code
120 --  The derived transaction reason code.
121 --End of Comments
122 --------------------------------------------------------------------------------
123 PROCEDURE get_trx_reason_code
124     ( p_fsp_inv_org_id    IN  NUMBER
125     , p_inventory_org_id  IN  NUMBER
126     , p_item_id           IN  NUMBER
127     , p_org_id            IN  NUMBER
128     , x_return_status     OUT NOCOPY VARCHAR2
129     , x_trx_reason_code   OUT NOCOPY VARCHAR2
130     )
131 IS
132 
133 l_api_name CONSTANT VARCHAR2(30) := 'get_trx_reason_code_2';
134 l_progress VARCHAR2(3);
135 
136 /*Bug#4430300 Replaced the references to JLBR data types with the po standard data types */
137 
138 l_trx_reason_code_tbl  po_tbl_varchar100 ;
139 l_error_code_tbl      po_tbl_number;
140 
141 BEGIN
142     l_progress := '000';
143 
144     x_return_status :=  FND_API.g_ret_sts_success;
145 
146 
147 EXCEPTION
148     WHEN FND_API.g_exc_error THEN
149         x_return_status := FND_API.g_ret_sts_error;
150         IF g_debug_stmt THEN
151             PO_DEBUG.debug_stmt(g_module_prefix||l_api_name,l_progress,
152                                 'Expected error from API call');
153         END IF;
154     WHEN FND_API.g_exc_unexpected_error THEN
155         x_return_status := FND_API.g_ret_sts_unexp_error;
156         IF g_debug_unexp THEN
157             PO_DEBUG.debug_unexp(g_module_prefix||l_api_name,l_progress,
158                                  'Unexpected error from API call');
159         END IF;
160     WHEN OTHERS THEN
161         x_return_status := FND_API.g_ret_sts_unexp_error;
162         FND_MSG_PUB.add_exc_msg(p_pkg_name       => g_pkg_name,
163                                 p_procedure_name => l_api_name||'-'||l_progress);
164         IF g_debug_unexp THEN
165             PO_DEBUG.debug_exc(g_module_prefix||l_api_name,l_progress);
166         END IF;
167 END get_trx_reason_code;
168 
169 
170 --------------------------------------------------------------------------------
171 --Start of Comments
172 --Name: chk_def_trx_reason_flag
173 --Pre-reqs:
174 --  None.
175 --Modifies:
176 --  FND_LOG
177 --  FND_MSG_PUB on error.
178 --Locks:
179 --  None.
180 --Function:
181 --  Check if transaction reason defaulting is available in the current org
182 --  context. Appends to the API message list upon error.
183 --Parameters:
184 --OUT:
185 --x_return_status
186 --  FND_API.g_ret_sts_success - if the procedure completed successfully
187 --  FND_API.g_ret_sts_unexp_error - unexpected error occurred
188 --x_def_trx_reason_flag
189 --  A flag: 'Y' default transaction reason
190 --          'N' do not default transaction reason
191 --End of Comments
192 --------------------------------------------------------------------------------
193 PROCEDURE chk_def_trx_reason_flag
194     ( x_return_status       OUT NOCOPY VARCHAR2
195     , x_def_trx_reason_flag OUT NOCOPY VARCHAR2
196     )
197 IS
198 
199 l_api_name CONSTANT VARCHAR2(30) := 'chk_def_trx_reason_flag';
200 l_progress VARCHAR2(3);
201 
202 BEGIN
203     l_progress := '000';
204      x_return_status :=  FND_API.g_ret_sts_success;
205 
206 EXCEPTION
207     WHEN FND_API.g_exc_unexpected_error THEN
208         x_return_status := FND_API.g_ret_sts_unexp_error;
209         IF g_debug_unexp THEN
210             PO_DEBUG.debug_unexp(g_module_prefix||l_api_name,l_progress,
211                                  'Unexpected error from API call');
212         END IF;
213     WHEN OTHERS THEN
214         x_return_status := FND_API.g_ret_sts_unexp_error;
215         FND_MSG_PUB.add_exc_msg(p_pkg_name       => g_pkg_name,
216                                 p_procedure_name => l_api_name||'-'||l_progress);
217         IF g_debug_unexp THEN
218             PO_DEBUG.debug_exc(g_module_prefix||l_api_name,l_progress);
219         END IF;
220 END chk_def_trx_reason_flag;
221 
222 END PO_JL_INTERFACE_PVT;