首頁  >  文章  >  後端開發  >  mtl_supply表的作用

mtl_supply表的作用

巴扎黑
巴扎黑原創
2016-12-01 11:36:491584瀏覽

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=POly_type_code被更改為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_DATE, MS.NEED. ,
--MS.EXPECTED_DELIVERY_DATE,被清空
3、當PO接收後,mtl_supply的變化
a.當po完全接收後,mtl_supply中原有的supply_type_code=PO被更改為supply_type_code=RECEIVING當採購單完成接收後,MTL_SUPPLY中supply_type_code=PO被更改為supply_type_code=RECEIVING,
--同時MS.SHIPMENT_HEADER_ID,MS.SHIPMENT_LINE_ID,MS.RCV_TRANSACTION_ID ,MS.SHIPMENT_LINE_ID,MS.RCV_TRANSACTION_ID ,hshipment的頭資訊,並存入行資訊,cid最小的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.sfromment1 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,300and
 
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
ttt上的解釋如下22. .
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 ordersuppyation 3) Shippments 45)alpmentsalation 45) Ination 4pments 455)s.

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 init. If ansthis con
ownership of the items in init. If ansthis con isf.
.
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.Lowd.al..S controated s​​oarei form​​be reappion sw. 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 approved.
One record of PO type will be created per PO ” shipment line will be created when a
shipment is created.
.
Records in MTL_SUPPLY will be recreated whenever there are
諸如退回收貨、退貨供應商或
取消採購訂單等交易。
.
每次將文件
狀態變更為未核准時,MTL_SUPPLY 中的記錄都會被刪除。例如,如果您更改線路和出貨數量,則採購訂單將需要批准。 
如果重新批准此類 PO,則將重新建立
新數量的 PO 供應。

每次自動建立申請時,REQ 供應記錄的供應類型代碼將變更為 PO。同樣,當完全收到 PO 時,供應類型代碼
從 PO 更改為 RECEIVING。如果採購訂單
部分收到,則將為收到的數量建立供應類型代碼為
RECEIVING 的供應。當收據
交付時,接收供應將被刪除。 SHIPMENT 供應的工作方式與 PO 供應相同。

MTL_SUPPLY 上有一個名為 MTL_SUPPLY_T 的資料庫觸發器。
此觸發器在插入、更新或刪除
MTL_SUPPLY 中的記錄時觸發。它將記錄插入 MRP_RELIEF_INTERFACE 表中

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn