0

0

mtl_supply表的作用

巴扎黑

巴扎黑

发布时间:2016-12-01 11:36:49

|

1959人浏览过

|

来源于php中文网

原创

mtl_supply表的作用,是当初培训时的一个知识点,现在我整理了一下,贴出来
1、当请购单创建、审批后,mtl_supply的变化
a.当创建完请购单,mtl_supply为空
b.当审批后,mtl_supply中产生一条数据,supply_type_code=req
c.当请购单审批后,请购头与请购行存入ms.req_header_id, ms.req_line_id,此时ms.supply_type_code=req

2、当po创建、审批后,mtl_supply的变化
a.当请购单转换成po后,在未审批时,mtl_supply为空
b.当审批后,mtl_supply中原有的supply_type_code=req被更改为supply_type_code=po
c.一般而言,当请购单自动创建为采购单时,其supply_type_code=req被更改为supply_type_code=po
d.当审批后的po做取消时,mtl_supply中supply_type_code=po被更改为supply_type_code=req
e.--当调用由请购单自动开采购单的程序时,如果未审批,ms.po_header_id ,ms.po_line_id,
--ms.po_release_id, ms.po_line_location_id ,ms.po_distribution_id,为空,如果已审批
--ms.req_header_id, ms.req_line_id被清空,ms.supply_type_code=po,对于在po单中修改数量或添加新的采购订单行
--而未审批,原有已审批的采购订单行数据不变,但新添加的行未录入该表
--当审批后的po做取消时,mtl_supply中supply_type_code=po被更改为supply_type_code=req,
--ms.req_header_id, ms.req_line_id被填入原有的请购单的头和行值,同时, ms.po_header_id,ms.po_line_id,
--ms.po_release_id, ms.po_line_location_id,ms.po_distribution_id, ms.need_by_date,ms.receipt_date,
--ms.expected_delivery_date,被清空
3、当po接收后,mtl_supply的变化
a.当po完全接收后,mtl_supply中原有的supply_type_code=po被更改为supply_type_code=receiving
b. --当采购单做完接收后,mtl_supply中supply_type_code=po被更改为supply_type_code=receiving,
--同时 ms.shipment_header_id,ms.shipment_line_id,ms.rcv_transaction_id ,存入shipment的头信息,行信息,及
--rcv_transaction的transaction_id
4、当po某行部分接收后,mtl_supply的变化
a.当po某行部分接收后,接受行中原有的supply_type_code=po被更改为supply_type_code=receiving
5、当po检验后,mtl_supply有什么变化
a.当po检验后,接受行中原有的supply_type_code=receiving不变
6、当po部分入库后,mtl_supply有什么变化;全部入库后呢
a.当po部分入库后,mtl_supply中该行记录被删除,而全部入库则该采购单所有行记录被删除
涉及的表

--已审批的请购单
select prh.requisition_header_id, prl.requisition_line_id,prh.segment1
from po_requisition_headers_all prh, po_requisition_lines_all prl
where prh.requisition_header_id = prl.requisition_header_id
and prh.requisition_header_id = 662
and prh.authorization_status= 'approved'

--已审批的采购单 
select ph.po_header_id,pl.po_line_id,ph.segment1,ph.*
from po_lines_all pl,po_headers_all ph
where pl.po_header_id=ph.po_header_id
/* and ph.po_header_id = 41526*/
and ph.authorization_status= 'approved'
and nvl(ph.cancel_flag,'n')'y'
and ph.creation_date>=trunc(sysdate)
--接收

select *
from rcv_shipment_headers rsh,
rcv_shipment_lines rsl
where rsh.shipment_header_id=rsl.shipment_header_id
and rsh.creation_date>=trunc(sysdate)
and rsh.receipt_num='185631'

select *
from rcv_transactions rt
wherert.transaction_id=870339
trm上的解释如下
mtl_supply stores incoming supply information for an organization.
this table forms one of the sources in inventory's demand-supply form.
there are four different types of supply captured in this table:

1) approved requisitions
2) approved purchase orders
3) shipments from suppliers
4) intransit shipments from another organization

types 3 and 4 could be distinguished by the presence of data in the
intransit_owning_organization_id column, which identifies the
ownership of the items in intransit. if this column is null then it
means that the shipment supply is from a vendor.
.
this information is used by the available to promise routine to derive
the atp information as appropiate. quantities of items in intransit
are also kept track of in the table.
.
records in mtl_supply are created every time you approve a requisition
or a po or create an intransit shipment. one record of req type will
be created for one requisition line when the requisition is approved.
one record of po type will be created per po distribution when a po is
approved and one record per shipment line will be created when a
shipment is created.
.
records in mtl_supply will be recreated whenever there are
transactions such as return to receiving, return to vendor or
cancellation of purchase orders.
.
records in mtl_supply are deleted every time you change the document
status to not approved. for example, a po would require approval if
you change the line and shipment quantity. 
if such a po is re-approved then the po supply will be recreated for
the new quantity.
.
the supply type code of a req supply record is changed to po every
time a requisition is autocreated. similarly the supply type code is
changed from po to receiving when a po is fully received. if a po is
partially received then a supply with the supply type code of
receiving will be created for the quantity received. when the receipt
is delivered the receiving supply is deleted. shipment supply works in
the same way as po supply.
.
there is a database trigger on mtl_supply with the name mtl_supply_t.
this trigger fires on insert, update or deletion of records in
mtl_supply. it inserts records into mrp_relief_interface table

热门AI工具

更多
DeepSeek
DeepSeek

幻方量化公司旗下的开源大模型平台

豆包大模型
豆包大模型

字节跳动自主研发的一系列大型语言模型

通义千问
通义千问

阿里巴巴推出的全能AI助手

腾讯元宝
腾讯元宝

腾讯混元平台推出的AI助手

文心一言
文心一言

文心一言是百度开发的AI聊天机器人,通过对话可以生成各种形式的内容。

讯飞写作
讯飞写作

基于讯飞星火大模型的AI写作工具,可以快速生成新闻稿件、品宣文案、工作总结、心得体会等各种文文稿

即梦AI
即梦AI

一站式AI创作平台,免费AI图片和视频生成。

ChatGPT
ChatGPT

最最强大的AI聊天机器人程序,ChatGPT不单是聊天机器人,还能进行撰写邮件、视频脚本、文案、翻译、代码等任务。

相关专题

更多
go语言 注释编码
go语言 注释编码

本专题整合了go语言注释、注释规范等等内容,阅读专题下面的文章了解更多详细内容。

2

2026.01.31

go语言 math包
go语言 math包

本专题整合了go语言math包相关内容,阅读专题下面的文章了解更多详细内容。

1

2026.01.31

go语言输入函数
go语言输入函数

本专题整合了go语言输入相关教程内容,阅读专题下面的文章了解更多详细内容。

1

2026.01.31

golang 循环遍历
golang 循环遍历

本专题整合了golang循环遍历相关教程,阅读专题下面的文章了解更多详细内容。

0

2026.01.31

Golang人工智能合集
Golang人工智能合集

本专题整合了Golang人工智能相关内容,阅读专题下面的文章了解更多详细内容。

1

2026.01.31

2026赚钱平台入口大全
2026赚钱平台入口大全

2026年最新赚钱平台入口汇总,涵盖任务众包、内容创作、电商运营、技能变现等多类正规渠道,助你轻松开启副业增收之路。阅读专题下面的文章了解更多详细内容。

76

2026.01.31

高干文在线阅读网站大全
高干文在线阅读网站大全

汇集热门1v1高干文免费阅读资源,涵盖都市言情、京味大院、军旅高干等经典题材,情节紧凑、人物鲜明。阅读专题下面的文章了解更多详细内容。

73

2026.01.31

无需付费的漫画app大全
无需付费的漫画app大全

想找真正免费又无套路的漫画App?本合集精选多款永久免费、资源丰富、无广告干扰的优质漫画应用,涵盖国漫、日漫、韩漫及经典老番,满足各类阅读需求。阅读专题下面的文章了解更多详细内容。

67

2026.01.31

漫画免费在线观看地址大全
漫画免费在线观看地址大全

想找免费又资源丰富的漫画网站?本合集精选2025-2026年热门平台,涵盖国漫、日漫、韩漫等多类型作品,支持高清流畅阅读与离线缓存。阅读专题下面的文章了解更多详细内容。

19

2026.01.31

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
php-src源码分析探索
php-src源码分析探索

共6课时 | 0.5万人学习

进程与SOCKET
进程与SOCKET

共6课时 | 0.4万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号