DBA Data[Home] [Help]

VIEW: APPS.OP_TRAN_TMP_V

Source

View Text - Preformatted

SELECT t.session_id, t.item_id, t.whse_code, max(t.line_id) line_id, lot_no, sublot_no, t.lot_id, lot_created, expire_date, qc_grade, t.location, i.lot_status, nettable_ind, shipping_ind, rejected_ind, sum(t.loct_onhand) onhand_qty, sum(t.loct_onhand2) onhand_qty2, sum(-commit_qty) commit_qty, sum(-commit_qty2) commit_qty2, sum(t.loct_onhand) + sum(commit_qty) avail_qty, sum(t.loct_onhand2) + sum(commit_qty2) avail_qty2, sum(-alloc_qty) qty1, decode(sum(-alloc_qty2),0, NULL, sum(-alloc_qty2)) qty2, count(*) numb_trans_line FROM op_tran_tmp t, ic_loct_inv i, ic_lots_sts l WHERE t.whse_code = i.whse_code AND t.item_id = i.item_id AND expire_date >= sysdate AND i.lot_id = t.lot_id AND i.location = t.location AND i.lot_status = l.lot_status (+) GROUP BY t.session_id, t.item_id, t.whse_code, lot_no, sublot_no, t.lot_id, lot_created, expire_date, qc_grade, t.location, i.lot_status, nettable_ind, shipping_ind, rejected_ind having sum(t.loct_onhand) + sum(commit_qty) > 0 or sum(-alloc_qty) > 0 ORDER BY qty1 desc
View Text - HTML Formatted

SELECT T.SESSION_ID
, T.ITEM_ID
, T.WHSE_CODE
, MAX(T.LINE_ID) LINE_ID
, LOT_NO
, SUBLOT_NO
, T.LOT_ID
, LOT_CREATED
, EXPIRE_DATE
, QC_GRADE
, T.LOCATION
, I.LOT_STATUS
, NETTABLE_IND
, SHIPPING_IND
, REJECTED_IND
, SUM(T.LOCT_ONHAND) ONHAND_QTY
, SUM(T.LOCT_ONHAND2) ONHAND_QTY2
, SUM(-COMMIT_QTY) COMMIT_QTY
, SUM(-COMMIT_QTY2) COMMIT_QTY2
, SUM(T.LOCT_ONHAND) + SUM(COMMIT_QTY) AVAIL_QTY
, SUM(T.LOCT_ONHAND2) + SUM(COMMIT_QTY2) AVAIL_QTY2
, SUM(-ALLOC_QTY) QTY1
, DECODE(SUM(-ALLOC_QTY2)
, 0
, NULL
, SUM(-ALLOC_QTY2)) QTY2
, COUNT(*) NUMB_TRANS_LINE
FROM OP_TRAN_TMP T
, IC_LOCT_INV I
, IC_LOTS_STS L
WHERE T.WHSE_CODE = I.WHSE_CODE
AND T.ITEM_ID = I.ITEM_ID
AND EXPIRE_DATE >= SYSDATE
AND I.LOT_ID = T.LOT_ID
AND I.LOCATION = T.LOCATION
AND I.LOT_STATUS = L.LOT_STATUS (+) GROUP BY T.SESSION_ID
, T.ITEM_ID
, T.WHSE_CODE
, LOT_NO
, SUBLOT_NO
, T.LOT_ID
, LOT_CREATED
, EXPIRE_DATE
, QC_GRADE
, T.LOCATION
, I.LOT_STATUS
, NETTABLE_IND
, SHIPPING_IND
, REJECTED_IND HAVING SUM(T.LOCT_ONHAND) + SUM(COMMIT_QTY) > 0 OR SUM(-ALLOC_QTY) > 0 ORDER BY QTY1 DESC