壹佰网|ERP100 - 企业信息化知识门户

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1247|回复: 3

[二次开发] 非標工單接口導入貼sql在线等解決辦法

[复制链接]
发表于 2012/11/15 20:22:25 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622  。

您需要 登录 才可以下载或查看,没有帐号?注册

x
提交批量導入工單請求沒有報錯 ,提示狀態是完成
   但是我進去查詢工單的時候只有頭進去了下面的組件信息沒有導入進去,不知道是什麼原因,在綫等解決

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;
  l_user_id        NUMBER := 0;
  l_cur_mfg_org_id NUMBER := 82;
  
Begin
  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;
   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;
  
  --工单任务接口表
  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.Load_Type       := 4; --工單類型
  L_Schedule_Iface_Rec.Allow_Explosion := 'Y'; --自定義組件和N 需要自定义组件需求和工序,写入wip_job_dtls_interface Y 自动用标准BOM和Routing展开
  L_Schedule_Iface_Rec.Process_Phase         := '2';
  L_Schedule_Iface_Rec.Process_Status        := '1';
  L_Schedule_Iface_Rec.Status_Type           := '1';
  L_Schedule_Iface_Rec.Job_Name              := 'TEST_JOB_0011';
  L_Schedule_Iface_Rec.Organization_Id       := 82;
  L_Schedule_Iface_Rec.Class_Code            := 'A2_工單';
  L_Schedule_Iface_Rec.Primary_Item_Id       := 7001;
  L_Schedule_Iface_Rec.Start_Quantity        := 123456;
  
  L_Schedule_Iface_Rec.Scheduling_Method     := '1';
  L_Schedule_Iface_Rec.First_Unit_Start_Date := Sysdate;
  L_Schedule_Iface_Rec.first_unit_completion_date:= Sysdate;
  L_Schedule_Iface_Rec.Last_Unit_Start_Date:= Sysdate;
   L_Schedule_Iface_Rec.last_unit_completion_date:= Sysdate;
  L_Schedule_Iface_Rec.Source_Code    := 'Test Only';
  L_Schedule_Iface_Rec.Source_Line_Id := 987654321;
  --
  /*------------------------------------------------
  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 := '121103';
  -- 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       := 82;
  L_Dtl_Iface_Rec.completion_Date        := Sysdate;
  L_Dtl_Iface_Rec.Start_Date            := Sysdate;
  L_Dtl_Iface_Rec.Operation_Seq_Num     := 1;
  L_Dtl_Iface_Rec.Inventory_Item_Id_Old := 13; --'C699010049' 组件ID
  l_dtl_iface_rec.inventory_item_id_new := 13;
  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 := '121103'; --供应子库
  -- l_dtl_iface_rec.supply_locator_id    := 6;       --供应货位
  L_Dtl_Iface_Rec.Comments := 'test for wip interface'; --备注
  L_Dtl_Iface_Rec.MINIMUM_TRANSFER_QUANTITY:=20000;--用糧
L_Dtl_Iface_Rec.count_point_type:=1; --   NUMBER 计数点(1.是--自动收费,2.否)
L_Dtl_Iface_Rec.BACKFLUSH_FLAG   :=1;--NUMBER 倒冲库存标识(1.是,2.否)
L_Dtl_Iface_Rec.wip_supply_type:=1;--车间供应类型(1.推式2.装配拉式3.操作拉式4.大量5.供应商6.虚拟)
  L_Dtl_Iface_Rec.quantity_per_assembly:=200;--单位需求量
L_Dtl_Iface_Rec.Load_Type := 4; --
  
  
  /*-------------------------------------
  增作業時, 下列欄位為必要欄位:
                   operation_seq_num, department_id, first_unit_start_date, first_unit_completion_date,
                     last_unit_start_date, last_unit_completion_date, minimum_transfer_quantity,
                     count_point_type 及 backflush_flag. (INTERFACE=2008)
    新增原物料需求時, 需要 inventory_item_id、wip_supply_type 及 quantity_per_assembly.
  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 := 2; --3:chage 1:delete 2:add
L_Dtl_Iface_Rec.Process_Phase  := 2; --Validation
L_Dtl_Iface_Rec.Process_Status := 2; --Pending--1
  --
  --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;

发表于 2012/11/16 09:53:03 | 显示全部楼层
确认下 L_Dtl_Iface_Rec.Wip_Entity_Id  在 wip_discrete_jobs 中有没有
发表于 2012/11/16 11:12:41 | 显示全部楼层
问题解决了么?楼主,解决说一声哈
发表于 2013/9/3 16:06:35 | 显示全部楼层
经常看到问题看不到答案,大家一起重复劳动
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|壹佰网 ERP100 ( 京ICP备19053597号-2 )

Copyright © 2005-2012 北京海之大网络技术有限责任公司 服务器托管由互联互通
手机:13911575376
网站技术点击发送消息给对方83569622   广告&合作 点击发送消息给对方27675401   点击发送消息给对方634043306   咨询及人才点击发送消息给对方138011526

GMT+8, 2025/11/29 05:38 , Processed in 0.012586 second(s), 14 queries , File On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表