|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服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;
|
|