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不单是聊天机器人,还能进行撰写邮件、视频脚本、文案、翻译、代码等任务。

相关专题

更多
C++ 设计模式与软件架构
C++ 设计模式与软件架构

本专题深入讲解 C++ 中的常见设计模式与架构优化,包括单例模式、工厂模式、观察者模式、策略模式、命令模式等,结合实际案例展示如何在 C++ 项目中应用这些模式提升代码可维护性与扩展性。通过案例分析,帮助开发者掌握 如何运用设计模式构建高质量的软件架构,提升系统的灵活性与可扩展性。

8

2026.01.30

c++ 字符串格式化
c++ 字符串格式化

本专题整合了c++字符串格式化用法、输出技巧、实践等等内容,阅读专题下面的文章了解更多详细内容。

8

2026.01.30

java 字符串格式化
java 字符串格式化

本专题整合了java如何进行字符串格式化相关教程、使用解析、方法详解等等内容。阅读专题下面的文章了解更多详细教程。

6

2026.01.30

python 字符串格式化
python 字符串格式化

本专题整合了python字符串格式化教程、实践、方法、进阶等等相关内容,阅读专题下面的文章了解更多详细操作。

1

2026.01.30

java入门学习合集
java入门学习合集

本专题整合了java入门学习指南、初学者项目实战、入门到精通等等内容,阅读专题下面的文章了解更多详细学习方法。

20

2026.01.29

java配置环境变量教程合集
java配置环境变量教程合集

本专题整合了java配置环境变量设置、步骤、安装jdk、避免冲突等等相关内容,阅读专题下面的文章了解更多详细操作。

17

2026.01.29

java成品学习网站推荐大全
java成品学习网站推荐大全

本专题整合了java成品网站、在线成品网站源码、源码入口等等相关内容,阅读专题下面的文章了解更多详细推荐内容。

18

2026.01.29

Java字符串处理使用教程合集
Java字符串处理使用教程合集

本专题整合了Java字符串截取、处理、使用、实战等等教程内容,阅读专题下面的文章了解详细操作教程。

3

2026.01.29

Java空对象相关教程合集
Java空对象相关教程合集

本专题整合了Java空对象相关教程,阅读专题下面的文章了解更多详细内容。

6

2026.01.29

热门下载

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

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
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号