Need to display COlumn headers dynamically in ALG Grid

Hello,
I need to display column headers dynamically in alv grid Display with its corresponding value.
Column headers should be picked from a field in Final Internal table and its corresponding field will also need to pick from the same table.
T_final... Suppose Field STCTS - (To pick coulmn headers)
                                  CCNGN - (To pick appropriate value for that column)
Can anybody explain me how i can pass these values to ALV Grid using
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
  EXPORTING
    IT_FIELDCATALOG           = Y_I_FCAT
  IMPORTING
    EP_TABLE                  = DY_TABLE.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Any suggestions will be appreciated....
Regards,
Kittu

Hi,
Go thru this link, and the code of Mr.Dev Parbutteea
Re: Probelm with Using Field Symbol in FM
thanks
Mahesh

Similar Messages

  • Assigning Column Headers Dynamically in ALV output

    Hello Experts,
    I have to create dynamic column headers based on the user input on the selection-screen. Basically users enter the period and the ALV output has to create the column headers dynamically for that along with some standard columns.
    For eg, The selection screen is like this:
    From:  'Q4' '2009'
    To      'Q2'  '2011'.
    Then I have to create 12 columns for the months and rest for the Quarters.
    Then the output will be like this:
    Material, Description,10/09, 11/09, 12/09, 01/10, 02/10, 03/10, 04/10, 05/10, 06/10, 07/10, 08/10, 09/10, Q4/10, Q1/11, Q2/11
    I have built the logic to determine the number of colums for the periods based on input.
    By reading other posts, I have learnt that I have to use call method cl_alv_table_create=>create_dynamic_table to get the functionality.
    I have also looked at program BCALV_TABLE_CREATE for some help. It only has column headers in increasing order. But I am not able to understand How to pass the Column Header Label (for eg 10/09 or Q1/10) to the fieldcat dynamically.
    Is there any blog/sample prog close to my req? Can anybody please please help me. I grealy appreciate it.
    Thanks.

    Hi Lope,
    You need to filll column heading based on dynamic internal table column names.
    In your final internal table, you will have some column names like '1009, 1109, 1209' .
    While filling fieldcatalog you need to put your logic for column heading text.
    If column name is 1009, concatenate '10 '  '/'   '09', or calculate the quarter 10 falls into ,and display Q4/09.
    Regards,
    Nisha Vengal.

  • Create grouped column headers dynamically

    Hi all,
    I want to create grouped column headers dynamically.
    DATA lr_table_column TYPE REF TO cl_wd_table_column.
    DATA lr_column_group TYPE REF TO cl_wd_table_column_group.
    DATA lr_caption TYPE REF TO cl_wd_caption.
    lr_table_column = cl_wd_table_column=>new_table_column( ).
    lr_table_column->set_table_cell_editor( lr_input ).
    lr_caption = cl_wd_caption=>new_caption( ).
    lr_caption->set_text( 'Min' ).
    lr_column_group = cl_wd_table_column_group=>NEW_TABLE_COLUMN_GROUP( ).
    lr_column_group->set_header( EXPORTING the_header = lr_caption ).
    CALL METHOD lr_column_group->add_column
            EXPORTING
              index      = 1
              the_column = lr_table_column.
           lr_table->ADD_GROUPED_COLUMN( EXPORTING the_grouped_column = lr_column_group ).
    But I don't understand how I can get the grouping of the columns.
    The following structure should be realized:
    FR  | Headline 1  |  Headline 2  |
    SR  | Min |  Max   |  Min |  Max   |
    FR = first row
    SR = second row
    regards
    Edited by: Wolfgang Bauer on May 19, 2010 7:52 AM

    LOOP AT it_comp_header INTO wa_comp_header.
    Minimum
          counter = counter + 1.
          CONDENSE counter.
          CONCATENATE 'INPUT_' counter INTO id.
         c_count = sy-index.
          c_count = counter.
          CONDENSE c_count.
          CONCATENATE 'IT_BIN_COMP.MIN' c_count INTO binding.
          cl_wd_input_field=>new_input_field(
            EXPORTING
               bind_value             = binding
               id                     = id
            RECEIVING
              control                = lr_input ).
          lr_column_group = cl_wd_table_column_group=>new_table_column_group( ).
          lr_table_column = cl_wd_table_column=>new_table_column( ).
          lr_table_column->set_table_cell_editor( lr_input ).
          lr_caption = cl_wd_caption=>new_caption( ).
          lr_caption->set_text( 'Min' ).
          lr_table_column->set_header( lr_caption ).
          lr_column_group->add_column( lr_table_column ).
          lr_table_column = cl_wd_table_column=>new_table_column( ).
          lr_table_column->set_table_cell_editor( lr_input ).
          lr_caption = cl_wd_caption=>new_caption( ).
          lr_caption->set_text( 'Max' ).
          lr_table_column->set_header( lr_caption ).
          lr_column_group->add_column( lr_table_column ).
          lr_table_column = cl_wd_table_column=>new_table_column( ).
          lr_table_column->set_table_cell_editor( lr_input ).
          lr_caption = cl_wd_caption=>new_caption( ).
          lr_caption->set_text( 'Sorting Bin' ).
          lr_table_column->set_header( lr_caption ).
          lr_column_group->add_column( lr_table_column ).
          lr_caption = cl_wd_caption=>new_caption( ).
          text = wa_comp_header-chip.
          lr_caption->set_text( text ).
          lr_column_group->set_header( lr_caption ).
          lr_table->add_grouped_column( lr_column_group ).
        ENDLOOP.
    Sub product
        lr_column_group = cl_wd_table_column_group=>new_table_column_group( ).
        lr_table_column = cl_wd_table_column=>new_table_column( ).
        lr_table_column->set_table_cell_editor( lr_input ).
        lr_caption = cl_wd_caption=>new_caption( ).
        lr_caption->set_text( 'Sub Product' ).
        lr_table_column->set_header( lr_caption ).
        lr_column_group->add_column( lr_table_column ).
        lr_table->add_grouped_column( lr_column_group ).
    Remarks
        lr_column_group = cl_wd_table_column_group=>new_table_column_group( ).
        lr_table_column = cl_wd_table_column=>new_table_column( ).
        lr_table_column->set_table_cell_editor( lr_input ).
        lr_caption = cl_wd_caption=>new_caption( ).
        lr_caption->set_text( 'Remarks' ).
        lr_table_column->set_header( lr_caption ).
        lr_column_group->add_column( lr_table_column ).
        lr_table->add_grouped_column( lr_column_group ).

  • Change column headers dynamically in OBIEE

    hey guys.
    We are working on a BI module for Finance. The data mart captures data for Actuals/Forecasts and Budgets for entire year by months (for example Jan2008 will have Actual/Forecast value and Budget value & similarly for other months of the year) .
    Now while displaying on the dashboard reports the column header for the current month should read as Actual and for coming months it should read as Forecast.
    Any suggestions as to where we can implement this business rule so as to make the column header dynamic.
    Thanks
    OBIEE_user

    Seems like you don't know Venkat yet...
    http://oraclebizint.wordpress.com/2008/01/25/oracle-bi-ee-101332-dynamic-column-headers-using-presentation-variables-sets-and-conditional-formatting/

  • Getting column headers dynamically from input parameters in alv.

    Hi all,
    I am new to abap, can any one help me in getting column header dynamically through parameters in alv ?
    Eg:-
    i Have parametars for days field ,
    user inputs days as 10 20 30 40.
    Now I want to display in alv column headers as:-
    1st column-  'FROM 0 TO 10'
    2nd column- 'FROM 10 TO 20 '
    3rd column- 'FROM 20 TO 30'
    4th column- 'FROM 30 TO 40'
    5th column- 'FROM 40 TO 50'
    6th column- 'FROM 50 TO 60'
    thanks in advance........

    Check this code snippet:
    Step 1: Create a dynamic table based on the input in the selection screen.
    TYPE-POOLS: abap.
    DATA:
      lr_structdescr    TYPE REF TO cl_abap_structdescr,
      lr_tabledescr     TYPE REF TO cl_abap_tabledescr,
      lr_datadescr      TYPE REF TO cl_abap_datadescr,
      lt_components     TYPE abap_component_tab,
      ls_component      TYPE abap_componentdescr,
      lr_wa             TYPE REF TO data,
      lr_tab            TYPE REF TO data.
    DATA: lv_index TYPE sy-index.
    DATA: lv_index_num(5) TYPE n.
    DATA: lv_index_char(5) TYPE c,
          lv_iter TYPE i,
          lv_low TYPE numc2 VALUE 0,
          lv_high TYPE numc2 VALUE 10.
    DATA: lr_alv TYPE REF TO cl_salv_table.
    FIELD-SYMBOLS: <fs_field> TYPE ANY.
    FIELD-SYMBOLS: <fs_wa> TYPE ANY.
    FIELD-SYMBOLS: <fs_tab> TYPE table.
    PARAMETERS p_numcol(2) TYPE n DEFAULT 50.
    START-OF-SELECTION.
      lv_iter = p_numcol DIV 10.
      DO lv_iter TIMES.
        IF sy-index > 1.
          lv_low = lv_low + 10.
          lv_high = lv_high + 10.
        ENDIF.
        lv_index_num = sy-index.
        lv_index_char = lv_index_num.
        CONCATENATE 'FROM' lv_low 'TO' lv_high INTO ls_component-name
        SEPARATED BY '_'.
        ls_component-type =
        cl_abap_elemdescr=>get_p( p_length = 10 p_decimals = 2 ).
        INSERT ls_component INTO TABLE lt_components.
      ENDDO.
    * get structure descriptor -> lr_STRUCTDESCR
      lr_structdescr
      = cl_abap_structdescr=>create( p_components = lt_components
                                     p_strict = space ).
    * create work area of structure lr_STRUCTDESCR -> lr_WA
      CREATE DATA lr_wa TYPE HANDLE lr_structdescr.
      ASSIGN lr_wa->* TO <fs_wa>.
      lr_datadescr = lr_structdescr.
      lr_tabledescr
      = cl_abap_tabledescr=>create( lr_datadescr ).
    * Create dynamic internal table
      CREATE DATA lr_tab TYPE HANDLE lr_tabledescr.
      ASSIGN lr_tab->* TO <fs_tab>.
    * Populate the internal table
      DO 10 TIMES.
        DO.
          lv_index = sy-index.
          ASSIGN COMPONENT  lv_index  OF STRUCTURE <fs_wa> TO <fs_field>.
          IF sy-subrc <> 0.
            EXIT.
          ENDIF.
          <fs_field> = sy-index.
        ENDDO.
        APPEND <fs_wa> TO <fs_tab>.
      ENDDO.

  • How Do I cahnge lables(column headers) dynamically?

    Hi,
    Dynamically, how do I change column headers based on some other value is the report?
    Thanks

    If the value you want as the column header is in the XML use the element.
    If you want different column headers based on a particular element in the XML then use conditional logic (if or when) wrapped around the column headers to do the selection at run time. See the user guide for examples of conditional processing in the template.
    cheers,
    Dave

  • Display column headers to display on detail section only

    Post Author: Docmidnite
    CA Forum: General Feedback
    I am using Crystal 9.0.
    I am creating reports with 3-5 group drill downs.
    The user only wants the column headers to be seen when they display the detail section.
    any ideas?

    Post Author: krishna.moorthi
    CA Forum: General Feedback
    write suppress condition for headers Like
    DrillDownGroupLevel<>drilldowngroupnumber(Ex : 3 or 4 or 5)

  • SQL Developer: How do I copy data with Column Headers from the output grid?

    Hello,
    I am using Version 2.1.1.64.
    I run a SQL query, I get the results grid in the "Query Result" window down below. Say I get 10 rows returned, with 5 columns.
    I want to Copy this entire grid, plus the column headers/names, to the clipboard. So I can paste it under the original query to document the results of that query.
    I can't find any way to do this. I can copy/paste the results grid, but it doesn't copy the headers.
    The only way I see to do it is to go through numerous steps to Export to a TXT file, then paste that. Unfortunately, that is a lot of wasted steps if I need to do this over and over, plus, the output gets pasted in an ugly format with double quotes, etc.
    It seems like the simplest functionality is to copy/paste the entire results grid, and of course you might the headers. Why is this so complicated/impossible to do?
    (I believe Toad has the same problem. DBArtisan allows you to copy/paste the entire results, plus headers, though.)
    Any assistance would be appreciated!
    Thanks,
    John

    Ah, ok...
    I had tried that before, and it didn't work, it seemed to copy the path of filename I was using. But I think that was because I had clicked on a Column Header first, and it had asked me if I wanted to filter. I think then it lost track that it was in the grid. It's a little flukey.
    What I did now was to click on an individual cell in the output, then hit CTRL-A to select all, then hit SHIFT-CTRL-C. That gives me exactly what I want.
    Thanks very much for your quick solution, I appreciate it!
    John

  • Need to display column names in a dynamic page

    Hi
    I am displaying some rows returned from an sql querry in a dynamic page ...I hv written the sql querry between <ORACLE> AND </ORACLE> TAGS...The problem is ,i am not able to display the column names ...Why ? pl help....
    ram

    You must to use the htp package. Example:
    <ORACLE>
    begin
    htp.tableopen('1','CENTER',null,null,'BORDER="1"');
    htp.tableheader('NParte','CENTER');
    htp.tableheader('Descripcisn','CENTER');
    htp.tableheader('Precio/Unit','CENTER');
    htp.tableheader('Servicio','CENTER');
    htp.tableheader('IVA','CENTER');
    htp.tableheader('Total','CENTER');
    for cursor_cotiza in (select
    r.Nparte as Nparte, r.Descripcion as Descripcion,
    r.preciounit as preciounit,
    NVL(f.servicio,0) as servicio,
    round((0.145)*r.preciounit,3) as IVA,
    round((0.145)*r.preciounit,3) + r.preciounit +
    NVL(f.servicio,0) as PrecioTotal
    from
    carryin.repuestos r,
    carryin.casos c, carryin.facturacion f
    where r.NCaso =:NCaso
    and r.Ncaso=c.NCaso
    and c.Ncaso=f.Ncaso(+)
    and f.servicio(+)<>0
    union
    select
    r.Nparte as Nparte, r.Descripcion as Descripcion,
    r.preciounit as preciounit,
    NVL(f.servicio,0) as servicio,
    round((0.145)*r.preciounit,3) as IVA,
    round((0.145)*r.preciounit,3) + r.preciounit +
    NVL(f.servicio,0) as PrecioTotal
    from
    carryin.casosneq r,
    carryin.facturacion f
    where r.NCaso =:NCaso
    and r.Ncaso=f.Ncaso(+)
    and f.servicio(+)<>0
    ) loop
    htp.tableRowOpen('CENTER','CENTER');
    htp.tableData(cursor_cotiza.Nparte,'CENTER');
    htp.tableData(cursor_cotiza.Descripcion,'CENTER');
    htp.tableData(cursor_cotiza.preciounit,'CENTER');
    htp.tableData(cursor_cotiza.servicio,'CENTER');
    htp.tableData(cursor_cotiza.IVA,'CENTER');
    htp.tableData(cursor_cotiza.PrecioTotal,'CENTER');
    htp.tableRowClose;
    end loop;
    htp.tableclose;
    end;
    </ORACLE>
    This example show a table with header and borders. You must to see this package for more information.

  • Need to Display columns depending on the prompt selection

    I  need to show the only the columns as per the prompt selection given by the user.
    Suppose there are 5 prompts say (first name, last name, phone number, address, DOJ). All the prompts should be optional. If the user gave input for first name and last name then only this two columns must be displayed in the report.

    Yes it is possible but you will have to write down formulas for these columns.
    First add all required object in your report and format them in your report.
    Now say you want Last name to appear when you user enters last name in prompt.
    Write down following formula
    Report Detail Area
    =If(UserResponse("Last Name"))="USER INPUT" Then [LNAME]
    For column Heading you can use
    =If(UserResponse("Last Name"))="USER INPUT" Then "Column Heading"
    The same pattern may be applied for other columns.
    Regards,
    Bashir Awan

  • Need to display texts on to the ALV grid using SALV

    Hi evryone,
                   There is a requirement to print an ALV grid containing the row titles and their subsequent values. The display shouild look like as below
    Summary                                     ItemsA cost                                                             111111
                                                        ItemsB cost                                                              222222
                                                        ItemC cost                                                                333333
                                                        New items
                                                        ItemD cost                                                                                111111
                                                        ItemE cost                                                                                222222
                                                        ItemF cost                                                                                333333
                                                                 Total                                                                 666666        666666
    The headings pertaining to ItemA to itemB should come in a single column and their subsequent values as shown above. The total should be displayed below the corresponding block of items. Can anyone please suggest me the way we can acheive this using SALV and container concept.

    Sorry my earlier did not get displayed as expected. Please find below the format  how the ALV should get displayed.
    Summary  -
    ITEMA----
    1111
    ITEMB----
    2222
    ITEMC----
    3333
    ITEMD----
    1111
    ITEME----
    2222
    ITEMF -
    3333
    Total--6666--
    6666
    Please ignore the dots here they are just written to indicate spaces between the texts. The text summary and the texts "ItemA, B, C etc" should have 1 coulmn gap and the prices for the first item block should have 1 column block from the texts and the prices for second Item block should have a 2 coulumn block from the texts and total value should be displayed below each block.
    Edited by: Phaniacumen on May 8, 2010 1:59 PM

  • Popluate Column Heading Dynamically in UI

    HI Experts,
    I have a requirement where i  need to get column descriptions dynamically at item level in UI  depending on the process type.
    I have an order with two items, when i display the order from search result i go to order detail where i can see the items also.
    There is a column called net value as column heading, this populates the net price for each item.
    I need to show base price instead of NET PRICE which i am able to do that and column heading name is DNP.
    But DNP column heading  along with base price is required only for a particular process types , for remaining process types the NET VALUE column heading followed by net price should remain same.

    Hi,
    User can Maintain the Column Heading's, by the way you mentioned....
    Else you can use TOP-OF-PAGE event to build Dynamic Coulmn Headers.

  • ADF swing: JTabbedPane does not display column names.

    Hi all,
    I have created an ADF Panel, which allows the user to run a few simple queries against an Oracle database done using ADF view objects and ADF view links and ADF application module.
    From the data control area I drag and drop a view link containing a query into a JTabbedPane. But when I run the ADF panel, JTabbedPane does not display the column headers from the SQL as opposed to JScrollPane which does.
    Suppose you do a select * from departments(dep_id, manager, state_cd), you will see all column headers meaning dep_id, manager, state_cd, and under each column the corresponding data which was retuned by the SQL if you use JScrollPane. But if you use you use JTabbedPane then you would only see the data which was retuned by the SQL without seeing the column header names meaning dep_id, manager, state_cd.
    What do I need to do to make JTabbedPane display columns headers?
    I would appreciate your input.
    Thanks.
    Bobby A.

    Hi,
    JScrollPane should be used. You can add this into a JTabbedPane if you like. Not all Swing panel show table headers
    Frank

  • RE: Workbook need to display chart by diffrent material

    Folks,
    I have to create report which need to display chart( by material, month, and sales QTY). I know I can use workbook create chart but which only work for one or specific  materials, I need to display many materials dynamically. if it need to create macro pls send to me some sample code.
    Thanks,
    Sam

    Hi Sam,
    Please see the below code for the macro.
    Sub Distinct_Material()
    ' Distinct_Material Macro
    ' Distinct_Material
        Columns("E:F").Select
        Range("E1:F142").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _
            "H1"), Unique:=True
        Columns("H:I").Select
        Selection.Copy
        Sheets("Name of the work book").Select
        ActiveSheet.Paste
    End Sub
    I hope this will help you.
    BR,
    Praveen

  • JTable column headers missing

    I created a JTable using:
    JTable table = new JTable(v,cN);
    where v is my vector that holds the data and cN is a vector to hold the column names as below:
    Vector cN = new Vector();
         cN.add("Registry Keys");
         cN.add("Program Name");
         cN.add("Key Type");
         cN.add("Drive");
         cN.add("Location");
         cN.add("Leave");It displays the table fine with the data and as I add or remove entries in the cN vector it adds and removes columns - but doesn't display column headers? Any help appreciated.

    Are you using a scrollpane? If not, you have to get the Table Header component and place it appropriately.

Maybe you are looking for

  • PTE file imports with different versions of ALUI?

    Hi, I am wondering if anyone knows of any issues with the import/export of data in ALUI via the PTE file from one version of ALUI to another. For example, are there any issues with exporting data from v6.5 of ALUI and importing it into v6.0 or v6.1.

  • Drag and drop text to Pages doc without formatting

    Pages '06 allowed me to 'drag and drop' text from another application into a cell in a Pages table, without disturbing cell formatting. i.e. the text would lose all its own styles, and take on those set for the cell. This is just the same as using th

  • TOC/Script problem with Netscape

    I am using RoboHelp (webhelp) 5.5. I am facing two problem with netscape browser. 1. loading the page itself take long time and show a message that script on this page is causing mozilla to run slowly. 2. in the TOC when i click the TOC BOOK the cont

  • Valid apple id is valid but not icloud accout

    this is what I get when trying to set up the Icloud, any ideas

  • CDD-23564: The file "c:\orant\BIN\cfg61.dll" could not be loaded or does not exist.

    Hi When I try and generate a form from Designer 6i i get the following error message :- CDD-23564: The file "c:\orant\BIN\cfg61.dll" could not be loaded or does not exist. However the file does exist in the specified location. I've looked thru the on