通过接口导入item cost

http://www.myhpf.co.uk/banner.asp?friend=295311 add-on firefox

declare
user_id                 number := fnd_global.user_id;
login_id                number := fnd_global.login_id; 
begin
INSERT INTO  CST_ITEM_CST_DTLS_INTERFACE
(
inventory_item_id ,
      organization_id,
      cost_type_id ,
   level_type,
   usage_rate_or_amount,
   basis_type,
   basis_factor,
   creation_date,
   created_by,
   last_update_date,
   last_updated_by,
   last_update_login,
   item_cost,
   cost_element_id,
   rollup_source_type,
   net_yield_or_shrinkage_factor,
   resource_id, 
   ---
   inventory_asset_flag,
   lot_size,
   shrinkage_rate,
   based_on_rollup_flag,
   PROCESS_FLAG,
   transaction_type   

   SELECT CIC.inventory_item_id ,
      272,
      3 ,
   1,
   CIC.usage_rate_or_amount,
   1,
   1,
   sysdate,
   user_id,
   sysdate,
   user_id,
   login_id,
   CIC.item_cost,
   1,
   CIC.rollup_source_type,
   CIC.net_yield_or_shrinkage_factor,
   977, 
   ---
   CICD.inventory_asset_flag,
   1,
   CICD.shrinkage_rate,
   CICD.based_on_rollup_flag,
   1,
   'CREATE'
FROM bom.CST_ITEM_COSTS CICd,
     bom.CST_ITEM_COST_DETAILS CIC
WHERE  CICD.ORGANIZATION_ID=CIC.ORGANIZATION_ID
AND CICD.INVENTORY_ITEM_ID=CIC.INVENTORY_ITEM_ID
AND CICD.COST_TYPE_ID=CIC.COST_TYPE_ID
AND CIC.ORGANIZATION_ID=81
AND CIC.COST_TYPE_ID=1
AND CIC.INVENTORY_ITEM_ID in
          ( select INVENTORY_ITEM_ID from
              mtl_system_items_b msi
        where substr(msi.SEGMENT1,1,1) in('1','2','3','4')
        and organization_id =272)
and CIC.INVENTORY_ITEM_ID in ( select moq.INVENTORY_ITEM_ID from
            APPS.MTL_ONHAND_QUANTITIES MOQ) ;
end;

http://www.myhpf.co.uk/banner.asp?friend=295311

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9880886/viewspace-444216/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/9880886/viewspace-444216/

你可能感兴趣的:(通过接口导入item cost)