DBA Data[Home] [Help]

PACKAGE: APPS.INV_MGD_MVT_STATS_PUB

Source


1 PACKAGE INV_MGD_MVT_STATS_PUB AUTHID CURRENT_USER AS
2 -- $Header: INVPMVTS.pls 120.0 2005/05/25 06:34:37 appldev noship $
3 /*#
4  * Provides various functionality for the Movement Statistics module.
5  * This includes processing, validating, creating, updating, resetting
6  * and purging of Movement Statistics data.
7  * @rep:scope public
8  * @rep:product INV
9  * @rep:displayname Movement Statistics
10  * @rep:lifecycle active
11  * @rep:category BUSINESS_ENTITY INV_MOVEMENT_STATISTICS
12  */
13 --+=======================================================================+
14 --|               Copyright (c) 1998 Oracle Corporation                   |
15 --|                       Redwood Shores, CA, USA                         |
16 --|                         All rights reserved.                          |
17 --+=======================================================================+
18 --| FILENAME                                                              |
19 --|     INVPMVTS.pls                                                      |
20 --|                                                                       |
21 --| DESCRIPTION                                                           |
22 --|    Spec of INV_MGD_MVT_STATS_PUB                                      |
23 --|                                                                       |
24 --|                                                                       |
25 --| HISTORY                                                               |
26 --|     06/14/00 pseshadr        Created                                  |
27 --|     06/15/00 ksaini          Added Procedure                          |
28 --|     01/24/05 vchu            Added Annotations for Integration        |
29 --|                              Repository                               |
30 --+======================================================================*/
31 
32 
33 --========================================================================
34 -- PROCEDURE : Process_Transaction PUBLIC
35 -- PARAMETERS: p_api_version_number    known api version
36 --             p_init_msg_list         FND_API.G_TRUE to reset list
37 --             x_return_status         return status
38 --             x_msg_count             number of messages in the list
39 --             x_msg_data              message text
40 --             p_legal_entity_id       Legal Entity ID
41 --             p_start_date            Transaction start date
42 --             p_end_date              Transaction end date
43 --             p_source type           Transaction type (SO,PO etc)
44 -- COMMENT   : Public Procedure
45 -- COMMENT   :
46 --             This processes all the transaction for the specified legal
47 --             entity that have a transaction date within the specified
48 --             date range.
49 --========================================================================
50 /*#
51  * Processes all the transactions for the specified legal entity that
52  * have a transaction date within the specified date range. Types of
53  * transactions can be Sales Order, Purchase Order, Inventory Transfer,
54  * Internal Order, Return Material Authorization or Return To Vendor.
55  * The data generated by the processor is inserted into the Movement
56  * Statistics table, which is used for Intrastat Reporting.
57  * @param p_api_version_number Standard API parameter
58  * @param p_init_msg_list Standard API parameter
59  * @param p_legal_entity_id Legal Entity ID
60  * @param p_start_date Transaction start date
61  * @param p_end_date Transaction end date
62  * @param p_source_type Transaction type. Options are PO, SO, INV,
63  *        IO, RMA and RTV
64  * @param x_return_status Standard API parameter
65  * @param x_msg_count Standard API parameter
66  * @param x_msg_data Standard API parameter
67  * @rep:scope public
68  * @rep:lifecycle active
69  * @rep:displayname Process Transaction
70  */
71 PROCEDURE Process_Transaction
72 ( p_api_version_number   IN  NUMBER
73 , p_init_msg_list        IN  VARCHAR2 := FND_API.G_FALSE
74 , p_legal_entity_id      IN  NUMBER
75 , p_start_date           IN  DATE
76 , p_end_date             IN  DATE
77 , p_source_type          IN  VARCHAR2
78 , x_return_status        OUT NOCOPY VARCHAR2
79 , x_msg_count            OUT NOCOPY NUMBER
80 , x_msg_data             OUT NOCOPY VARCHAR2
81 );
82 
83 
84 --========================================================================
85 -- PROCEDURE : Create_Movement_Statistics PUBLIC
86 -- PARAMETERS: p_api_version_number    known api version
87 --             p_init_msg_list         FND_API.G_TRUE to reset list
88 --             x_return_status         return status
89 --             x_msg_count             number of messages in the list
90 --             x_msg_data              message text
91 --             p_movement_transaction  movement transaction data record
92 -- VERSION   : current version         1.0
93 --             initial version         1.0
94 -- COMMENT   : Public Procedure
95 --=======================================================================
96 /*#
97  * Inserts Movement Statistics data for a transaction into the Movement
98  * Statistics table.
99  * @param p_api_version_number Standard API parameter
100  * @param p_init_msg_list Standard API parameter
101  * @param p_movement_transaction Movement transaction data record
102  *                               containing data to be inserted into
103  *                               the Movement Statistics table.
104  * @param x_movement_transaction Movement transaction data record
105  *                               containing the data inserted and
106  *                               the unique Movement ID generated.
107  * @param x_return_status Standard API parameter
108  * @param x_msg_count Standard API parameter
109  * @param x_msg_data Standard API parameter
110  * @rep:scope public
111  * @rep:lifecycle active
112  * @rep:displayname Create Movement Statistics
113  */
114 PROCEDURE Create_Movement_Statistics
115 ( p_api_version_number   IN  NUMBER
116 , p_init_msg_list        IN  VARCHAR2 := FND_API.G_FALSE
117 , p_movement_transaction IN
118     INV_MGD_MVT_DATA_STR.Movement_Transaction_Rec_Type
119 , x_movement_transaction OUT
120     INV_MGD_MVT_DATA_STR.Movement_Transaction_Rec_Type
121 , x_return_status        OUT NOCOPY VARCHAR2
122 , x_msg_count            OUT NOCOPY NUMBER
123 , x_msg_data             OUT NOCOPY VARCHAR2
124 );
125 
126 --========================================================================
127 -- PROCEDURE : Reset_Transaction_Status   PUBLIC
128 --
129 -- PARAMETERS: x_return_status      Procedure return status
130 --             x_msg_count          Number of messages in the list
131 --             x_msg_data           Message text
132 --             p_api_version_number Known Version Number
133 --             p_init_msg_list      Empty PL/SQL Table listfor
134 --                                  Initialization
135 --
136 --             p_legal_entity_id    Legal Entity
137 --             p_zone_code          Zonal Code
138 --             p_usage_type         Usage Type
139 --             p_stat_type          Stat Type
140 ----           p_period_name        Period Name for processing
141 --             p_document_source_type Document Source Type
142 --                                    (PO,SO,INV,RMA,RTV)
143 --
144 -- VERSION   : current version         1.0
145 --             initial version         1.0
146 --
147 -- Updated   :  18/Apr/2002
148 -- History   :  yawang add parameter p_reset_option
149 --=======================================================================--
150 /*#
151  * Resets Movement Statistics records to the status Open. Movement
152  * Statistics records can be status Open, Pending, Exported, Ignored,
153  * Frozen or Verified.  All records except the ones in status pending
154  * would be open if the reset option is 'All'.  Only the records in status
155  * Ignored would be open if the reset option is 'Ignored Only'.  All
156  * records except the ones in status Ignored or Pending would be Open
157  * if the rest option is 'Exclude Ignored'.
158  * @param p_api_version_number Standard API parameter
159  * @param p_init_msg_list Standard API parameter
160  * @param p_legal_entity_id Legal Entity ID
161  * @param p_zone_code Economic Zone Code
162  * @param p_usage_type Usage Type. Options are Internal or External.
163  * @param p_stat_type Statistics Type. Options are Intrastat or Extrastat.
164  * @param p_period_name Period Name for processing
165  * @param p_document_source_type Document Source Type. Options are PO, SO,
166  *                               INV, IO, RMA and RTV.
167  * @param p_reset_option Reset Option. Options are All, Ignored Only and
168  *                       Exclude Ignored.
169  * @param x_return_status Standard API parameter
170  * @param x_msg_count Standard API parameter
171  * @param x_msg_data Standard API parameter
172  * @rep:scope public
173  * @rep:lifecycle active
174  * @rep:displayname Reset Transaction Status
175  */
176 PROCEDURE Reset_Transaction_Status
177 ( p_api_version_number   IN  NUMBER
178 , p_init_msg_list        IN  VARCHAR2 := FND_API.G_FALSE
179 , p_legal_entity_id      IN   NUMBER
180 , p_zone_code            IN   VARCHAR2
181 , p_usage_type           IN   VARCHAR2
182 , p_stat_type            IN   VARCHAR2
183 , p_period_name          IN   VARCHAR2
184 , p_document_source_type IN   VARCHAR2
185 , p_reset_option         IN   VARCHAR2
186 , x_return_status        OUT NOCOPY  VARCHAR2
187 , x_msg_count            OUT NOCOPY NUMBER
188 , x_msg_data             OUT NOCOPY VARCHAR2
189 )
190 ;
191 
192 --========================================================================
193 -- PROCEDURE : Purge_Movement_Transactions   PUBLIC
194 --
195 -- PARAMETERS: x_return_status      Procedure return status
196 --             p_legal_entity_id    Legal Entity
197 --             p_zone_code          Zonal Code
198 --             p_usage_type         Usage Type
199 --             p_stat_type          Stat Type
200 ----           p_period_name        Period Name for processing
201 --             p_document_source_type Document Source Type
202 --                                    (PO,SO,INV,RMA,RTV)
203 --
204 -- VERSION   : current version         1.0
205 --             initial version         1.0
206 --
207 -- COMMENT   : Procedure specification
208 
209 -- Updated   :  09/Jul/2000
210 --=======================================================================--
211 /*#
212  * Deletes data from the Movement Statistics table according to the
213  * given parameters.
214  * @param p_api_version_number Standard API parameter
215  * @param p_init_msg_list Standard API parameter
216  * @param p_legal_entity_id Legal Entity ID
217  * @param p_zone_code Economic Zone Code
218  * @param p_usage_type Usage Type. Options are Internal or External.
219  * @param p_stat_type Statistics Type. Options are Intrastat or Extrastat.
220  * @param p_period_name Period Name for processing
221  * @param p_document_source_type Document Source Type. Options are PO, SO,
222  *                               INV, IO, RMA and RTV.
223  * @param x_return_status Standard API parameter
224  * @param x_msg_count Standard API parameter
225  * @param x_msg_data Standard API parameter
226  * @rep:scope public
227  * @rep:lifecycle active
228  * @rep:displayname Purge Movement Transactions
229  */
230 PROCEDURE Purge_Movement_Transactions
231 ( p_api_version_number   IN  NUMBER
232 , p_init_msg_list        IN  VARCHAR2 := FND_API.G_FALSE
233 , p_legal_entity_id      IN   NUMBER
234 , p_zone_code            IN   VARCHAR2
235 , p_usage_type           IN   VARCHAR2
236 , p_stat_type            IN   VARCHAR2
237 , p_period_name          IN   VARCHAR2
238 , p_document_source_type IN   VARCHAR2
239 , x_return_status        OUT NOCOPY  VARCHAR2
240 , x_msg_count            OUT NOCOPY NUMBER
241 , x_msg_data             OUT NOCOPY VARCHAR2
242 )
243 ;
244 
245 
246 --===========================================================================
247 -- PROCEDURE : Validate_Movement_Statistics - PUBLIC
248 --
249 -- PARAMETERS:
250 --             p_movement_statistics     Material Movement Statistics transaction
251 --                                       Input data record
252 --             p_movement_stat_usages_rec usage record
253 --             x_excp_list               PL/SQL Table type list for storing
254 --                                       and returning the Exception messages
255 --             x_return_status           Procedure return status
256 --             x_msg_count               Number of messages in the list
257 --             x_msg_data                Message text
258 --             x_movement_statistics     Material Movement Statistics transaction
259 --                                       Output data record
260 --
261 -- VERSION   : current version           1.0
262 --             initial version           1.0
263 --
264 -- COMMENT   :  Procedure specification to Perform the
265 --              Validation for the Movement
266 --             Statistics Record FOR Exceptions
267 --
268 -- CREATED  : 10/20/1999
269 --=============================================================================-
270 /*#
271  * Performs validations for the Movement Statistics Record for any Exceptions.
272  * @param p_movement_statistics Movement Statistics transaction Input data
273  *                              record containing Movement Statistics setup data.
274  * @param p_movement_stat_usages_rec Usage record
275  * @param x_excp_list PL/SQL Table type list for storing and returning the
276  *                    Exception messages
277  * @param x_updated_flag Flag that indicates whether the Movement Statistics
278  *                       record that matches the input data record has been
279  *                       updated.
280  * @param x_return_status Standard API parameter
281  * @param x_msg_count Standard API parameter
282  * @param x_msg_data Standard API parameter
283  * @param x_movement_statistics Movement transaction data record containing
284  *                              the data which might have been updated.
285  * @rep:scope public
286  * @rep:lifecycle active
287  * @rep:displayname Validate Movement Statistics
288  */
289 PROCEDURE Validate_Movement_Statistics
290  ( p_movement_statistics      IN
291      INV_MGD_MVT_DATA_STR.Movement_Transaction_Rec_Type
292  , p_movement_stat_usages_rec IN
293      INV_MGD_MVT_DATA_STR.Movement_Stat_Usages_Rec_Type
294  , x_excp_list                OUT NOCOPY
295      INV_MGD_MVT_DATA_STR.excp_list
296  , x_updated_flag             OUT NOCOPY VARCHAR2
297  , x_return_status            OUT NOCOPY VARCHAR2
298  , x_msg_count                OUT NOCOPY NUMBER
299  , x_msg_data                 OUT NOCOPY VARCHAR2
300  , x_movement_statistics      OUT
301      INV_MGD_MVT_DATA_STR.Movement_Transaction_Rec_Type
302 );
303 
304 --========================================================================
305 -- PROCEDURE : Update_Movement_Statistics   PUBLIC
306 --
307 -- PARAMETERS: x_return_status      Procedure return status
308 --             x_msg_count          Number of messages in the list
309 --             x_msg_data           Message text
310 --             p_movement_statistics  Material Movement Statistics transaction
311 --                                  Input data record
312 --
313 -- COMMENT   : Procedure body to Update the Movement
314 --             Statistics record with the
315 --             calculated values ( EX: Invoice information, Status etc ).
316 -- Updated   : 09/Jul/1999
317 --=======================================================================--
318 /*#
319  * Updates existing data in the Movement Statistics table.
320  * @param p_movement_statistics Movement Statistics transaction Input data record
321  * @param x_return_status Standard API parameter
322  * @param x_msg_count Standard API parameter
323  * @param x_msg_data Standard API parameter
324  * @rep:scope public
325  * @rep:lifecycle active
326  * @rep:displayname Update Movement Statistics
327  */
328 PROCEDURE Update_Movement_Statistics (
329   p_movement_statistics          IN
330         INV_MGD_MVT_DATA_STR.Movement_Transaction_Rec_Type
331 , x_return_status                OUT NOCOPY    VARCHAR2
332 , x_msg_count                    OUT NOCOPY    NUMBER
333 , x_msg_data                     OUT NOCOPY    VARCHAR2
334 );
335 
336 END INV_MGD_MVT_STATS_PUB;