Oracle9i reports take longer time while running in web

Hi,
I have developed few reports in Oracle9i and I am trying to run the reports in web. Running a report through report builder takes lesser time compare to running the same report in web using web.show_document. This also depends on the file size. If my report file size(.jsp file) is less than 100KB then it takes 1 minute to show the parameter form and another 1 minute to show the report output. If my file size is around 190KB then the system takes atleast 15 minutes to show the parameter form. Another 10 to 15 minutes to show the report output. I don't understand why the system takes long time to show the parameter form.
I have a similar problem while opening the file in reports builder also. If my file size is more than 150KB then it takes more than 15 minutes to open the file.
Could anyone please help me on this.
Thanks, Radha

This problem exists only with .jsp reports. I saved the reports in .rdf format and they run faster on web now. Opening a .jsp report takes longer time(file with 600KB takes atleast 2 hours) but the same report in .rdf format takes few seconds to get opened in reports builder.

Similar Messages

  • Auto message  restart job take long time to run

    Dear all,
    I have configre the auto message restart job in sdoe_bg_job_monitor
    but it take long time to run.
    i have execute the report i have find out that it is faching records from smmw_msg_hdr .
    in the table present 67 laks records are there.
    actually it is taking a lot of time while getting data from the table
    is there any report or tcode for clearing data in the table.
    I need ur valiuble help to resolve the issue.
    Regards
    lakshman balanagu

    HI,
    If you are using oracle database you may need to run table statistics report (RSOANARA) to update the index. The system admin should be able to this.
    Regards,
    Vikas
    Edited by: Vikas Lamba on Aug 3, 2010 1:20 PM

  • The 0co_om_opa_6 ip in the process chains takes long time to run

    Hi experts,
    The 0co_om_opa_6 ip in the process chains takes long time to run around 5 hours in production
    I have checked the note 382329,
    -> where the indexes 1 and 4 are active
    -> index 4 was not "Index does not exist in database system ORACLE"- i have assgined to " Indexes on all database systems and ran the delta load in development system, but guess there are not much data in dev it took 2-1/2 hrs to run as it was taking earlier. so didnt find much differnce in performance.
    As per the note Note 549552 - CO line item extractors: performance, i have checked in the table BWOM_SETTINGS these are the settings that are there in the ECC system.
    -> OLTPSOURCE -  is blank
       PARAM_NAME - OBJSELSIZE
       PARAM_VALUE- is blank
    -> OLTPSOURCE - is blank
       PARAM_NAME - NOTSSELECT
       PARAM_VALUE- is blank
    -> OLTPSOURCE- 0CO_OM_OPA_6
       PARAM_NAME - NOBLOCKING
       PARAM_VALUE- is blank.
    Could you please check if any other settings needs to be done .
    Also for the IP there is selction criteris for FISCALYEAR/PERIOD from 2004-2099, also an inti is done for the same period as a result it becoming difficult for me to load for a single year.
    Please suggest.

    The problem was the index 4 was not active in the database level..it was recommended by the SAP team to activate it in se14..however while doing so we face few issues se14 is a very sensitive transaction should be handled carefully ... it should be activate not created.
    The OBJSELSIZE in the table BWOM_SETTINGS has to be Marked 'X' to improve the quality as well as the indexe 4 should be activate at the abap level i.e in the table COEP -> INDEXES-> INDEX 4 -> Select the  u201Cindex on all database systemu201D in place of u201CNo database indexu201D, once it is activated in the table abap level you can activate the same indexes in the database level.
    Be very carefull while you execute it in se14 best is to use db02 to do the same , basis tend to make less mistake there.
    Thanks Hope this helps ..

  • Payables Account Analysis report takes long time to produce xml output

    Hi,
    I am trying to get xml data for the Payables Account Analysis report. I have changed the output format of the concurrent program to XML.
    The report takes long time to produce the xml data irrespective of the number of rows fetched. But the same report with Text output runs very fast.
    Any reason why the xml output takes long time?
    thanks in advance
    Malathi.

    Hi,
    Thanks for the reply.
    As mentioned above, i deleted the Q_FLEXDATA and ran the report. it takes less time.
    But Will the report data not affected when we delete Q_FLEXDATA Group? and Why this flexdata group affects the running time?
    Thanks,
    Malathi.

  • Concurrent report takes long time to complete

    Dear all,
    Concurrent report "Inactive items report" takes long time to complete.
    How to solve this performance issue ?
    Kindly offer me solution to this.
    Regards,
    Arun

    Please post the details of the application release, database version and OS.
    Was the performance acceptable before? If yes, any changes been done recently?
    Do you have the statistics collected up to date?
    Please enable trace and generate the TKPROF to determine why the request takes that long to complete.
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Slow+AND+Concurrent&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Slow+AND+Concurrent+AND+TKPROF&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Take more time while running report on live

    report takes more time to open on live. while running manually by connecting to live it run (means first pages generate with in 4 sec) but when i click to next page it tooks 3-4 sec.
    thers's only two formula column.
    please advice me to make it run smooth. waiting for ur response.
    Regards

    May i know which version u are using
    and hw many records does it has to fetch.?

  • Bex Reports takes long time for filtering

    Hi,
    We have gone live in last December.And already our inventory cube contains some 15 million records,sales cube contains 12 million records.
    Is there any specific limit to number of records.Because while doing filtering in inventory report or sales reports it is taking very  long time.
    Is there any alternative or we should delete some the data from the cube.
    for filtering any value it is taking long time than running the query itself.
    Pls help...
    Regards,
    viren.

    Hi Viren,
    I hope a cube can perform well even at 100 million records with some performance tunning. So i absolutely doubt why it is taking long time for your cube with just 10-15 million records.
    Do a performance analysis and check whether aggregates will be helpful or not.
    Check the below link for how to do a performance analysis.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/d9fd84ad-0701-0010-d9a5-ba726caa585d
    Hope it helps.
    Thx,
    Soumya

  • Report takes  long time to refresh

    Hi Experts ,
    I have an issue ,when I have only used one workshet  to upload as the original workbook has about 25 worksheet tabs and is too large to upload.The report takes 20 minutes to refresh I was rebuilding the report when I noticed that when I added the formulas to the bottom to the original report the report started to take longer to run.When the bottom section of the report is not included the report refreshed in about  2 minutes.
    In the file that completes faster,there are no formulas after line 353
    In the file that takes long time o refresh,the start on line 357.When the bottom section of the report is not included the report refreshed in about 2 minutes.Any sugession.Thanku.
    Regards
    R@vi

    hi,
    If you discover significant high frontend time, check whether the formatting is the reason. If so, either switch it off or reduce the result lines.
    As formatting information is not transferred, the time consumed in the frontend can be reduced.
    But the workbook you are executing may obviously take much time.
    Message was edited by: AVR - Intelli

  • Report takes long time for few records

    hi frends,
    I m facing one problem with my Web based erp application which is developed in .net , in my application when i open the  report from my applicaiton , in my temp folder there one file gets created name is "rpt conmgr cache"
    bcoz of this for few records also my report takes too much time and opens very slow and it takes long time, and it happens in some of the reports only , other reports are working cool and its not creating any file in temp folder,,, so can u guide me whats this file and what can be the solution for it,
    Thanks
    Mithun

    hi sabhajit,
    i have already checked the sql query it is taking less then seconds.
    any other steps u want me to check then pls let me know?
    thanks mithun

  • NAC Agent takes long time to run

    Cisco NAC agent takes long time to popup or run on Windows 7 machine.
    The client machine is windows 7, running nac agent 4.9.0.42, against ISE 1.1.1
    Any ideas how to reduce NAC Agent timing?

    Hi Tariq,
    I'm facing the same issue with ISE 1.1.1 (268) with Agent 4.9.0.47 for Windows XP clients. I have already configured "yes" to disabled the l3 swiss delay and reduced the httpa discovery timer from 30 to 05 sec but still clients get aprox 2.30 minutes to popup and finished the posture discovery.
    Can you please advise if this is the minimum time or what is the minimum time and what are the parameters to set to a minimum time to complete agent popup and posture discovery..?
    Is there any option that we can run this on backgroup..?
    thanks in advance..

  • Webi report takes long time to open

    Hi All.
    We have created few reports in webi and we have used variables in these reports.
    But while opening that reports into BI Launch pad browser, it is taking long time to open. e.g. 5 to 7 min or more.
    Please help to resolve this issue.

    Hi Anand R,
    A couple of questions from my side:
    1) Does the webi report contains any chart
    2) Are webi reports which are slow only on a single .UNX
    3) How about the network.
    4) Are you using IE
    5) Are you in 3.x or 4.x
    Could you try any of the below:
    1) Increase Tomcat memory pool to 4096Mb
    2) Stop and restart Tomcat once.
    3) Try with other browser
    4) Use something like Fiddler to understand the network speed
    5) Delete cookies in the browser
    Try the other options told by our SCN colleagues aswell..
    BR
    Prabhith

  • How to run ABAP Function Module in Background Wchich Takes Long Time to Run

    How to run ABAP Function Module in Background FOR LONG TIME
    I am not that experienced with ABAP. I am on SAP BI 7.0. I WANT TO RUN A FUNCTION MODULE
    RSDRT_INFOCUBE_DATA_COPY.
    I used SE37 and then executed the module, I supplied  the parameters on the form which opped-up and then  program started running. . Program was however interrupted after 10 minutes by ABAP. How can I run  it in background without interruption?
    THANKS A LOT.

    Hi,
    You can call this FM in a program and run that program in background.
    Regards,
    Raju

  • Script takes long time to run

    Hi Friends,
    We have a leave record in the following manner:
    name date leaves
    ABC 01-oct-08 1
    ABC 02-oct-08 1
    ABC 03-oct-08 1
    ABC 04-oct-08 1
    ABC 05-oct-08 1
    ABC 10-oct-08 1
    ABC 18-oct-08 1
    ABC 19-oct-08 1
    ABC 20-oct-08 1
    ABC 25-oct-08 1
    ABC 26-oct-08 1
    ABC 27-oct-08 1
    ABC 28-oct-08 1
    and we need an output in the following manner:
    output
    Name FromDate ToDate Leaves
    ABC 01-oct-08 05-oct-08 5
    ABC 10-oct-08 10-oct-08 1
    ABC 18-oct-08 20-oct-08 3
    ABC 25-oct-08 28-oct-08 4
    The code for the above mentioned logic is as follows:
    =======================================================
    =======================================================
    procedure KPM_AB_LWP_PROC(p_err_buf OUT VARCHAR2, p_ret_code OUT NUMBER) is
    diff number;
    prev_date date;
    p_prev_date date;
    first_date date;
    last_date date;
    dt date;
    total_leaves number := 0;
    ecode varchar2(20);
    ename varchar2(240);
    cursor ab_lwp_cur(process_from_date date, process_to_date date, e_code varchar2) is
    select
    ab.EMPCODE,
    ab.RECORD_DATE,
    ab.FIRST_HALF,
    ab.SECOND_HALF,
    (em.last_name || ', ' || em.TITLE || ' '|| em.FIRST_NAME || em.MIDDLE_NAME) EMP_NAME
    from
    kpm_hr_absent_record ab, kpm_hr_emp_mst em
    where
    ab.EMPCODE = em.EMPCODE
    and (ab.FIRST_HALF in ('AB','LWP') or ab.SECOND_HALF in ('AB','LWP'))
    and ab.EMPCODE like e_code
    and ab.record_date between process_from_date and process_to_date;
    cursor active_emp is
    select empcode
    from kpm_hr_emp_mst
    where status='Active'
    order by empcode;
    begin
    for emp in active_emp loop
    begin
    select min(ab.RECORD_DATE), max(ab.RECORD_DATE)
    into prev_date, last_date
    from kpm_hr_absent_record ab
    where (ab.FIRST_HALF in ('AB','LWP') or ab.SECOND_HALF in ('AB','LWP'))
    and ab.EMPCODE like emp.empcode;
    exception
    when others then
    prev_date := null;
    last_date := null;
    end;
    dt := prev_date;
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'Employee' || chr(9) || chr(9) || 'Name' || chr(9) || chr(9) || 'From Date' || chr(9) || chr(9) || 'To Date' || chr(9) || chr(9) || 'Total Leaves');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'---------' || chr(9) || chr(9) || '-----' || chr(9) || chr(9) || '----------' || chr(9) || chr(9) || '---------' || chr(9) || chr(9) || '-------------');
    while dt <= last_date loop
    first_date := dt;
    total_leaves := 0;
    for m in ab_lwp_cur(prev_date, last_date, emp.empcode) loop
    ecode := m.empcode;
    ename := m.emp_name;
    diff := m.record_date - prev_date;
    if diff = 0 then
    if m.first_half in ('AB','LWP') then
    total_leaves := total_leaves + 0.5;
    end if;
    if m.second_half in ('AB','LWP') then
    total_leaves := total_leaves + 0.5;
    end if;
    prev_date := prev_date + 1;
    else
    prev_date := m.record_date;
    goto print_leave;
    end if;
    p_prev_date := prev_date -1;
    end loop;
    <<print_leave>>
    if total_leaves > 0 then
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,ecode || chr(9) || chr(9) || ename || chr(9) || chr(9) || first_date || chr(9) || chr(9) || p_prev_date || chr(9) || chr(9) || total_leaves);
    end if;
    dt := prev_date;
    end loop;
    end loop;
    exception
    when others then
    FND_FILE.PUT_LINE(FND_FILE.LOG,'Error: ' || sqlerrm);
    end KPM_AB_LWP_PROC;
    =======================================================
    =======================================================
    The problem is that this code takes about 24hrs to run which is not accepted.
    Kindly suggest us some other technique to implement the same logic.
    For your reference, the KPM_HR_ABSENT_RECORD table has about 3,75,000 records in it.
    Also we have created some indexes on certain column as recommended by explain plans.
    Thanks in advance
    Ankur

    with t as (select 'ABC' as nm, to_date('01-oct-08','dd-mon-yy') as dt, 1 as leaves from dual union all
                   select 'ABC',to_date('02-oct-08','dd-mon-yy'), 1 from dual union all
                   select 'ABC',to_date('03-oct-08','dd-mon-yy'), 1 from dual union all
                   select 'ABC',to_date('04-oct-08','dd-mon-yy'), 1 from dual union all
                   select 'ABC',to_date('05-oct-08','dd-mon-yy'), 1 from dual union all
                   select 'ABC',to_date('10-oct-08','dd-mon-yy'), 1 from dual union all
                  select 'ABC',to_date('18-oct-08','dd-mon-yy'), 1 from dual union all
                   select 'ABC',to_date('19-oct-08','dd-mon-yy'), 1 from dual union all
                   select 'ABC',to_date('20-oct-08','dd-mon-yy'), 1 from dual union all
                  select 'ABC',to_date('25-oct-08','dd-mon-yy'), 1 from dual union all
                  select 'ABC',to_date('26-oct-08','dd-mon-yy'), 1 from dual union all
                  select 'ABC',to_date('27-oct-08','dd-mon-yy'), 1 from dual union all
                  select 'ABC',to_date('28-oct-08','dd-mon-yy'), 1 from dual)
       -- end of sample data
    select nm, min(dt), max(dt), sum(leaves)
    from
       select nm, dt, max(group_id) over(partition by nm order by dt) group_id
                , leaves
       from
          select nm, dt, case when trunc(dt) - 1 != lag(trunc(dt),1,trunc(dt))
                                                                     over(partition by nm order by dt)
                               then rownum
                               end group_id
                 , leaves
          from t
    group by nm, group_id
    order by 1,2;Hope this helps.
    @Blushadow, thanks very much for the test data.
    Regards
    Raj
    P.S : For more information check this link
    http://www.oracle.com/technology/oramag/oracle/04-mar/o24asktom.html
    and search for "Analytics to the Rescue (Again)" in that page.
    Edited by: R.Subramanian on Oct 22, 2008 4:52 AM
    Changed count function to Sum function

  • RDS 2012 R2 take long time while opening first application

    Hello experts:
    My RDS Environment Have the following servers:
    1- Two web access server ( RR DNS )---> virtual machines
    2- Two Connection brokers servers (RR DNS) ---> Virtual machines
    3- Two host session servers combined as a farm ---> Physical machines with 128 GB of RAM for each server
    4- There is no gateway server.
    5- The Active Directory is 2008 R2 while the RDS is 2012 R2
    My problem is when the users try to access published application they faced a long time ( around 1 min ) to open the first app, the subsequent app open quickly, the problem on when launch the first app.
    I tried the following in order to solve the problem with no luck:
    - Edit the registry and add DisableTaskOffload with value =1.
    - Disable the large send offload v2 IPv4 on all NIC's.
    so the problem still exist and i didn't found any solution for it, any help or suggestion will highly appreciated.

    Hiya,
    I'm afraid I don't have a environment to build the exact script on, however I would think the below script should be able to help you:
    http://jesperarnecke.wordpress.com/2013/07/24/sharepoint-2010-mysite-preferred-search-center-setting-powershell/
    The above script really just opens an IE and navigates to the specified page. Finds the different required elements on the page(View Source to find) and manipulates them as required. ().Click etc.
    You properly need to add a Username and Password, in order to login, which the script should be able to handle fine. Do consider the risk of storing username/password in cleartext. - Its not necessarily a problem, but it could be if the account needs elevated
    privileges. However in this case it should just be a service user with 1 app to start :)
    Let me know if it helps you :)

  • Report takes long time in different database version

    Dear Mates,
    I have been in serious problem from last one month. Still i don't get any solution. Come to the problem.
    I have a program where, database version is *9i R2*. Here one report are base on a database function and works perfectly. It takes 30/35 seconds to preview.
    I take this schema backup by EXP command and import it to database version XE and also database version *10G R2* with IMP command. import is successful. Others report still preview as it is at 9i. But my mentioned reports didn't come as same. Now it takes 3 Hrs. :(.
    I run explain plan and the out put is bellow. What should i do now ? If you want to check the query i can also post it. If any one have experience regarding this, please help me.
    Plan hash value: 3745590339
    | Id  | Operation                      | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |             |  9454 |  1874K|   207  (55)| 00:00:03 |
    |   1 |  SORT GROUP BY                 |             |  9454 |  1874K|   207  (55)| 00:00:03 |
    |*  2 |   HASH JOIN                    |             |  9454 |  1874K|   205  (55)| 00:00:03 |
    |*  3 |    INDEX FAST FULL SCAN        | IND_AD_ID   |  9454 |   120K|   201  (55)| 00:00:03 |
    |   4 |    INLIST ITERATOR             |             |       |       |            |          |
    |   5 |     TABLE ACCESS BY INDEX ROWID| ACC_DTL     |  1351 |   250K|     3   (0)| 00:00:01 |
    |*  6 |      INDEX RANGE SCAN          | IND_AD_FLAG |     8 |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("ACC_LEDGER"."LG_AD_ID"="ACC_DTL"."AD_ID")
       3 - filter("ACC_BALANCE"("ACC_LEDGER"."LG_AD_ID",:UNIT,:PROJ)<>0)
       6 - access("ACC_DTL"."AD_FLAG"=6 OR "ACC_DTL"."AD_FLAG"=7 OR "ACC_DTL"."AD_FLAG"=8
                  OR "ACC_DTL"."AD_FLAG"=18 OR "ACC_DTL"."AD_FLAG"=19)
    Note
       - dynamic sampling used for this statementupper explain plan is from database 10g R2
    bellow r from 9i R2
    | Id  | Operation                      |  Name        | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT               |              |       |       |       |
    |   1 |  SORT GROUP BY                 |              |       |       |       |
    |   2 |   CONCATENATION                |              |       |       |       |
    |   3 |    NESTED LOOPS                |              |       |       |       |
    |   4 |     TABLE ACCESS BY INDEX ROWID| ACC_DTL      |       |       |       |
    |*  5 |      INDEX RANGE SCAN          | IND_AD_FLAG  |       |       |       |
    |*  6 |     INDEX RANGE SCAN           | IND_AD_ID    |       |       |       |
    |   7 |    NESTED LOOPS                |              |       |       |       |
    |   8 |     TABLE ACCESS BY INDEX ROWID| ACC_DTL      |       |       |       |
    |*  9 |      INDEX RANGE SCAN          | IND_AD_FLAG  |       |       |       |
    |* 10 |     INDEX RANGE SCAN           | IND_AD_ID    |       |       |       |
    |  11 |    NESTED LOOPS                |              |       |       |       |
    |  12 |     TABLE ACCESS BY INDEX ROWID| ACC_DTL      |       |       |       |
    |* 13 |      INDEX RANGE SCAN          | IND_AD_FLAG  |       |       |       |
    |* 14 |     INDEX RANGE SCAN           | IND_AD_ID    |       |       |       |
    |  15 |    NESTED LOOPS                |              |       |       |       |
    |  16 |     TABLE ACCESS BY INDEX ROWID| ACC_DTL      |       |       |       |
    |* 17 |      INDEX RANGE SCAN          | IND_AD_FLAG  |       |       |       |
    |* 18 |     INDEX RANGE SCAN           | IND_AD_ID    |       |       |       |
    |  19 |    NESTED LOOPS                |              |       |       |       |
    |  20 |     TABLE ACCESS BY INDEX ROWID| ACC_DTL      |       |       |       |
    |* 21 |      INDEX RANGE SCAN          | IND_AD_FLAG  |       |       |       |
    |* 22 |     INDEX RANGE SCAN           | IND_AD_ID    |       |       |       |
    Predicate Information (identified by operation id):
       5 - access("ACC_DTL"."AD_FLAG"=19)
       6 - access("ACC_LEDGER"."LG_AD_ID"="ACC_DTL"."AD_ID")
           filter("ERP"."ACC_BALANCE"("ACC_LEDGER"."LG_AD_ID",TO_NUMBER(:Z),TO_N
                  UMBER(:Z))<>0)
       9 - access("ACC_DTL"."AD_FLAG"=18)
      10 - access("ACC_LEDGER"."LG_AD_ID"="ACC_DTL"."AD_ID")
           filter("ERP"."ACC_BALANCE"("ACC_LEDGER"."LG_AD_ID",TO_NUMBER(:Z),TO_N
                  UMBER(:Z))<>0)
      13 - access("ACC_DTL"."AD_FLAG"=8)
      14 - access("ACC_LEDGER"."LG_AD_ID"="ACC_DTL"."AD_ID")
           filter("ERP"."ACC_BALANCE"("ACC_LEDGER"."LG_AD_ID",TO_NUMBER(:Z),TO_N
                  UMBER(:Z))<>0)
      17 - access("ACC_DTL"."AD_FLAG"=7)
      18 - access("ACC_LEDGER"."LG_AD_ID"="ACC_DTL"."AD_ID")
           filter("ERP"."ACC_BALANCE"("ACC_LEDGER"."LG_AD_ID",TO_NUMBER(:Z),TO_N
                  UMBER(:Z))<>0)
      21 - access("ACC_DTL"."AD_FLAG"=6)
      22 - access("ACC_LEDGER"."LG_AD_ID"="ACC_DTL"."AD_ID")
           filter("ERP"."ACC_BALANCE"("ACC_LEDGER"."LG_AD_ID",TO_NUMBER(:Z),TO_N
                  UMBER(:Z))<>0)
    Note: rule based optimizationEdited by: HamidHelal on Oct 12, 2011 6:42 PM

    yes..
    SELECT ALL ACC_LEDGER.LG_AD_ID, ACC_DTL.AD_NAME, abs(ACC_BALANCE(ACC_LEDGER.LG_AD_ID, :UNIT, :PROJ) )BAL,
    CASE WHEN ACC_BALANCE(ACC_LEDGER.LG_AD_ID, :UNIT, :PROJ)>0  AND ACC_DTL.AD_FLAG IN(6 ,18) THEN
                'RECEIVABLE'
               WHEN  ACC_BALANCE(ACC_LEDGER.LG_AD_ID, :UNIT, :PROJ)<0  AND ACC_DTL.AD_FLAG IN(6,18)  THEN
                'PAYABLE'
                 WHEN ACC_BALANCE(ACC_LEDGER.LG_AD_ID, :UNIT, :PROJ)>0  AND ACC_DTL.AD_FLAG IN(7,8,19)  THEN
                'PAYABLE'
                WHEN ACC_BALANCE(ACC_LEDGER.LG_AD_ID, :UNIT, :PROJ)<0  AND ACC_DTL.AD_FLAG IN(7,8,19)  THEN
                'RECEIVABLE'
                END AS BALANCE_TYPE,
    ACC_DTL.AD_CODE, ACC_DTL.AD_FLAG
    FROM ACC_DTL, ACC_LEDGER
    WHERE ACC_DTL.AD_FLAG IN (6, 7, 8,18,19)
    AND (ACC_LEDGER.LG_AD_ID = ACC_DTL.AD_ID)
    AND ACC_BALANCE(ACC_LEDGER.LG_AD_ID, :UNIT, :PROJ)<>0
    GROUP BY ACC_LEDGER.LG_AD_ID, ACC_DTL.AD_NAME, ACC_DTL.AD_CODE, ACC_DTL.AD_FLAG
    ORDER BY   ACC_DTL.AD_FLAG , ACC_DTL.AD_NAME;here ACC_BALANCE is the database function name..

Maybe you are looking for