To create inventory items using oracle standard APIs please follow the below steps.
- Fetch the Oracle provided Template Id for creating purchasing Item.
SELECT template_id
FROM apps.MTL_ITEM_TEMPLATES
WHERE template_name='Purchased Item';
- Insert the Inventory Item details into Item interface table with above fetched Template id.
INTO apps.MTL_SYSTEM_ITEMS_INTERFACE
(
process_flag,
set_process_id,
transaction_type,
organization_id,
segment1,
description,
PRIMARY_UNIT_OF_MEASURE,
LIST_PRICE_PER_UNIT,
TEMPLATE_ID
)
VALUES
(
1,
1,
'CREATE',
204, -- Organization ID
'Coal', -- Name of the Item
'Mining Coal', -- Item Description
'Each', -- Primary UOM of the item
1000, -- Price
123 -- Template Id SELECT template_id FROM MTL_ITEM_TEMPLATES WHERE template_name='Purchased Item'
);
- After inserting run the following concurrent program which creates the corresponding Inventory Items.
DECLARE
v_request_id number;
BEGIN
apps.FND_GLOBAL.APPS_INITIALIZE(1318,50583,401);
apps.MO_GLOBAL.SET_POLICY_CONTEXT('S','204');
v_request_id := apps.Fnd_Request.submit_request
(
application => 'INV',
program => 'INCOIN',
description => NULL,
start_time => SYSDATE,
sub_request => FALSE,
argument1 => 204, -- Organization id
argument2 => 1, -- All organizations
argument3 => 1, -- Validate Items
argument4 => 1, -- Process Items
argument5 => 1, -- Delete Processed Rows
argument6 => NULL, -- Process Set (Null for All)
argument7 => 1, -- Create or Update Items
argument8 => 1 -- Gather Statistics
);
IF ( v_request_id = 0 ) THEN
dbms_output.put_line( 'Item Import Program Not Submitted');
ELSE
dbms_output.put_line( 'Item Imported Successfully');
END IF;
END;
No comments:
Post a Comment