The role of the mtl_supply table

巴扎黑
Release: 2023-03-02 18:10:01
Original
1637 people have browsed it

The role of the mtl_supply table is a knowledge point during the original training. Now I have sorted it out and posted it
1. When the purchase requisition is created and approved, the changes in mtl_supply
a. When the purchase requisition is created, MTL_SUPPLY is Empty
b. After approval, a piece of data is generated in mtl_supply, supply_type_code=REQ
c. When the requisition is approved, the requisition header and requisition line are stored in MS.REQ_HEADER_ID, MS.REQ_LINE_ID, and at this time MS.SUPPLY_TYPE_CODE= REQ

2. When the PO is created and approved, the changes in mtl_supply
a. When the purchase requisition is converted to PO, MTL_SUPPLY is empty when it is not approved
b. When approved, the original supply_type_code=REQ in mtl_supply is replaced Change to supply_type_code=PO
c. Generally speaking, when a purchase requisition is automatically created as a purchase order, its supply_type_code=REQ is changed to supply_type_code=PO
d. When the approved po is canceled, supply_type_code=PO in MTL_SUPPLY Was changed to supply_type_code=REQ
e.--When calling the program that automatically opens purchase orders by purchase requisitions, if it is not approved, MS.PO_HEADER_ID,MS.PO_LINE_ID,
--MS.PO_RELEASE_ID, MS.PO_LINE_LOCATION_ID,MS. PO_DISTRIBUTION_ID is empty. If it has been approved
--MS.REQ_HEADER_ID, MS.REQ_LINE_ID is cleared, MS.SUPPLY_TYPE_CODE=PO, for modifying the quantity or adding a new purchase order line in the PO order
--but not approved, the original The approved purchase order line data remains unchanged, but the newly added lines are not entered into the table
--When the approved PO is canceled, supply_type_code=PO in MTL_SUPPLY is changed to supply_type_code=REQ,
--MS.REQ_HEADER_ID, MS.REQ_LINE_ID is filled in the header and line values ​​of the original purchase requisition. At the same time, 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, is cleared
3. When PO is received, the change of mtl_supply
a. When po is fully received, the original supply_type_code=PO in mtl_supply is changed to supply_type_code=RECEIVING
b. --When purchasing After the order is received, the supply_type_code=PO in MTL_SUPPLY is changed to supply_type_code=RECEIVING,
--At the same time, MS.SHIPMENT_HEADER_ID, MS.SHIPMENT_LINE_ID, MS.RCV_TRANSACTION_ID, the header information, line information, and
--rcv_transaction are stored in the shipment. transaction_id
4. When a certain line of PO is partially received, the change of mtl_supply
a. When a certain line of PO is partially received, the original supply_type_code=PO in the receiving line is changed to supply_type_code=RECEIVING
5. When the PO is inspected, mtl_supply has What changes
a. After the PO is inspected, the original supply_type_code=RECEIVING in the acceptance line remains unchanged
6. What changes will happen to mtl_supply after the PO part is put into the warehouse? What about after all the PO parts are put into the warehouse?
a. When the PO part is put into the warehouse, The record of this line in mtl_supply is deleted, and when all the records of the purchase order are put into the database, all the records of the purchase order are deleted
Involved tables

--Approved purchase requisitions
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'

--Approved purchase order
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)
--Receive

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
trmThe explanation is as follows
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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template