1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Cash Flow Report

Discussion in 'Oracle Financials' started by appidi, Oct 22, 2011.

  1. appidi

    appidi Active Member

    Likes Received:
    Trophy Points:

    I'm working on a Cash Flow Report, but i'm stuck with the code performance.
    Not sure whether logic i used is correct, If anyone developed Cash Flow report (AR/AP) please share your report.
    Below is my code for AR part but the cost is very high.
    In this forum i have seen (RIAZ) posted on cash flow, but not sure how to contact him.

    SELECT gcc.segment2,(NVL(SUM(gb.period_net_dr),0)-NVL(SUM(gb.period_net_cr),0))
    FROM ar_cash_receipts_all acr
    ,ar_cash_receipt_history_all acrh
    ,ar_distributions_all ard
    ,xla_ae_headers xah
    ,xla_ae_lines xal
    ,xla_distribution_links xdl
    ,gl_import_references glimp
    ,gl_je_batches glb
    ,gl_je_headers glh
    ,gl_je_lines gll
    ,gl_code_combinations gcc
    ,gl_balances gb
    WHERE acr.cash_receipt_id = acrh.cash_receipt_id
    AND acrh.cash_receipt_history_id = ard.source_id
    AND ard.source_table ='CRH'
    --AND acr.receipt_number ='2418224'
    AND xal.application_id = '222'
    AND xdl.application_id = '222'
    AND xah.application_id = '222'
    AND xah.ae_header_id = xal.ae_header_id
    AND xah.ae_header_id = xdl.ae_header_id
    AND xal.ae_line_num = xdl.ae_line_num
    AND xdl.source_distribution_type = 'AR_DISTRIBUTIONS_ALL'
    AND xdl.source_distribution_id_num_1 = ard.line_id
    AND glimp.je_header_id = glh.je_header_id
    AND glimp.je_line_num = gll.je_line_num
    AND glimp.je_batch_id = glb.je_batch_id
    AND glh.je_header_id = gll.je_header_id
    AND glh.je_batch_id = glb.je_batch_id
    AND glimp.gl_sl_link_table = xal.gl_sl_link_table
    AND glimp.gl_sl_link_id = xal.gl_sl_link_id
    AND glimp.reference_5 = xah.entity_id
    AND glimp.reference_6 = xah.event_id
    AND glimp.reference_7 = xah.ae_header_id
    AND gcc.code_combination_id = xal.code_combination_id
    AND gll.code_combination_id = gcc.code_combination_id
    AND gb.code_combination_id = gcc.code_combination_id
    AND gcc.enabled_flag = 'Y'
    AND gcc.end_date_active is NULL
    AND gb.actual_flag ='A'
    AND ((nvl(gb.PERIOD_NET_DR,0) != 0) or (nvl(gb.PERIOD_NET_CR,0) != 0))
    AND glh.je_source = 'Receivables'
    AND gll.effective_date BETWEEN :begin_date AND :end_date