一、新增工艺路线
INSERT INTO bom_op_sequences_interface
(assembly_item_number,
operation_seq_num,
department_code,
transaction_type,
process_flag,
organization_code,
attribute14)
VALUES
(rec.assembly_item_number,
rec.,operation_seq_num
rec.department_code,
'CREATE',
1,
rec.organization_code,
gv_batch);
二、新增资源
INSERT INTO bom_op_resources_interface
(assembly_item_id,
organization_id,
operation_seq_num,
effectivity_date,
resource_seq_num,
resource_code,
basis_type,
usage_rate_or_amount,
schedule_flag,
standard_rate_flag,
transaction_type,
process_flag,
organization_code,
attribute14)
VALUES
(ln_assembly_item_id,
ln_organization_id,
rec.operation_seq_num,
SYSDATE,
rec.,resource_seq_num
rec.resource_code,
1,
rec.usage_rate_or_amount,
2, -- NO
2,
'Insert',
1,
rec.organization_code,
gv_batch);
三、更新BOMINSERT INTO bom_inventory_comps_interface
(component_sequence_id,
--component_item_id,
organization_id,
new_operation_seq_num,
wip_supply_type,
supply_subinventory,
supply_locator_id,
location_name,
transaction_type,
process_flag,
old_operation_seq_num,
attribute14)
VALUES
(rec_b.component_sequence_id,
--rec_b.component_item_id,
ln_organization_id,
rec_b.new_operation_seq_num,
lv_wip_supply_type,
rec.supply_subinventory,
NULL,
NULL,
'UPDATE',
1,
gv_batch);
四、注意:
1.implementation_date为空的记录不能被更改,要预先筛选掉,否则会报 BOM_COLUMN_NOT_UPDATABLE
2.需要修改子库存(supply_subinventory),而新的子库存是没有货位控制的,这时要预先清除 bom_inventory_components 表的supply_locator_id字段,否则会报BOM_LOCATOR_INVALID。 (ps:supply_locator_id设置为空,也无济于事。)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26555596/viewspace-720682/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26555596/viewspace-720682/