DECLARE
l_msg_index_out NUMBER;
l_error_message VARCHAR2 (2000);
l_return_status VARCHAR2 (80);
l_error_code NUMBER;
l_msg_count NUMBER;
l_msg_data VARCHAR2 (250);
l_CATEGORY_ID NUMBER := 2124;
l_CATEGORY_SET_ID NUMBER := 1100000041;
l_INVENTORY_ITEM_ID NUMBER := 16001;
l_ORGANIZATION_ID NUMBER := 539;
l_old_category_id NUMBER := 2123;
BEGIN
inv_item_category_pub.update_category_assignment (
p_api_version => 1.0,
p_init_msg_list => fnd_api.g_false,
p_commit => fnd_api.g_true,
x_return_status => l_return_status,
x_errorcode => l_error_code,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_category_id => l_category_id,
p_category_set_id => l_category_set_id,
p_inventory_item_id => l_inventory_item_id,
p_organization_id => l_organization_id,
p_old_category_id => l_old_category_id
);
IF l_return_status <> fnd_api.g_ret_sts_success
THEN
ROLLBACK;
FOR i IN 1 .. l_msg_count
LOOP
apps.fnd_msg_pub.get (p_msg_index => i,
p_encoded => fnd_api.g_false,
p_data => l_msg_data,
p_msg_index_out => l_msg_index_out);
IF l_error_message IS NULL
THEN
l_error_message := SUBSTR (l_msg_data, 1, 250);
ELSE
l_error_message :=
l_error_message || ' /' || SUBSTR (l_msg_data, 1, 250);
END IF;
END LOOP;
DBMS_OUTPUT.put_line ('*****************************************');
DBMS_OUTPUT.put_line ('API Error : ' || l_error_message);
DBMS_OUTPUT.put_line ('*****************************************');
ELSE
COMMIT;
DBMS_OUTPUT.put_line ('*****************************************');
DBMS_OUTPUT.put_line( 'Created Category Assiginment from Item id : '
|| l_inventory_item_id
|| ' Successfully');
DBMS_OUTPUT.put_line ('*****************************************');
END IF;
END;
/
l_msg_index_out NUMBER;
l_error_message VARCHAR2 (2000);
l_return_status VARCHAR2 (80);
l_error_code NUMBER;
l_msg_count NUMBER;
l_msg_data VARCHAR2 (250);
l_CATEGORY_ID NUMBER := 2124;
l_CATEGORY_SET_ID NUMBER := 1100000041;
l_INVENTORY_ITEM_ID NUMBER := 16001;
l_ORGANIZATION_ID NUMBER := 539;
l_old_category_id NUMBER := 2123;
BEGIN
inv_item_category_pub.update_category_assignment (
p_api_version => 1.0,
p_init_msg_list => fnd_api.g_false,
p_commit => fnd_api.g_true,
x_return_status => l_return_status,
x_errorcode => l_error_code,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_category_id => l_category_id,
p_category_set_id => l_category_set_id,
p_inventory_item_id => l_inventory_item_id,
p_organization_id => l_organization_id,
p_old_category_id => l_old_category_id
);
IF l_return_status <> fnd_api.g_ret_sts_success
THEN
ROLLBACK;
FOR i IN 1 .. l_msg_count
LOOP
apps.fnd_msg_pub.get (p_msg_index => i,
p_encoded => fnd_api.g_false,
p_data => l_msg_data,
p_msg_index_out => l_msg_index_out);
IF l_error_message IS NULL
THEN
l_error_message := SUBSTR (l_msg_data, 1, 250);
ELSE
l_error_message :=
l_error_message || ' /' || SUBSTR (l_msg_data, 1, 250);
END IF;
END LOOP;
DBMS_OUTPUT.put_line ('*****************************************');
DBMS_OUTPUT.put_line ('API Error : ' || l_error_message);
DBMS_OUTPUT.put_line ('*****************************************');
ELSE
COMMIT;
DBMS_OUTPUT.put_line ('*****************************************');
DBMS_OUTPUT.put_line( 'Created Category Assiginment from Item id : '
|| l_inventory_item_id
|| ' Successfully');
DBMS_OUTPUT.put_line ('*****************************************');
END IF;
END;
/
No comments:
Post a Comment