我正在寻找一种更便宜的替代方法来从PO行中恢复成本中心。
我所在的生产线可以做到这一点,但是需要很长时间才能运行
SELECT APA.INVOICE_NUM
, APA.INVOICE_ID
, APA.INVOICE_AMOUNT
, APA.INVOICE_DATE
, APA.PAYMENT_STATUS_FLAG
, APA.VENDOR_ID
, APA.VENDOR_SITE_ID
, AIL.ITEM_DESCRIPTION
, AIL.LINE_NUMBER as "Invoice Line No"
, AIL.AMOUNT as "Line Amount"
, AIL.PO_HEADER_ID
, PLO.LINE_STATUS
, RHA.REQUISITION_NUMBER
, RHA.PREPARER_ID
, RHA.CREATED_BY as REQUESTER
, RLA.REQUESTER_ID
, RHA.REQUISITION_HEADER_ID
, SUP.VENDOR_NAME
, SSV.VENDOR_SITE_CODE
, HOLDS.HELD_BY
, HOLDS.HOLD_LOOKUP_CODE
, HOLDS.CREATED_BY as HOLDER
, HOLDS.HOLD_REASON
, POV.PO_NUMBER
, PO_BIP_HELPER.get_cost_center(NULL,PLO.PO_LINE_ID,'DRAFT','0') AS CostCenter
FROM AP_INVOICE_LINES_ALL AIL
, AP_INVOICES_ALL APA
, PO_LINES_ALL PLO
, POR_REQUISITION_HEADERS_ALL RHA
, POR_REQUISITION_LINES_ALL RLA
, AP_PO_HEADERS_EXTRACT_V PHE
, POZ_SUPPLIERS_V SUP
, POZ_SUPPLIER_SITES_V SSV
, AP_HOLDS_ALL HOLDS
, AP_OFR_PO_LINES_V POV
WHERE APA.INVOICE_ID = AIL.INVOICE_ID
AND PHE.PO_HEADER_ID = AIL.PO_HEADER_ID
AND PHE.PO_HEADER_ID = PLO.PO_HEADER_ID
AND PHE.PO_HEADER_ID = RLA.PO_HEADER_ID
AND RHA.REQUISITION_HEADER_ID = RLA.REQUISITION_HEADER_ID
AND APA.VENDOR_ID = SUP.VENDOR_ID
AND APA.VENDOR_SITE_ID = SSV.VENDOR_SITE_ID
AND AIL.INVOICE_ID = HOLDS.INVOICE_ID
AND AIL.PO_HEADER_ID = POV.PO_HEADER_ID
这是贵行
PO_BIP_HELPER.get_cost_center(NULL,PLO.PO_LINE_ID,'DRAFT','0') AS CostCenter
没有这一行,报告很快就闪了
想要一种快速收回成本中心的方法