Wednesday, November 5, 2014

Item Cost with Material and Material Overhead Elements - Data Conversion

Dear Reader

In this post, we will see how we can convert the data for item costs (with the material and Material overhead elements)

Below is a sample script of the data which needs to be inserted into the interface tables

INSERT INTO cst_item_costs_interface
(
   inventory_item_id,
   organization_id,
   cost_type_id,
   inventory_asset_flag,
   item_cost,
   process_flag,
   transaction_type
)
values
(
   :inventory_item_id,
   :organization_id,
   :cost_type_id, --derive Pending cost type ID from cst_cost_types table
   1,
   :material_cost,
   1,
   'CREATE'
);

INSERT INTO cst_item_cst_dtls_interface
(
   inventory_item_id,
   organization_id,
   cost_type_id,
   level_type,
   operation_seq_num,
   item_cost,
   usage_rate_or_amount,
   cost_element_id,
   process_flag,
   transaction_type
)
values
(
   :inventory_item_id,
   :organization_id,
   :cost_type_id, --derive Pending cost type ID from cst_cost_types table
   1,
   1,
   :material_cost,
   :material_cost,
   1, --element ID = 1 for Material element of the cost
   1,
   'CREATE'
);

INSERT INTO cst_item_cst_dtls_interface
(
   inventory_item_id,
   organization_id,
   cost_type_id,
   level_type,
   operation_seq_num,
   resource_id,
   item_cost,
   usage_rate_or_amount,
   cost_element_id,
   process_flag,
   transaction_type
)
values
(
   :inventory_item_id,
   :organization_id,
   :cost_type_id, --derive Pending cost type ID from cst_cost_types table
   1,
   1,
   :resource_id,  --Overhead cost is always associated with a resource. Derive this from BOM_RESOURCES_V (maybe Freight or any custom resource you have)
   :material_ovhd_cost,
   :material_ovhd_cost,
   2, --element ID = 2 for Material Overhead element of the cost
   1,
   'CREATE'
);


Once the data is inserted into the table, launch the concurrent program "CSTPCIMP" to import this data into base tables

Once done, the data should appear in cst_item_costs and cst_item_cost_details table

Cheers
A