--以下脚本于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;
相关文章
- 12-27详解EBS接口开发之物料导入API
- 12-27boost.asio包装类st_asio_wrapper开发教程(2014.5.23更新)(一)-----转
- 12-27EBS开发_更新物料类别集
- 12-27boost.asio包装类st_asio_wrapper开发教程(2014.5.23更新)(一)-----转
- 12-27具体解释EBS接口开发之物料导入API
- 12-27详解EBS接口开发之物料导入API
- 12-27详解EBS接口开发之更新供应商付款方法
- 12-27详解EBS接口开发之库存事务处理批次更新
- 12-27C#微信开发之旅(二):基础类之HttpClientHelper(更新:SSL安全策略)
- 12-27boost.asio包装类st_asio_wrapper开发教程(2013.12.8更新)(二)