Item Assignment to Inventory Org

The basic script is as mentioned below:

DECLARE
x_return_status VARCHAR2 (10);
x_msg_count NUMBER;
l_item_table ego_item_pub.item_tbl_type;
x_item_table ego_item_pub.item_tbl_type;
x_message_list error_handler.error_tbl_type;
BEGIN
apps.fnd_global.apps_initialize (apps.fnd_profile.VALUE (‘USER_ID’),
apps.fnd_profile.VALUE (‘RESP_ID’),
apps.fnd_profile.VALUE (‘RESP_APPL_ID’)
);
ego_item_pub.assign_item_to_org
(p_api_version => 1.0,
p_init_msg_list => fnd_api.g_false,
p_commit => fnd_api.g_false,
— p_inventory_item_id => 54110,–i.inventory_item_id –non mandatory
p_item_number => ‘Segment1 of mtl system items ‘,
— Pass Segment 1 Here
p_organization_id => ‘Oganization in whick to assign’,
x_return_status => x_return_status,
x_msg_count => x_msg_count
);

IF x_return_status = ‘S’
THEN
DBMS_OUTPUT.put_line (‘Success’);
COMMIT;
ELSE
DBMS_OUTPUT.put_line (‘Item Not Assigned ‘);
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;
END;

Item assignment fails in cases where the items have been created using template and in the template ,some org attributes have been enabled but no value is assigned to them.

Therefore, make sure to disabled those attributes or assign a value. Don’t leave the field as null.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s