"某料號" 在 "某期間內" 的 "SO 已銷退數量"

在 Oracle ERP 中, 可利用 RCV_TRANSACTIONS, 來取得 ""某料號" 在 "某期間內" 的 "SO 已銷退數量"",

語法, 如下 :
 語法
SELECT RT.TRANSACTION_DATE
, RT.QUANTITY
FROM OE_ORDER_HEADERS_ALL OOH
, OE_ORDER_LINES_ALL OOL
, RCV_SHIPMENT_LINES RSL
, RCV_TRANSACTIONS RT
WHERE OOH.HEADER_ID = OOL.HEADER_ID
AND OOL.LINE_ID = RSL.OE_ORDER_LINE_ID
AND RSL.SHIPMENT_LINE_ID = RT.SHIPMENT_LINE_ID
AND OOL.ORG_ID = &ORG_ID
AND OOL.INVENTORY_ITEM_ID = &INVENTORY_ITEM_ID
AND OOL.FLOW_STATUS_CODE <> 'CANCELLED'
AND RSL.QUANTITY_RECEIVED <> 0
AND RT.TRANSACTION_DATE BETWEEN TO_DATE('&START_DATE','YYYYMMDD') and (TO_DATE('&END_DATE','YYYYMMDD')+ 1)
AND RT.TRANSACTION_TYPE = 'DELIVER'
AND RT.SOURCE_DOCUMENT_CODE = 'RMA';
Related Posts Plugin for WordPress, Blogger...