1 PACKAGE inv_logical_transactions_pvt AUTHID CURRENT_USER AS
2 /* $Header: INVLTPVS.pls 115.3 2003/10/15 06:14:36 lplam noship $ */
3
4
5 TYPE VARCHAR30_TBL IS TABLE OF VARCHAR2(30) INDEX BY BINARY_INTEGER;
6
7 -- Procedure
8 -- validate_input_parameters
9 -- Description
10 -- validate the input paremters before populating the
11 -- inventory transactions table.
12
13 PROCEDURE validate_input_parameters
14 (
15 x_return_status OUT NOCOPY VARCHAR2
16 , x_msg_count OUT NOCOPY NUMBER
17 , x_msg_data OUT NOCOPY VARCHAR2
18 , p_api_version_number IN NUMBER := 1.0
19 , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
20 , p_mtl_trx_tbl IN inv_logical_transaction_global.mtl_trx_tbl_type
21 , p_validation_level IN VARCHAR2 DEFAULT fnd_api.g_true
22 , p_logical_trx_type_code IN NUMBER DEFAULT NULL
23 );
24
25
26 /*==========================================================================*
27 | Procedure : INV_MMT_INSERT |
28 | |
29 | Description : This API will be called by INV create logical transactions |
30 | API to do a bulk insert into MTL_MATERIAL_TRANSACTIONS |
31 | table. |
32 | |
33 | Input Parameters : |
34 | p_api_version_number - API version number |
35 | p_init_msg_lst - Whether initialize the error message list or not|
36 | Should be fnd_api.g_false or fnd_api.g_true |
37 | p_mtl_trx_rec - An array of mtl_trx_rec_type records |
38 | |
39 | Output Parameters : |
40 | x_return_status - fnd_api.g_ret_sts_success, if succeeded |
41 | fnd_api.g_ret_sts_exc_error, if an expected |
42 | error occurred |
43 | fnd_api.g_ret_sts_unexp_error, if an unexpected |
44 | eror occurred |
45 | x_msg_count - Number of error message in the error message |
46 | list |
47 | x_msg_data - If the number of error message in the error |
48 | message list is one, the error message is in |
49 | this output parameter |
50 *==========================================================================*/
51
52 PROCEDURE inv_mmt_insert
53 (
54 x_return_status OUT NOCOPY VARCHAR2
55 , x_msg_count OUT NOCOPY NUMBER
56 , x_msg_data OUT NOCOPY VARCHAR2
57 , p_api_version_number IN NUMBER := 1.0
58 , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
59 , p_mtl_trx_tbl IN
60 inv_logical_transaction_global.mtl_trx_tbl_type
61 , p_logical_trx_type_code IN NUMBER
62 );
63
64 /*==========================================================================*
65 | Procedure : INV_LOT_SERIAL_INSERT |
66 | |
67 | Description : This API will be called by INV create_logical_transactions |
68 | API to do a bulk insert into mtl_transaction_lot_numbers if|
69 | the item is lot control and insert into |
70 | mtl_unit_transactions if the item is serial control. |
71 | |
72 | Input Parameters : |
73 | p_api_version_number - API version number |
74 | p_init_msg_lst - Whether initialize the error message list or not|
75 | Should be fnd_api.g_false or fnd_api.g_true |
76 | p_parent_transaction_id - the transaction id of the parent transaction|
77 | in mmt. |
78 | p_transaction_id - the transaction id of the parent transaction in |
79 | mmt. |
80 | p_lot_control_code - the lot control code of the item |
81 | p_serial_control_code - the serial control code of the item |
82 | |
83 | Output Parameters : |
84 | x_return_status - fnd_api.g_ret_sts_success, if succeeded |
85 | fnd_api.g_ret_sts_exc_error, if an expected |
86 | error occurred |
87 | fnd_api.g_ret_sts_unexp_error, if an unexpected |
88 | eror occurred |
89 | x_msg_count - Number of error message in the error message |
90 | list |
91 | x_msg_data - If the number of error message in the error |
92 | message list is one, the error message is in |
93 | this output parameter |
94 *==========================================================================*/
95
96 PROCEDURE inv_lot_serial_insert
97 (
98 x_return_status OUT NOCOPY VARCHAR2
99 , x_msg_count OUT NOCOPY NUMBER
100 , x_msg_data OUT NOCOPY VARCHAR2
101 , p_api_version_number IN NUMBER := 1.0
102 , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
103 , p_parent_transaction_id IN NUMBER
104 , p_transaction_id IN NUMBER
105 , p_lot_control_code IN NUMBER
106 , p_serial_control_code IN NUMBER
107 , p_organization_id IN NUMBER
108 , p_inventory_item_id IN NUMBER
109 , p_primary_quantity IN NUMBER
110 , p_trx_source_type_id IN NUMBER
111 , p_revision IN VARCHAR2
112 );
113
114 /*==========================================================================*
115 | Procedure : GENERATE_SERIAL_NUMBERS |
116 | |
117 | Description : This API will generate serial numbers with the quantity |
118 | provided and store it in a pl/sql table. |
119 | |
120 | Input Parameters : |
121 | p_org_id - the organization_id to generate the serial number. |
122 | p_item_id - the inventory_item_id to generate the serial number. |
123 | p_lot_number - the lot number of the item. |
124 | p_qty - the number of serial numbers that need to be generated. |
125 | p_revision - the revision of the item. |
126 | |
127 | Output Parameters : |
128 | x_return_status - fnd_api.g_ret_sts_success, if succeeded |
129 | fnd_api.g_ret_sts_exc_error, if an expected |
130 | error occurred |
131 | fnd_api.g_ret_sts_unexp_error, if an unexpected |
132 | eror occurred |
133 | x_msg_count - Number of error message in the error message |
134 | list |
135 | x_msg_data - If the number of error message in the error |
136 | message list is one, the error message is in |
137 | this output parameter |
138 | x_ser_num_tbl - the pl/sql table of generated serial number. |
139 *==========================================================================*/
140
141 PROCEDURE generate_serial_numbers
142 (
143 x_return_status OUT NOCOPY VARCHAR2
144 , x_msg_count OUT NOCOPY NUMBER
145 , x_msg_data OUT NOCOPY VARCHAR2
146 , x_ser_num_tbl OUT NOCOPY VARCHAR30_TBL
147 , p_org_id IN NUMBER
148 , p_item_id IN NUMBER
149 , p_lot_number IN VARCHAR2
150 , p_qty IN NUMBER
151 , p_revision IN VARCHAR2
152 );
153
154 /*==========================================================================*
155 | Procedure : INV_MUT_INSERT |
156 | |
157 | Description : This API will insert records into mtl_unit_transactions. |
158 | |
159 | Input Parameters : |
160 | p_parent_serial_trx_id - the serial transaction id from the parent |
161 | record |
162 | p_serial_transaction_id - the serial transaction id that should insert|
163 | into mtl_unit_transactions. |
164 | p_serial_number_tbl - the serial numbers that need to be inserted |
165 | into mtl_unit_transactions. |
166 | p_organization_id - the organization id. |
167 | p_inventory_item_Id - the inventory item id. |
168 | p_trx_source_type_id - the transaction source type id. |
169 | p_receipt_issue_type - the type of the transaction |
170 | 1 - issue |
171 | 2 - receipt |
172 | Output Parameters : |
173 | x_return_status - fnd_api.g_ret_sts_success, if succeeded |
174 | fnd_api.g_ret_sts_exc_error, if an expected |
175 | error occurred |
176 | fnd_api.g_ret_sts_unexp_error, if an unexpected |
177 | eror occurred |
178 | x_msg_count - Number of error message in the error message |
179 | list |
180 | x_msg_data - If the number of error message in the error |
181 | message list is one, the error message is in |
182 | this output parameter |
183 *==========================================================================*/
184
185 PROCEDURE inv_mut_insert
186 (
187 x_return_status OUT NOCOPY VARCHAR2
188 , x_msg_count OUT NOCOPY NUMBER
189 , x_msg_data OUT NOCOPY VARCHAR2
190 , x_serial_number_tbl IN OUT NOCOPY VARCHAR30_TBL
191 , p_parent_serial_trx_id IN NUMBER
192 , p_serial_transaction_id IN NUMBER
193 , p_organization_id IN NUMBER
194 , p_inventory_item_id IN NUMBER
195 , p_trx_source_type_id IN NUMBER
196 , p_receipt_issue_type IN NUMBER
197 );
198
199 /*==========================================================================*
200 | Procedure : UPDATE_SERIAL_NUMBERS |
201 | |
202 | Description : This API will update the current_status of the serial |
203 | number in mtl_serial_numbers to issue out of store. |
204 | |
205 | Input Parameters : |
206 | p_serial_number_tbl - the serial numbers that need to be updated |
207 | in mtl_serial_numbers. |
208 | p_organization_id - the organization id. |
209 | p_inventory_item_Id - the inventory item id. |
210 | |
211 | Output Parameters : |
212 | x_return_status - fnd_api.g_ret_sts_success, if succeeded |
213 | fnd_api.g_ret_sts_exc_error, if an expected |
214 | error occurred |
215 | fnd_api.g_ret_sts_unexp_error, if an unexpected |
216 | eror occurred |
217 | x_msg_count - Number of error message in the error message |
218 | list |
219 | x_msg_data - If the number of error message in the error |
220 | message list is one, the error message is in |
221 | this output parameter |
222 *==========================================================================*/
223 PROCEDURE update_serial_numbers
224 (
225 x_return_status OUT NOCOPY VARCHAR2
226 , x_msg_count OUT NOCOPY NUMBER
227 , x_msg_data OUT NOCOPY VARCHAR2
228 , p_ser_num_tbl IN VARCHAR30_TBL
229 , p_organization_id IN NUMBER
230 , p_inventory_item_id IN NUMBER
231 );
232
233 END inv_logical_transactions_pvt;