Overview:
Using below PL/SQL you will create or update Inventory Item in
Oracle Apps.
API Name: Ego_Item_pub.process_item
DECLARE
ln_inventory_item_id NUMBER;
ln_organization_id NUMBER;
lc_return_status VARCHAR2 (4000);
lc_msg_data VARCHAR2 (4000);
ln_msg_count NUMBER;
x_message_list error_handler.error_tbl_type;
BEGIN
fnd_global.apps_initialize (user_id => 77767,
resp_id => 87987,
resp_appl_id => 208);
ego_item_pub.process_item (p_api_version
=> 1.0
,p_init_msg_list => 'T'
,p_commit => 'T'
,p_transaction_type =>
'CREATE' -- UPDATE for Updating item
,p_segment1 => 'XX_TEST1' -- Item
Code
,p_description => 'XX Oracle Test Item1' -- Item Description
,p_long_description => 'XX
Oracle Test Item1' — ITEM LONG DESCRIPTION
,p_organization_id =>
230 -- Organization ID
,p_apply_template =>
'ALL'
,p_template_name => '@Activity' -- SELECT * FROM mtl_item_templates_vl
,p_item_type => 'P'
,p_inventory_item_status_code =>
'Active'
,p_approval_status =>
'A'
-- Below are Out parameters
,x_inventory_item_id =>
ln_inventory_item_id
,x_organization_id =>
ln_organization_id
,x_return_status => lc_return_status
,x_msg_count => ln_msg_count
,x_msg_data => lc_msg_data);
IF l_return_status = fnd_api.g_ret_sts_success THEN
dbms_output.put_line ('Item is Created
Successfully, Inventory Item ID : ' || ln_inventory_item_id||'Organization
ID:'||ln_organization_id);
COMMIT;
ELSE
dbms_output.put_line ('Item Creation
is Failed');
error_handler.get_message_list
(x_message_list => x_message_list);
FOR i IN 1 .. x_message_list.count
LOOP
dbms_output.put_line
(x_message_list (i).message_text);
END LOOP;
ROLLBACK;
END IF;
--
EXCEPTION
WHEN OTHERS THEN
FOR i IN 1 .. ln_msg_count
LOOP
dbms_output.put_line (substr
(fnd_msg_pub.get (p_encoded => fnd_api.g_false), 1, 255));
dbms_output.put_line ('message is: '
|| lc_msg_data);
END LOOP;
END;
/
No comments:
Post a Comment