ALV - Group columns and multiple header

Hello,
Is it possible to have a common header for multiple columns in an ALV grid ( OO based).
Example:
HdrLine1>>>     Header1           Header2
HdrLine2>>>   Fld1 Fld2 Fld3    Fld4 Fld5 Fld6
Thanks
Hiri

Thanks!
I did some research and maybe I can use CL_GUI_COLUMN_TREE class to achieve this. Is there a way to edit the fields of the columns?
HD

Similar Messages

  • ALV display column and row wise

    hi experts,
    Is it possible to display in ALV display as 6 fields in column and some ranges in row display so how to display that using alv grid any sample report please do send me.
    e.g.display format.
                   PO Type          Shipping Date          Invoice Num          PCS  #        Po No.          Cust Name          Terms          Open Balance
    Current                                                                           
    Total Current                                                                           
    1 - 15                                                                           
    Total 1 - 15                                                                           
    16-30                                                                           
    Total 16-30                                                                           
    31 - 60                                                                           
    Total 31 - 60                                                                           
    61 - 90                                                                           
    Total 61 - 90                                                                           
    > 90                                                                           
    Total > 90                                                                           
    TOTAL

    hi Lakshman,
    i want report for customer open invoices that is aging report,
    so depens on due days as per ranges shown in my question like 1--15 days,
    15-16 days these are due days ranges , and i have display these related ranges records horizontally , just understand my display format u will get what i mean to say,
    please send me any proper solution.
    Thanks and Regards,
    Yogesh

  • Advanced datagrid with grouped columns and grouped rows

    hello every body, plz need your experience help. 'cause Im so new using FLEX
    I have an XML (like an XML data type) something like this
    <Table>
      <Rows>
        <cAgencia>F0002</cAgencia>
        <cAgNombre>SanBorja</cAgNombre>
        <cTVentanilla>V0002</cTVentanilla>
        <dTVNombre>Plataforma</dTVNombre>
        <TcksEnEspera>20</TcksEnEspera>
        <VentsEnAtencion>50</VentsEnAtencion>
      </Rows>
      <Rows>
         <cAgencia>F0003</cAgencia>
         <cAgNombre>Miraflores</cAgNombre>
         <cTVentanilla>V0002</cTVentanilla>
         <dTVNombre>Plataforma</dTVNombre>
         <TcksEnEspera>30</TcksEnEspera>
         <VentsEnAtencion>40</VentsEnAtencion>
       </Rows>
      <Rows>
         <cAgencia>F0002</cAgencia>
         <cAgNombre>SanBorja</cAgNombre>
         <cTVentanilla>V0003</cTVentanilla>
         <dTVNombre>Caja</dTVNombre>
         <TcksEnEspera>55</TcksEnEspera>
         <VentsEnAtencion>25</VentsEnAtencion>
       </Rows>
       ...... (continue)
    </Table>
    so, I need to make a table (I guess with advancedDataGrid) something like this
    as you can see,   I have to group them by columns and Rows.  I have found a "mx:groupedColumns" that maybe could help me , but I couldn't find something like "mx:groupedRows".
    The grid may be dynamic,   for example if I have another XML node like:
      <Rows>
         <cAgencia>F0004</cAgencia>
         <cAgNombre>SanMiguel</cAgNombre>
         <cTVentanilla>V0002</cTVentanilla>
         <dTVNombre>Plataforma</dTVNombre>
         <TcksEnEspera>15</TcksEnEspera>
         <VentsEnAtencion>52</VentsEnAtencion>
       </Rows>
    the grid may add a ROW and in the column of plataforma add the data: 15 and 52, so the grid may be something like this:
    as you can see, the grid may add rows and columns in depends of the count of XML data.
    plz help.
    thanks, regards  from Lima, Peru.
    JS

    any help ????????? I found OLAPDataGrid .....   I was thinking to send all the data into a bidimensional Array , then pass the data of my bidimensionalArray to  OLAPDataGrid ...  but I'n not sure if Flex is able to do it  .... 
    the really serious problem is the special ROW I must use ...
    regards
    JS

  • Webdynpro IWDTable - Item table , grouped column and Column difference?

    I had added Column to Table in webdynpro java UI
    but , when I am getting the values for the same from BAPI was displayed but , when I am saving , it is not saving
    Is there any difference between GroupedColumn and Column?
    The other columns which were there in the table are all Grouped Column for the ItemTable.
    Also, when I deployed the code in the j2ee server, when I open my UWL , the columns are displayed in the bottom .. whether it is coming because I have not groupedcolumn?
    Thanks in advance...
    Kiran

    I had added Column to Table in webdynpro java UI
    but , when I am getting the values for the same from BAPI was displayed but , when I am saving , it is not saving
    Is there any difference between GroupedColumn and Column?
    The other columns which were there in the table are all Grouped Column for the ItemTable.
    Also, when I deployed the code in the j2ee server, when I open my UWL , the columns are displayed in the bottom .. whether it is coming because I have not groupedcolumn?
    Thanks in advance...
    Kiran

  • Including both the Jquery script to calculate the total of calculated column and freeze header row

    Hi
    I managed to get this code from here,
    http://techtrainingnotes.blogspot.in/2013/03/freezing-title-row-of-sharepoint-2010.html done on the page 
    I also managed to get this code from here, http://www.sharepointed.com/2012/11/28/jquery-total-calculated-column-in-sharpoint-2010/ done on another page.
    However, I need this to be done on the same page. When I do this, I only get the freeze header thingy to be up and not the calculated column. Could something be blocking. 

    Hi,
    You take the code below for a try in your environment after modified it a bit to suit the structure of your page:
    <script type="text/javascript" src="../../SiteAssets/js/jquery-1.10.2.min.js"></script>
    <script type="text/javascript">
    // update the list after the page has loaded
    _spBodyOnLoadFunctionNames.push("TTNListScroll");
    function TTNListScroll()
    // Scrolling list code from TechTrainingNotes.blogspot.com
    // Edit the next line with your list's summary name
    var SummaryName = "List28_frozenheader ";
    var TTNmyTable;
    var TTNListDiv = document.createElement('div');
    var TTNHeadingDiv = document.createElement('div');
    var tables = document.getElementsByTagName("table");
    for (var i=0;i<tables.length;i++)
    if(tables[i].summary == SummaryName)
    TTNmyTable = tables[i];
    break;
    if(TTNmyTable == undefined)
    // // Table not found!
    // you may want to comment out the next line after testing
    alert("table '" + SummaryName + "' not found");
    return;
    // make a copy of the table for the heading area
    TTNHeadingDiv.appendChild(TTNmyTable.cloneNode(true));
    TTNHeadingDiv.id="TTNheading";
    TTNListDiv.appendChild(TTNmyTable.cloneNode(true));
    TTNListDiv.id="TTNlist";
    TTNListDiv.width="100%";
    // udpate the page
    var TTNnode = TTNmyTable.parentNode;
    TTNnode.replaceChild(TTNHeadingDiv, TTNmyTable);
    TTNnode.appendChild(TTNListDiv);
    // hide the heading row of the main list
    TTNListDiv.childNodes[0].rows[0].style.visibility='hidden';
    // make the DIV for the heading the same width as the main list
    TTNHeadingDiv.childNodes[0].style.width = TTNListDiv.childNodes[0].offsetWidth;
    getSum(3);
    //pass the column number to this function
    function getSum(col)
    var m = "$"; //change to "" for non-money format
    var arrayList = $("table.ms-listviewtable:first> tbody> tr:gt(0)").find(">td:eq("+col+")");
    var x = 0;
    var p1 = "";
    var p2 = "";
    $.each(arrayList, function(){
    //console.log('$(this).text(): '+$(this).text());
    x += Number($(this).text().replace(/\$|,|\)/g, "").replace(/\(/g,"-"));
    //console.log('x: '+x);
    //format for negative numbers
    if (x < 0)
    p1 = "(";
    p2 = ")";
    x = Math.abs(x);
    $('#diidSortcal').attr('visibility','visible');
    $('#diidSortcal').text($('#diidSortcal').text()+'(sum: '+x+')');
    function addCommas(nStr)
    //formats number
    nStr += '';
    x = nStr.split('.');
    x1 = x[0];
    x2 = x.length > 1 ? '.' + x[1] : '';
    var rgx = /(\d+)(\d{3})/;
    while (rgx.test(x1))
    x1 = x1.replace(rgx, '$1' + ',' + '$2');
    return x1 + x2;
    </script>
    <style type="text/css">
    #TTNheading
    height:28px;
    #TTNlist
    height:200px;
    overflow-y:scroll !important;
    overflow-x:auto
    </style>
    Then you might get something like this:
    Feel free to reply if there are still any questions.
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to create total column and change heading

    I have a region that is display only - financials. I need to add total columns after data is displayed. Does framework support this or will I need to do this in java.
    Secondly I will need to change the column heading to current year - ie '2008'.
    From previous thread I tried the following in processRequest but getting exception
    String tt = "Testing";
    OATableBean table = (OATableBean)webBean.findIndexedChildRecursive("CustFinancialFullVO1");
    table.prepareForRendering(pageContext);
    OAMessageStyledTextBean aa = (OAMessageStyledTextBean)webBean.findIndexedChildRecursive("CurrentYear");
    aa.setPrompt(tt);
    New to oaf and java but just looking for some direction.
    Thanks

    Framework, supports inbuilt support to total feature, check tables section in dev guide.
    --Mukul                                                                                                                                                                                                                                   

  • How to Make FUNCTION to return multiple column and multiple row output

    Hi All,
    Kindly Share ur Idea;Thanks in Advance;
    i Have Table Demo.
    table DEMO:
    id name
    1 a10
    1 a11
    1 a12
    2 b10
    2 b11
    3 ccc
    and the function is like:
    create or replace function (p1 number) return varchar2 as
    vid number;
    vname varchar2(20);
    begin
    select id,name into vid,vname from demo where id=p1;
    return v1;
    end;
    this function returns output for id=3;
    BUT,
    i need output as (for input as 1)
    vid vname
    1 a10
    1 a11
    1 a12

    A function returns a single datatype.
    That datatype may be an atomic datatype (varchar2, number etc.) or it may be an object/record datatype, or even a collection datatype.
    Where are you going to use this function? In PL/SQL or SQL?
    If you are wanting to use it in SQL, then you would need a pipelined function e.g.
    SQL> CREATE OR REPLACE TYPE myemp AS OBJECT
      2  ( empno    number,
      3    ename    varchar2(10),
      4    job      varchar2(10),
      5    mgr      number,
      6    hiredate date,
      7    sal      number,
      8    comm     number,
      9    deptno   number
    10  )
    11  /
    Type created.
    SQL> CREATE OR REPLACE TYPE myrectable AS TABLE OF myemp
      2  /
    Type created.
    SQL> CREATE OR REPLACE FUNCTION pipedata(p_min_row number, p_max_row number) RETURN myrectable PIPELINED IS
      2    v_obj myemp := myemp(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
      3  BEGIN
      4    FOR e IN (select *
      5              from (
      6                    select e.*
      7                          ,rownum rn
      8                    from (select * from emp order by empno) e
      9                   )
    10              where rn between p_min_row and p_max_row)
    11    LOOP
    12      v_obj.empno    := e.empno;
    13      v_obj.ename    := e.ename;
    14      v_obj.job      := e.job;
    15      v_obj.mgr      := e.mgr;
    16      v_obj.hiredate := e.hiredate;
    17      v_obj.sal      := e.sal;
    18      v_obj.comm     := e.comm;
    19      v_obj.deptno   := e.deptno;
    20      PIPE ROW (v_obj);
    21    END LOOP;
    22    RETURN;
    23  END;
    24  /
    Function created.
    SQL> select * from table(pipedata(1,5));
         EMPNO ENAME      JOB               MGR HIREDATE                    SAL       COMM     DEPTNO
          7369 SMITH      CLERK            7902 17-DEC-1980 00:00:00        800                    20
          7499 ALLEN      SALESMAN         7698 20-FEB-1981 00:00:00       1600        300         30
          7521 WARD       SALESMAN         7698 22-FEB-1981 00:00:00       1250        500         30
          7566 JONES      MANAGER          7839 02-APR-1981 00:00:00       2975                    20
          7654 MARTIN     SALESMAN         7698 28-SEP-1981 00:00:00       1250       1400         30
    SQL> select * from table(pipedata(6,10));
         EMPNO ENAME      JOB               MGR HIREDATE                    SAL       COMM     DEPTNO
          7698 BLAKE      MANAGER          7839 01-MAY-1981 00:00:00       2850                    30
          7782 CLARK      MANAGER          7839 09-JUN-1981 00:00:00       2450                    10
          7788 SCOTT      ANALYST          7566 19-APR-1987 00:00:00       3000                    20
          7839 KING       PRESIDENT             17-NOV-1981 00:00:00       5000                    10
          7844 TURNER     SALESMAN         7698 08-SEP-1981 00:00:00       1500          0         30
    SQL> select * from table(pipedata(11,15));
         EMPNO ENAME      JOB               MGR HIREDATE                    SAL       COMM     DEPTNO
          7876 ADAMS      CLERK            7788 23-MAY-1987 00:00:00       1100                    20
          7900 JAMES      CLERK            7698 03-DEC-1981 00:00:00        950                    30
          7902 FORD       ANALYST          7566 03-DEC-1981 00:00:00       3000                    20
          7934 MILLER     CLERK            7782 23-JAN-1982 00:00:00       1300                    10
    SQL>If you are using it in PL/SQL then just populating a collection datatype and returning that will do. Though you should question why you want to pass large amounts of data around like that first.
    Explain your purpose and what you are intending to do and we can recommend the best way.
    {message:id=9360002}

  • How can I do a Header Group Using Group columns for WD ALV tables

    Hi
    I want to group columns into a header group.
    Eg:
                       from Date
    Availability
                       to date
    Any ideas if it is possible with WD ALV tables?

    Hi,
    Try to use the if_salv_wd_field_settings for the column grouping of the Model object.
    Also check the class CL_SALV_WD_FIELD.
    Regards,
    Lekha.

  • Display only one row for distinct columns and with multiple rows their valu

    Hi,
    I have a table having some similar rows for some columns and multiple different rows for some other columns
    i.e
    o_mobile_no o_doc_date o_status d_mobile_no d_doc_date d_status
    9825000111 01-jan-06 'a' 980515464 01-feb-06 c
    9825000111 01-jan-06 'a' 991543154 02-feb-06 d
    9825000111 01-jan-06 'a' 154845545 10-mar-06 a
    What i want is to display only one row for above distinct row along with multiple non distinct colums
    ie
    o_mobile_no o_doc_date o_status d_mobile_no d_doc_date d_status
    9825000111 01-jan-06 'a' 980515464 01-feb-06 c
    991543154 02-feb-06 d
    154845545 10-mar-06 a
    regards,
    Kumar

    Re: SQL Help

  • How do I lock columns and rows in numbers?

    I have a large spreadsheet and I want to scroll up, down, left and right without the need to go up and down to find the name of the column or row where the information goes into.
    In Excel you lock a column or row just as easy but in numbers I have looked everywhere and don´t find an answer to this (otherwise) simple procedure.
    Thanks tho anyone who can help me.

    Hi Laura,
    The commands you are looking for are "Freeze Header Rows" and "Freeze Header Columns", both found in the Table menu.
    To use them, you must first convert the rows and columns you want to keep visible as Header Rows and Header Columns. You can define up to five of each. Rows must be at the top of the table and columns at the left, and multiple header rows/columns must be contiguous.
    Be aware that the conversion is not (easily) reversable, and that multiple headers (and footer rows) tend to slow large tables significantly.
    To convert an eligible row, hover the mouse over the row reference tab, then click the triangle when it appears. If the row is eligible for conversion (ie. if it is the top non-header row on the table, and is in the top five rows), you will see the option to "Convert to Header Row, seen below for row 2:.
    Regards,
    Barry

  • Display 80 characters of PO text in ALV grid column?

    Hi Guys,
                 I just want to display only 80 characters of PO Header text in the ALV grid column and  the rest should appear when we move the Mouse on to the each ALV grid'd POtext column. So how is it possible 1st tell me how to display 80 characters of PO text.?
      in ME23n u can see the PO  header text.
    Thanks ,
    Gopi.

    Hi Gopi,
    Are you displaying ALV in your custom report and you want to show just 80 char in output?
    If this is yes:
    You can set ALV column width as 80 CHAR while building field catalog.
    Column cell will have complete text but when ALV appears it will first show first 80 char.
    thnx,
    ags.

  • Check current user exist people or group column

    How to check current logged in user name already exist in people or group column of share-point custom list 2013 using c#?
    Note: People or group column contains multiple items.
    Thanks in advance

    You can use javascript to get current user and then perform vlookup on the field
    Current use
    function CallClientOM()
    var context = new SP.ClientContext.get_current();
    this.website = context.get_web();
    this.currentUser = website.get_currentUser();
    context.load(currentUser);
    context.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    function onQuerySucceeded(sender, args)
    alert(currentUser.get_loginName());
    function onQueryFailed(sender, args)
    alert('request failed ' + args.get_message() + '\n'+ args.get_stackTrace());
    http://spjsblog.com/2010/03/18/vlookup-type-rollup-for-sharepoint/
    If this helped you resolve your issue, please mark it Answered

  • ALV with multiple header & dynamic columns

    Hello All,
    I have a requirement where in I need to print multiple header in alv.
    For eg.
    User Name : <Name_1>
    Channel     : <Channel_1>
    Sale Org    : <Sales Org_1>
    Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8
    User Name : <Name_2>
    Channel     : <Channel_2>
    Sale Org    : <Sales Org_2>
    Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8
    no of columns (Col1 , col2 )  are dynamic  . Which would be the best alv type do I need do use?  Is it possible using simple alv grid display. How to handle dynamic column.
    Thnx.

    it is not possible with normal grid or list.
    I guess it is possible by using ALV Block list
    Modified below program to get mutiple header
    REPORT z_alv_block_list.
    Type-pools
    TYPE-POOLS: slis.
    Data declarations.
    DATA: BEGIN OF t_vbak OCCURS 0,
            vbeln TYPE vbeln,
            bstnk TYPE vbak-bstnk,
            erdat TYPE vbak-erdat,
            kunnr TYPE vbak-kunnr,
          END OF t_vbak.
    DATA: BEGIN OF t_vbap OCCURS 0,
            vbeln  TYPE vbeln,
            matnr  TYPE vbap-matnr,
            netpr  TYPE vbap-netpr,
            waerk  TYPE vbap-waerk,
            kwmeng TYPE vbap-kwmeng,
            meins  TYPE vbap-meins,
          END OF t_vbap.
    DATA: t_fieldcatalog1 TYPE slis_t_fieldcat_alv.
    DATA: t_fieldcatalog2 TYPE slis_t_fieldcat_alv.
    DATA: v_repid         TYPE syrepid.
    DATA: s_layout        TYPE slis_layout_alv.
    DATA: v_tabname       TYPE slis_tabname.
    DATA: t_events        TYPE slis_t_event.
    start-of-selection event.
    START-OF-SELECTION.
      v_repid = sy-repid.
    Get the fieldcatalog for the first block
      PERFORM get_fieldcat1 CHANGING t_fieldcatalog1.
    Get the fieldcatalog for the second block
      PERFORM get_fieldcat2 CHANGING t_fieldcatalog2.
    Get the data for the first block
      SELECT vbeln bstnk erdat kunnr UP TO 10 ROWS
             INTO TABLE t_vbak
             FROM vbak WHERE vbeln > '0060000100'.
    Get the data for the second block
      SELECT vbeln matnr netpr waerk kwmeng meins UP TO 10
    ROWS
             INTO TABLE t_vbap
             FROM vbap WHERE vbeln > '0060000100'.
    init
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
           EXPORTING
                i_callback_program = v_repid.
    First block
      v_tabname = 'ITAB1'.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
           EXPORTING
                is_layout   = s_layout
                it_fieldcat = t_fieldcatalog1
                i_tabname   = v_tabname
                it_events   = t_events
           TABLES
                t_outtab    = t_vbak.
    Second block
      v_tabname = 'ITAB2'.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
           EXPORTING
                is_layout   = s_layout
                it_fieldcat = t_fieldcatalog2
                i_tabname   = v_tabname
                it_events   = t_events
           TABLES
                t_outtab    = t_vbap.
    *Display
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
          FORM GET_FIELDCAT1                           
          Get the field catalog for the first block    
    FORM get_fieldcat1 CHANGING lt_fieldcatalog TYPE
    slis_t_fieldcat_alv.
      DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    Order number
      s_fieldcatalog-col_pos       = '1'.
      s_fieldcatalog-fieldname     = 'VBELN'.
      s_fieldcatalog-tabname       = 'T_VBAK'.
      s_fieldcatalog-ref_tabname   = 'VBAK'.
      s_fieldcatalog-ref_fieldname = 'VBELN'.
      APPEND s_fieldcatalog TO lt_fieldcatalog.
      CLEAR s_fieldcatalog.
    Customer purchase order.
      s_fieldcatalog-col_pos       = '2'.
      s_fieldcatalog-fieldname     = 'BSTNK'.
      s_fieldcatalog-tabname       = 'T_VBAK'.
      s_fieldcatalog-ref_tabname   = 'VBAK'.
      s_fieldcatalog-ref_fieldname = 'BSTNK'.
      APPEND s_fieldcatalog TO lt_fieldcatalog.
      CLEAR s_fieldcatalog.
    Creation date.
      s_fieldcatalog-col_pos       = '3'.
      s_fieldcatalog-fieldname     = 'ERDAT'.
      s_fieldcatalog-tabname       = 'T_VBAK'.
      s_fieldcatalog-ref_tabname   = 'VBAK'.
      s_fieldcatalog-ref_fieldname = 'ERDAT'.
      APPEND s_fieldcatalog TO lt_fieldcatalog.
      CLEAR s_fieldcatalog.
    Customer
      s_fieldcatalog-col_pos       = '4'.
      s_fieldcatalog-fieldname     = 'KUNNR'.
      s_fieldcatalog-tabname       = 'T_VBAK'.
      s_fieldcatalog-ref_tabname   = 'VBAK'.
      s_fieldcatalog-ref_fieldname = 'KUNNR'.
      APPEND s_fieldcatalog TO lt_fieldcatalog.
      CLEAR s_fieldcatalog.
    ENDFORM.
          FORM GET_FIELDCAT2                           
          Get the field catalog for the second block   
    FORM get_fieldcat2 CHANGING lt_fieldcatalog TYPE
    slis_t_fieldcat_alv.
      DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    Order number
      s_fieldcatalog-col_pos       = '1'.
      s_fieldcatalog-fieldname     = 'VBELN'.
      s_fieldcatalog-tabname       = 'T_VBAP'.
      s_fieldcatalog-ref_tabname   = 'VBAP'.
      s_fieldcatalog-ref_fieldname = 'VBELN'.
      APPEND s_fieldcatalog TO lt_fieldcatalog.
      CLEAR s_fieldcatalog.
    Material number
      s_fieldcatalog-col_pos       = '2'.
      s_fieldcatalog-fieldname     = 'MATNR'.
      s_fieldcatalog-tabname       = 'T_VBAP'.
      s_fieldcatalog-ref_tabname   = 'VBAP'.
      s_fieldcatalog-ref_fieldname = 'MATNR'.
      APPEND s_fieldcatalog TO lt_fieldcatalog.
      CLEAR s_fieldcatalog.
    Net price
      s_fieldcatalog-col_pos       = '3'.
      s_fieldcatalog-fieldname     = 'NETPR'.
      s_fieldcatalog-tabname       = 'T_VBAP'.
      s_fieldcatalog-ref_tabname   = 'VBAP'.
      s_fieldcatalog-ref_fieldname = 'NETPR'.
      s_fieldcatalog-cfieldname    = 'WAERK'.
      s_fieldcatalog-ctabname      = 'T_VBAP'.
      APPEND s_fieldcatalog TO lt_fieldcatalog.
      CLEAR s_fieldcatalog.
    Currency.
      s_fieldcatalog-col_pos       = '4'.
      s_fieldcatalog-fieldname     = 'WAERK'.
      s_fieldcatalog-tabname       = 'T_VBAP'.
      s_fieldcatalog-ref_tabname   = 'VBAP'.
      s_fieldcatalog-ref_fieldname = 'WAERK'.
      APPEND s_fieldcatalog TO lt_fieldcatalog.
      CLEAR s_fieldcatalog.
    Quantity
      s_fieldcatalog-col_pos       = '5'.
      s_fieldcatalog-fieldname     = 'KWMENG'.
      s_fieldcatalog-tabname       = 'T_VBAP'.
      s_fieldcatalog-ref_tabname   = 'VBAP'.
      s_fieldcatalog-ref_fieldname = 'KWMENG'.
      s_fieldcatalog-qfieldname    = 'MEINS'.
      s_fieldcatalog-qtabname      = 'T_VBAP'.
      APPEND s_fieldcatalog TO lt_fieldcatalog.
      CLEAR s_fieldcatalog.
    UOM
      s_fieldcatalog-col_pos       = '6'.
      s_fieldcatalog-fieldname     = 'MEINS'.
      s_fieldcatalog-tabname       = 'T_VBAP'.
      s_fieldcatalog-ref_tabname   = 'VBAP'.
      s_fieldcatalog-ref_fieldname = 'MEINS'.
      APPEND s_fieldcatalog TO lt_fieldcatalog.
      CLEAR s_fieldcatalog.
    ENDFORM.

  • ALV with dynamic columns and description labels in header titles

    Hi everybody,
    I have to implement an ALV whose columns are not defined until runtime. Is it possible to do that in some simple way? Is it necessary to use objects to define this kind of ALV's?
    And another one query, is it possible to add description labels to column headers so that when the user points with the cursor in them he/she gets a little explanation about the detail of the column (for example, description name of the product hierarchy when pointing to the column named with one of the existing hierarchies, i.e 010102102)
    Thanks in advance,

    for your first question check this
    Just check this sample from one of the SAP site
    ABAP Code Sample for Dynamic Table for ALV with Cell Coloring
    Applies To:
    ABAP / ALV Grid
    Article Summary
    ABAP Code Sample that uses dynamic programming techniques to build a dynamic internal table for display in an ALV Grid with Cell Coloring.
    Code Sample
    REPORT zcdf_dynamic_table.
    * Dynamic ALV Grid with Cell Coloring.
    * Build a field catalog dynamically and provide the ability to color
    * the cells.
    * To test, copy this code to any program name and create screen 100
    * as described in the comments. After the screen is displayed, hit
    * enter to exit the screen.
    * Tested in 4.6C and 6.20
    * Charles Folwell - [email protected] - Feb 2, 2005
    DATA:
    r_dyn_table TYPE REF TO data,
    r_wa_dyn_table TYPE REF TO data,
    r_dock_ctnr TYPE REF TO cl_gui_docking_container,
    r_alv_grid TYPE REF TO cl_gui_alv_grid,
    t_fieldcat1 TYPE lvc_t_fcat, "with cell color
    t_fieldcat2 TYPE lvc_t_fcat, "without cell color
    wa_fieldcat LIKE LINE OF t_fieldcat1,
    wa_cellcolors TYPE LINE OF lvc_t_scol,
    wa_is_layout TYPE lvc_s_layo.
    FIELD-SYMBOLS:
    <t_dyn_table> TYPE STANDARD TABLE,
    <wa_dyn_table> TYPE ANY,
    <t_cellcolors> TYPE lvc_t_scol,
    <w_field> TYPE ANY.
    START-OF-SELECTION.
    * Build field catalog based on your criteria.
    wa_fieldcat-fieldname = 'FIELD1'.
    wa_fieldcat-inttype = 'C'.
    wa_fieldcat-outputlen = '10'.
    wa_fieldcat-coltext = 'My Field 1'.
    wa_fieldcat-seltext = wa_fieldcat-coltext.
    APPEND wa_fieldcat TO t_fieldcat1.
    wa_fieldcat-fieldname = 'FIELD2'.
    wa_fieldcat-inttype = 'C'.
    wa_fieldcat-outputlen = '10'.
    wa_fieldcat-coltext = 'My Field 2'.
    wa_fieldcat-seltext = wa_fieldcat-coltext.
    APPEND wa_fieldcat TO t_fieldcat1.
    * Before adding cell color table, save fieldcatalog to pass
    * to ALV call. The ALV call needs a fieldcatalog without
    * the internal table for cell coloring.
    t_fieldcat2[] = t_fieldcat1[].
    * Add cell color table.
    * CALENDAR_TYPE is a structure in the dictionary with a
    * field called COLTAB of type LVC_T_SCOL. You can use
    * any structure and field that has the type LVC_T_SCOL.
    wa_fieldcat-fieldname = 'T_CELLCOLORS'.
    wa_fieldcat-ref_field = 'COLTAB'.
    wa_fieldcat-ref_table = 'CALENDAR_TYPE'.
    APPEND wa_fieldcat TO t_fieldcat1.
    * Create dynamic table including the internal table
    * for cell coloring.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
    it_fieldcatalog = t_fieldcat1
    IMPORTING
    ep_table = r_dyn_table
    EXCEPTIONS
    generate_subpool_dir_full = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    * Get access to new table using field symbol.
    ASSIGN r_dyn_table->* TO <t_dyn_table>.
    * Create work area for new table.
    CREATE DATA r_wa_dyn_table LIKE LINE OF <t_dyn_table>.
    * Get access to new work area using field symbol.
    ASSIGN r_wa_dyn_table->* TO <wa_dyn_table>.
    * Get data into table from somewhere. Field names are
    * known at this point because field catalog is already
    * built. Read field names from the field catalog or use
    * COMPONENT <number> in a DO loop to access the fields. A
    * simpler hard coded approach is used here.
    ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    <w_field> = 'ABC'.
    ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    <w_field> = 'XYZ'.
    APPEND <wa_dyn_table> TO <t_dyn_table>.
    ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    <w_field> = 'TUV'.
    ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    <w_field> = 'DEF'.
    APPEND <wa_dyn_table> TO <t_dyn_table>.
    * Color cells based on your criteria. In this example, a test on
    * FIELD2 is used to decide on color.
    LOOP AT <t_dyn_table> INTO <wa_dyn_table>.
    ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    * Get access to internal table used to color cells.
    ASSIGN COMPONENT 'T_CELLCOLORS'
    OF STRUCTURE <wa_dyn_table> TO <t_cellcolors>.
    CLEAR wa_cellcolors.
    wa_cellcolors-fname = 'FIELD2'.
    IF <w_field> = 'DEF'.
    wa_cellcolors-color-col = '7'.
    ELSE.
    wa_cellcolors-color-col = '5'.
    ENDIF.
    APPEND wa_cellcolors TO <t_cellcolors>.
    MODIFY <t_dyn_table> FROM <wa_dyn_table>.
    ENDLOOP.
    * Display screen. Define screen 100 as empty, with next screen
    * set to 0 and flow logic of:
    * PROCESS BEFORE OUTPUT.
    * MODULE initialization.
    * PROCESS AFTER INPUT.
    CALL SCREEN 100.
    * MODULE initialization OUTPUT
    MODULE initialization OUTPUT.
    * Set up for ALV display.
    IF r_dock_ctnr IS INITIAL.
    CREATE OBJECT r_dock_ctnr
    EXPORTING
    side = cl_gui_docking_container=>dock_at_left
    ratio = '90'.
    CREATE OBJECT r_alv_grid
    EXPORTING i_parent = r_dock_ctnr.
    * Set ALV controls for cell coloring table.
    wa_is_layout-ctab_fname = 'T_CELLCOLORS'.
    * Display.
    CALL METHOD r_alv_grid->set_table_for_first_display
    EXPORTING
    is_layout = wa_is_layout
    CHANGING
    it_outtab = <t_dyn_table>
    it_fieldcatalog = t_fieldcat2.
    ELSE. "grid already prepared
    * Refresh display.
    CALL METHOD r_alv_grid->refresh_table_display
    EXPORTING
    i_soft_refresh = ' '
    EXCEPTIONS
    finished = 1
    OTHERS = 2.
    ENDIF.
    ENDMODULE. " initialization OUTPUT

  • Main heading and Sub Heading Requirment in ALV wih download to excel featur

    Hello Everyone,
    I have a very typical requirment in ALV . I want the output to be displayed as folows :
    Category
    Head1
    Head2
    Here the heading category is just a heading and no header and line item data. so hirearchal kind of ALV is of no use.  and i cant write this was in TOP-OF-PAGE as i want to download this data to excel and if i write it in TOP-OF-PAGE the dwnload in excel is misaligned. I have been thorugh the various topics posted here and couldn't get a feasible solution. Please Help.

    Hi,
    This is not possible
    Refer these links
    Re: ALV query
    Re: Multiple lines in alv column headings
    If this solves ur problem reward points and close the thread

Maybe you are looking for

  • Error: 1013231 Unable to update database while in readonly mode for backup

    Hi all, Wen im deleting the members for dimendsion , its giving error (hyperion 11.1 aso) Error: 1013231 Unable to update database while in readonly mode for backup , how can i solve this problem ,plz can any one help on this Thanks

  • IOS 7 on iPhone 5 classic -- Battery Issues?

    I might as well start this since somebody inevitably will. I am niticing in the first hours after updating to iOS 7 that the battery seems to be draining faster than normal.  However I don't want to start a panic, because somebody says this about eve

  • Tricky SQL

    Hi, I have a table X that contains data and another table Y that contains user preferences data. I am trying, without much success so far, to write an sql query which returns all data in table X if there are no preferences in table Y for a specific u

  • Subpartition issue.

    Hello Folks, I am having 1 table, and it has 3 partitions and one of it's having max value and I want to create subpartition inside that partition. When I have created subpartition it's got created with system generated name. When I am trying to expl

  • CRM event handler CRMV_EVENT

    Hi All, We have configured an event with following parameters. Trans. Category : BUS2000112  Service Contract Execution Time  : 1    Immediately Priority       :  1 Object Name :    PARTNER Event           : PROCEED_PARTNER_DETERMINATION Attribute