1 PACKAGE BODY INV_MGD_MVT_DEF_ATTR AS
2 /* $Header: INVDEFSB.pls 120.0.12020000.2 2012/07/05 07:25:31 ntungare ship $ */
3 --+=======================================================================+
4 --| Copyright (c) 1998 Oracle Corporation |
5 --| Redwood Shores, CA, USA |
6 --| All rights reserved. |
7 --+=======================================================================+
8 --| FILENAME |
9 --| INVDEFSB.pls |
10 --| |
11 --| DESCRIPTION |
12 --| Spec. of INV_MGD_MVT_DEF_ATTR |
13 --| |
14 --| PROCEDURE LIST |
15 --| Default_Attr |
16 --| HISTORY |
17 --| 05/11/1999 pseshadr Created |
18 --| 12/04/2002 vma Default_Attr: added NOCOPY to x_return_sta|
19 --| tus, x_msg_count, x_msg data. Change the |
20 --| other OUT parameters to IN OUT NOCOPY |
21 --| parameters. This is to comply with new |
22 --| PL/SQL standards for better performance. |
23 --| ! Following this change, l_movement_transact|
24 --| ! ion should be used whenever the program |
25 --| ! wants to read the original input value of |
26 --| ! p_movement_transaction. |
27 --| 03/17/2005 yawang Add new program for default movement amt |
28 --| stat_ext_value, document price and vlaue |
29 --+======================================================================*/
30
31 --===================
32 -- CONSTANTS
33 --===================
34 G_PKG_NAME CONSTANT VARCHAR2(30) := 'INV_MGD_MVT_DEF_ATTR';
35 G_MODULE_NAME CONSTANT VARCHAR2(100) := 'inv.plsql.INV_MGD_MVT_DEF_ATTR.';
36
37 --========================================================================
38 -- PROCEDURE : Default_Attr PRIVATE
39 -- PARAMETERS: p_api_version_number known api version
40 -- p_init_msg_list FND_API.G_TRUE to reset list
41 -- p_movement_transaction
42 -- x_transaction_nature Transaction Nature
43 -- x_delivery_terms Delivery Terms
44 -- x_area Area where goods arrive/depart
45 -- x_Port Port where goods arrive/depart
46 -- x_csa_code Csa code
47 -- x_oil_reference_code Used in oil industry
48 -- x_container_type_code Container Type
49 -- x_flow_indicator_code Used in the oil industry
50 -- x_affiliation_reference_code
51 -- x_traic_code Taric Code
52 -- x_preference_code Preference Code
53 -- x_return_status return status
54 -- x_msg_count number of messages in the list
55 -- x_msg_data message text
56 -- x_attribute1 - x_attribute15 DFF attributes -- bug 13501354
57 -- COMMENT : This is the callout procedure which is called before
58 -- inserting records into MVt Stats table to default some of the
59 -- attributes if the user wanted to define their own values.
60 --========================================================================
61
62 --
63 -- bug 13501354
64 -- Added the DFF attributes from attribute1 to attribute15
65 -- as parameters to allow the customer to defalut the DFF values.
66 --
67
68 PROCEDURE Default_Attr
69 ( p_api_version_number IN NUMBER
70 , p_init_msg_list IN VARCHAR2
71 , p_movement_transaction IN
72 Inv_MGD_MVT_DATA_STR.Movement_Transaction_Rec_Type
73 , x_transaction_nature IN OUT NOCOPY VARCHAR2
74 , x_delivery_terms IN OUT NOCOPY VARCHAR2
75 , x_area IN OUT NOCOPY VARCHAR2
76 , x_port IN OUT NOCOPY VARCHAR2
77 , x_csa_code IN OUT NOCOPY VARCHAR2
78 , x_oil_reference_code IN OUT NOCOPY VARCHAR2
79 , x_container_type_code IN OUT NOCOPY VARCHAR2
80 , x_flow_indicator_code IN OUT NOCOPY VARCHAR2
81 , x_affiliation_reference_code IN OUT NOCOPY VARCHAR2
82 , x_taric_code IN OUT NOCOPY VARCHAR2
83 , x_preference_code IN OUT NOCOPY VARCHAR2
84 , x_statistical_procedure_code IN OUT NOCOPY VARCHAR2
85 , x_transport_mode IN OUT NOCOPY VARCHAR2
86 , x_attribute1 IN OUT NOCOPY VARCHAR2
87 , x_attribute2 IN OUT NOCOPY VARCHAR2
88 , x_attribute3 IN OUT NOCOPY VARCHAR2
89 , x_attribute4 IN OUT NOCOPY VARCHAR2
90 , x_attribute5 IN OUT NOCOPY VARCHAR2
91 , x_attribute6 IN OUT NOCOPY VARCHAR2
92 , x_attribute7 IN OUT NOCOPY VARCHAR2
93 , x_attribute8 IN OUT NOCOPY VARCHAR2
94 , x_attribute9 IN OUT NOCOPY VARCHAR2
95 , x_attribute10 IN OUT NOCOPY VARCHAR2
96 , x_attribute11 IN OUT NOCOPY VARCHAR2
97 , x_attribute12 IN OUT NOCOPY VARCHAR2
98 , x_attribute13 IN OUT NOCOPY VARCHAR2
99 , x_attribute14 IN OUT NOCOPY VARCHAR2
100 , x_attribute15 IN OUT NOCOPY VARCHAR2
101 , x_return_status OUT NOCOPY VARCHAR2
102 , x_msg_count OUT NOCOPY NUMBER
103 , x_msg_data OUT NOCOPY VARCHAR2
104 )
105 IS
106
107 l_movement_transaction
108 Inv_MGD_MVT_DATA_STR.Movement_Transaction_Rec_Type;
109 l_return_status VARCHAR2(1);
110 l_api_version_number NUMBER := 1.0;
111 l_procedure_name CONSTANT VARCHAR2(30) := 'Default_Attr';
112
113 BEGIN
114 IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL)
115 THEN
116 FND_LOG.string(FND_LOG.LEVEL_PROCEDURE
117 , G_MODULE_NAME || l_procedure_name || '.begin'
118 ,'enter procedure'
119 );
120 END IF;
121
122 IF NOT FND_API.Compatible_API_Call
123 ( l_api_version_number
124 , p_api_version_number
125 , l_procedure_name
126 , G_PKG_NAME
127 )
128 THEN
129 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
130 END IF;
131
132 -- Initialize message stack if required
133 IF FND_API.to_Boolean(p_init_msg_list)
134 THEN
135 FND_MSG_PUB.initialize;
136 END IF;
137
138 x_return_status := FND_API.G_RET_STS_SUCCESS;
139
140 l_movement_transaction := p_movement_transaction;
141 x_transaction_nature := l_movement_transaction.transaction_nature;
142 x_delivery_terms := l_movement_transaction.delivery_terms;
143 x_area := l_movement_transaction.area;
144 x_port := l_movement_transaction.port;
145 x_csa_code := l_movement_transaction.csa_code;
146 x_oil_reference_code := l_movement_transaction.oil_reference_code;
147 x_container_type_code := l_movement_transaction.container_type_code;
148 x_flow_indicator_code := l_movement_transaction.flow_indicator_code;
149 x_affiliation_reference_code :=
150 l_movement_transaction.affiliation_reference_code;
151 x_taric_code := l_movement_transaction.taric_code;
152 x_preference_code := l_movement_transaction.preference_code;
153 x_statistical_procedure_code := l_movement_transaction.statistical_procedure_code;
154 x_transport_mode := l_movement_transaction.transport_mode;
155
156 --
157 -- bug 13501354
158 -- Added the DFF attributes from attribute1 to attribute15
159 -- to allow the customer to defalut the DFF values.
160 --
161 x_attribute1 := l_movement_transaction.attribute1;
162 x_attribute2 := l_movement_transaction.attribute2;
163 x_attribute3 := l_movement_transaction.attribute3;
164 x_attribute4 := l_movement_transaction.attribute4;
165 x_attribute5 := l_movement_transaction.attribute5;
166 x_attribute6 := l_movement_transaction.attribute6;
167 x_attribute7 := l_movement_transaction.attribute7;
168 x_attribute8 := l_movement_transaction.attribute8;
169 x_attribute9 := l_movement_transaction.attribute9;
170 x_attribute10 := l_movement_transaction.attribute10;
171 x_attribute11 := l_movement_transaction.attribute11;
172 x_attribute12 := l_movement_transaction.attribute12;
173 x_attribute13 := l_movement_transaction.attribute13;
174 x_attribute14 := l_movement_transaction.attribute14;
175 x_attribute15 := l_movement_transaction.attribute15;
176
177 /* If you need to modify the default values for the following columns
178 DO IT HERE. If there is no change required then the values for these
179 columns are the same values obtained when calling this procedure
180
181 To define your own defaults:
182 STEP 1: replace the value required with the columns as
183 indicated by <replace transaction_nature>
184 STEP 2: Remove the comment from the line which is indicated by
185 "--" in the beginning of the line.
186
187 For eg: If you want to replace the transaction_nature with a value
188 10, then the first line would read as follows:
189 x_transaction_nature := '10';
190
191 */
192
193 -- x_transaction_nature := <replace transaction_nature>
194 -- x_delivery_terms := <replace delivery_terms>
195 -- x_area := <replace area>
196 -- x_port := <replace port>
197 -- x_csa_code := <replace csa_code>
198 -- x_oil_reference_code := <replace oil_reference_code>
199 -- x_container_type_code := <replace container_type_code>
200 -- x_flow_indicator_code := <replace flow_indicator_code>
201 -- x_affiliation_reference_code :=
202 -- <replace affiliation_reference_code>
203 -- x_taric_code := <replace taric_code>
204 -- x_preference_code := <replace preference_code>
205 -- x_statistical_procedure_code := <replace statistical_procedure_code>
206 -- x_transport_mode := <replace transport_mode>
207
208 --
209 -- bug 13501354
210 -- Added the DFF attributes from attribute1 to attribute15
211 -- to allow the customer to defalut the DFF values.
212 --
213
214 -- x_attribute1 := <replace DFF attribute1>
215 -- x_attribute2 := <replace DFF attribute2>
216 -- x_attribute3 := <replace DFF attribute3>
217 -- x_attribute4 := <replace DFF attribute4>
218 -- x_attribute5 := <replace DFF attribute5>
219 -- x_attribute6 := <replace DFF attribute6>
220 -- x_attribute7 := <replace DFF attribute7>
221 -- x_attribute8 := <replace DFF attribute8>
222 -- x_attribute9 := <replace DFF attribute9>
223 -- x_attribute10 := <replace DFF attribute10>
224 -- x_attribute11 := <replace DFF attribute11>
225 -- x_attribute12 := <replace DFF attribute12>
226 -- x_attribute13 := <replace DFF attribute13>
227 -- x_attribute14 := <replace DFF attribute14>
228 -- x_attribute15 := <replace DFF attribute15>
229
230 IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL)
231 THEN
232 FND_LOG.string(FND_LOG.LEVEL_PROCEDURE
233 , G_MODULE_NAME || l_procedure_name || '.end'
234 ,'exit procedure'
235 );
236 END IF;
237 EXCEPTION
238
239 WHEN FND_API.G_EXC_ERROR THEN
240 x_return_status := FND_API.G_RET_STS_ERROR;
241
242 -- Get message count and data
243 FND_MSG_PUB.Count_And_Get
244 ( p_count => x_msg_count
245 , p_data => x_msg_data
246 );
247 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
248 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
249
250 -- Get message count and data
251 FND_MSG_PUB.Count_And_Get
252 ( p_count => x_msg_count
253 , p_data => x_msg_data
254 );
255 WHEN OTHERS THEN
256 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
257
258 IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
259 THEN
260 FND_MSG_PUB.Add_Exc_Msg
261 ( G_PKG_NAME
262 , 'Default_Attr'
263 );
264 END IF;
265 -- Get message count and data
266 FND_MSG_PUB.Count_And_Get
267 ( p_count => x_msg_count
268 , p_data => x_msg_data
269 );
270
271 END Default_Attr;
272
273 --========================================================================
274 -- PROCEDURE : Default_Value
275 -- PARAMETERS: p_api_version_number known api version
276 -- p_init_msg_list FND_API.G_TRUE to reset list
277 -- p_movement_transaction IN Movement Statistics Record Type
278 -- x_document_unit_price IN OUT Unit price on SO/PO
279 -- x_document_line_ext_vlaue IN OUT Line value on SO/PO
280 -- x_movement_amount IN OUT Movement amount
281 -- x_stat_ext_value IN OUT Statistics value
282 -- x_return_status return status
283 -- x_msg_count number of messages in the list
284 -- x_msg_data message text
285 -- COMMENT : This is the callout procedure which is called before
286 -- inserting records into MVt Stats table to default some of the
287 -- values if the user wanted to define their own.
288 --========================================================================
289
290 PROCEDURE Default_Value
291 ( p_api_version_number IN NUMBER
292 , p_init_msg_list IN VARCHAR2
293 , p_movement_transaction IN
294 Inv_MGD_MVT_DATA_STR.Movement_Transaction_Rec_Type
295 , x_document_unit_price IN OUT NOCOPY NUMBER
296 , x_document_line_ext_value IN OUT NOCOPY NUMBER
297 , x_movement_amount IN OUT NOCOPY NUMBER
298 , x_stat_ext_value IN OUT NOCOPY NUMBER
299 , x_return_status OUT NOCOPY VARCHAR2
300 , x_msg_count OUT NOCOPY NUMBER
301 , x_msg_data OUT NOCOPY VARCHAR2
302 )
306 l_return_status VARCHAR2(1);
303 IS
304 l_movement_transaction
305 Inv_MGD_MVT_DATA_STR.Movement_Transaction_Rec_Type;
307 l_api_version_number NUMBER := 1.0;
308 l_procedure_name CONSTANT VARCHAR2(30) := 'Default_Value';
309
310 BEGIN
311 IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL)
312 THEN
313 FND_LOG.string(FND_LOG.LEVEL_PROCEDURE
314 , G_MODULE_NAME || l_procedure_name || '.begin'
315 ,'enter procedure'
316 );
317 END IF;
318
319 IF NOT FND_API.Compatible_API_Call
320 ( l_api_version_number
321 , p_api_version_number
322 , l_procedure_name
323 , G_PKG_NAME
324 )
325 THEN
326 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
327 END IF;
328
329 -- Initialize message stack if required
330 IF FND_API.to_Boolean(p_init_msg_list)
331 THEN
332 FND_MSG_PUB.initialize;
333 END IF;
334
335 x_return_status := FND_API.G_RET_STS_SUCCESS;
336
337 l_movement_transaction := p_movement_transaction;
338 x_document_unit_price := l_movement_transaction.document_unit_price;
339 x_document_line_ext_value := l_movement_transaction.document_line_ext_value;
340 x_movement_amount := l_movement_transaction.movement_amount;
341 x_stat_ext_value := l_movement_transaction.stat_ext_value;
342
343 /* If you need to modify the values for the following columns
344 DO IT HERE. If there is no change required then the values for these
345 columns are the same values obtained when calling this procedure
346
347 To define your own values:
348 STEP 1: replace the value required with the columns as
349 indicated by <replace document_unit_price>
350 STEP 2: Remove the comment from the line which is indicated by
351 "--" in the beginning of the line.
352
353 For eg: If you want to replace the document_unit_price with a value 1500
354 from your own logic, then the first line would read as follows:
355 x_document_unit_price := 1500;
356
357 */
358
359 -- x_document_unit_price := <replace document_unit_price>
360 -- x_document_line_ext_value := <replace document_line_ext_value>
361 -- x_movement_amount := <replace movement_amount>
362 -- x_stat_ext_value := <replace stat_ext_value>
363
364 IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL)
365 THEN
366 FND_LOG.string(FND_LOG.LEVEL_PROCEDURE
367 , G_MODULE_NAME || l_procedure_name || '.end'
368 ,'exit procedure'
369 );
370 END IF;
371 EXCEPTION
372
373 WHEN FND_API.G_EXC_ERROR THEN
374 x_return_status := FND_API.G_RET_STS_ERROR;
375
376 -- Get message count and data
377 FND_MSG_PUB.Count_And_Get
378 ( p_count => x_msg_count
379 , p_data => x_msg_data
380 );
381 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
382 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
383
384 -- Get message count and data
385 FND_MSG_PUB.Count_And_Get
386 ( p_count => x_msg_count
387 , p_data => x_msg_data
388 );
389 WHEN OTHERS THEN
390 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
391
392 IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
393 THEN
394 FND_MSG_PUB.Add_Exc_Msg
395 ( G_PKG_NAME
396 , 'Default_Attr'
397 );
398 END IF;
399 -- Get message count and data
400 FND_MSG_PUB.Count_And_Get
401 ( p_count => x_msg_count
402 , p_data => x_msg_data
403 );
404 END Default_Value;
405
406 END INV_MGD_MVT_DEF_ATTR;