EBS开发_更新物料类别集
作者:互联网
--以下脚本于20180117在Tony环境成功实现
--更新物料类别集
DECLARE
x_return_status VARCHAR2(1);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000);
x_errorcode VARCHAR2(30);
l_cur_mfg_org_id NUMBER := 83; --Current Inv Organization
l_user_id NUMBER := 1110; --User ID, Sysadmin here
BEGIN
--Initialize first, or create_by will be -1
fnd_global.apps_initialize(user_id => 1110,
resp_id => 50597,
resp_appl_id => 20003);
inv_item_category_pub.Update_Category_Assignment(p_api_version => '1.0',--如果是新建物料需要用此API‘’create_category_assignment
p_init_msg_list => fnd_api.g_true,
p_commit => fnd_api.g_false,
x_return_status => x_return_status,
x_errorcode => x_errorcode,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_category_id => 1123,--1123
p_old_category_id => 1126,--1126
p_category_set_id => 1, --1 Inventory
p_inventory_item_id => 82,
p_organization_id => l_cur_mfg_org_id);
IF x_return_status <> fnd_api.g_ret_sts_success THEN
ROLLBACK;
dbms_output.put_line('error code : ' || x_errorcode);
fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
dbms_output.put_line('error count : ' || to_char(x_msg_count));
dbms_output.put_line(REPLACE(x_msg_data, chr(0), ' '));
FOR i IN 2 .. x_msg_count LOOP
x_msg_data := fnd_msg_pub.get;
dbms_output.put_line(REPLACE(x_msg_data, chr(0), ' '));
END LOOP;
IF (x_return_status = fnd_api.g_ret_sts_unexp_error) THEN
RAISE fnd_api.g_exc_unexpected_error;
ELSIF (x_return_status = fnd_api.g_ret_sts_error) THEN
RAISE fnd_api.g_exc_error;
END IF;
ELSE
COMMIT;
dbms_output.put_line('Successfully.');
END IF;
END;
标签:物料,count,api,msg,fnd,EBS,类别,data,id 来源: https://blog.csdn.net/u013711561/article/details/79090106