Problem counting dinamic column!

Hi,
I am trying to make something like a statistic of a table.
i have a table :
table(M) {
column(priority) data = hight ,medium, low
column(departement) = departement A, departement B, departement C
column(id_message)} = 1, 2 ,3 ..............
i wanted to creat a report output like this:
------------------------Hight---------Medium--------Low---------- Total
departement A ------1---------------2----------------2--------------5
departement B-------3---------------3----------------1--------------7
departement C-------2---------------2----------------2--------------6
with this code i obtain this output, but it is a static solution, that only works for 3 types of priorities and i nedd a dinamic solution
select department,
count(decode(priority,'high',id_message,null)) high,
count(decode(priority,'medium',id_message,null)) medium,
count(decode(priority,'low',id_message,null)) low,
count(id_message) Total
from m
group by department
order by department
can i make something like this:
create or replace function statistic_dep_prior
return clob
is
declare
i number;
j number;
begin
for i in 0..dp_id_departament loop
for j in 0..id_priority loop
count(id_ticket) departement,
end loop;
end loop;
count(id_ticket) Total
from V_TICKET
group by dp_id_departament
order by dp_id_departament
return('
<table>
<tr>
<td>Departament</td>
<td>Hight</td>
</tr>
<tr>
<td>Dep. A</td>
<td>10</td>
<td>20</td>
</tr>
</table>
end;
Thank´s
Pepe
Message was edited by:
Pepe

What you appear to be trying to do likely will work far better using a pipelined table function.
Try this:
EXPLAIN PLAN FOR
SELECT table_name
FROM user_tables;
SELECT * FROM TABLE(dbms_xplan.display);
[pre]
If that kind of control over formatting an output looks good then check out the demos here:
http://www.psoug.org/reference/pipelined.html
asktom.oracle.com and the docs at http://tahiti.oracle.com are also great resources for learning about them.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Problem with checkbox column in matrix

    Hello.
    I have a little problem with checkbox column in matrix.
    Column is binded to the UserData.
    It has ValOn="Y", ValOff="N".
    I use C++. It is wird problem. In matrix I have 10 columns - scrollbar role and if You want see checkbox column, You must role to the right. If this column is on the screen, and I use:
    checkcell->PutChecked(VARIANT_TRUE);
    then the checkbox is cheched, and if the checkbox isn`t on the screen and I use this comment - it nothing happening.
    I tried to use ValOn="Y", PutChecked...
    The problem i solved if the column is on the screen - if the column is first in matrix or second, but if it`s last I have a big problem.
    My column with checkbox is not editable, but I tried to make it editable, check it, and then make it uneditable - the same efect.
    How can I solve it ?
    Sorry for my english.
    Kamil Wydra

    Hello Kamil,
    I am not sure about your problem, but here is an example of how to use checkbox in UI API.
    First, create the matrix with checkbox column in Screen painter, and the output is an xml file, like this. Type as 121 indicates that it is a check box.
    - <column AffectsFormMode="0" backcolor="-1" description="" disp_desc="0" editable="0" right_just="0" title="Rented" type="121" uid="Rented" val_off="N" val_on="Y" visible="1" width="41">
      <databind alias="U_RENTED" databound="1" table="@VIDS" />
      <ExtendedObject />
    Second, bind the column to table from DB. This is a bug of 2004 Screen Painter, so if you are using 2005 Screen Painter, there is no problem.
    Third, when you open the form, you can check and uncheck the cell.
    BTW, please set the editable of the column to true.
    Hope this helps,
    Nick

  • Problems with Dinamic Link between Premiere pro CC and After Effects CC

    I'm having serious problems with dinamic link between premiere pro and after effects, really serious problems that have 2 big projects in trouble (a documentary and a video clip) and I had to redo all the work pipeline to the consumer.
    The documentary for a spanish TV was made on CC 2014 and a video clip was made on CC. Both of them with a lot of after effects composition in the premiere pro timeline. Render freeze, a lot of playback issues, and many more problems... Until I decided to remove these links between premiere and after effects and render out all the after effects compositions one by one and insert as clips in premiere pro. 1 week working away with back and fourth.
    I've got a huge workstation:
    i7 4990
    32Gb ram
    GTX780 3gb
    256 gb system ssd
    2 Tb project storage
    *All my hardware and software are update.
    I know that a lot of folks are on the same huge problem and I want to ask everyone:
    How do you save this?
    What is your pipeline?
    Are there any solution?
    Best practice to use dinamic link in a huge project?
    Thanks,
    Ruben Gimenez.
    R&D iceblink.es
    www.rambot.es

    Thank You, Jim -
    Unfortunately that specifically did not work.
    Based on another comment sent to me, here is what did.
    In PProCC
    File > Adobe Dynamic Link > New After Effects Composition
    In AECC
    From that composition created from PPro, I imported the project (aep) initially created in AECC from another team member. Saved the file.
    Back in PProCC
    File > Adobe Dynamic Link > Import After Effects Composition
    Magic.

  • Count of columns in a query

    All,
    Could anyone please clarify me on , how we can count the column's which were used in a query.
    Ex:    SELECT ENAME, EMPNO, SAL , JOB FROM EMP; 
    --Here in the above query, I have taken 4 columns(counted manually) . Instead of counting it manually is there any other way.
    Thanks

    It sounds like you're creating dynamic SQL.  Why are you doing that?  Dynamic SQL's would seem to indicate you don't know the structure of your own database or that your application design is trying to be generic rather than being designed in proper modularized units (1 unit does 1 task, not multiple generic tasks).  99.999% of the time, people using dynamic SQL indicates that they are misusing the database or haven't designed things properly.
    If there's really a valid reason for using dynamic SQL, then of course you can do it properly and use all the features of Oracle to get information about the dynamic SQL, but that means not using something as poor as EXECUTE IMMEDIATE (which is often abused by most people), or trying to use ref cursors within PL/SQL (which are more intended for 3rd party application layers).  The power of dynamic SQL is gained from using the DBMS_SQL package... as in the following simplistic example...
    SQL> set serverout on
    SQL> create or replace procedure run_query(p_sql IN VARCHAR2) is
      2    v_v_val     varchar2(4000);
      3    v_n_val     number;
      4    v_d_val     date;
      5    v_ret       number;
      6    c           number;
      7    d           number;
      8    col_cnt     integer;
      9    f           boolean;
    10    rec_tab     dbms_sql.desc_tab;
    11    col_num     number;
    12    v_rowcount  number := 0;
    13  begin
    14    -- create a cursor
    15    c := dbms_sql.open_cursor;
    16    -- parse the SQL statement into the cursor
    17    dbms_sql.parse(c, p_sql, dbms_sql.native);
    18    -- execute the cursor
    19    d := dbms_sql.execute(c);
    20    --
    21    -- Describe the columns returned by the SQL statement
    22    dbms_sql.describe_columns(c, col_cnt, rec_tab);
    23    --
    24    -- Bind local return variables to the various columns based on their types
    25
    26    dbms_output.put_line('Number of columns in query : '||col_cnt);
    27    for j in 1..col_cnt
    28    loop
    29      case rec_tab(j).col_type
    30        when 1 then dbms_sql.define_column(c,j,v_v_val,2000); -- Varchar2
    31        when 2 then dbms_sql.define_column(c,j,v_n_val);      -- Number
    32        when 12 then dbms_sql.define_column(c,j,v_d_val);     -- Date
    33      else
    34        dbms_sql.define_column(c,j,v_v_val,2000);  -- Any other type return as varchar2
    35      end case;
    36    end loop;
    37    --
    38    -- Display what columns are being returned...
    39    dbms_output.put_line('-- Columns --');
    40    for j in 1..col_cnt
    41    loop
    42      dbms_output.put_line(rec_tab(j).col_name||' - '||case rec_tab(j).col_type when 1 then 'VARCHAR2'
    43                                                                                when 2 then 'NUMBER'
    44                                                                                when 12 then 'DATE'
    45                                                       else 'Other' end);
    46    end loop;
    47    dbms_output.put_line('-------------');
    48    --
    49    -- This part outputs the DATA
    50    loop
    51      -- Fetch a row of data through the cursor
    52      v_ret := dbms_sql.fetch_rows(c);
    53      -- Exit when no more rows
    54      exit when v_ret = 0;
    55      v_rowcount := v_rowcount + 1;
    56      dbms_output.put_line('Row: '||v_rowcount);
    57      dbms_output.put_line('--------------');
    58      -- Fetch the value of each column from the row
    59      for j in 1..col_cnt
    60      loop
    61        -- Fetch each column into the correct data type based on the description of the column
    62        case rec_tab(j).col_type
    63          when 1  then dbms_sql.column_value(c,j,v_v_val);
    64                       dbms_output.put_line(rec_tab(j).col_name||' : '||v_v_val);
    65          when 2  then dbms_sql.column_value(c,j,v_n_val);
    66                       dbms_output.put_line(rec_tab(j).col_name||' : '||v_n_val);
    67          when 12 then dbms_sql.column_value(c,j,v_d_val);
    68                       dbms_output.put_line(rec_tab(j).col_name||' : '||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'));
    69        else
    70          dbms_sql.column_value(c,j,v_v_val);
    71          dbms_output.put_line(rec_tab(j).col_name||' : '||v_v_val);
    72        end case;
    73      end loop;
    74      dbms_output.put_line('--------------');
    75    end loop;
    76    --
    77    -- Close the cursor now we have finished with it
    78    dbms_sql.close_cursor(c);
    79  END;
    80  /
    Procedure created.
    SQL> exec run_query('select empno, ename, deptno, sal from emp where deptno = 10');
    Number of columns in query : 4
    -- Columns --
    EMPNO - NUMBER
    ENAME - VARCHAR2
    DEPTNO - NUMBER
    SAL - NUMBER
    Row: 1
    EMPNO : 7782
    ENAME : CLARK
    DEPTNO : 10
    SAL : 2450
    Row: 2
    EMPNO : 7839
    ENAME : KING
    DEPTNO : 10
    SAL : 5000
    Row: 3
    EMPNO : 7934
    ENAME : MILLER
    DEPTNO : 10
    SAL : 1300
    PL/SQL procedure successfully completed.
    SQL>

  • WebRowSet Problem  with database columns defined as TEXT??

    Hello,
    Can somebody help me on this subject. (http://forum.java.sun.com/thread.jspa?forumID=31&threadID=778586)
    I have the same problem with TEXT column when I try to populate the WebRowset.
    Thanks,
    Stephane

    OK,
    I change my postgresql driver for the lastest version (postgresql-8.2-506.jdbc3.jar) for JVM 1.5 and it's find...
    This driver support the javax.sql.
    St�phane
    Edited by: Borealis on Oct 15, 2007 12:43 PM

  • Set count of column in database......

    hi All,
    i just wanna to ask, it is possible that i can set count of column depends on data/input.
    for example;
    in common, when 2 column, code sql like:
    String query3 = "INSERT INTO Sheet5(Rule, Weight)" + "VALUES ('"+ finalRule+"', '"+weight+"')";but if n column, how?
    anybody knows or give me some idea to handle that..
    thanks.

    what do you means by using preparedStatement?
    is it like this
    String sql1 = "SELECT empno FRom emp WHERE empno = ?";
    String sql2 = "INSERT INTO emp VALUES (?,?,?,?,?,?,?,?)";
    PreparedStatement pstmt1 = conn.prepareStatement(sql1);
    PreparedStatement pstmt2 = conn.prepareStatement(sql2);
    pstmt1.setInt(1, 9999);
    ResultSet rset = pstmt1.executeQuery();
         if(rset.next()){
              System.out.println("The employee");
               rset.close();
         else {
                         pstmt2.setInt(1, 99990);
         pstmt2.setString(2, "CHARLIE");
         pstmt2.setString(3, "ANALYST");
         pstmt2.setInt(4, 7566);
         pstmt2.setString(5, "01-jan-01");
         pstmt2.setFloat(6, 12000);
         pstmt2.setFloat(7, (float)10.5);
         pstmt2.setInt(8, 10);
         pstmt2.executeUpdate();
         }so, i still need to write 8 times '?' for 8 column.
    but how if i don't know count of column?

  • Problems using "Edit Column Widths" feature in List View component

    Hello. I'm using a list view component (Xcelsius 4.5 Professional) to display a simple table of text from Excel. I want to adjust the width of the component colums so that all of them fit on the screen at the same time- regardless of how wide they are in the excel columns. The problem is the columns in excel are of variable length; I have no way to predict how wide they will be. The list view component always defaults to the widest column(s) so it ends up pushing some of the columns to the right and  I then have to use the scroll bar to see them. I thought the "edit column widths" would allow me to force the column widths in the component (potentially truncating some of the columns), but it does not work that way.
    How is the "edit column width" feature supposed to work? What does one enter in the value for each label? Are the units in pixels? When I start entering values I get all kinds of strange behavior...

    This was a great place for me to start
    Thank you
    I took profdant139's suggestions a bit further as my real goal was to have the "Document column" narrower. The goal to be able to see all the other document info that was usually hidden way out to the right
    To achieve my results I right clicked in the upper bar with the column names and chose from the drop down box "comments" column (as suggested). I then dragged it to the far right. This pushed all the other columns over.
    In the end of the day I ended up adding "Size" and "Date modified" columns as well to get my desired results.
    Remember one can move different columns around to be in the order you need by clicking on the column to get it active and then left click and drag it to where you want
    Another great thing is that by default (Using Mavericks) the date modified, opened,created columns have date and time. One can shrink them down to xx/xx/xx format by manually adjusting the column width like one does in Excel - click on column separator up top and drag
    Once all that is done, at least on my box, I closed it out and opened up a new finder window and everything was as I wanted.
    Thank you for the help  from the above helper to get me here

  • Count of Column

    I'm using Derby 10.5 via Command Interpreter
    I stucked at the count of column
    I need to know the command for getting number of columns used in a table .

    ibanezplayer85 wrote:
    Do you mean JTable? If so, check out the API. There's a method called [getColumnCount()|http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JTable.html#getColumnCount()] . If you're using a table model, there should also be a getColumnCount() method.
    If this isn't what you meant, you will probably have to clarify.My guess: that this isn't a Java question but rather is a Derby question, but this is just a SWAG. Who knows?

  • Query to count of Columns??

    How to count the number of columns of a table??
    Thanks in Advance,
    Babjan.

    Ora wrote:
    select count(1) from user_tab_cols where table_name = 'TEMP'
    There is a slight difference between user_tab_cols and user_tab_columns. And user_tab_cols is not suitable for counting table columns:
    SQL> create table tbl(n number)
      2  /
    Table created.
    SQL> select count(*)
      2  from all_tab_cols
      3  where owner = 'SCOTT'
      4  and table_name = 'TBL'
      5  /
      COUNT(*)
             1
    SQL> select count(*)
      2  from all_tab_columns
      3  where owner = 'SCOTT'
      4  and table_name = 'TBL'
      5  /
      COUNT(*)
             1
    SQL> create index tbl_fbi1
      2  on tbl(nvl(n,0))
      3  /
    Index created.
    SQL> select count(*)
      2  from all_tab_cols
      3  where owner = 'SCOTT'
      4  and table_name = 'TBL'
      5  /
      COUNT(*)
             2
    SQL> select count(*)
      2  from all_tab_columns
      3  where owner = 'SCOTT'
      4  and table_name = 'TBL'
      5  /
      COUNT(*)
             1
    SQL> SY.

  • SCOM-Difference between Problem Count and Event Count in Application Failure Analysis Report

    Dear All, 
    Could someone explain me clearly , the difference between  Problem Count and
    Event Count in Application Failure Analysis  Report. Please help me in understanding What is meant be problem and event in the report .
    Thanks in Advance.
    Regards,
    Rajesh Kumar C

    Hello Rajesh,
    The "problem" is the logically grouped set of the exception events which have the identical hash calculated over several fields as "Stack", "Source", "Failed Function" and so on... So, even if exceptions are different
    in the other properties but hash matches over the considered properties - then all those exceptions go into the same "problem group".
    So, event is an instance of the problem. One event contributes to one problem but one problem might have a huge event count if you have a repeating issue.
    The logic is similar for the performance analysis report, only fields that go into the "problem" hash are different. e.g. "Stack" is not used in hash for perf events...
    Dmitry Matveev

  • Help! Problem Updating Blob Columns

    Good day
    Please i have problems updating Blob columns storing images and doc files. can someone put me through the way out hassle free
    Thank You
    God Bless U all
    Femi

    I keep geting this error
    java.sql.SQLException: ORA-01729: database link name expected
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
    at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:955)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1169)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3368)
    when ever i try to update The Blob colum with a Blob object retrieved by resultset.getBlob from another Blob column of a different table.
    Blob b = rset.getBlob(1);
    String x = (String)jComboBox2.getSelectedItem();     
         ps=c.prepareStatement("UPDATE PROPERTIES SET "+x+" = "+b+" WHERE NAME = ?");
         ps.setString(1, (String)jComboBox1.getSelectedItem());
         System.out.println("success");
         ps.executeUpdate();

  • Problem with performing calculations on COUNT-aggregated columns

    Hi guys,
    I have something weird - 2 columns with Aggregation set to Count, both are from the same Fact table. Indicators are in the same Fact table.
    Count column A (with FILTER key_column USING Indicator1='yes')
    Count column B (with FILTER key_column USING Indicator1='yes' and Indicator2='yes')
    They show fine by themselves.
    However, when I create a column C where:
    Column B / Column A - I get nulls.
    I tried both filtering logical content with Filter and also running CASE WHEN , etc.
    Anyone else had it?

    Well, it certainly has to do something with IFNULL. Now, when I did what you suggested, I get correct numbers, but only after i drill-down from top level. I'll try to tweak with levels and see what's up.
    Success:
    not only it's important to use IFNULL, but also it's important to set level aggregation for A and B (i set it to Fiscal Year). Thanks for assistance
    Message was edited by:
    wildmight

  • SQL REPORT BUT SEARCH PROBLEM ON CREATED_ON Column

    Hi Friend,
    i have create SQL Report .
    My Code
    select      CRM_SALES_DEALs.id,
                        "CRM_SALES_CUSTOMERS"."CUSTOMER_NAME" as "CUSTOMER_NAME",
          "CRM_SALES_SALESREPS"."REP_LAST_NAME"||', '||
          "CRM_SALES_SALESREPS"."REP_FIRST_NAME" as "REP_NAME",
           "CRM_SALES_DEALS"."DEAL_CLOSE_DATE" as "DEAL_CLOSE_DATE",
           "CRM_SALES_DEALS"."DEAL_PROBABILITY" as "DEAL_PROBABILITY",
          "CRM_SALES_DEAL_STATUS_CODES"."STATUS_CODE" as "STATUS_CODE" ,
             "CRM_SALES_DEALS"."DEAL_AMOUNT" *
             "CRM_SALES_DEALS"."DEAL_PROBABILITY" / 100 weighted_forecast,
    (select count(*) from CRM_SALES_DEAL_notes where deal_id = "CRM_SALES_DEALS".id) notes,
    (select count(*) from CRM_SALES_DEAL_products where deal_id = "CRM_SALES_DEALS".id) products,
    nvl("CRM_SALES_DEALS".updated_on,"CRM_SALES_DEALS".created_on) last_changed,
    t.territory_name,
    CRM_SALES_DEALS.qtr, "CRM_SALES_DEALS"."CONTACT_NAME" as "CONTACT_NAME"
    from     
    "CRM_SALES_SALESREPS",
    "CRM_SALES_DEAL_STATUS_CODES" ,
    "CRM_SALES_CUSTOMERS",
    "CRM_SALES_DEALS",
    CRM_SALES_territories t
    where  
    CRM_SALES_customers.customer_territory_id = t.id(+) and
    "CRM_SALES_DEALS"."CUSTOMER_ID"="CRM_SALES_CUSTOMERS"."ID"(+)
    and      "CRM_SALES_DEALS"."DEAL_STATUS_CODE_ID"="CRM_SALES_DEAL_STATUS_CODES"."ID"(+)
    and      "CRM_SALES_DEALS"."SALESREP_ID_01"="CRM_SALES_SALESREPS"."ID"(+)
    and (:p1_find is null or instr(upper("CRM_SALES_CUSTOMERS"."CUSTOMER_NAME"),upper(:p1_find))>0 or instr(upper("CRM_SALES_DEALS"."DEAL_NAME"),upper(:p1_find))>0 or
    instr(upper("CRM_SALES_SALESREPS"."REP_FIRST_NAME"||' '||"CRM_SALES_SALESREPS"."REP_LAST_NAME"),upper(:p1_find))>0)
    and
    (nvl(:P1_TERRITORY,0) = 0 or t.id= :P1_TERRITORY)
    and
    (nvl(:P1_ACCOUNT,0) = 0 or "CRM_SALES_CUSTOMERS".id = :P1_ACCOUNT)
    and
    (nvl(:P1_QUARTER,'0') = '0' or CRM_SALES_deals.qtr = :P1_QUARTER)
    and
    nvl(DEAL_PROBABILITY,10) between nvl(:P1_MINIMUM_PROBABILITY,0) and nvl(:P1_MAXIMUM_PROBABILITY,100) or
    instr(upper("CREATED_ON"),upper(nvl(:P1_CREATE_DATE,"CREATED_ON")))My TAble
    CREATE TABLE  "CRM_SALES_DEALS"
       (     "ID" NUMBER,
         "CUSTOMER_ID" NUMBER NOT NULL ENABLE,
         "DEAL_NAME" VARCHAR2(255),
         "DEAL_CLOSE_DATE" DATE NOT NULL ENABLE,
         "DEAL_CLOSE_DATE_ALT" DATE,
         "DEAL_STATUS_CODE_ID" NUMBER,
         "DEAL_CUSTOMER_LOCATION" VARCHAR2(4000),
         "CREATED_BY" VARCHAR2(255),
         "CREATED_ON" DATE,
         "UPDATED_BY" VARCHAR2(255),
         "UPDATED_ON" DATE,
         "QTR" VARCHAR2(8),
         "DEPARTURE_DATE" DATE,
         "DEAL_SOURCE" VARCHAR2(15),
         "ADDRESS1" VARCHAR2(255),
          PRIMARY KEY ("ID") ENABLE
    /i want to search with CREATE_ON Column.
    How can i create code for search in my Quary Code.
    My Item is :P1_CREATE_DATE
    I have try it in last Line in code but it's show me Error.Invalid Relational Operator .
    How can i slove and serch with Created_on Column.
    Thanks
    Edited by: 805629 on Dec 27, 2010 9:13 PM
    Edited by: 805629 on Dec 27, 2010 9:13 PM

    Hi Friends,
    i have sortout this problem.
    Thanks

  • Counter in column GUI ALV GRID

    Hello every one, I have a alv grid, and i have a column where i need to put a counter in the cell, so every time a new row is added, the cell of that column will be incrementing in a number and show it in the cell automatic.
    Im new in abap, so i hope could show me some code to do it. Thanks

    Hi Naimesh, thak you for your answer, it helps me to solve the problem, i let the code here for other people could use it.
    DATA:
            vl_consec              TYPE I,
            p_data                    TYPE REF TO cl_alv_changed_data_protocol.
            wa_rowid               TYPE lvc_s_roid,                 
            wa_inserted_rows TYPE lvc_s_roid,
            wa_dll                     LIKE LINE OF vg_ti_dll,
            wa_insert               LIKE LINE OF vg_ti_dll.
    "get the row inserted using the class CL_ALV_CHANGED_DATA_PROTOCOL.
        LOOP AT p_data->mt_roid_front INTO wa_rowid.
          READ TABLE p_data->mt_inserted_rows INTO wa_inserted_rows WITH KEY row_id = wa_rowid-row_id.
             CHECK sy-subrc = 0.
    "get the highest number from the table
    SORT vg_ti_dll BY consec DESCENDING.
                  READ TABLE vg_ti_dll INTO wa_dll INDEX 1.
         wa_insert-consec  = wa_dll-consec.
    INSERT wa_insert INTO vg_ti_dll INDEX wa_insert-consec.
                CALL METHOD p_data->modify_cell
                EXPORTING
                  i_row_id    = wa_rowid-row_id
                  i_fieldname = 'CONSEC'
                  i_value     = wa_dll-consec.
    ENDLOOP.

  • Problem in matrix Column

    Hi,
    In a matrix column if all row contains data 'A' means in the header text it should display 'A'  but if in matrix column if 5 rows contains 'A' and 3 rows contains 'B' means in the header text should display 'B'. How to do this i have done but its not working correctly in all entries.
    Regards,
    madhavi

    Hi Madhavi,
    sounds like an algorithm problem in your code.
    you problem should be no big deal:
    1. you have have two counter variables
    2. go through the matrix.rowcount
    3. look in the column if there's A or B
    4. add 1 to the correct counter
    5. look which counter is higher - more A or more B
    6. set the column title.
    lg David

Maybe you are looking for