Dynamic column selection while running report

Can any one explain how to get the following functionality in report:
I have a cube with following fields:(with depriciaated amounts)
Plant  Mat#  Fiscper       Jan   Feb  March April  May   June   July   Aug   Sep   Oct   Nov   Dec
==== ====    =====      ==== ==== ===== ==== ==== ===== ==== ==== ===== ==== ==== ====
P1      M1     03/2009    $100    $90   $80   
P1      M1     04/2009    $100    $90   $80     $70  
P2      M2     04/2009     $10     $9      $8     
P2      M2     04/2009     $10     $9      $8      $7
When I run the report with Fiscper as selection, ie 04/2009, I shoud get the report displayed only April column
Report out put: (Only April column should be displayed)
Plant  Mat#  Fiscper       April
==== ====    =====       ====
P1      M1     04/2009    $70      
P2      M2     04/2009     $7
When I run the report with Fiscper as selection, ie 03/2009, I shoud get the report displayed only March column
Report out put: (Only March column should be displayed)
Plant  Mat#  Fiscper       March
==== ====    =====       ====
P1      M1     04/2009    $80      
P2      M2     04/2009     $8
Can any explain how to desing this in query designer?
Thanks,
PV

create new selection
drag and drop the kf
drag and drop calmonth
create formula variable for calmonth using type as "customer exit"
now based on the fiscperiod you can fill calmonth in customer exit which will give you desired output
you can use text variable if you want the heading for the KF to be dynamic.

Similar Messages

  • Regarding Printer Tray Selection while running BI Publisher Report.

    Hi All,
    Below is my requirement.
    When ever user tries to run the report, based on the customer code the printer tray has to be passed to printer so that the report gets printed by selecting the paper from the same tray. Each printer tray will have different paper color.
    Let me know how can I achieve this? Its very urgent..
    Thanks
    Babu

    hi,
    Just now i identified that its not deleting the report but its reverting back the report to its previous version. Let me explain it you in details:
    suppose i created a report with following query source as Oracle Database:
    select territory_code from fnd_territories_tl
    where LANGUAGE = USERENV ('Lang')
    now if i modify the query in the same report to following query:
    <dataTemplate name="dunningLetter" description="Dunning Letter Report" dataSourceRef="IPOVIS" defaultPackage="xx_shpckt_init" Version="1.0">
    <parameters>
    <parameter name="p_order_number" dataType="character"/>
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[select order_number from oe_order_headers where order_number = :p_order_number
      ]]>
    </sqlStatement>
    </dataQuery>
    <dataTrigger name="beforeReport" source="xx_shpckt_init.beforeReportTrigger"/>
    </dataTemplate>
    and then if i run the report again, the report will still show the result of previous query!! and then if i go back to data model then it will show the previous query there!! not sure why is it doing this way?? Also sometimes, when i create a new report and then view the result then it will revert its previous stage i.e report without Data model, LOVs and parameters!! That is the reason i thought its deleting the report while running report.
    Please suggest why is it acting this way? Appreciate your help and time.
    Thanks,
    Regards,
    AS

  • FRM-92101 error while running report from a button or menu

    Hi All,
    I am getting the error FRM-92101 while running report without parameter from a button or menu. I am using Developer Suit 10g. I get the error as it shows there has some configuration problem in my form. Will you please help me anyone how can i solve the problem. My previous forms running very well both with parameter and without parameter.
    Arif

    Hello Sir,
    Thanks for your cooperation. I have solved my problem by myself. The fact was that, when i tried with the following code which made my report---
    SELECT br.bid, br.bname, br.branchtxnstatus, dif.difference
    FROM branch br,
    (SELECT gladbrid branchid,
    SUM
    (CASE
    WHEN ga.gl_acc_categry IN ('L', 'I')
    THEN gd.gladbalance
    ELSE -1 * gd.gladbalance
    END
    ) AS difference
    FROM glaccount ga, glaccountdetail gd
    WHERE ga.glid = gd.gladglid
    GROUP BY gladbrid) dif
    WHERE dif.branchid = br.bid AND br.branchtxnstatus = :Br_Status
    and dif.difference!=0
    ORDER BY br.bid;
    and the code against the button or menu item is---
    DECLARE
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    BEGIN
    repid := FIND_REPORT_OBJECT('ASSET');
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    IF rep_status = 'FINISHED' THEN
    /*Display report in the browser*/
    WEB.SHOW_DOCUMENT('http://192.168.0.21:8889/reports/rwservlet/getjobid'||
    substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver90','_blank');
    ELSE
    message('Error when running report');
    END IF;
    Clear_message;
    END;
    Clear_message;
    which has shown the error FRM-92101 and didn't run the report.
    In that case I have changed the query to run the report. first of all i create a view following the query and build the report using a simple select query. that's etc. my report running fine now.
    It is mentioned that there had no error on my codes.
    Arif

  • Error while running report 10g

    DECLARE
         repid REPORT_OBJECT;
         v_rep VARCHAR2(1000);
    rep_status VARCHAR2(2000);
    BEGIN      
         repid := find_report_object('REPORT2');      
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,BATCH);
    set_report_object_property(repid, report_comm_mode, 1);
    set_report_object_property(repid, report_destype, cache);
    set_report_object_property(repid, report_desformat, 'PDF');
    set_report_object_property(repid, report_server, 'myserver');
    v_rep := run_report_object(repid);
    rep_status := report_object_status(v_rep);
    WHILE rep_status IN ('RUNNING', 'OPENING_REPORT', 'ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    message(rep_status);
    IF rep_status = 'FINISHED'
    THEN
    web.show_document('http://localhost:8889/reports/rwservlet/showjobid' || substr(v_rep, instr(v_rep, '_', -1) + 1)
    || '?server = myserver');
    ELSE
    message('error while running reports-object ' || error_text);
    message(' ');
    clear_message;
    END IF;
    EXCEPTION
         WHEN OTHERS THEN
    message('error while running reports-object' || error_text );
    END;
    I have been trying the whole 5 days running this report but it is giving me error, i am making simple report which select all data and display from emp table, please help. Error I am getting is unable to run the report and Terminated_Report.

    Hi,
    Check this link...How to call a report in Forms 10g ?
    Hope this works...
    Hamid

  • Timeout error while running Report

    Hi
    All,
    Windows 2000
    Oracle Report builder 10g
    Oracle developer suite 10g
    when I had OLD computer i was able to run report more than 10 minutes. Now, I got NEW computer and i am getting TIMEOUT error while running report more than 10 minutes.
    Any clue?
    Thanks,
    Vishal

    As Fs says it depends on how you're running the report.
    If you're running via a server then you need to make the change on that server or amend the URL you are using to run the report to add the enginereponsetimeout parameter.
    You can amend this parameter on the server either by using the Application Server Control as I described in my last post or by directly editing the config file. This file will be called <reportservername>.conf and can be found in the oracle_home/reports/conf directory.
    In this file look for the engine tag and see if the engineResponseTimeOut property is set.
    E.g:
    <engine id="rwEng" class="oracle.reports.engine.EngineImpl" initEngine="1" maxEngine="4" minEngine="1" engLife="50" maxIdle="20" callbackTimeOut="90000" engineResponseTimeOut="5">
    </engine>
    This value is in minutes so increase to a time larger than that it takes to run the report.
    If instead you're running the report via Report Builder on your own PC then look for a file called rwbuilder.conf in the same location on your PC and make the same change as described above.
    If this property isn't in the file then the engine isn't supposed to time out at all so the problem may well be something different. But to discount it try setting to a large value like 30.

  • FRM-92101 error while running report from form

    HI All,
    I am getting the form error FRM-92101 while running report from form menu.My code is given below:
    DECLARE
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    BEGIN
    repid := FIND_REPORT_OBJECT('REPORT47');
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    IF rep_status = 'FINISHED' THEN
    WEB.SHOW_DOCUMENT('http://192.168.0.21:8889/reports/rwservlet/getjobid'||
    substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver90','_blank');
    ELSE
    message('Error when running report');
    END IF;
    Clear_message;
    END;
    Clear_message;
    --Arif                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    hi Arif
    Please see this note on MOS/Metalink for some common causes of this error:
    Known Causes of FRM-92101 Error In Forms [ID 604633.1]
    thanks,
    AMN

  • Dataset can not be open error while running report rtcctool

    Hello Experts,
    While running report rtcctool we are gettin following dumps the says
    ABAP runtime errors    DATASET_CANT_OPEN
           Occurred on     05/27/2011 at 10:00:52
    Unable to open file "/usr/sap/B**/DVEBMGS00/sec/SAP_AGS_OLCNT_VERIFY.pse".
    I am aware that the eror is happening because of this file but not sure from where to get this file. Please let me know any of you aware about this.
    Regards
    Yogesh

    Hi all.
    I have the same problem and explore all possible solutions found in this discussion and others without satisfactory result.
    Everything points that may be an inconsistency error external certificate which is in the DB. Anyone know how to fix this.
    Greetings.

  • Error message: rep-4232, rep-4204 while running report

    hi
    if possible pl. reply me at: [email protected]
    i want to email my report by using report6i. i have given following parameters as per
    oracle note : 106549.1;
    destype: mail
    desformat: pdf
    desname: [email protected]
    i am running this application on window nt .
    in my system i am able to send emails using netscape browser. i am getting rep-4232, rep-4204 while running report when i run my report.
    pl. suggest.
    bye
    navdeep
    null

    i got one reply:
    This bug is fixed in version 6.0.8.12.0
    Please go through this bug document REP-4204 / REP-4232 WHEN EMAIL REPORT TO VALID EMAIL ADDRESS NOT IN ADDRESS BOOK for explanation.
    but problem is that i have 6.0.8.8.3
    how to resolve problem in this version

  • How to create a dynamic RTF report which creates dynamic columns based on dynamic column selection from a table?

    Hi All,
    Suppose I have table, whose structure changes frequently on daily basis.
    For eg. desc my_table gives you following column name on Day 1
    SQL > desc my_table;
    Output
    Name
    Age
    Phone
    On Day 2, two more columns are added, viz, Address and Salary.
    SQL > desc my_table;
    Output
    Name
    Age
    Phone
    Address
    Salary
    Now I want to create an Dynnamic RTF report which would fetch data from ALL columns from my_table on daily basis. For that I have defined a concurrent program with XML as output type and have attached a data template/data definition to it which takes in XML as input and gives final output of conc program in EXCEL layout. I am able to do this for constant number of columns, but dont know how to do it when the number of columns to be displayed changes dynamically.
    For Day 1 my XML file should be like this.
    <?xml version="1.0" encoding="UTF-8"?>
    <dataTemplate name="XYZ" description="iExpenses Report" Version="1.0">
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    SELECT Name
    ,Age
    ,Phone
    FROM my_table
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_my_table" source="Q2">
      <element name="Name" value="Name" />
      <element name="Age" value="Age" />
      <element name="Phone" value="Phone" />
    </group>
    </dataStructure>
    </dataTemplate>
    And my Day 1, EXCEL output from RTF template should be like this.
    Name     Age     Phone
    Swapnill     23     12345
    For Day 2 my XML file should be like this. With 2 new columns selected in SELECT clause.
    <?xml version="1.0" encoding="UTF-8"?>
    <dataTemplate name="XYZ" description="iExpenses Report" Version="1.0">
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    SELECT Name
    ,Age
    ,Phone
    ,Address
    ,Salary
    FROM my_table
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_my_table" source="Q2">
      <element name="Name" value="Name" />
      <element name="Age" value="Age" />
      <element name="Phone" value="Phone" />
      <element name="Address" value="Address" />
      <element name="Salary" value="Salary" />
    </group>
    </dataStructure>
    </dataTemplate>
    And my Day 2, EXCEL output from RTF template should be like this.
    Name     Age     Phone     Address     Salary
    Swapnill     23     12345         Madrid     100000
    Now, I dont know below things.
    Make the XML dynamic as in on Day 1 there must be 3 columns in the SELECT statement and on Day 2, 5 columns. I want to create one dynamic XML which should not be required to be changed if new columns are added in my_table. I dont know how to create this query and also create their corresponding elements below.
    Make the RTF template dyanamic as in Day1 there must 3 columns in EXCEL output and on Day 2, 5 columns. I want to create a Dynamic RTF template which would show all the columns selected in Dynamic XML.I dont know how the RTF will create new XML tags and how it will know where to place it in the report. Means, I can create RTF template on Day 1, by loading XML data for 3 columns and placing 3 XML tags in template. But how will it create and place tags for new columns on Day 2?
    Hope, you got my requirement, its a challenging one. Please let me know how I can implement the required solution using RTF dynamically without any manual intervention.
    Regards,
    Swapnil K.
    Message was edited by: SwapnilK

    Hi All,
    I am able to fulfil above requirement. Now I am stuck at below point. Need your help!
    Is there any way to UPDATE the XML file attached to a Data Definition (XML Publisher > Data Definition) using a standard package or procedure call or may be an API from backend? I am creating an XML dynamically and I want to attach it to its Data Definition programmatically using SQL.
    Please let me know if there is any oracle functionality to do this.
    If not, please let me know the standard directories on application/database server where the XML files attached to Data Definitions are stored.
    For eg, /$APPL_TOP/ar/1.0/sql or something.
    Regards,
    Swapnil K.

  • Out of Memory while running report

    Hi All,
    DB Version :- 10.1.0.5.0
    Our applications is used to genrate reports, where one report has limitations on the date range. This was due to 'out of memory' error which occured before and it was taking huge time to complete before. Now we have tune the SQL and its completeing in mins (performance increased by 80%) :-)
    Now we wanted to remove the 10 year limit and run for past 30 years data. when we reomve limitation it throws the below error message.
    "when others Error ORA-04030: out of process memory when trying to allocate 1872664 bytes (PLS non-lib hp,DARWIN) with query in ....package" .
    While running the report i asked DBA to check the usage and he mentioned that its at peak. Only one report using 42 GB of RAM.
    Can anyone provide me how to tackle the issue/start investigation to conclude the reason for the issue.
    When the report runs there some dynamic SQL's generated and report is completed.
    Regards,
    Sunny

    Hi All,
    DB Version :- 10.1.0.5.0
    I got the dynamic SQL's and from those found that this piece of SQL is taking huge time. It takes around 15 mins to complete.
    Below is the SQL
    SELECT
    X.TIME_PERIOD EXPOSURE_PERIOD, Y.TIME_PERIOD EVALUATION_PERIOD,b.BUSINESS_UNIT,
    decode(GROUPING(LOB_VALUE),1,'SEL',LOB_VALUE) BUSINESS_UNIT_LOB_ID_ACT,
    0 CALC_VALUE
    FROM
    ACTUARIAL_REF_DATA.TIME_PERIOD_HIERARCHY X, ACTUARIAL_REF_DATA.TIME_PERIOD_HIERARCHY Y,
    ANALYSIS_BUSINESS_UNITS B, ANALYSIS_LOBS L
    WHERE
    B.ANALYSIS_ID = L.ANALYSIS_ID
    AND X.TIME_PERIOD BETWEEN TO_NUMBER('198001') AND TO_NUMBER('201006')
    AND Y.TIME_PERIOD BETWEEN TO_NUMBER('198001') AND TO_NUMBER('201006')
    AND b.BUSINESS_UNIT='31003'
    AND LOB_VALUE IN (SELECT TO_NUMBER(LOB_VALUE) FROM ANALYSIS_LOBS WHERE ANALYSIS_ID=TO_NUMBER('3979'))
    GROUP BY X.TIME_PERIOD, Y.TIME_PERIOD,BUSINESS_UNIT,CUBE(LOB_VALUE)
    PLAN_TABLE_OUTPUT
    Plan hash value: 929111431
    | Id  | Operation                    | Name                       | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |                            |    26M|   996M|       |   203K  (3)| 00:47:35 |
    |   1 |  SORT GROUP BY               |                            |    26M|   996M|       |   203K  (3)| 00:47:35 |
    |   2 |   GENERATE CUBE              |                            |    26M|   996M|       |   203K  (3)| 00:47:35 |
    |   3 |    SORT GROUP BY             |                            |    26M|   996M|  2868M|   203K  (3)| 00:47:35 |
    |*  4 |     HASH JOIN                |                            |    35M|  1324M|       |  6694  (17)| 00:01:34 |
    |*  5 |      INDEX RANGE SCAN        | ANALYSIS_LOBS_PK           |    48 |   480 |       |     2   (0)| 00:00:01 |
    |*  6 |      HASH JOIN               |                            |   148M|  4097M|       |  5619   (1)| 00:01:19 |
    |   7 |       TABLE ACCESS FULL      | ANALYSIS_LOBS              | 24264 |   236K|       |    12   (0)| 00:00:01 |
    |   8 |       MERGE JOIN CARTESIAN   |                            |  3068K|    55M|       |  5584   (1)| 00:01:19 |
    |   9 |        MERGE JOIN CARTESIAN  |                            |  8401 |   114K|       |    20   (0)| 00:00:01 |
    |* 10 |         INDEX FAST FULL SCAN | ANALYSIS_BUSINESS_UNITS_PK |    23 |   207 |       |     3   (0)| 00:00:01 |
    |  11 |         BUFFER SORT          |                            |   365 |  1825 |       |    17   (0)| 00:00:01 |
    |* 12 |          INDEX FAST FULL SCAN| TIME_PERIOD_HIERARCHY_PK   |   365 |  1825 |       |     1   (0)| 00:00:01 |
    |  13 |        BUFFER SORT           |                            |   365 |  1825 |       |  5583   (1)| 00:01:19 |
    |* 14 |         INDEX FAST FULL SCAN | TIME_PERIOD_HIERARCHY_PK   |   365 |  1825 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       4 - access(TO_NUMBER("LOB_VALUE")=TO_NUMBER("LOB_VALUE"))
       5 - access("ANALYSIS_ID"=3979)
       6 - access("B"."ANALYSIS_ID"="L"."ANALYSIS_ID")
      10 - filter("B"."BUSINESS_UNIT"='31003')
      12 - filter("X"."TIME_PERIOD">=198001 AND "X"."TIME_PERIOD"<=201006)
      14 - filter("Y"."TIME_PERIOD">=198001 AND "Y"."TIME_PERIOD"<=201006)
    no.of rows returing :- 58404816
    Desc of the tables
    TABLE TIME_PERIOD_HIERARCHY
      TIME_PERIOD        NUMBER(6),
      QUARTER_DESC       VARCHAR2(6 CHAR),
      QUARTER_START      NUMBER(6),
      QUARTER_END        NUMBER(6),
      SEMI_ANNUAL_DESC   VARCHAR2(12 CHAR),
      SEMI_ANNUAL_START  NUMBER(6),
      SEMI_ANNUAL_END    NUMBER(6),
      YEAR               NUMBER(4),
      YEAR_START         NUMBER(6),
      YEAR_END           NUMBER(6)
    TABLE ANALYSIS_LOBS
      ANALYSIS_ID  NUMBER(10),
      LOB_TYPE_ID  NUMBER(1),
      LOB_VALUE    VARCHAR2(7 CHAR)
    TABLE ANALYSIS_BUSINESS_UNITS
      ANALYSIS_ID    NUMBER(10),
      BUSINESS_UNIT  VARCHAR2(5 CHAR)
    )Kindly let me know if there is any point where we can improve the performance.
    Regards,
    Sunny
    Edited by: k_17 on Nov 22, 2011 2:47 PM

  • Error while running report..

    Hi, We use 9iAS on linux and while running one report , we get this error:
    REP-0177: Error while running in remote server
    REP-300: date format is too long for internal buffer
    (sign(decode( ==> trunc(imp.tnr_matu_date),
    When i run the same report on my system (WINDOWS) it runs fine..Even on my dev UNIX box , it runs without any problem..Could somebody help me out?Thanks..

    Hi
    Check that eul user discoverer user has the select right to the data table(s).
    Ott Karesz
    http://www.trendo-kft.hu

  • Dynamic Columns requirement in a report

    Hi,
    I have a requirement in my report:
    Report takes Month &Year presentation Variable as a input and result should be dynamic 11 past months as columns in my report.
    Eg: If i select September 2011, Report should have 11 coumns which should start from August 2010 till September 2011
    If i select August 2011, Report should have 11 coumns which should start from July 2010 till August 2011
    Please suggest the optimized way to acheive this result.
    Thanks in Advance.
    Regards,
    Rahul

    This is more simpler...think logically. Suppose, you take current month-yr i.e. Sept 2011, then you want to show data from Aug 10 - Sept 11.
    Simply follow these:
    - Create a simple report say 'Mid Report' with 2 columns. Change the fx to give something like 1109 for Sept-11 and 1008 for Aug-10
    - This will give you 1 record with 2 values 1008 & 1109
    - In your main report creata a similar FX for Year-Month and put a filter based on other report. One less than eqaul to 1109 and One more than or equal to 1008. This will give you results for:
    1008
    1009
    1010
    1011
    1012
    1101
    1102
    1103
    1104
    1105
    1106
    1107
    1108
    1109
    This can be utilized to get any trend report

  • 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.?

  • Error while running reports in Portal

    Hi ,
    While running a crystal reports in portal a pop-up appears with the following error message
    " Sorry = you are not logged into this server. Ensure that your user name and password, as well as the APS name are correct. "
    Can anyone help on this?

    Can you provide more information about the SDK, product version, application server, etc. that you are using?
    That error message indicates that you are trying to retrieve a report from BusinessObjects Enterprise without entering the authentication information.

  • ERROR WHILE RUNNING REPORT THROUGH FORMS.....!

    hi all,
    ive designed one form in Forms 9i...I'm tryin to run report through a Push button .....report is running well in paper layout through report builder 9i...The problem I'm facing is dat when i pressed button it is giving me error initially as FRM-41214 cannot run report and after that FRM-40735 When button pressed unhandled exception ora-06502.....What could go wrong??... Ive started OC4J instance ....created report object in object nevigator as well and defined basic properties for diff.parameters HTMLCSS,CACHE..etc.,mentioned report path in complete i.e.c:\reports\genbill.rdf ...Can anybody help me out ??? Thnx.!
    -----------------------CODE ON BUTTON----------------------------------
    DECLARE
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    BEGIN
    repid := FIND_REPORT_OBJECT('REPORT5');
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    IF rep_status = 'FINISHED' THEN
    /*Display report in the browser*/
    WEB.SHOW_DOCUMENT('<HOSTNAME>:8889/reports/rwservlet/getjobid'||
    substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=myrepserver','_blank');
    ELSE
    message('Error when running report');
    END IF;
    PAUSE;
    END;

    When a report terminates with an error, REPORT_OBJECT_STATUS returns the value "TERMINATED_WITH_ERROR", which is 21 bytes of data, but rep_status is defined as 20 bytes. The 6502 error is due to the data not fitting the variable.
    I recommend wrapping the REPORT_OBJECT_STATUS function with a SUBSTR that limits the data returned to 20 bytes, which will ensure the results fit.
    For example:
    rep_status := SUBSTR(REPORT_OBJECT_STATUS(v_rep), 1, 20);

Maybe you are looking for