文档目的
本文档针对WIP模块业务功能和接口进行分析和研究,对采用并发请求方式和调用API方式分别进行介绍
内容
WIP模块常用标准表简介
WIP事物处理组成
WIP相关业务流程
WIP相关API研究事例
(十)参考文档(七)采购相关的一些知识
(一)WIP模块常用标准表简介
1.1 常用标准表
如下表中列出了与WIP导入相关的表和说明:
表名 |
说明 |
其他信息 |
||
BOM_STRUCTURES_B |
BOM头信息 |
|
|
|
BOM_COMPONENTS_B |
BOM组件信息 |
|
|
|
BOM_OPERATIONAL_ROUTINGS |
BOM工艺路线头信息 |
|
|
|
BOM_OPERATION_SEQUENCES |
BOM工艺路线生产信息 |
|
|
|
WIP_ENTITIES |
工单信息表 |
|
|
|
WIP_DISCRETE_JOBS |
离散工单信息表 |
|
|
|
WIP_REQUIREMENT_OPERATIONS |
任务领料需求发放表 |
|
|
|
WIP_OPERATIONS |
离散作业工序(操作)表 |
|
|
|
WIP_OPERATION_RESOURCES |
生产资源表 |
|
|
|
MTL_MATERIAL_TRANSACTIONS |
事物处理表 |
|
|
|
WIP_TRANSACTIONS |
WIP事物处理表 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1.2 接口表大体介绍
如下表中列出了与WIP导入相关的接口表和说明:
表名 |
说明 |
其他信息 |
||
mtl_transactions_interface |
事物处理接口表 |
|
|
|
mtl_serial_numbers_interface |
事物处理序列表 |
|
|
|
mtl_transaction_lots_interface |
事物处理批次表 |
|
|
|
cst_comp_snap_interface |
|
|
|
|
wip_move_txn_interface |
移动事物处理接口表 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3 说明
这里只列出了WIP相关的大多数常用表。还有一些不经常用到的没有涉及,具体可以参考oracle网站上的
(二)WIP事物处理组成
WIP事物处理主要包括:工单生成,工单更改,投料退料,工单移动,工单完工
2.1 WIP事物处理组成
工单创建:生成工单
工单更改:更改工单信息
投料退料:工单的投料以及退料
工单移动:工单的正向移动和逆向移动
投料退料:工单的完工事物处理
(三)WIP相关业务流程
3.1 创建BOM
路径:Bill Of Materials > Bills > Bills
后台数据
SELECT * FROM bom_structures_b l WHERE l.assembly_item_id = 24815;
SELECT *
FROM bom_components_b
WHERE bill_sequence_id IN
(SELECT bill_sequence_id
FROM bom_structures_b
WHERE assembly_item_id = 24815);
发料方式
Push 推式发料,必须手工通过界面做发料 需严格控制数量或者波动比较大的物料
Assembly Pull 拉式发料,装配件完工或报废时自动按标准消耗量触发 消耗比较稳定的物料
Operation Pull 拉式发料,工序移动至To Move时自动按标准消耗量触发 消耗比较稳定的物料
BOM_COMPONENTS_B.WIP_SUPPLY_TYPE存储发料方式
Value |
Meaning |
1 |
Push |
2 |
Assembly Pull |
3 |
Operation Pull |
4 |
Bulk |
5 |
Supplier |
6 |
Phantom |
7 |
Based on Bill |
3.2 定义ROUTING
路径:Bill Of Materials > Routings> Routings
Routings(工艺路线)最终解决的问题是生产过程中加工顺序、资源和用量的标准化。Routing是产品/半成品的生产步骤图,定义了生产特定物料所要经历的工序、加工部门(工作中心)、提前期、耗用的资源及其额定数量。
Routing头信息存储在表BOM_OPERATIONAL_ROUTINGS中,Routing的Operations信息存储在BOM_OPERATION_SEQUENCES表中,两个表通过字段ROUTING_SEQUENCE_ID字段关联
SELECT * FROM BOM_OPERATIONAL_ROUTINGS WHERE ASSEMBLY_ITEM_ID = 24815;
SELECT *
FROM bom_operation_sequences
WHERE routing_sequence_id IN
(SELECT routing_sequence_id
FROM bom_operational_routings
WHERE assembly_item_id = 24815);
3.2 定义离散工单
路径:WIP > Discrete > DiscreteJobs
Discrete,离散式,一种制造方法,用于装配件的分组或成批制造。制定标准离散任务,输入核心内容:任务名称(工单号)、生产类型、装配件、工单类型、生产数量、开工时间或完工时间。
这里在Discrete Job里定义job,保存,并release这个job。
工序
组件
涉及到几张表WIP_ENTITIES,WIP_DISCRETE_JOBS,WIP_REQUIREMENT_OPERATIONS和,这几张表都是通过WIP_ENTITY_ID相互关联.
<<WIP_ENTITIES>>
WIP_ENTITIES stores information about jobs,repetitive assemblies, and flow schedules. Each row includes a unique entityname, the entity type, and the assembly being built. Oracle Work in Process uses this information to controlproduction activities and to ensure that entities with duplicate names are notcreated.
Key Fields:
WIP_ENTITY_ID:Job or schedule Identifier
ORGANIZATION_ID:Organization Identifier
WIP_ENTITY_NAME:WIP job or repetitiveassembly name or flow schedule reference code
ENTITY_TYPE:WIP entity type code
1 |
Discrete job |
2 |
Repetitive assembly |
3 |
Closed discrete job |
4 |
Flow schedule |
PRIMARY_ITEM_ID:Assembly Item Item
<<WIP_DISCRETE_JOBS>>
WIP_DISCRETE_JOBS stores discrete jobinformation. Each row represents a discrete job, and contains information aboutthe assembly being built, the revision of the assembly, the job quantity, thestatus of the job, the material control method, accounting information, and jobschedule dates. Oracle Work in Process uses this information to controldiscrete production.
Key Fields:
WIP_ENTITY_ID:Job or schedule Identifier
ORGANIZATION_ID:Organization Identifier
PRIMARY_ITEM_ID:Assembly Item Item
STATUS_TYPE :Status of job
可以通过下边的SQL查得code的意义
SELECT lookup_code,meaning FROMFND_LOOKUP_VALUES
where LANGUAGE = 'US' AND Upper(lookup_type) LIKE Upper('WIP_JOB_STATUS')
Value |
Meaning |
7 |
Cancelled |
8 |
Pending Bill Load |
9 |
Failed Bill Load |
10 |
Pending Routing Load |
11 |
Failed Routing Load |
12 |
Closed |
13 |
Pending - Mass Loaded |
14 |
Pending Close |
15 |
Failed Close |
1 |
Unreleased |
3 |
Released |
4 |
Complete |
5 |
Complete - No Charges |
6 |
On Hold |
JOB_TYPE :Type of discrete job
Value |
Meaning |
1 |
Standard |
3 |
Non-standard |
WIP_SUPPLY_TYPE :Method of material consumption within WIP
Value |
Meaning |
1 |
Push |
2 |
Assembly Pull |
3 |
Operation Pull |
4 |
Bulk |
5 |
Supplier |
6 |
Phantom |
7 |
Based on Bill |
START_QUANTITY:Job start quantity
QUANTITY_COMPLETED:Current job quantity completed
COMMON_BOM_SEQUENCE_ID:-->BOM_COMPONENTS_B.BILL_SEQUENCE_ID
COMMON_ROUTING_SEQUENCE_ID:-->BOM_OPERATIONAL_ROUTINGS.ROUTING_SEQUENCE_ID
<<WIP_REQUIREMENT_OPERATIONS>>
WIP_REQUIREMENT_OPERATIONS storesinformation about the material requirements of jobs and schedules. Each rowrepresents a material requirement and contains information about the componentitem, its usage quantities, the using department, requirement date, and thematerial control method. Oracle Work in Process uses this information to trackthe material usage of jobs and schedules.
Key Fields:
WIP_ENTITY_ID:Job or schedule Identifier
ORGANIZATION_ID:Organization Identifier
INVENTORY_ITEM_ID:Component Item Id
COMPONENT_SEQUENCE_ID:-->BOM_COMPONENTS_B.COMPONENT_SEQUENCE_ID
WIP_SUPPLY_TYPE :Method of material consumption within WIP
Value |
Meaning |
1 |
Push |
2 |
Assembly Pull |
3 |
Operation Pull |
4 |
Bulk |
5 |
Supplier |
6 |
Phantom |
7 |
Based on Bill |
REQUIRED_QUANTITY:Component quantityrequired
QUANTITY_ISSUED:Component quantity issued
SUPPLY_SUBINVENTORY:Subinventory used tosupply component to WIP
SUPPLY_LOCATOR_ID:Locator used to supplycomponent to WIP
SEGMENT1:Component Item segment
QUANTITY_ALLOCATED:Quantity allocated
QUANTITY_BACKORDERED:Quantity backordered
SELECT * FROM WIP_ENTITIES WHERE WIP_ENTITY_NAME = 'J2010113';
WIP_ENTITIES.PRIMARY_ITEM_ID= 24815与BOM关联
SELECT *
FROM wip_discrete_jobs
WHERE wip_entity_id =
(SELECT wip_entity_id
FROM wip_entities
WHERE wip_entity_name = 'J2010113');
SELECT *
FROM wip_requirement_operations
WHERE wip_entity_id =
(SELECT wip_entity_id
FROM wip_entities
WHERE wip_entity_name = 'J2010113');
3.2 发料
接下来我们就要从库存中给工单发货,这里有两种方法发料到工单
方法1:WIP > Material Transactions > WIP Material Transactions
这种方式比较简单,直接指定库存并发料
方法2:WIP > Discrete > Component Pick Release > Component Pick Releas(Form) / (SRS)
当BOM的组件很多,使用方法一发料的话,一个个指定库存会很麻烦,Oracle EBS提供了Pick Release的方式来发料,这样用户只要指定合适的Picking Rule,那么系统会自动帮你挑库。
系统会产生一个Move Order(Move Order Type:Manufacturing Pick),这一步实际上非常类似于订单的Pick Release。
接下来去Transact Move Order界面,Transact这个Move Order就完成发料动作了。
注意使用方式一发料的话,后台是不会产生Move Order的,只有方式二才会有Move Order产生。
3.2 事物处理
这个时候可以去Material Transaction form里查看,组件已经从库存中扣减,Transaction Type=WIP Issue(Transaction_Type_id:35,WIPcomponent issue)
这个时候MTL_MATERIAL_TRANSACTIONS表中几个JOB相关的字段
MMT.Transaction_Type_id:35
MMT.TRANSACTION_ACTION_ID:1
MMT.TRANSACTION_SOURCE_TYPE_ID:5
MMT.TRANSACTION_SOURCE_ID-->WIP_DISCRETE_JOBS.WIP_ENTITY_ID
MMT.TRX_SOURCE_LINE_ID-->WIP_REQUIREMENT_OPERATIONS.OPERATION_SEQ_NUM
MMT.SOURCE_LINE_ID -->MTL_TXN_REQUEST_LINES.LINE_ID
MMT.Move_Order_line_ID-->MTL_TXN_REQUEST_LINES.LINE_ID
3.2 退料
物料发到工单后,有可能因为各种原因要把料退回到仓库,可以使用WIP Return
路径:WIP > Material Transactions > WIPMaterial Transactions,Type选择 WIP Return
查看Material Transaction,就可以看到一条WIP Return的Transaction发生了,并且组件库存数量又恢复到发料前的数量。
Transaction_TYPE_ID:43(WIP Component Return)
ps:不管是上边所说的WIP Issue还是WIP Return,在WIP_TRANSACTIONS表中是没有数据产生的。
WIP_TRANSACTIONS stores information aboutWIP resource transactions.Each row represents a single resource transaction andincludes a uniquetransaction Identifier, a transaction date, the job orrepetitiveschedule charged, the WIP operation and resource charges, andthenumber of units of measure applied. Oracle Work in Process uses thisinformation to track resourcecharges and to calculate the values stored in WIP_TRANSACTION_ACCOUNTS.
(四)WIP相关API研究事例
相关接口字段说明参见参考例子里的说明
3.1 工单创建
PROCEDUREnew_work_order(p_wip_entity_id NUMBER,
p_organization_idNUMBER,
x_error_status OUTVARCHAR2,
x_error_message OUTVARCHAR2) IS
l_iface_rec wip.wip_job_schedule_interface%ROWTYPE; --工单任务接口表
CURSOR c_wdj IS
SELECT *
FROM cux_wip_discrete_jobs_temp cwdj
WHERE cwdj.wip_entity_id =p_wip_entity_id
AND cwdj.organization_id =p_organization_id;
BEGIN
--
l_iface_rec.last_update_date := SYSDATE;
l_iface_rec.last_updated_by := fnd_global.user_id;
l_iface_rec.creation_date := SYSDATE;
l_iface_rec.created_by := fnd_global.user_id;
--
l_iface_rec.group_id := wip.wip_job_schedule_interface_s.nextval;
/*================================================
WIP_LOAD_TYPE MFG_LOOKUPS
------------ --------------
1 Create Standard Job
2 Create Repetitive Schedule
3 Update Discrete Job
4 Create Non–standard Job
================================================*/
FOR rec_wdj IN c_wdj LOOP
g_status_type := rec_wdj.status_type;
--根据业务逻辑判断标准非标准工单
IF rec_wdj.job_type = 1 THEN
l_iface_rec.load_type := 1; --1标准
ELSE
l_iface_rec.load_type := 4; --非标准
END IF;
l_iface_rec.allow_explosion := 'Y';
l_iface_rec.process_phase := '2';
l_iface_rec.process_status := '1';
l_iface_rec.status_type := '3'/*rec_wdj.status_type*/
; --已发放
l_iface_rec.job_name := rec_wdj.job_num;