Sunday, September 21, 2014

Bill of Material Data Conversion Sample script

Dear Reader

Just thought to share a sample script for the data conversion of Bills of Material (BOM)

You would need to change some values as mentioned below and you would be good to go

INSERT INTO bom_bill_of_mtls_interface
(
bill_sequence_id,
assembly_item_id,
process_flag,
item_number,
last_update_login,
last_update_date,
last_updated_by,
creation_date,
created_by,
organization_id,
transaction_type
)
VALUES
(
bom.bom_inventory_components_s.NEXTVAL,
81434,   --Assembly Item Inventory Item ID from MTL_SYSTEM_ITEMS
1,
'TST00001', --This is the assembly item number
fnd_global.login_id,
SYSDATE,
fnd_global.user_id,
SYSDATE,
fnd_global.user_id,
341,  --Organization ID in which the BOM is to be created
'CREATE'
);


INSERT INTO bom_inventory_comps_interface
(
bill_sequence_id,
assembly_item_id,
component_item_id,
effectivity_date,
organization_code,
organization_id,
bom_item_type,
last_update_login,
last_update_date,
last_updated_by,
creation_date,
created_by,
operation_seq_num,
component_quantity,
component_yield_factor,
process_flag,
transaction_type,
include_in_cost_rollup,
wip_supply_type,
supply_subinventory,
item_num
)
VALUES
(
bom.bom_inventory_components_s.CURRVAL,
81434,   --Again the assembly item ID value same as inserted in earlier statement
6076,    --Inventory Item ID of the Component Item which comprises the BOM for the assembly
SYSDATE,
'VX1',   --Organization code in which BOM is to be created
341,     --Organization ID in which BOM is to be created
4,       --You can take this value from BOM_ITEM_TYPE in MTL_SYSTEM_ITEMS for the Component Item
fnd_global.login_id,
SYSDATE,
fnd_global.user_id,
SYSDATE,
fnd_global.user_id,
1,
1,
1,
1,
'CREATE',
1,
NULL,
NULL,
1        --Item Num value determines the sequence of the component items how they will appear in the BOM so this is first component
);


INSERT INTO bom_inventory_comps_interface
(
bill_sequence_id,
assembly_item_id,
component_item_id,
effectivity_date,
organization_code,
organization_id,
bom_item_type,
last_update_login,
last_update_date,
last_updated_by,
creation_date,
created_by,
operation_seq_num,
component_quantity,
component_yield_factor,
process_flag,
transaction_type,
include_in_cost_rollup,
wip_supply_type,
supply_subinventory,
item_num
)
VALUES
(
bom.bom_inventory_components_s.CURRVAL,
81434,      --Again the assembly item ID value same as inserted in earlier statement
6064,       --Inventory Item ID of the Component Item which comprises the BOM for the assembly
SYSDATE,
'VX1',      --Organization code in which BOM is to be created
341,        --Organization ID in which BOM is to be created
4,          --You can take this value from BOM_ITEM_TYPE in MTL_SYSTEM_ITEMS for the Component Item
fnd_global.login_id,
SYSDATE,
fnd_global.user_id,
SYSDATE,
fnd_global.user_id,
1,
1,
1,
1,
'CREATE',
1,
NULL,
NULL,
2           --Item Num value determines the sequence of the component items how they will appear in the BOM so this is second component
);

Hope this helps

Cheers
A

1 comment: