Introduction:

This Post illustrates the steps required to update the Item Status using API.

Script to Update the Item Status

DECLARE
p_item_number VARCHAR2 (300);
p_organization_id NUMBER;
p_inventory_item_id NUMBER;
p_org_id NUMBER;
p_user_id NUMBER;
p_resp_id NUMBER;
p_resp_appl_id NUMBER;
l_item_table ego_item_pub.item_tbl_type;
x_item_table ego_item_pub.item_tbl_type;
x_return_status VARCHAR2 (1);
x_msg_count NUMBER (10);
x_msg_data VARCHAR2 (1000);
x_message_list error_handler.error_tbl_type;
ln_responsbility_id NUMBER;
BEGIN
–Apps Initialize
fnd_global.apps_initialize (user_id => p_user_id,
resp_id => p_resp_id,
resp_appl_id => p_resp_appl_id
);
l_item_table (1).transaction_type := ‘UPDATE’;
l_item_table (1).segment1 := p_item_number;
l_item_table (1).organization_id := p_organization_id;
l_item_table (1).inventory_item_id := p_inventory_item_id;
l_item_table (1).inventory_item_status_code := ‘EXCESS’;
— Calling procedure EGO_ITEM_PUB.Process_Items
apps.ego_item_pub.process_items (p_api_version => 1.0,
p_init_msg_list => fnd_api.g_true,
p_commit => fnd_api.g_true,
p_item_tbl => l_item_table,
x_item_tbl => x_item_table,
x_return_status => x_return_status,
x_msg_count => x_msg_count
);
DBMS_OUTPUT.put_line (‘Items updated Status ==>’ || x_return_status);

IF (x_return_status = fnd_api.g_ret_sts_success)
THEN
FOR i IN 1 .. x_item_table.COUNT
LOOP
DBMS_OUTPUT.put_line ( ‘Inventory Item Id :’
|| TO_CHAR (x_item_table (i).inventory_item_id)
);
DBMS_OUTPUT.put_line ( ‘Organization Id :’
|| TO_CHAR (x_item_table (i).organization_id)
);
END LOOP;
ELSE
DBMS_OUTPUT.put_line (‘Error Messages :’);
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;
END IF;

COMMIT;
END;

Got any queries?

Do drop a note by writing us at venkatesh.b@doyensys.com or use the comment section below to ask your questions

Recent Posts

Start typing and press Enter to search