CM_OHACT_INQ_VW

(SQL View)
Index Back

On hand value

09/02/99 RML Added cm_method. 08/11/99 RML Translate values changed in cm_method; 2,3,4,5 is replaced with value of 1. 08/02/99 RML Removed cm_seq_receipt in where clause due to record change in CM_RECEIPTS Created on 06/04/99 RML CM800-9.0 View to show on hand value by business unit, item, and book. This view depends on CM_OH_INQ_VW1 for on hand quantity. 10/01 dmw change build seq nbr from 1 to 3

SELECT a.oprid , a.business_unit , a.inv_item_id , a.cm_book , c.cm_method , d.cm_onhand_qty , %Round(SUM(%DecMult(a.cm_onhand_qty,b.cm_unit_cost)),6) FROM PS_CM_OH_INQ_TMP1 a , PS_CM_ACTUAL_COSTB b , PS_CM_ITEM_METH_VW c , PS_CM_OH_INQ_VW1 d , PS_CM_ELEMENT e , PS_SET_CNTRL_REC f WHERE a.business_unit = b.business_unit AND a.inv_item_id = b.inv_item_id AND a.cm_book = b.cm_book AND a.cm_dt_timestamp_a = b.dt_timestamp AND a.cm_seq_nbr_a = b.seq_nbr AND a.business_unit = c.business_unit AND a.inv_item_id = c.inv_item_id AND b.CM_DTTM_STAMP = ( SELECT MAX(ACT.CM_DTTM_STAMP) FROM PS_CM_ACTUAL_COSTB ACT WHERE ACT.BUSINESS_UNIT = a.BUSINESS_UNIT AND ACT.INV_ITEM_ID = a.INV_ITEM_ID AND ACT.CM_BOOK = a.CM_BOOK AND ACT.DT_TIMESTAMP = a.CM_DT_TIMESTAMP_A AND ACT.SEQ_NBR = a.CM_SEQ_NBR_A AND ACT.COST_ELEMENT = B.COST_ELEMENT AND ACT.CM_DTTM_IN_EFFECT < a.cm_system_tm_stamp AND ACT.CM_SEQ_COST = ( SELECT MAX(ACT2.CM_SEQ_COST) FROM PS_CM_ACTUAL_COSTB ACT2 WHERE ACT2.BUSINESS_UNIT = ACT.BUSINESS_UNIT AND ACT2.INV_ITEM_ID = ACT.INV_ITEM_ID AND ACT2.CM_BOOK = ACT.CM_BOOK AND ACT2.DT_TIMESTAMP = ACT.DT_TIMESTAMP AND ACT2.SEQ_NBR = ACT.SEQ_NBR AND ACT2.COST_ELEMENT = ACT.COST_ELEMENT AND ACT2.CM_DTTM_STAMP = ACT.CM_DTTM_STAMP)) AND a.cm_book = c.cm_book AND (c.cm_method = '1' OR c.cm_method = '7' ) AND a.oprid = d.oprid AND a.business_unit = d.business_unit AND a.inv_item_id = d.inv_item_id AND a.cm_book = d.cm_book AND a.consigned_flag = 'N' AND b.business_unit = f.setcntrlvalue AND f.RECNAME = 'CM_ELEMENT' AND f.setid = e.setid AND e.cost_element = b.cost_element AND e.cost_category <> 'OUB' GROUP BY a.oprid, a.business_unit, a.inv_item_id, a.cm_book, c.cm_method, d.cm_onhand_qty

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 OPRID Character(30) VARCHAR2(30) NOT NULL A user's ID (see PSOPRDEFN).
2 BUSINESS_UNIT Character(5) VARCHAR2(5) NOT NULL Business Unit
3 INV_ITEM_ID Character(18) VARCHAR2(18) NOT NULL Item ID
4 CM_BOOK Character(10) VARCHAR2(10) NOT NULL Cost Book
5 CM_METHOD Character(2) VARCHAR2(2) NOT NULL 8/20/02 lee: added xlate 9 for retroactive perp average 01/18/99 RML Created for CN800-9.0 FIFO/LIFO Enhancements
0=Non Cost
1=Actual Cost
6=Perpetual Weighted Average
7=Periodic Weighted Average
8=Value at Current Standard
9=Retroactive Perpetual Average
6 CM_ONHAND_QTY Signed Number(17,4) DECIMAL(15,4) NOT NULL 08/30/99 RML Changed from "onhand" to "on hand"
7 CM_ONHAND_VALUE Number(19,6) DECIMAL(18,6) NOT NULL 08/30/99 RML Changed from "onhand" to "on hand"