DBA Data[Home] [Help]

PACKAGE: APPS.INV_SALESORDER

Source


1 PACKAGE inv_salesorder AUTHID CURRENT_USER AS
2 /* $Header: INVSOOMS.pls 120.1 2005/06/20 11:10:43 appldev ship $ */
3 /*#
4  * This package can be used to manage sales orders that are represented in
5  * MTL Sales Orders, the Oracle Inventory sales order key flexfield. Records can be created
6  * deleted and information retrieved from MTL Sales orders.
7  * @rep:scope public
8  * @rep:product INV
9  * @rep:lifecycle active
10  * @rep:displayname Inventory Sales Orders
11  * @rep:category BUSINESS_ENTITY INV_SALES_ORDERS
12  */
13 /*----------------------------------------------------------------------------+
14  |Procedure create_salesorder (
15  |		p_api_version_number	IN	NUMBER, -- version number, 1.0
16  |		p_init_msg_list		IN	VARCHAR2 DEFAULT FND_API.G_FALSE,
17  |		p_segment1		IN	NUMBER, -- the order number
18  |		p_segment2		IN	VARCHAR2, -- order type for non OOM, order
19  |                                                            header id for OOM
20  |		p_segment3		IN	VARCHAR2,-- order source
21  |		p_validate_full		IN	NUMBER DEFAULT 1, -- do full flex validation
22  |		p_validation_date	IN	DATE, -- date of creation
23  |		x_salesorder_id		OUT NOCOPY	NUMBER, -- returned SO id
24  |		x_message_data		OUT NOCOPY	VARCHAR2, -- error message data
25  |		x_message_count		OUT NOCOPY	NUMBER, -- number of messages on stack
26  |		x_return_status		OUT NOCOPY	VARCHAR2) -- return status
27  |
28  | x_return status could be:
29  |  (1)fnd_api.g_ret_success, when procedure completes successfully
30  |  (2)fnd_api.g_exc_error, when procedure completes with error. Examine x_message_data
31  |  (3)fnd_api.g_exc_unexpected_error, when an unexpected error occurs. Examine
32  |  x_message_data
33  | The parameter p_validate_full is defualted to 1 which means that flex field APIs
34  | are used to create sales orer flex field. When set to 0, we do the creation of the
35  | sales order flex field manually. This is faster, but does not do all the validation
36  | that the flex field API would do. Set this option to 0 only if you know what you are doing.
37  +----------------------------------------------------------------------------------*/
38 
39 /*#
40  * This procedure is used to create a single MTL Sales Order record
41  * @param p_api_version_number API Version of this procedure. Current version is 1.0
42  * @param p_init_msg_list fnd_api.g_false or fnd_api.g_true is passed as input to determine whether to Initialize message list or not
43  * @param p_segment1 the order number
44  * @param p_segment2 the order type
45  * @param p_segment3 the order source
46  * @param p_validate_full is defualted to 1 which means that flex field APIs are used to create sales orer flex field. When set to 0 the creation of the sales order flex field done manually
47  * @param p_validation_date date if creation
48  * @param x_return_status Returns the status to indicate success or failure of execution
49  * @param x_message_count Returns number of error message in the error message stack in case of failure
50  * @param x_message_data Returns the error message in case of failure
51  * @param x_salesorder_id Returned sales order id
52  * @return Returns the status with value fnd_api.g_ret_success to indicate successful processing and value fnd_api.g_exc_error or fnd_api.g_exc_unexpected_error to indicate failure processing
53  * @rep:scope public
54  * @rep:lifecycle active
55  * @rep:displayname Material Create MTL Sales Order
56  */
57    Procedure create_salesorder (
58 		p_api_version_number	IN	NUMBER,
59 		p_init_msg_list		IN	VARCHAR2 DEFAULT FND_API.G_FALSE,
60 		p_segment1		IN	NUMBER,
61 		p_segment2		IN	VARCHAR2,
62 		p_segment3		IN	VARCHAR2,
63 		p_validate_full		IN	NUMBER DEFAULT 1,
64 		p_validation_date	IN	DATE,
65 		x_salesorder_id		OUT NOCOPY	NUMBER,
66 		x_message_data		OUT NOCOPY	VARCHAR2,
67 		x_message_count		OUT NOCOPY	NUMBER,
68 		x_return_status		OUT NOCOPY	VARCHAR2);
69 
70 
71 /*-------------------------------------------------------------------------------------+
72  | This procedure is used for getting the Oracle Order Management (OOM) order_header_id
73  | when a SO id is passed to it. It retruns a negative one (-1), if the SO id was created
74  | by another system (not OOM).
75  | x_return status could be:
76  |  (1)fnd_api.g_ret_success, when procedure completes successfully
77  |  (2)fnd_api.g_exc_error, when procedure completes with error. Examine x_message_data
78  |  (3)fnd_api.g_exc_unexpected_error, when an unexpected error occurs. Examine
79  |  x_message_data
80  +-------------------------------------------------------------------------------------*/
81 /*#
82  * This Procedure is used to get Order Management Order Header ID using MTL sales order id
83  * @param p_salesorder_id Returned sales order id
84  * @param x_oe_header_id Returned sales order id
85  * @param x_return_status Returns the status to indicate success or failure of execution
86  * @return Returns the status with value fnd_api.g_ret_success to indicate successful processing and value fnd_api.g_exc_error or fnd_api.g_exc_unexpected_error to indicate failure processing
87  * @rep:scope public
88  * @rep:lifecycle active
89  * @rep:displayname Get Header ID For MTL Sales Order
90  */
91 Procedure get_oeheader_for_salesorder(
92 		p_salesorder_id		IN	NUMBER,
93 		x_oe_header_id		OUT NOCOPY	NUMBER,
94 		x_return_status		OUT NOCOPY	VARCHAR2);
95 
96 /*----------------------------------------------------------------------------------------+
97  | This function,  get_salesorder_for_oeheader, can be used to get a sales order id       |
98  | starting from an Order Management order header id. If there is no matching             |
99  |sales order id, a null is returned.	                                                  |
100  +----------------------------------------------------------------------------------------*/
101 /*#
102  * This function is used to get sales order using Order Management Order Header ID
103  * @param p_oe_header_id Sales order header id
104  * @return Returns the MTL sales order id
105  * @rep:scope public
106  * @rep:lifecycle active
107  * @rep:displayname Get MTL Sales Order ID for Sales Order Header
108  */
109 function get_salesorder_for_oeheader(
110 		p_oe_header_id		IN	NUMBER) RETURN NUMBER;
111 
112 /*----------------------------------------------------------------------------------------+
113  | This function,  synch_salesorders_with_om, is used to update an existing sales order   |
114  | with new segment values for either order_number and/or order type and/or order source  |
115  | given an original order number and/or order type and/or order source. This API is      |
116  | is provided because in Order Management the order number and order type can be updated |
117  | even after a sales order has been created. The input parameter "multiple_rows"         |
118  | determines whether it is teh intention of the caller to update multiple rows.	  |
119  +----------------------------------------------------------------------------------------*/
120 /*#
121  * This function,  synch_salesorders_with_om, is used to update an existing sales order
122  * with new segment values for either order_number and/or order type and/or order source
123  * given an original order number and/or order type and/or order source. This API is
124  * is provided because in Order Management the order number and order type can be updated
125  * even after a sales order has been created.
126  * @param p_original_order_number the order number
127  * @param p_original_order_type the order type
128  * @param p_original_source_code the order source
129  * @param p_new_order_number the new order number
130  * @param p_new_order_type the new order type
131  * @param p_new_order_source the new order source
132  * @param p_multiple_rows indicated whether caller intends to update multiple rows
133  * @return Returns the MTL sales order id
134  * @rep:scope public
135  * @rep:lifecycle active
136  * @rep:displayname Get MTL Sales Order ID for Sales Order Header
137  */
138 function synch_salesorders_with_om(
139 		p_original_order_number	IN	VARCHAR2,
140 		p_original_order_type	IN	VARCHAR2,
141 		p_original_source_code	IN	VARCHAR2,
142 		p_new_order_number	IN	VARCHAR2,
143 		p_new_order_type	IN	VARCHAR2,
144 		p_new_order_source	IN	VARCHAR2,
145 		p_multiple_rows		IN	VARCHAR2 default 'N') return number ;
146 /*------------------------------------------------------------------
147 Added this function as OM  utility is giving Operating unit specfic
148 and inventory doesnt look  at opertaing unit*/
149 FUNCTION Get_Header_Id (p_order_number    IN  NUMBER,
150                         p_order_type      IN  VARCHAR2,
151                         p_order_source    IN  VARCHAR2)
152 RETURN NUMBER;
153 
154 /*----------------------------------------------------------------------------+
155  |Procedure create_mtl_sales_orders_bulk (
156  |		p_api_version_number	IN	NUMBER, -- version number, 1.0
157  |		p_init_msg_list		IN	VARCHAR2 DEFAULT FND_API.G_FALSE,
158  |		p_header_rec		IN	OE_BULK_ORDER_PVT.HEADER_REC_TYPE
159  |		x_message_data		OUT NOCOPY	VARCHAR2, -- error message data
160  |		x_message_count		OUT NOCOPY	NUMBER, -- number of messages on stack
161  |		x_return_status		OUT NOCOPY	VARCHAR2) -- return status
162  |
163  | x_return status could be:
164  |  (1)fnd_api.g_ret_success, when procedure completes successfully
165  |  (2)fnd_api.g_exc_error, when procedure completes with error. Examine x_message_data
166  |  (3)fnd_api.g_exc_unexpected_error, when an unexpected error occurs. Examine
167  |  x_message_data
168  | This API directly inserts into mtl_sales_orders all the rows passed in using the table
169  | p_header_rec.
170  +----------------------------------------------------------------------------------*/
171 /*#
172  * This procedure inserts the records passed into mtl_sales_orders directly
173  * @param p_api_version_number API Version of this procedure. Current version is 1.0
174  * @param p_init_msg_list fnd_api.g_false or fnd_api.g_true is passed as input to determine whether to Initialize message list or not
175  * @param p_header_rec list of record to be inserted into mtl_sales_orders
176  * @param x_return_status Returns the status to indicate success or failure of execution
177  * @param x_message_count Returns number of error message in the error message stack in case of failure
178  * @param x_message_data Returns the error message in case of failure
179  * @return Returns the status with value fnd_api.g_ret_success to indicate successful processing and value fnd_api.g_exc_error or fnd_api.g_exc_unexpected_error to indicate failure processing
180  * @rep:scope public
181  * @rep:lifecycle active
182  * @rep:displayname Bulk Create MTL Sales Order
183  */
184 Procedure create_mtl_sales_orders_bulk (
185                 p_api_version_number    IN      NUMBER,
186                 p_init_msg_list         IN      VARCHAR2 DEFAULT FND_API.G_FALSE,
187                 p_header_rec            IN      OE_BULK_ORDER_PVT.HEADER_REC_TYPE,
188                 x_message_data          OUT NOCOPY     VARCHAR2,
189                 x_message_count         OUT NOCOPY     NUMBER,
190                 x_return_status         OUT NOCOPY     VARCHAR2);
191 
192 
193 /*----------------------------------------------------------------------------+
194  |Procedure delete_mtl_sales_orders_bulk (
195  |		p_api_version_number	IN	NUMBER, -- version number, 1.0
196  |		p_init_msg_list		IN	VARCHAR2 DEFAULT FND_API.G_FALSE,
197  |		p_error_rec		IN	OE_BULK_ORDER_PVT.INVALID_HDR_REC_TYPE
198  |		x_message_data		OUT NOCOPY	VARCHAR2, -- error message data
199  |		x_message_count		OUT NOCOPY	NUMBER, -- number of messages on stack
200  |		x_return_status		OUT NOCOPY	VARCHAR2) -- return status
201  |
202  | x_return status could be:
203  |  (1)fnd_api.g_ret_success, when procedure completes successfully
204  |  (2)fnd_api.g_exc_error, when procedure completes with error. Examine x_message_data
205  |  (3)fnd_api.g_exc_unexpected_error, when an unexpected error occurs. Examine
206  |  x_message_data
207  | This API deletes from mtl_sales_orders for orders with errors. These orders are
208  | passed in via p_erro_rec.
209  +----------------------------------------------------------------------------------*/
210 /*#
211  * This procedure deletes the records passed from mtl_sales_orders directly
212  * @param p_api_version_number API Version of this procedure. Current version is 1.0
213  * @param p_error_rec list of sales orders to be deleted from mtl_sales_orders
214  * @param p_init_msg_list fnd_api.g_false or fnd_api.g_true is passed as input to determine whether to Initialize message list or not
215  * @param x_return_status Returns the status to indicate success or failure of execution
216  * @param x_message_count Returns number of error message in the error message stack in case of failure
217  * @param x_message_data Returns the error message in case of failure
218  * @return Returns the status with value fnd_api.g_ret_success to indicate successful processing and value fnd_api.g_exc_error or fnd_api.g_exc_unexpected_error to indicate failure processing
219  * @rep:scope public
220  * @rep:lifecycle active
221  * @rep:displayname Bulk Delete MTL Sales Order
222  */
223 PROCEDURE delete_mtl_sales_orders_bulk(
224                 p_api_version_number    IN      NUMBER,
225                 p_init_msg_list         IN      VARCHAR2 DEFAULT FND_API.G_FALSE,
226                 p_error_rec             IN      OE_BULK_ORDER_PVT.INVALID_HDR_REC_TYPE,
227                 x_message_data          OUT NOCOPY     VARCHAR2,
228                 x_message_count         OUT NOCOPY     NUMBER,
229                 x_return_status         OUT NOCOPY     VARCHAR2);
230 
231 end inv_salesorder ;
232