CM_OH2_INQ_VW

(SQL View)
Index Back

Onhand by receipt (non-config)

Created on 09/07/99 RML CM800-9.0 View to show quantity on hand, unit cost, on hand value, and total depletion per receipt line. This view is used for on hand inquiry for specific business unit item - standard cost non-config items only (CM_RCPT_LINEDET_SP).

SELECT a.oprid , a.business_unit , a.inv_item_id , a.cm_book , a.dt_timestamp , a.seq_nbr , b.cost_element , a.storage_area , a.inv_lot_id , a.serial_id , a.transaction_date , a.cm_receipt_qty , a.cm_deplete_qty , a.cm_onhand_qty , b.tl_cost + b.ll_cost , %Round(%DecMult(a.cm_onhand_qty,(b.tl_cost + b.ll_cost)),6) FROM PS_CM_OH_INQ_TMP1 a , PS_CM_PRODCOST b , PS_CM_ITEM_METH_VW c , PS_CM_ELEMENT d , PS_SET_CNTRL_REC e WHERE a.business_unit = b.business_unit AND a.inv_item_id = b.inv_item_id AND b.config_code = ' ' AND b.effdt = ( SELECT MAX(s.effdt) FROM PS_CM_PRODCOST s WHERE s.business_unit = a.business_unit AND s.inv_item_id = a.inv_item_id AND s.config_code = ' ' AND s.effdt <= a.system_date) AND a.business_unit = c.business_unit AND a.inv_item_id = c.inv_item_id AND a.cm_book = c.cm_book AND c.cm_method = '8' AND a.consigned_flag = 'N' AND b.business_unit = e.setcntrlvalue AND e.RECNAME = 'CM_ELEMENT' AND e.setid = d.setid AND d.cost_element = b.cost_element AND d.cost_category <> 'OUB'

# 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 DT_TIMESTAMP DateTime(26) TIMESTAMP Date Timestamp
6 SEQ_NBR Number(15,0) DECIMAL(15) NOT NULL Sequence Number
7 COST_ELEMENT Character(4) VARCHAR2(4) NOT NULL Cost Element
8 STORAGE_AREA Character(5) VARCHAR2(5) NOT NULL Storage Area
9 INV_LOT_ID Character(15) VARCHAR2(15) NOT NULL Lot ID
10 SERIAL_ID Character(20) VARCHAR2(20) NOT NULL Serial ID
11 TRANSACTION_DATE Date(10) DATE Transaction Date
12 CM_RECEIPT_QTY Signed Number(17,4) DECIMAL(15,4) NOT NULL 07/99 GMG CN800-9.0:
13 CM_DEPLETE_QTY Signed Number(17,4) DECIMAL(15,4) NOT NULL Base Quantity Depleted
14 CM_ONHAND_QTY Signed Number(17,4) DECIMAL(15,4) NOT NULL 08/30/99 RML Changed from "onhand" to "on hand"
15 CM_UNIT_COST Signed Number(27,15) DECIMAL(25,15) NOT NULL 07/99 GMG CN800-9.0:
16 CM_ONHAND_VALUE Number(19,6) DECIMAL(18,6) NOT NULL 08/30/99 RML Changed from "onhand" to "on hand"