Professional Documents
Culture Documents
Purpose
Categories are the method or controlling how an item logically and functionally separated for planning,
purchasing and other functions. They aid in the control of all aspect of inventory management. We shall
look at the various methods of assinging categories to items
Assumption
This note will work with an organization control level category that is not assigned to a functional area.
When a item is create and the functional catagories are assigned automaticly. A category assignment must
exist for the functional area therefore the category can only be updated .
The categories used here we created for note “How to Create a Category Set”.
1
After creating the item and saving
In the pull down menu at the top of the screen.
Select:
Tools -> Categories
2
Assign the category
3
Cateries can also be assigned in the Category Sets form
4
In the assignment screen
Item : select Category_Item
Category : “BLACK”
5
How used the Category interface to create, update and delete
item category assignments
6
The example query show now to connect categories to a category set.
When looking for the data , the name of the category set os stored in the mtl_category_sets_tl.
MTL_CATEGORY_SETS_TL table does not contain the STRUCTURE_ID to link
back to the categories in the mtl_categories_b table. When linking these
tables it is also important to note, a category structure can be used by
more than one category set.
DELETE
7
CREATE
INSERT INTO MTL_ITEM_CATEGORIES_INTERFACE
(ITEM_NUMBER,CATEGORY_SET_NAME,CATEGORY_NAME ,PROCESS_FLAG,
ORGANIZATION_CODE ,
SET_PROCESS_ID, TRANSACTION_TYPE)
VALUES
('Category_Item','INV_COLORS_SET','BLACK',1,'V1',1,'CREATE');
COMMIT;
(Note: the create transaction can be used in combination with the Item Open Interface to creates items
with something other than the default category. The SET_PROCESS_ID in both the
MTL_ITEM_CATEGORIES_INTERFACE and the MTL_SYSTEM_ITEMS_INTERFACE must be the
same AND the when the Item Open interface is run the “Process Set” must equal the The
SET_PROCESS_ID. If the Item Open interface is run with the “Null” the categies will not be imported at
the same tiem )
FOR THE UPDATE TRANSATION WE NEED TO ADD THE FIELD OLD_CATEGORY_NAME FOR
THE RECORD TO PROCESS CORRECTLY .
8
Example of using the ID fields.
( For my example I started with the 'Category_Item' assign to the value 'BLACK')
9
Using the Import Item Category Assignments
10
from
Oracle® Manufacturing APIs and Open Interfaces
Manual
Release 11i
Part No. A95953-05
11
Delete successfully processed item category assignment records from the item
categories interface table.
No
Leave all records in the item categories interface table.
12
The are are three types of transaction supported for categories CREATE, UPDATE, and DELETE
(Note the UPDATE transaction type was not originally supported
For 11.5.9 Patch 4088037 Patch recommended for all users. On applying this patch Import Item Category
Assignment program will support transaction type 'UPDATE' to update existing Item Category assignments
Minimum file version
Product Directory File Version
inv patch/115/odf invintf.odf 115.59.11592.2
inv patch/115/sql INVCICIB.pls 115.17.11592.4
inv patch/115/sql INVPCATB.pls 115.24.11590.9
inv patch/115/sql INVPCATS.pls 115.10.11590.5
inv patch/115/sql INVVCATB.pls 115.11.11592.7
inv patch/115/sql INVVCATS.pls 115.9.11592.2
For 11.5.10 Patch 4060373 FP:11I9-11.5.10 - 'UPDATE' FUNCTIONALITY FOR IMPORT ITEM
CATEGORY ASSIGNMENT
Minimum file version
The file INVPCATS.pls contain the definition for all the APIs . The example below show how to select
the data via sql . These are only exmaples you will need to verfy they work for you. The control stucture
and error handling are not provide, you will need to generate these to meet your needs.
13
APIs
declare
l_return_status VARCHAR2(80);
l_error_code NUMBER;
l_msg_count NUMBER;
l_msg_data VARCHAR2(80);
l_category_id NUMBER;
l_category_set_id NUMBER;
l_Inventory_item_id NUMBER;
l_organization_id NUMBER;
begin
select mcs_tl.CATEGORY_SET_ID into l_category_set_id
from mtl_category_sets_tl mcs_tl
where mcs_tl.CATEGORY_SET_NAME ='INV_COLORS_SET';
select mcb.CATEGORY_ID into l_category_id
from mtl_categories_b mcb
where mcb.SEGMENT1='RED'
and mcb.STRUCTURE_ID = (select mcs_b.STRUCTURE_ID
from mtl_category_sets_b mcs_b
where mcs_b.CATEGORY_SET_ID = (select mcs_tl.CATEGORY_SET_ID
from mtl_category_sets_tl mcs_tl
where CATEGORY_SET_NAME ='INV_COLORS_SET'));
select distinct (INVENTORY_ITEM_ID ) into l_Inventory_item_id
from MTL_SYSTEM_ITEMS_KFV msik
where msik.CONCATENATED_SEGMENTS = 'Category_Item';
select organization_id into l_organization_id
from mtl_parameters
where organization_code ='V1';
INV_ITEM_CATEGORY_PUB.Delete_Category_Assignment (
p_api_version => 1.0,
p_init_msg_list => FND_API.G_FALSE,
p_commit => FND_API.G_TRUE,
x_return_status => l_return_status,
x_errorcode => l_error_code,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_category_id => l_category_id,
p_category_set_id => l_category_set_id,
p_inventory_item_id => l_Inventory_item_id,
p_organization_id =>l_organization_id
);
end;
14
declare
l_return_status VARCHAR2(80);
l_error_code NUMBER;
l_msg_count NUMBER;
l_msg_data VARCHAR2(80);
l_category_id NUMBER;
l_category_set_id NUMBER;
l_Inventory_item_id NUMBER;
l_organization_id NUMBER;
begin
select mcs_tl.CATEGORY_SET_ID into l_category_set_id
from mtl_category_sets_tl mcs_tl
where mcs_tl.CATEGORY_SET_NAME ='INV_COLORS_SET';
select mcb.CATEGORY_ID into l_category_id
from mtl_categories_b mcb
where mcb.SEGMENT1='BLACK'
and mcb.STRUCTURE_ID = (select mcs_b.STRUCTURE_ID
from mtl_category_sets_b mcs_b
where mcs_b.CATEGORY_SET_ID = (select mcs_tl.CATEGORY_SET_ID
from mtl_category_sets_tl mcs_tl
where CATEGORY_SET_NAME ='INV_COLORS_SET'));
select distinct (INVENTORY_ITEM_ID ) into l_Inventory_item_id
from MTL_SYSTEM_ITEMS_KFV msik
where msik.CONCATENATED_SEGMENTS = 'Category_Item';
select organization_id into l_organization_id
from mtl_parameters
where organization_code ='V1';
INV_ITEM_CATEGORY_PUB.Create_Category_Assignment (
p_api_version => 1.0,
p_init_msg_list => FND_API.G_FALSE,
p_commit => FND_API.G_TRUE,
x_return_status => l_return_status,
x_errorcode => l_error_code,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_category_id => l_category_id,
p_category_set_id => l_category_set_id,
p_inventory_item_id => l_Inventory_item_id,
p_organization_id =>l_organization_id
);
end;
15
declare
l_return_status VARCHAR2(80);
l_error_code NUMBER;
l_msg_count NUMBER;
l_msg_data VARCHAR2(80);
l_category_id NUMBER;
l_category_set_id NUMBER;
l_Inventory_item_id NUMBER;
l_organization_id NUMBER;
l_old_category_id NUMBER;
begin
select mcs_tl.CATEGORY_SET_ID into l_category_set_id
from mtl_category_sets_tl mcs_tl
where mcs_tl.CATEGORY_SET_NAME ='INV_COLORS_SET';
select mcb.CATEGORY_ID into l_category_id
from mtl_categories_b mcb
where mcb.SEGMENT1='RED'
and mcb.STRUCTURE_ID = (select mcs_b.STRUCTURE_ID
from mtl_category_sets_b mcs_b
where mcs_b.CATEGORY_SET_ID = (select mcs_tl.CATEGORY_SET_ID
from mtl_category_sets_tl mcs_tl
where CATEGORY_SET_NAME ='INV_COLORS_SET'));
select distinct (INVENTORY_ITEM_ID ) into l_Inventory_item_id
from MTL_SYSTEM_ITEMS_KFV msik
where msik.CONCATENATED_SEGMENTS = 'Category_Item';
select organization_id into l_organization_id
from mtl_parameters
where organization_code ='V1';
select mic.CATEGORY_ID into l_old_category_id
from mtl_item_categories mic
where inventory_item_id = ( select distinct (INVENTORY_ITEM_ID )
from MTL_SYSTEM_ITEMS_B
where segment1 = 'Category_Item')
and category_set_id = (select mcs_tl.CATEGORY_SET_ID
from mtl_category_sets_tl mcs_tl
where mcs_tl.CATEGORY_SET_NAME='INV_COLORS_SET')
and organization_id = l_organization_id ;
INV_ITEM_CATEGORY_PUB.Update_Category_Assignment (
p_api_version => 1.0,
p_init_msg_list => FND_API.G_FALSE,
p_commit => FND_API.G_TRUE,
x_return_status => l_return_status,
x_errorcode => l_error_code,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_category_id => l_category_id,
p_category_set_id => l_category_set_id,
p_inventory_item_id => l_Inventory_item_id,
p_organization_id =>l_organization_id,
p_old_category_id => l_old_category_id
);
end;
16