DBA Data[Home] [Help]

PACKAGE: APPS.INV_ITEM_CATEGORY_PUB

Source


1 PACKAGE INV_ITEM_CATEGORY_PUB AUTHID CURRENT_USER AS
2 /* $Header: INVPCATS.pls 120.4.12010000.2 2009/06/02 02:48:09 geguo ship $ */
3 /*#
4  * This package provides functionality for maintaining categories, category
5  * assignments etc.<BR>
6  *
7  * <B>Constants:</B> All constants that are unqualified belong to
8  * INV_ITEM_CATEGORY_PUB.<BR>
9  *
10  * <B>Standard parameters:</B> Several standard parameters are
11  * used throughout the APIs below. Those parameters are:
12  * <ul>
13  * <li>p_api_version: A decimal number indicating major and minor
14  * revisions to the API.  Pass 1.0 unless otherwise indicated in
15  * the API parameter list.</li>
16  * <li>p_init_msg_list: A one-character flag indicating whether
17  * to initialize the FND_MSG_PUB package's message stack at the
18  * beginning of API processing (and thus remove any messages that
19  * may exist on the stack from prior processing in the same session).
20  * Valid values are FND_API.G_TRUE and FND_API.G_FALSE.</li>
21  * <li>p_commit: A one-character flag indicating whether to commit
22  * work at the end of API processing.  Valid values are
23  * FND_API.G_TRUE and FND_API.G_FALSE.</li>
24  * <li>x_return_status: A one-character code indicating whether
25  * any errors occurred during processing (in which case error
26  * messages will be present on the FND_MSG_PUB package's message
27  * stack).  Valid values are FND_API.G_RET_STS_SUCCESS,
28  * FND_API.G_RET_STS_ERROR, and FND_API.G_RET_STS_UNEXP_ERROR.</li>
29  * <li>x_msg_count: An integer indicating the number of messages
30  * on the FND_MSG_PUB package's message stack at the end of API
31  * processing.  Refer to FND_MSG_PUB documentation for more
32  * information about how to retrieve messages from the message
33  * stack.</li>
34  * <li>x_msg_data: A character string containing message text;
35  * will be nonempty only when x_msg_count is exactly 1.  This is
36  * a convenience feature so that callers need not interact with
37  * the  message stack when there is only one error message (as is
38  * commonly the case).</li>
39  * </ul>
40  * <BR>
41  * <B>G_MISS_* values:</B> In addition, four standard default values
42  * (i.e., INV_ITEM_CATEGORY_PUB.G_MISS_NUM, INV_ITEM_CATEGORY_PUB.G_MISS_CHAR,
43  * INV_ITEM_CATEGORY_PUB.G_MISS_DATE)
44  * are used throughout the APIs below.  These default values are used to
45  * differentiate between a value not being passed at all (represented
46  * by the G_MISS_* default value) and a value being explicitly
47  * passed as NULL; this convention avoids unintentional nulling
48  * out of values during update processing (because G_MISS_* values
49  * are never applied to the database; only explicit NULL values are).
50  *
51  * @rep:scope public
52  * @rep:product INV
53  * @rep:displayname Category Maintainence
54  * @rep:lifecycle active
55  * @rep:category BUSINESS_ENTITY EGO_ITEM
56  */
57 
58   --  Global variables and constants
59   ----------------------------------------------------------------------------
60   g_MISS_CHAR     VARCHAR2(1)  :=  fnd_api.g_MISS_CHAR;
61   g_MISS_NUM      NUMBER       :=  fnd_api.g_MISS_NUM;
62   g_MISS_DATE     DATE         :=  fnd_api.g_MISS_DATE;
63   g_YES     VARCHAR2(1)        :=  'Y';
64   g_NO      VARCHAR2(1)        :=  'N';
65   g_eni_upgarde_flag VARCHAR2(1) := 'N'; -- This is set by PVT pkg ONLY for ENI 11.5.10
66   -----------------------------------------------------------------------------
67 
68   --  Category Record Type
69   -----------------------------------------------------------------------------
70   TYPE CATEGORY_REC_TYPE IS RECORD
71   (
72       CATEGORY_ID                       MTL_CATEGORIES_B.CATEGORY_ID%TYPE       :=  g_MISS_NUM
73      ,STRUCTURE_ID                      MTL_CATEGORIES_B.STRUCTURE_ID%TYPE      :=  g_MISS_NUM
74      ,STRUCTURE_CODE                    FND_ID_FLEX_STRUCTURES.ID_FLEX_STRUCTURE_CODE%TYPE      :=  g_MISS_CHAR
75      ,SEGMENT1                          MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
76      ,SEGMENT2                          MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
77      ,SEGMENT3                          MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
78      ,SEGMENT4                          MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
79      ,SEGMENT5                          MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
80      ,SEGMENT6                          MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
81      ,SEGMENT7                          MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
82      ,SEGMENT8                          MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
83      ,SEGMENT9                          MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
84      ,SEGMENT10                         MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
85      ,SEGMENT11                         MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
86      ,SEGMENT12                         MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
87      ,SEGMENT13                         MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
88      ,SEGMENT14                         MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
89      ,SEGMENT15                         MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
90      ,SEGMENT16                         MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
91      ,SEGMENT17                         MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
92      ,SEGMENT18                         MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
93      ,SEGMENT19                         MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
94      ,SEGMENT20                         MTL_CATEGORIES_B.SEGMENT1%TYPE  :=  g_MISS_CHAR
95     -- Changing the default value as per CRM requirements.
96     -- Since these are NOT NULL columns.
97     ,SUMMARY_FLAG                       MTL_CATEGORIES_B.SUMMARY_FLAG%TYPE      := g_MISS_CHAR
98      ,ENABLED_FLAG                      MTL_CATEGORIES_B.ENABLED_FLAG%TYPE      := g_MISS_CHAR
99      ,START_DATE_ACTIVE                 MTL_CATEGORIES_B.START_DATE_ACTIVE%TYPE         :=  g_MISS_DATE
100      ,END_DATE_ACTIVE                   MTL_CATEGORIES_B.END_DATE_ACTIVE%TYPE           :=  g_MISS_DATE
101      ,DISABLE_DATE                      MTL_CATEGORIES_B.DISABLE_DATE%TYPE              :=  g_MISS_DATE
102      ,DESCRIPTION                       MTL_CATEGORIES_TL.DESCRIPTION%TYPE              :=  g_MISS_CHAR
103      ,ATTRIBUTE_CATEGORY                MTL_CATEGORIES_B.ATTRIBUTE_CATEGORY%TYPE        :=  g_MISS_CHAR
104      ,ATTRIBUTE1                        MTL_CATEGORIES_B.ATTRIBUTE1%TYPE        :=  g_MISS_CHAR
105      ,ATTRIBUTE2                        MTL_CATEGORIES_B.ATTRIBUTE1%TYPE        :=  g_MISS_CHAR
106      ,ATTRIBUTE3                        MTL_CATEGORIES_B.ATTRIBUTE1%TYPE        :=  g_MISS_CHAR
107      ,ATTRIBUTE4                        MTL_CATEGORIES_B.ATTRIBUTE1%TYPE        :=  g_MISS_CHAR
108      ,ATTRIBUTE5                        MTL_CATEGORIES_B.ATTRIBUTE1%TYPE        :=  g_MISS_CHAR
109      ,ATTRIBUTE6                        MTL_CATEGORIES_B.ATTRIBUTE1%TYPE        :=  g_MISS_CHAR
110      ,ATTRIBUTE7                        MTL_CATEGORIES_B.ATTRIBUTE1%TYPE        :=  g_MISS_CHAR
111      ,ATTRIBUTE8                        MTL_CATEGORIES_B.ATTRIBUTE1%TYPE        :=  g_MISS_CHAR
112      ,ATTRIBUTE9                        MTL_CATEGORIES_B.ATTRIBUTE1%TYPE        :=  g_MISS_CHAR
113      ,ATTRIBUTE10                       MTL_CATEGORIES_B.ATTRIBUTE1%TYPE        :=  g_MISS_CHAR
114      ,ATTRIBUTE11                       MTL_CATEGORIES_B.ATTRIBUTE1%TYPE        :=  g_MISS_CHAR
115      ,ATTRIBUTE12                       MTL_CATEGORIES_B.ATTRIBUTE1%TYPE        :=  g_MISS_CHAR
116      ,ATTRIBUTE13                       MTL_CATEGORIES_B.ATTRIBUTE1%TYPE        :=  g_MISS_CHAR
117      ,ATTRIBUTE14                       MTL_CATEGORIES_B.ATTRIBUTE1%TYPE        :=  g_MISS_CHAR
118      ,ATTRIBUTE15                       MTL_CATEGORIES_B.ATTRIBUTE1%TYPE        :=  g_MISS_CHAR
119 --Bug: 2430879
120      ,WEB_STATUS                        MTL_CATEGORIES_B.WEB_STATUS%TYPE        :=  g_MISS_CHAR
121 --Bug: 2645153
122      ,SUPPLIER_ENABLED_FLAG             MTL_CATEGORIES_B.SUPPLIER_ENABLED_FLAG%TYPE     :=  g_MISS_CHAR
123    );
124   -----------------------------------------------------------------------------
125 
126   -- 1. Create_Category
127   ----------------------------------------------------------------------------
128 
129 /*#
130  * Use this API to create a category.  The
131  * record type passed in p_category_rec is as follows:
132  *<code><pre>
133   TYPE CATEGORY_REC_TYPE IS RECORD
134   (
135       CATEGORY_ID               MTL_CATEGORIES_B.CATEGORY_ID%TYPE                       :=  g_MISS_NUM
136      ,STRUCTURE_ID              MTL_CATEGORIES_B.STRUCTURE_ID%TYPE                      :=  g_MISS_NUM
137      ,STRUCTURE_CODE            FND_ID_FLEX_STRUCTURES.ID_FLEX_STRUCTURE_CODE%TYPE      :=  g_MISS_CHAR
138      ,Columns SEGMENT1 to SEGMENT20               MTL_CATEGORIES_B.SEGMENT(n)%TYPE      :=  g_MISS_CHAR
139      ,SUMMARY_FLAG              MTL_CATEGORIES_B.SUMMARY_FLAG%TYPE                      :=  g_MISS_CHAR
140      ,ENABLED_FLAG              MTL_CATEGORIES_B.ENABLED_FLAG%TYPE                      :=  g_MISS_CHAR
141      ,START_DATE_ACTIVE         MTL_CATEGORIES_B.START_DATE_ACTIVE%TYPE                 :=  g_MISS_DATE
142      ,END_DATE_ACTIVE           MTL_CATEGORIES_B.END_DATE_ACTIVE%TYPE                   :=  g_MISS_DATE
143      ,DISABLE_DATE              MTL_CATEGORIES_B.DISABLE_DATE%TYPE                      :=  g_MISS_DATE
144      ,DESCRIPTION               MTL_CATEGORIES_TL.DESCRIPTION%TYPE                      :=  g_MISS_CHAR
145      ,ATTRIBUTE_CATEGORY        MTL_CATEGORIES_B.ATTRIBUTE_CATEGORY%TYPE                :=  g_MISS_CHAR
146      ,Columns ATTRIBUTE1 to ATTRIBUTE15         MTL_CATEGORIES_B.ATTRIBUTE(n)%TYPE      :=  g_MISS_CHAR
147      ,WEB_STATUS                MTL_CATEGORIES_B.WEB_STATUS%TYPE                        :=  g_MISS_CHAR
148      ,SUPPLIER_ENABLED_FLAG     MTL_CATEGORIES_B.SUPPLIER_ENABLED_FLAG%TYPE             :=  g_MISS_CHAR
149    );
150  *</pre></code>
151  * <PRE>
152  * PARAMETERS
153  * ------------------------------------------------------------------------------------------------------
154  * CATEGORY_ID                   : Not Required.
155  * STRUCTURE_ID                  : The structure id of the category.
156  * STRUCTURE_CODE                : The structure code of the category.
157  * SEGMENT1 to SEGMENT20         : Defines the category.
158  * SUMMARY_FLAG                  : Not required.
159  * ENABLED_FLAG                  : Not required.
160  * START_DATE_ACTIVE             : Not required.
161  * END_DATE_ACTIVE               : Not required.
162  * DISABLE_DATE                  : Disbale date of the category.
163  * DESCRIPTION                   : Category Description.
164  * ATTRIBUTE_CATEGORY            : Descriptive attributes category.
165  * ATTRIBUTE1 to ATTRIBUTE15     : These are descriptive attributes.
166  * WEB_STATUS                    : Indicates weather the category is enabled for iProcurement or not.
167  * SUPPLIER_ENABLED_FLAG         : Indicates weather the category should be viewable by supplier or not.
168  * ------------------------------------------------------------------------------------------------------
169  *
170  * NOTE :
171  * <LI> Either STRUCTURE_ID or STRUCTURE_CODE can be populated to identify the structure. </LI>
172  * </PRE>
173  * @param p_category_rec Each record contains the complete interface record
174  * containg 47 fields representing attribute values for the category to be created .
175  * For more information about the record fields, see the parameter
176  * documentation for the full parameter-list version of Create Category.
177  * @rep:displayname Create Category
178  * @rep:scope public
179  */
180 
181 
182   PROCEDURE Create_Category
183   (
184     p_api_version      IN   NUMBER,
185     p_init_msg_list    IN   VARCHAR2 DEFAULT FND_API.G_FALSE,
186     p_commit           IN   VARCHAR2 DEFAULT FND_API.G_FALSE,
187     x_return_status    OUT  NOCOPY VARCHAR2,
188     x_errorcode        OUT  NOCOPY NUMBER,
189     x_msg_count        OUT  NOCOPY NUMBER,
190     x_msg_data         OUT  NOCOPY VARCHAR2,
191     p_category_rec     IN   INV_ITEM_CATEGORY_PUB.CATEGORY_REC_TYPE,
192     x_category_id      OUT  NOCOPY NUMBER
193   );
194     -- Start OF comments
195     -- API name  : Create_Category
196     -- TYPE      : Public
197     -- Pre-reqs  : None
198     -- FUNCTION  : Create a category.
199     --             If this operation fails then the category is not
200     --              created and error code is returned.
201     --
202     -- Parameters:
203     --     IN    : p_api_version      IN  NUMBER (required)
204     --             API Version of this procedure
205     --
206     --             p_init_msg_level   IN  VARCHAR2 (optional)
207     --                                    DEFAULT = FND_API.G_FALSE,
208     --
209     --             p_commit           IN  VARCHAR2 (optional)
210     --                                    DEFAULT = FND_API.G_FALSE,
211     --
212     --             p_category_rec    IN  MTL_CATEGORIES (required)
213     --             complete interface RECORD
214     --
215     --     OUT  :  x_msg_count        OUT NUMBER,
216     --             number of messages in the message list
217     --
218     --             x_msg_data         OUT VARCHAR2,
219     --             if number of messages is 1, then this parameter
220     --             contains the message itself
221     --
222     --             x_category_id     OUT NUMBER
223     --             returns category id of record processed
224     --
225     --             X_return_status    OUT NUMBER
226     --             Result of all the operations
227     --                   FND_API.G_RET_STS_SUCCESS if success
228     --                   FND_API.G_RET_STS_ERROR if error
229     --                 FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
230     --
231     --             X_ErrorCode        OUT NUMBER
232     --                RETURN value OF the x_errorcode
233     --                check only if x_return_status <> fnd_api.g_ret_sts_success
234     --                These errors are unrecoverable and the API failed as a result of this
235     --                XXX - Error reason/message (will be updated after implementation)
236     --                -1  - unexpected error - all operations have been rollbacked
237     --
238     --
239     -- Version: Current Version 0.1
240     -- Previous Version :  None
241     -- Notes  :
242     --
243     -- END OF comments
244   ----------------------------------------------------------------------------
245 
246 
247   -- 2. Update_Category
248   ----------------------------------------------------------------------------
249 
250 
251 
252 /*#
253  * Use this API to update a category.  The
254  * record type passed in p_category_rec is as follows:
255  *<code><pre>
256   TYPE CATEGORY_REC_TYPE IS RECORD
257   (
258       CATEGORY_ID               MTL_CATEGORIES_B.CATEGORY_ID%TYPE                       :=  g_MISS_NUM
259      ,STRUCTURE_ID              MTL_CATEGORIES_B.STRUCTURE_ID%TYPE                      :=  g_MISS_NUM
260      ,STRUCTURE_CODE            FND_ID_FLEX_STRUCTURES.ID_FLEX_STRUCTURE_CODE%TYPE      :=  g_MISS_CHAR
261      ,Columns SEGMENT1 to SEGMENT20               MTL_CATEGORIES_B.SEGMENT(n)%TYPE      :=  g_MISS_CHAR
262      ,SUMMARY_FLAG              MTL_CATEGORIES_B.SUMMARY_FLAG%TYPE                      :=  g_MISS_CHAR
263      ,ENABLED_FLAG              MTL_CATEGORIES_B.ENABLED_FLAG%TYPE                      :=  g_MISS_CHAR
264      ,START_DATE_ACTIVE         MTL_CATEGORIES_B.START_DATE_ACTIVE%TYPE                 :=  g_MISS_DATE
265      ,END_DATE_ACTIVE           MTL_CATEGORIES_B.END_DATE_ACTIVE%TYPE                   :=  g_MISS_DATE
266      ,DISABLE_DATE              MTL_CATEGORIES_B.DISABLE_DATE%TYPE                      :=  g_MISS_DATE
270      ,WEB_STATUS                MTL_CATEGORIES_B.WEB_STATUS%TYPE                        :=  g_MISS_CHAR
267      ,DESCRIPTION               MTL_CATEGORIES_TL.DESCRIPTION%TYPE                      :=  g_MISS_CHAR
268      ,ATTRIBUTE_CATEGORY        MTL_CATEGORIES_B.ATTRIBUTE_CATEGORY%TYPE                :=  g_MISS_CHAR
269      ,Columns ATTRIBUTE1 to ATTRIBUTE15         MTL_CATEGORIES_B.ATTRIBUTE(n)%TYPE      :=  g_MISS_CHAR
271      ,SUPPLIER_ENABLED_FLAG     MTL_CATEGORIES_B.SUPPLIER_ENABLED_FLAG%TYPE             :=  g_MISS_CHAR
272    );
273  *</pre></code>
274  * <PRE>
275  * PARAMETERS
276  * ------------------------------------------------------------------------------------------------------
277  * CATEGORY_ID                   : The Category ID of the category to be updated.
278  * STRUCTURE_ID                  : The structure id of the category.
279  * STRUCTURE_CODE                : The structure code of the category.
280  * SEGMENT1 to SEGMENT20         : Defines the category.
281  * SUMMARY_FLAG                  : Not required.
282  * ENABLED_FLAG                  : Not required.
283  * START_DATE_ACTIVE             : Not required.
284  * END_DATE_ACTIVE               : Not required.
285  * DISABLE_DATE                  : Disbale date of the category.
286  * DESCRIPTION                   : Category Description.
287  * ATTRIBUTE_CATEGORY            : Descriptive attributes category.
288  * ATTRIBUTE1 to ATTRIBUTE15     : These are descriptive attributes.
289  * WEB_STATUS                    : Indicates weather the category is enabled for iProcurement or not.
290  * SUPPLIER_ENABLED_FLAG         : Indicates weather the category should be viewable by supplier or not.
291  * ------------------------------------------------------------------------------------------------------
292  *
293  * NOTE :
294  * <LI> Either CATEGORY_ID or SEGMENT1 to SEGMENT20 can be populated to identify the category.</LI>
295  * <LI> Either STRUCTURE_ID or STRUCTURE_CODE can be populated to identify the structure. </LI>
296  * </PRE>
297  * @param p_category_rec This record contains 47
298  * fields representing the new attribute values for the category
299  * to be updated.
300  * For more information about the record fields, see the parameter
301  * documentation for the full parameter-list version of Update Category.
302  * @rep:displayname Update Category
303  * @rep:scope public
304  */
305 
306   PROCEDURE Update_Category
307   (
308     p_api_version      IN   NUMBER,
309     p_init_msg_list    IN   VARCHAR2 DEFAULT FND_API.G_FALSE,
310     p_commit           IN   VARCHAR2 DEFAULT FND_API.G_FALSE,
311     x_return_status    OUT  NOCOPY VARCHAR2,
312     x_errorcode        OUT  NOCOPY NUMBER,
313     x_msg_count        OUT  NOCOPY NUMBER,
314     x_msg_data         OUT  NOCOPY VARCHAR2,
315     p_category_rec     IN   INV_ITEM_CATEGORY_PUB.CATEGORY_REC_TYPE
316    );
317     -- Start OF comments
318     -- API name  : Update_Category
319     -- TYPE      : Public
320     -- Pre-reqs  : None
321     -- FUNCTION  : Update a category.
322     --             If this operation fails then the category is not
323     --             updated and error code is returned.
324     --
325     -- Parameters:
326     --     IN    : p_api_version      IN  NUMBER (required)
327     --             API Version of this procedure
328     --
329     --             p_init_msg_level   IN  VARCHAR2 (optional)
330     --                                    DEFAULT = FND_API.G_FALSE,
331     --
332     --             p_commit           IN  VARCHAR2 (optional)
333     --                                    DEFAULT = FND_API.G_FALSE,
334     --
335     --             p_category_rec    IN  MTL_CATEGORIES (required)
336     --             new category attribute values
337     --
338     --     OUT  :  x_msg_count        OUT NUMBER,
339     --             number of messages in the message list
340     --
341     --             x_msg_data         OUT VARCHAR2,
342     --             if number of messages is 1, then this parameter
343     --             contains the message itself
344     --
345     --             X_return_status    OUT NUMBER
346     --             Result of all the operations
347     --                   FND_API.G_RET_STS_SUCCESS if success
348     --                   FND_API.G_RET_STS_ERROR if error
349     --                 FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
350     --
351     --             X_ErrorCode        OUT NUMBER
352     --                RETURN value OF the x_errorcode
353     --                check only if x_return_status <> fnd_api.g_ret_sts_success
354     --                These errors are unrecoverable and the API failed as a result of this
355     --                XXX - Error reason/message (will be updated after implementation)
356     --                -1  - unexpected error - all operations have been rollbacked
357     --
358     --
359     -- Version: Current Version 0.1
360     -- Previous Version :  None
361     -- Notes  :
362     --
363     -- END OF comments
364   ----------------------------------------------------------------------------
365 
366 
367   -- 3. Update_Category_Description
368   ----------------------------------------------------------------------------
369 
370 /*#
371  * Use this API to update a category description.
372  * @param p_category_id contains the category id for the record for
373  * which the description needs to be updated. The language in which
374  * the description is updated is the currently set language for the session.
378  * @rep:scope public
375  * @param p_description contains the new description to be set for the given
376  * category.
377  * @rep:displayname Update Category Description
379  */
380 
381 
382   PROCEDURE Update_Category_Description
383   (
384     p_api_version      IN   NUMBER,
385     p_init_msg_list    IN   VARCHAR2 DEFAULT FND_API.G_FALSE,
386     p_commit           IN   VARCHAR2 DEFAULT FND_API.G_FALSE,
387     x_return_status    OUT  NOCOPY VARCHAR2,
388     x_errorcode        OUT  NOCOPY NUMBER,
389     x_msg_count        OUT  NOCOPY NUMBER,
390     x_msg_data         OUT  NOCOPY VARCHAR2,
391     p_category_id      IN   NUMBER,
392     p_description      IN   VARCHAR2
393     -- deleted as this can be picked up from the environment.
394     --p_language         IN   VARCHAR2
395    );
396     -- Start OF comments
397     -- API name  : Update_Category_Description
398     -- TYPE      : Public
399     -- Pre-reqs  : None
400     -- FUNCTION  : Update a category description in the specified language.
401     --             If this operation fails then the category description
402     --             is not updated and error code is returned.
403     --
404     -- Parameters:
405     --     IN    : p_api_version      IN  NUMBER (required)
406     --             API Version of this procedure
407     --
408     --             p_init_msg_level   IN  VARCHAR2 (optional)
409     --                                    DEFAULT = FND_API.G_FALSE,
410     --
411     --             p_commit           IN  VARCHAR2 (optional)
412     --                                    DEFAULT = FND_API.G_FALSE,
413     --
414     --             p_description      IN  VARCHAR2 (required)
415     --             new category description
416     --
417     --             p_language         IN  VARCHAR2 (required)
418     --             language of description
419     --
420     --     OUT  :  x_msg_count        OUT NUMBER,
421     --             number of messages in the message list
422     --
423     --             x_msg_data         OUT VARCHAR2,
424     --             if number of messages is 1, then this parameter
425     --             contains the message itself
426     --
427     --             X_return_status    OUT NUMBER
428     --             Result of all the operations
429     --                   FND_API.G_RET_STS_SUCCESS if success
430     --                   FND_API.G_RET_STS_ERROR if error
431     --                 FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
432     --
433     --             X_ErrorCode        OUT NUMBER
434     --                RETURN value OF the x_errorcode
435     --                check only if x_return_status <> fnd_api.g_ret_sts_success
436     --                These errors are unrecoverable and the API failed as a result of this
437     --                XXX - Error reason/message (will be updated after implementation)
438     --                -1  - unexpected error - all operations have been rollbacked
439     --
440     --
441     -- Version: Current Version 0.1
442     -- Previous Version :  None
443     -- Notes  :
444     --
445     -- END OF comments
446   ----------------------------------------------------------------------------
447 
448   -- 4. Delete_Category
449   ----------------------------------------------------------------------------
450 /*#
451  * Use this API to delete a category. If category is assigned to a category set or
452  * has item assignments the category cannot be deleted.
453  * @param p_category_id contains the category id of the category to be deleted.
454  * @rep:displayname Delete Category
455  * @rep:scope public
456  */
457 
458   PROCEDURE Delete_Category
459   (
460     p_api_version      IN   NUMBER,
461     p_init_msg_list    IN   VARCHAR2 DEFAULT FND_API.G_FALSE,
462     p_commit           IN   VARCHAR2 DEFAULT FND_API.G_FALSE,
463     x_return_status    OUT  NOCOPY VARCHAR2,
464     x_errorcode        OUT  NOCOPY NUMBER,
465     x_msg_count        OUT  NOCOPY NUMBER,
466     x_msg_data         OUT  NOCOPY VARCHAR2,
467     p_category_id      IN   NUMBER
468    );
469     -- Start OF comments
470     -- API name  : Delete_Category
471     -- TYPE      : Public
472     -- Pre-reqs  : None
473     -- FUNCTION  : Delete a category.
474     --             If this operation fails then the category is not
475     --             deleted and error code is returned.
476     --
477     -- Parameters:
478     --     IN    : p_api_version      IN  NUMBER (required)
479     --             API Version of this procedure
480     --
481     --             p_init_msg_level   IN  VARCHAR2 (optional)
482     --                                    DEFAULT = FND_API.G_FALSE,
483     --
484     --             p_commit           IN  VARCHAR2 (optional)
485     --                                    DEFAULT = FND_API.G_FALSE,
486     --
487     --             p_category_id      IN  NUMBER (required)
488     --             category to delete
489     --
490     --     OUT  :  x_msg_count        OUT NUMBER,
491     --             number of messages in the message list
492     --
493     --             x_msg_data         OUT VARCHAR2,
494     --             if number of messages is 1, then this parameter
495     --             contains the message itself
496     --
497     --             X_return_status    OUT NUMBER
498     --             Result of all the operations
502     --
499     --                   FND_API.G_RET_STS_SUCCESS if success
500     --                   FND_API.G_RET_STS_ERROR if error
501     --                 FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
503     --             X_ErrorCode        OUT NUMBER
504     --                RETURN value OF the x_errorcode
505     --                check only if x_return_status <> fnd_api.g_ret_sts_success
506     --                These errors are unrecoverable and the API failed as a result of this
507     --                XXX - Error reason/message (will be updated after implementation)
508     --                -1  - unexpected error - all operations have been rollbacked
509     --
510     --
511     -- Version: Current Version 0.1
512     -- Previous Version :  None
513     -- Notes  :
514     --
515     -- END OF comments
516   ----------------------------------------------------------------------------
517 
518   -- 5. Create_Category_Assignment
519   ----------------------------------------------------------------------------
520   /*#
521  * Use this API to create an item category assignment.
522  * @param p_category_id contains the category id of the category to which the item
523    has to be assigned.
524  * @param p_category_set_id contains the category set for the assignment being created.
525  * An item can be assigned to only one category within a category set.
526  * @param p_inventory_item_id contains the item id of the atem to be assigned.
527  * @param p_organization_id contains the organization id of the item to be assigned.
528  * @rep:displayname Create Item Category Assignment
529  * @rep:scope public
530  */
531   PROCEDURE Create_Category_Assignment
532   (
533     p_api_version       IN   NUMBER,
534     p_init_msg_list     IN   VARCHAR2 DEFAULT FND_API.G_FALSE,
535     p_commit            IN   VARCHAR2 DEFAULT FND_API.G_FALSE,
536     x_return_status     OUT  NOCOPY VARCHAR2,
537     x_errorcode         OUT  NOCOPY NUMBER,
538     x_msg_count         OUT  NOCOPY NUMBER,
539     x_msg_data          OUT  NOCOPY VARCHAR2,
540     p_category_id       IN   NUMBER,
541     p_category_set_id   IN   NUMBER,
542     p_inventory_item_id IN   NUMBER,
543     p_organization_id   IN   NUMBER
544    );
545     -- Start OF comments
546     -- API name  : Create_Category_Assignment
547     -- TYPE      : Public
548     -- Pre-reqs  : None
549     -- FUNCTION  : Create an item category assignment.
550     --             If this operation fails then the item-category assignment
551     --             is not created and error code is returned.
552     --
553     -- Parameters:
554     --     IN    : p_api_version      IN  NUMBER (required)
555     --             API Version of this procedure
556     --
557     --             p_init_msg_level   IN  VARCHAR2 (optional)
558     --                                    DEFAULT = FND_API.G_FALSE,
559     --
560     --             p_commit           IN  VARCHAR2 (optional)
561     --                                    DEFAULT = FND_API.G_FALSE,
562     --
563     --             p_category_id      IN  NUMBER (required)
564     --             category for assigning item
565     --
566     --             p_category_set_id  IN  NUMBER (required)
567     --             category set for assignment. An item can be assigned to
568     --             only one category within a category set.
569     --
570     --             p_inventory_item_id IN  NUMBER (required)
571     --             id of inventory item (item key)
572     --
573     --             p_organization_id  IN  NUMBER (required)
574     --             id of item organization  (item key)
575 
576     --     OUT  :  x_msg_count        OUT NUMBER,
577     --             number of messages in the message list
578     --
579     --             x_msg_data         OUT VARCHAR2,
580     --             if number of messages is 1, then this parameter
581     --             contains the message itself
582     --
583     --             X_return_status    OUT NUMBER
584     --             Result of all the operations
585     --                   FND_API.G_RET_STS_SUCCESS if success
586     --                   FND_API.G_RET_STS_ERROR if error
587     --                 FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
588     --
589     --             X_ErrorCode        OUT NUMBER
590     --                RETURN value OF the x_errorcode
591     --                check only if x_return_status <> fnd_api.g_ret_sts_success
592     --                These errors are unrecoverable and the API failed as a result of this
593     --                XXX - Error reason/message (will be updated after implementation)
594     --                -1  - unexpected error - all operations have been rollbacked
595     --
596     --
597     -- Version: Current Version 0.1
598     -- Previous Version :  None
599     -- Notes  :
600     --
601     -- END OF comments
602   ----------------------------------------------------------------------------
603 
604   -- 6. Delete_Category_Assignment
605   ----------------------------------------------------------------------------
606   /*#
607  * Use this API to delete an item category assignment. User cannot delete a category
608  * assignment if it is a defualt functional area item category assignment or if the category
609  * set is master controlled and current organisation is not the master organisation.
610  * @param p_category_id contains the category of the assignment to be deleted.
614  * @rep:displayname Delete Item Category Assignment.
611  * @param p_category_set_id contains the category set for the assignment being deleted.
612  * @param p_inventory_item_id contains the item id of the assigned item.
613  * @param p_organization_id contains the organization id of the assigned item.
615  * @rep:scope public
616  */
617   PROCEDURE Delete_Category_Assignment
618   (
619     p_api_version       IN   NUMBER,
620     p_init_msg_list     IN   VARCHAR2 DEFAULT FND_API.G_FALSE,
621     p_commit            IN   VARCHAR2 DEFAULT FND_API.G_FALSE,
622     x_return_status     OUT  NOCOPY VARCHAR2,
623     x_errorcode         OUT  NOCOPY NUMBER,
624     x_msg_count         OUT  NOCOPY NUMBER,
625     x_msg_data          OUT  NOCOPY VARCHAR2,
626     p_category_id       IN   NUMBER,
627     p_category_set_id   IN   NUMBER,
628     p_inventory_item_id IN   NUMBER,
629     p_organization_id   IN   NUMBER
630    );
631     -- Start OF comments
632     -- API name  : Delete_Category_Assignment
633     -- TYPE      : Public
634     -- Pre-reqs  : None
635     -- FUNCTION  : Delete an item category assignment.
636     --             If this operation fails then the category is not
637     --             deleted and error code is returned.
638     --
639     -- Parameters:
640     --     IN    : p_api_version      IN  NUMBER (required)
641     --             API Version of this procedure
642     --
643     --             p_init_msg_level   IN  VARCHAR2 (optional)
644     --                                    DEFAULT = FND_API.G_FALSE,
645     --
646     --             p_commit           IN  VARCHAR2 (optional)
647     --                                    DEFAULT = FND_API.G_FALSE,
648     --
649     --             p_category_id      IN  NUMBER (required)
650     --             category of the assginement
651     --
652     --             p_category_set_id  IN  NUMBER (required)
653     --             category set of the assignment.
654     --
655     --             p_inventory_item_id IN  NUMBER (required)
656     --             assigned inventory item (item key)
657     --
658     --             p_organization_id  IN  NUMBER (required)
659     --             item organization of the assigned item (item key)
660 
661     --     OUT  :  x_msg_count        OUT NUMBER,
662     --             number of messages in the message list
663     --
664     --             x_msg_data         OUT VARCHAR2,
665     --             if number of messages is 1, then this parameter
666     --             contains the message itself
667     --
668     --             X_return_status    OUT NUMBER
669     --             Result of all the operations
670     --                   FND_API.G_RET_STS_SUCCESS if success
671     --                   FND_API.G_RET_STS_ERROR if error
672     --                 FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
673     --
674     --             X_ErrorCode        OUT NUMBER
675     --                RETURN value OF the x_errorcode
676     --                check only if x_return_status <> fnd_api.g_ret_sts_success
677     --                These errors are unrecoverable and the API failed as a result of this
678     --                XXX - Error reason/message (will be updated after implementation)
679     --                -1  - unexpected error - all operations have been rollbacked
680     --
681     --
682     -- Version: Current Version 0.1
683     -- Previous Version :  None
684     -- Notes  :
685     --
686     -- END OF comments
687   ----------------------------------------------------------------------------
688 
689 
690   -- 7. Get_Category_Rec_Type
691   ----------------------------------------------------------------------------
692   FUNCTION Get_Category_Rec_Type
693     RETURN INV_ITEM_CATEGORY_PUB.CATEGORY_REC_TYPE ;
694 
695  -----------------------------------------------------------------------------
696   -- 8. Validate_iProcurements_flags
697   --Bug: 2645153 validating structure and iProcurement flags
698   -- Validate WEB_STATUS and SUPPLIER_ENABLED_FLAG
699   ----------------------------------------------------------------------------
700   PROCEDURE Validate_iProcurements_flags
701   (
702     x_category_rec  IN INV_ITEM_CATEGORY_PUB.CATEGORY_REC_TYPE
703    );
704 
705   -- 9.  Create Valid Category
706   -- Bug: 3093555
707   -- API to create a valid Category in Category Sets
708   -----------------------------------------------------------------------------
709   /*#
710  * Use this API to for assigning a category to a category set. A category will be available
711  * in the list of valid categoies for a category set only if it is assigned to the category set.
712  * @param p_category_id contains the category id of the category being created.
713  * @param p_category_set_id identifies the category set in which the category is to be created.
714  * @param p_parent_category_id  if NULL then this category becomes a first level child in the category set.
715  * @rep:displayname Assign a Category to a Category Set.
716  * @rep:scope public
717  */
718   PROCEDURE Create_Valid_Category(
719     p_api_version         IN  NUMBER,
720     p_init_msg_list       IN  VARCHAR2 DEFAULT FND_API.G_FALSE,
721     p_commit              IN  VARCHAR2 DEFAULT FND_API.G_FALSE,
722     p_category_set_id     IN  NUMBER,
723     p_category_id         IN  NUMBER,
724     p_parent_category_id  IN  NUMBER,
725     x_return_status       OUT  NOCOPY VARCHAR2,
726     x_errorcode           OUT  NOCOPY NUMBER,
727     x_msg_count           OUT  NOCOPY NUMBER,
731     -- API name  : Create_Valid_Category
728     x_msg_data            OUT  NOCOPY VARCHAR2
729   );
730     -- Start OF comments
732     -- TYPE      : Public
733     -- Pre-reqs  : None
734     -- FUNCTION  : Create a record in mtl_category_set_valid_cats.
735     --             If this operation fails then the category is not
736     --              created and error code is returned.
737     --
738     -- Parameters:
739     --     IN    : p_api_version         IN  NUMBER (required)
740     --             API Version of this procedure
741     --
742     --             p_init_msg_level      IN  VARCHAR2 (optional)
743     --                                       DEFAULT = FND_API.G_FALSE,
744     --
745     --             p_commit              IN  VARCHAR2 (optional)
746     --                                       DEFAULT = FND_API.G_FALSE,
747     --
748     --             p_category_set_id     IN  NUMBER (required)
749     --                                       category_set_id
750     --
751     --             p_category_id         IN  NUMBER (required)
752     --                                       category_id
753     --
754     --             p_parent_category_id  IN  NUMBER (required)
755     --                                       parent of current category id
756     --
757     --     OUT  :  x_msg_count        OUT NUMBER,
758     --             number of messages in the message list
759     --
760     --             x_msg_data         OUT VARCHAR2,
761     --             if number of messages is 1, then this parameter
762     --             contains the message itself
763     --
764     --             X_return_status    OUT NUMBER
765     --             Result of all the operations
766     --                   FND_API.G_RET_STS_SUCCESS if success
767     --                   FND_API.G_RET_STS_ERROR if error
768     --                   FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
769     --
770     --             X_ErrorCode        OUT NUMBER
771     --                RETURN value OF the x_errorcode
772     --                check only if x_return_status <> fnd_api.g_ret_sts_success
773     --                These errors are unrecoverable and the API failed as a result of this
774     --                XXX - Error reason/message (will be updated after implementation)
775     --                -1  - unexpected error - all operations have been rollbacked
776     --
777     -- Version: Current Version 1.0
778     -- Previous Version :  None
779     -- Notes  :
780     --
781     -- END OF comments
782   -----------------------------------------------------------------------------
783 
784   -- 10. Update Valid Category
785   -- Bug: 3093555
786   -- API to update a valid Category in Category Sets
787   -----------------------------------------------------------------------------
788   /*#
789  * Use this API to for reassigning the parent category of a category in a given category set.
790  * @param p_category_id contains the category id of the category being updated.
791  * @param p_category_set_id identifies the category set to which the category belongs.
792  * @param p_parent_category_id contains the parent of the current category id.
793  * @rep:displayname Update Parent Category of a given Category.
794  * @rep:scope public
795  */
796   PROCEDURE Update_Valid_Category(
797     p_api_version         IN  NUMBER,
798     p_init_msg_list       IN  VARCHAR2 DEFAULT FND_API.G_FALSE,
799     p_commit              IN  VARCHAR2 DEFAULT FND_API.G_FALSE,
800     p_category_set_id     IN  NUMBER,
801     p_category_id         IN  NUMBER,
802     p_parent_category_id  IN  NUMBER,
803     x_return_status       OUT  NOCOPY VARCHAR2,
804     x_errorcode           OUT  NOCOPY NUMBER,
805     x_msg_count           OUT  NOCOPY NUMBER,
806     x_msg_data            OUT  NOCOPY VARCHAR2
807   );
808     -- Start OF comments
809     -- API name  : Update_Valid_Category
810     -- TYPE      : Public
811     -- Pre-reqs  : None
812     -- FUNCTION  : Update a record in mtl_category_set_valid_cats.
813     --             If this operation fails then the category is not
814     --              updated and error code is returned.
815     --             The record to be updated is identified by the keys
816     --              category_id and category_set_id
817     --
818     -- Parameters:
819     --     IN    : p_api_version         IN  NUMBER (required)
820     --             API Version of this procedure
821     --
822     --             p_init_msg_level      IN  VARCHAR2 (optional)
823     --                                       DEFAULT = FND_API.G_FALSE,
824     --
825     --             p_commit              IN  VARCHAR2 (optional)
826     --                                       DEFAULT = FND_API.G_FALSE,
827     --
828     --             p_category_set_id     IN  NUMBER (required)
829     --                                       category_set_id
830     --
831     --             p_category_id         IN  NUMBER (required)
832     --                                       category_id
833     --
834     --             p_parent_category_id  IN  NUMBER (required)
835     --                                       parent of current category id
836     --
837     --     OUT  :  x_msg_count        OUT NUMBER,
838     --             number of messages in the message list
839     --
840     --             x_msg_data         OUT VARCHAR2,
841     --             if number of messages is 1, then this parameter
842     --             contains the message itself
846     --                   FND_API.G_RET_STS_SUCCESS if success
843     --
844     --             X_return_status    OUT NUMBER
845     --             Result of all the operations
847     --                   FND_API.G_RET_STS_ERROR if error
848     --                   FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
849     --
850     --             X_ErrorCode        OUT NUMBER
851     --                RETURN value OF the x_errorcode
852     --                check only if x_return_status <> fnd_api.g_ret_sts_success
853     --                These errors are unrecoverable and the API failed as a result of this
854     --                XXX - Error reason/message (will be updated after implementation)
855     --                -1  - unexpected error - all operations have been rollbacked
856     --
857     -- Version: Current Version 1.0
858     -- Previous Version :  None
859     -- Notes  :
860     --
861     -- END OF comments
862   -----------------------------------------------------------------------------
863 
864   -- 11. Delete Valid Category
865   -- Bug: 3093555
866   -- API to delete Category Sets
867   -----------------------------------------------------------------------------
868   /*#
869  * Use this API to delete category assignment to its category set.
870  * @param p_category_id contains the category id of the category being updated.
871  * @param p_category_set_id identifies the category set to which the category belongs.
872  * @rep:displayname Delete Category from a Category Set.
873  * @rep:scope public
874  */
875   PROCEDURE Delete_Valid_Category(
876     p_api_version         IN  NUMBER,
877     p_init_msg_list       IN  VARCHAR2 DEFAULT FND_API.G_FALSE,
878     p_commit              IN  VARCHAR2 DEFAULT FND_API.G_FALSE,
879     p_category_set_id     IN  NUMBER,
880     p_category_id         IN  NUMBER,
881     x_return_status       OUT  NOCOPY VARCHAR2,
882     x_errorcode           OUT  NOCOPY NUMBER,
883     x_msg_count           OUT  NOCOPY NUMBER,
884     x_msg_data            OUT  NOCOPY VARCHAR2
885   );
886     -- Start OF comments
887     -- API name  : Delete_Valid_Category
888     -- TYPE      : Public
889     -- Pre-reqs  : None
890     -- FUNCTION  : Delete the record from mtl_category_set_valid_cats.
891     --             If this operation fails then the category is not deleted
892     --
893     -- Parameters:
894     --     IN    : p_api_version         IN  NUMBER (required)
895     --             API Version of this procedure
896     --
897     --             p_init_msg_level      IN  VARCHAR2 (optional)
898     --                                       DEFAULT = FND_API.G_FALSE,
899     --
900     --             p_commit              IN  VARCHAR2 (optional)
901     --                                       DEFAULT = FND_API.G_FALSE,
902     --
903     --             p_category_set_id     IN  NUMBER (required)
904     --                                       category_set_id
905     --
906     --             p_category_id         IN  NUMBER (required)
907     --                                       category_id
908     --
909     --     OUT  :  x_msg_count        OUT NUMBER,
910     --             number of messages in the message list
911     --
912     --             x_msg_data         OUT VARCHAR2,
913     --             if number of messages is 1, then this parameter
914     --             contains the message itself
915     --
916     --             X_return_status    OUT NUMBER
917     --             Result of all the operations
918     --                   FND_API.G_RET_STS_SUCCESS if success
919     --                   FND_API.G_RET_STS_ERROR if error
920     --                   FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
921     --
922     --             X_ErrorCode        OUT NUMBER
923     --                RETURN value OF the x_errorcode
924     --                check only if x_return_status <> fnd_api.g_ret_sts_success
925     --                These errors are unrecoverable and the API failed as a result of this
926     --                XXX - Error reason/message (will be updated after implementation)
927     --                -1  - unexpected error - all operations have been rollbacked
928     --
929     -- Version: Current Version 1.0
930     -- Previous Version :  None
931     -- Notes  :
932     --
933     -- END OF comments
934   ----------------------------------------------------------------------------
935   --  12. Process_dml_on_row
936   --  Bug: 5023883, Create/Update/Delete to the EGO tables
937   ----------------------------------------------------------------------------
938   PROCEDURE Process_Dml_On_Row
939   (
940     p_api_version         IN  NUMBER,
941     p_category_set_id     IN  NUMBER,
942     p_category_id         IN  NUMBER,
943     p_mode                IN  VARCHAR2,
944     x_return_status       OUT  NOCOPY VARCHAR2,
945     x_errorcode           OUT  NOCOPY NUMBER,
946     x_msg_count           OUT  NOCOPY NUMBER,
947     x_msg_data            OUT  NOCOPY VARCHAR2
948    );
949   -----------------------------------------------------------------------------
950   -----------------------------------------------------------------------------
951 
952   --* Code added for Bug #3991044
953   -- 13. Update_Category_Assignment
954   ----------------------------------------------------------------------------
955   /*#
956  * Use this API to for re-assigning an item to a new category in the given category set.
957  * @param p_category_id contains the category id to which the item is to be assigned.
958  * @param p_old_category_id contains the category to which the item is assigned
959  * before updation.
963  * item belongs.
960  * @param p_category_set_id identifies the category set to which the old category belongs.
961  * @param p_inventory_item_id contains the item id for which the assignment is to be updated.
962  * @param p_organization_id contains the organization id of the organization to which the
964  * @rep:displayname Update an Item Category Assignment.
965  * @rep:scope public
966  */
967   PROCEDURE Update_Category_Assignment
968   (
969     p_api_version       IN   NUMBER,
970     p_init_msg_list     IN   VARCHAR2 DEFAULT FND_API.G_FALSE,
971     p_commit            IN   VARCHAR2 DEFAULT FND_API.G_FALSE,
972     p_category_id       IN   NUMBER,
973     p_old_category_id   IN   NUMBER,
974     p_category_set_id   IN   NUMBER,
975     p_inventory_item_id IN   NUMBER,
976     p_organization_id   IN   NUMBER,
977     x_return_status     OUT  NOCOPY VARCHAR2,
978     x_errorcode         OUT  NOCOPY NUMBER,
979     x_msg_count         OUT  NOCOPY NUMBER,
980     x_msg_data          OUT  NOCOPY VARCHAR2
981    );
982     -- Start OF comments
983     -- API name  : Update_Category_Assignment
984     -- TYPE      : Public
985     -- Pre-reqs  : None
986     -- FUNCTION  : Update an item category assignment.
987     --             If this operation fails then the category is not
988     --             updated and error code is returned.
989     --
990     -- Parameters:
991     --     IN    : p_api_version      IN  NUMBER (required)
992     --             API Version of this procedure
993     --
994     --             p_init_msg_level   IN  VARCHAR2 (optional)
995     --                                    DEFAULT = FND_API.G_FALSE,
996     --
997     --             p_commit           IN  VARCHAR2 (optional)
998     --                                    DEFAULT = FND_API.G_FALSE,
999     --
1000     --             p_category_id      IN  NUMBER (required)
1001     --             new category to be updated
1002     --
1003     --             p_old_category_id  IN  NUMBER (required)
1004     --             existing category of the assginement
1005     --
1006     --             p_category_set_id  IN  NUMBER (required)
1007     --             category set of the assignment.
1008     --
1009     --             p_inventory_item_id IN  NUMBER (required)
1010     --             assigned inventory item (item key)
1011     --
1012     --             p_organization_id  IN  NUMBER (required)
1013     --             item organization of the assigned item (item key)
1014 
1015     --     OUT  :  x_msg_count        OUT NUMBER,
1016     --             number of messages in the message list
1017     --
1018     --             x_msg_data         OUT VARCHAR2,
1019     --             if number of messages is 1, then this parameter
1020     --             contains the message itself
1021     --
1022     --             X_return_status    OUT NUMBER
1023     --             Result of all the operations
1024     --                   FND_API.G_RET_STS_SUCCESS if success
1025     --                   FND_API.G_RET_STS_ERROR if error
1026     --                 FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
1027     --
1028     --             X_ErrorCode        OUT NUMBER
1029     --                RETURN value OF the x_errorcode
1030     --                check only if x_return_status <> fnd_api.g_ret_sts_success
1031     --                These errors are unrecoverable and the API failed as a result of this
1032     --                XXX - Error reason/message (will be updated after implementation)
1033     --                -1  - unexpected error - all operations have been rollbacked
1034     --
1035     --
1036     -- Version: Current Version 0.1
1037     -- Previous Version :  None
1038     -- Notes  :
1039     --
1040     -- END OF comments
1041   ----------------------------------------------------------------------------
1042   --* End of Bug #3991044
1043 
1044   /* Add this procedure by geguo for bug 8547305 */
1045   ----------------------------------------------------------------------------------------------------------
1046   --when x_return_status return FND_API.G_RET_STS_SUCCESS,
1047   --  x_category_id return the category id if the segment combination existed.
1048   --  Or x_category_id return -1 if the combination doesn't exist.
1049   --when x_return_status return FND_API.G_RET_STS_UNEXP_ERROR Or G_RET_STS_ERROR
1050   --  indicating error happened, get the error message from x_msg_data
1051   ----------------------------------------------------------------------------------------------------------
1052   PROCEDURE Get_Category_Id_From_Cat_Rec(
1053     p_category_rec     IN   INV_ITEM_CATEGORY_PUB.CATEGORY_REC_TYPE,
1054     x_category_id      OUT  NOCOPY NUMBER,
1055     x_return_status    OUT  NOCOPY VARCHAR2,
1056     x_msg_data         OUT  NOCOPY VARCHAR2
1057   );
1058 
1059 END INV_ITEM_CATEGORY_PUB;