0 Replies Latest reply: Jan 18, 2012 1:44 AM by 685326 RSS

    This Formula(Function) compiles but does not display any result

    685326
      Please can anybody help me resolve this issue.The code below is a code for a formula(function) column in oracle report, i have complied this code and it successfully complied but it does not display any result for the column having a stock balance in the entire report.




      function CF_STOCK_BALFormula return Number is
           v_all_positive NUMBER;
           v_all_negative NUMBER;
           
      begin
           --
           IF :transaction_type IN ('RECEIPT', 'RETURN') THEN
                IF :cp_stock_bal IS NULL OR :cp_stock_bal = 0 THEN
                     :cp_stock_bal := :opening_balance + :cp_stock_bal + :quantity;
                ELSE
                     :cp_stock_bal := :cp_stock_bal + :quantity;
                END IF;
           ELSIF :transaction_type IN ('ISSUE') THEN
                IF :cp_stock_bal IS NULL OR :cp_stock_bal = 0 THEN
                     :cp_stock_bal := :opening_balance + :cp_stock_bal - :quantity;
                ELSE
                     :cp_stock_bal := :cp_stock_bal - :quantity;
                END IF;
           END IF;
           --
      RETURN (:cp_stock_bal);
      end;

      Edited by: Gbenga on Jan 17, 2012 11:30 PM