You are on page 1of 2

How to create an Item using API and assign a template to it...?

Its very easy to create an item in oracle using API.

MTL_SYSTEM_ITEMS_INTERFACE:-
To create an item using API in oracle, 1st you need to put data in interface
table MTL_SYSTEM_ITEMS_INTERFACE.

Following insert script will help you to insert data:-

INSERT INTO MTL_SYSTEM_ITEMS_INTERFACE
(SEGMENT1,
 DESCRIPTION,
 ORGANIZATION_ID,
 TRANSACTION_TYPE,
 TEMPLATE_ID,
 PROCESS_FLAG,
 SET_PROCESS_ID,
 CREATION_DATE,
 CREATED_BY,
 LAST_UPDATE_DATE,
 LAST_UPDATED_BY,
 LAST_UPDATE_LOGIN)

VALUES
(ITEM NAME,                       --- Name of the Item
 ITEM DESCRIPTION,         -- Description for the Item
 ORGANIZATION_ID,         -- Organization ID or GLOBAL MASTER ITEM
 TRANSACTION_TYPE,      -- It can be INSERT OR UPDATE
 TEMPLATE_ID,                   -- Template ID which you want to apply on this item
 1,                                            -- Put process flag as 1
 SET_PROCESS_ID,             -- Unique number generated by sequence, will be passed to
Item Import
 SYSDATE,
 FND_GLOBAL.USER_ID,
 SYSDATE,
 FND_GLOBAL.USER_ID,
 FND_GLOBAL.LOGIN_ID);

Note for ORGANIZATION_ID: As we know in oracle Item 1st need to be created in


GLOBAL MASTER, then can be assigned to other inventory organization. So, if you are
creating an item 1st time you need to put the Organization ID of GLOBAL MASTER.
If you want to active this item for other organization then you need to inset one more
record in this table with other inventory organization ID.

Note for SET_PROCESS_ID: For set_process_id create a sequence to generate a unique


number and assign it to the variable set_process_id, same set_process_id can be
assigned to multiple lines of table MTL_SYSTEM_ITEMS_INTERFACE. When you call
the Import Item program, it will process all the line with same set_process_id in a batch.

Note for TEMPLATE_ID: TEMPLATE_ID can be any pre-defined template id or user


defined template id, if you pass this argument as blank, system will take default template
ID.

Now you just need to call the Item Import program as below:-


v_request_id := fnd_request.submit_request('INV',
                                                                        'INCOIN',
                                                                       'Import Items',
                                                                        SYSDATE,
                                                                        FALSE,
                                                                        85,       -- Organization Id for GIM
                                                                        1,          --All Organizations - Yes
                                                                        1,         -- Validate Items - Yes
                                                                        1,         -- Process Items - Yes
                                                                        1,          --Delete Processed Rows - Yes
                                                                        SET_PROCESS_ID,
                                                                        1);      -- Create or Update Items - Create

Here v_request_id will give you the request ID of concurrent submitted to import the
program.
So, make sure that you are storing it and printing it in your log of main concurrent for
tracking purpose.

Thanks for visiting my blog, if you find it helpful then please put your comment and
share it with your Oracle friends.
Thanks a lot for your co-operation.
See you in next blog.

You might also like