wip.wip_job_schedule_interface

--interface update wip requirement
DECLARE
  l_schedule_iface_rec wip.wip_job_schedule_interface%ROWTYPE; --工单任务接口表
  l_dtl_iface_rec      wip.wip_job_dtls_interface%ROWTYPE;     --工单工序组件接口表
  l_user_id           NUMBER := 1341;
BEGIN
  --工单任务接口表
  SELECT wip.wip_job_schedule_interface_s.NEXTVAL
    INTO l_schedule_iface_rec.group_id
    FROM dual;
  --
  SELECT wip.wip_job_schedule_interface_s.NEXTVAL
    INTO l_schedule_iface_rec.header_id
    FROM dual;
    --
  l_schedule_iface_rec.last_update_date  := SYSDATE;
  l_schedule_iface_rec.last_updated_by   := l_user_id;
  l_schedule_iface_rec.creation_date     := SYSDATE;
  l_schedule_iface_rec.created_by        := l_user_id;
  l_schedule_iface_rec.last_update_login := -1;
  --
  /*------------------------------------------------
  If set to N, must provide requirements manually
  any values other than N or n are assumed to be Y
   -------------------------------------------------*/
  --l_schedule_iface_rec.allow_explosion    := 'Y'
  
  l_schedule_iface_rec.load_type            := 3;  --Update standard or non-standard Discrete Job
  /*------------------------------------------------
    WIP_LOAD_TYPE       MFG_LOOKUPS
        1                Create Standard Job
        2                Create Repetitive Schedule
        3                Update Discrete Job
        4                Create Non–standard Job
    -----------------------------------------------*/
  l_schedule_iface_rec.process_phase        := 2;  --Validation
  
  l_schedule_iface_rec.process_status       := 1;  --Pending
  --
  l_schedule_iface_rec.wip_entity_id        := 33049; --12407
  l_schedule_iface_rec.organization_id      := 104;
  
  --l_schedule_iface_rec.start_quantity       := 10;
  l_schedule_iface_rec.completion_subinventory := 'BJC01';
  l_schedule_iface_rec.completion_locator_id := 7;
  --
  INSERT INTO wip.wip_job_schedule_interface VALUES l_schedule_iface_rec;
  --工单工序组件接口表
  l_dtl_iface_rec.parent_header_id     := l_schedule_iface_rec.header_id;
  l_dtl_iface_rec.group_id             := l_schedule_iface_rec.group_id;
  --
  l_dtl_iface_rec.wip_entity_id        := l_schedule_iface_rec.wip_entity_id; --12407
  l_dtl_iface_rec.organization_id      := 104;
  l_dtl_iface_rec.operation_seq_num    := 10;
  l_dtl_iface_rec.inventory_item_id_old := 32621; --'C699010049' 组件ID
  --l_dtl_iface_rec.inventory_item_id_new := 32621;
  l_dtl_iface_rec.wip_supply_type       := 1;      --供应类型  2.装配拉式 1.推式
  /*-----------------------------------
     WIP_SUPPLY         MFG_LOOKUPS
          1 Push
          2 Assembly Pull
          3 Operation Pull
          4 Bulk
          5 Supplier
          6 Phantom
          7 Based on Bill
    -----------------------------------*/
  l_dtl_iface_rec.supply_subinventory  := 'DQC01'; --供应子库
  l_dtl_iface_rec.supply_locator_id    := 6;       --供应货位
  l_dtl_iface_rec.comments             := 'test for wip interface'; --备注
  --
  l_dtl_iface_rec.load_type            := 2;  --
  /*-------------------------------------
  1. for loading a resource
  2. for loading a component
  3. for loading an operation
  4. for loading multiple resource usage
  --------------------------------------*/
  l_dtl_iface_rec.substitution_type    := 1;  --3:chage 1:delete 2:add
  
  l_dtl_iface_rec.process_phase        := 2;  --Validation
  l_dtl_iface_rec.process_status       := 1;  --Pending
  --
  l_dtl_iface_rec.last_update_date  := SYSDATE;
  l_dtl_iface_rec.last_updated_by   := l_user_id;
  l_dtl_iface_rec.creation_date     := SYSDATE;
  l_dtl_iface_rec.created_by        := l_user_id;
  l_dtl_iface_rec.last_update_login := -1;
  --
  INSERT INTO wip.wip_job_dtls_interface VALUES l_dtl_iface_rec;
  dbms_output.put_line(l_schedule_iface_rec.group_id);
END;

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
优化sql:SELECT we.organization_id ,we.wip_entity_id ,case when wl.line_id is null then we.wip_entity_name else '' end wip_entity_name ,we.primary_item_id ,mtt.transaction_type_name ,mmt.transaction_date ,bd.department_code ,mmt.inventory_item_id ,mmt.subinventory_code ,mta.reference_account ,br.resource_code ,lu2.meaning as line_type_name ,mta.base_transaction_value ,mta.cost_element_id ,flv.meaning as cost_element ,wdj.class_code job_type_code ,ml.meaning job_type_name FROM (select * from gerp.mtl_material_transactions where substr(transaction_date,1,7) >= '2023-06' and transaction_source_type_id = 5) mmt inner join gerp.wip_entities we on mmt.organization_id = we.organization_id inner join gerp.mtl_transaction_accounts mta on mta.transaction_source_id = we.wip_entity_id and mta.transaction_id = mmt.transaction_id and mta.transaction_source_type_id = 5 inner join gerp.mtl_transaction_types mtt on mtt.transaction_type_id = mmt.transaction_type_id inner join mfg_lookups lu2 on lu2.lookup_code = mta.accounting_line_type and lu2.lookup_type = 'CST_ACCOUNTING_LINE_TYPE' inner join gerp.mtl_system_items_b msi on msi.inventory_item_id = mmt.inventory_item_id and msi.organization_id = mta.organization_id left join gerp.bom_departments bd on bd.department_id = mmt.department_id left join gerp.bom_resources br on br.resource_id = mta.resource_id left join gerp.wip_lines wl on wl.line_id = mmt.repetitive_line_id left join gerp.wip_discrete_jobs wdj on wdj.wip_entity_id = mta.transaction_source_id left join gerp.fnd_lookup_values_vl flv on cast(mta.cost_element_id as string) = flv.lookup_code and flv.lookup_type = 'CST_COST_CODE_TYPE' left join mfg_lookups ml on ml.lookup_code = wdj.job_type and ml.lookup_type = 'WIP_DISCRETE_JOB' 。其中mmt,we,mta,msi,wdj数据量很大
06-10

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值