Changing header title of column at runtime

Hi
I want to change the column header in an ALV table at runtime. I know how to overwrite a DDIC binding text of the column header with my own static text but I also want to know how to modify this column header text dynamically. I have a separate attribute in my context node to serve as the column header, which I can keep modifying at runtime, but the problem is to bind this attribute  to the header of the column.
Thanks and regards
Sukanya

Hi Sukanya,
Refer to code given by Thomas in this thread: change ALV column Header
Also refer these threads: Webdynpro ALV title
Re: Change Header Text for a ALV table column
I hope it helps.
Regards
Arjun
Edited by: Arjun Thakur on Mar 26, 2009 4:41 PM

Similar Messages

  • Changing header text of column in ALV

    Hello. I'm trying to change header of a column in WD ALV using this code:
      lr_col = lo_value->if_salv_wd_column_settings~get_column( 'DESCRIPTION' ).
      lr_header = lr_col->get_header( ).
      lr_header->set_text( EXPORTING value = 'My perfect text' ).
    But it doesn't work. Where was I wrong?

    Hi..
    Add the following code after set_text
    lr_header->set_prop_ddic_binding_field( ).
    this will clear the binding of dataelement text with the column..
    Ranganathan

  • Can we change width of the column at runtime

    I have a report with columns assigned runtime, can we change width of the colimn runtime?
    for example Query: select &lp_1, &lp_2 from emp &LP_Where
    if i assign lp_1 empno size 10 and empname size 50. Vertical and horizantal elasticty is not going work for me. Any suggestions please..
    Lalitha

    Doubt there is the dynamic you are seeking.
    But you may put a few overlapped columns (diff. length of course) and display/hide by passing parameters.

  • How to Change Default Title and Icon of Forms 5.0 Runtime

    Whenever i run Forms 5.0 runtime , it always shows
    'Developer 2000 Forms Runtime for Windows 95/ NT'.
    If i set a title to the main window then also the above message preceeds my Title of Window.
    Is there any way to remove that ????
    My Application is ready for delivery but the only problem is this title message. and also,, I want to change my own ICON in place of deafult icon
    How to do that

    Hi,
    You can always change you Window title at runtime.
    On Windows, You ALWAYS have a container window (There is an option from 5.0 onwards to avoid this container window) and at least one window in you applciation e.g. window0.
    Use the following command to change the title of the MDI window:
    set_window_property (FORMS_MDI_WINDOW,title,'My Application');
    For window0, try this:
    set_window_property ('WINDOW0',title,'Registration of Employee');
    Please see all the options available in the online help of forms under SET_WINDOW_PROPERTY.
    Bye,
    Vani
    null

  • How to change the "name of column" property of an text item in runtime?

    How to change the "name of column" property of an text item in runtime?
    I look the properties of items in help and found nothing about this!
    It's possible?

    Hi,
    an other solution is change the block property QUERY_DATA_SOURCE_TYPE from "Table" to "Sub-query" , than change at run time the property QUERY_DATA_SOURCE_NAME.
    First create block and add items
    The QUERY_DATA_SOURCE_NAME will be for ex. "Select 'A' as col1, 'B' AS col2, 'C' as col3 from dual"
    Set into items the column name property to col1 , col2 ...
    At run time change the query to "Select 'Z' as col1, 'X' as col2 , 'Y' as col3 from dual"
    in this way you can change the source of column value.
    Caution because if you change value type from varchar2 to date you must cast date into varchar2.
    May be that this way is valid only for view data not for insert-update, i don't remember.
    bye
    Message was edited by:
    Killernero

  • Change color in alv column

    how do change color of a column in ALV.

    Hi
    The below abap program shows how to change the colour of individual ALV cells /fields. Only a small number of changes are required from a basic ALV grid which include adding a new field to ALV data declaration table(it_ekko), populating this field with the field name identifier and colour attributes and finally adding an entry to layout control work area. These changes are highlighted in bold below.
    REPORT  zdemo_alvgrid                 .
    REPORT  ZALV_CELLCOLOR.
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
      CELLCOLOR TYPE LVC_T_SCOL,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid,
          gt_events     type slis_t_event,
          gd_prntparams type slis_print_alv.
    *Start-of-selection.
    START-OF-SELECTION.
      perform data_retrieval.
      perform build_fieldcatalog.
      perform build_layout.
      perform set_cell_colours.
      perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    There are a number of ways to create a fieldcat.
    For the purpose of this example i will build the fieldcatalog manualy
    by populating the internal table fields individually and then
    appending the rows. This method can be the most time consuming but can
    also allow you  more control of the final product.
    Beware though, you need to ensure that all fields required are
    populated. When using some of functionality available via ALV, such as
    total. You may need to provide more information than if you were
    simply displaying the result
                  I.e. Field type may be required in-order for
                       the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-do_sum      = 'X'.
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
      gd_LAYOUT-coltab_fieldname = 'CELLCOLOR'.  "CTAB_FNAME
    endform.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
               i_callback_user_command = 'USER_COMMAND'
               i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
               it_special_groups       = gd_tabgroup
              it_events               = gt_events
              is_print                = gd_prntparams
                i_save                  = 'X'
               is_variant              = z_template
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 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.
    endform.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
      select ebeln ebelp statu aedat matnr menge meins netpr peinh
       up to 10 rows
        from ekpo
        into CORRESPONDING FIELDS OF TABLE it_ekko.
    endform.                    " DATA_RETRIEVAL
    Form  TOP-OF-PAGE                                                 *
    ALV Report Header                                                 *
    Form top-of-page.
    *ALV Header declarations
      data: t_header type slis_t_listheader,
            wa_header type slis_listheader,
            t_line like wa_header-info,
            ld_lines type i,
            ld_linesc(10) type c.
    Title
      wa_header-typ  = 'H'.
      wa_header-info = 'EKKO Table Report'.
      append wa_header to t_header.
      clear wa_header.
    Date
      wa_header-typ  = 'S'.
      wa_header-key = 'Date: '.
      CONCATENATE  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
                   sy-datum(4) INTO wa_header-info.   "todays date
      append wa_header to t_header.
      clear: wa_header.
    Total No. of Records Selected
      describe table it_ekko lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' ld_linesc
                        into t_line separated by space.
      wa_header-typ  = 'A'.
      wa_header-info = t_line.
      append wa_header to t_header.
      clear: wa_header, t_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = t_header.
               i_logo             = 'Z_LOGO'.
    endform.                    "top-of-page
    *&      Form  SET_CELL_COLOURS
          Set colour of individual ALV cell, field
    FORM SET_CELL_COLOURS .
      DATA: WA_CELLCOLOR TYPE LVC_S_SCOL.
      DATA: ld_index TYPE SY-TABIX.
      LOOP AT IT_EKKO into wa_ekko.
        LD_INDEX = SY-TABIX.
      Set colour of EBELN field to various colors based on sy-tabix value
        WA_CELLCOLOR-FNAME = 'EBELN'.
        WA_CELLCOLOR-COLOR-COL = sy-tabix.  "color code 1-7, if outside rage defaults to 7
        WA_CELLCOLOR-COLOR-INT = '1'.  "1 = Intensified on, 0 = Intensified off
        WA_CELLCOLOR-COLOR-INV = '0'.  "1 = text colour, 0 = background colour
        APPEND WA_CELLCOLOR TO wa_ekko-CELLCOLOR.
        MODIFY it_ekko from wa_ekko INDEX ld_index TRANSPORTING CELLCOLOR.
      Set colour of NETPR field to color 4 if gt 0
        if wa_ekko-netpr gt 0.
          WA_CELLCOLOR-FNAME = 'NETPR'.
          WA_CELLCOLOR-COLOR-COL = 4.  "color code 1-7, if outside rage defaults to 7
          WA_CELLCOLOR-COLOR-INT = '0'.  "1 = Intensified on, 0 = Intensified off
          WA_CELLCOLOR-COLOR-INV = '0'.  "1 = text colour, 0 = background colour
          APPEND WA_CELLCOLOR TO wa_ekko-CELLCOLOR.
          MODIFY it_ekko from wa_ekko INDEX ld_index TRANSPORTING CELLCOLOR.
        endif.
      Set colour of AEDAT field text to red(6)
        WA_CELLCOLOR-FNAME = 'AEDAT'.
        WA_CELLCOLOR-COLOR-COL = 6.  "color code 1-7, if outside rage defaults to 7
        WA_CELLCOLOR-COLOR-INT = '0'.  "1 = Intensified on, 0 = Intensified off
        WA_CELLCOLOR-COLOR-INV = '1'.  "1 = text colour, 0 = background colour
        APPEND WA_CELLCOLOR TO wa_ekko-CELLCOLOR.
        MODIFY it_ekko from wa_ekko INDEX ld_index TRANSPORTING CELLCOLOR.
      ENDLOOP.
    ENDFORM.                    " SET_CELL_COLOURS

  • Change windows title in Portal 60

    Hi.
    When we navigate page in porta1, We have page title in browser title for example "Portal Support Desk - Enterprise Portal 6.0 - Microsoft Internet Explorer".
    In above, "Portal Support Desk"  is a page title and "Enterprise Portal 6.0" is a portal title.
    So, I thihk portal has "Page Title - Portal Title" pattern.
    Is there any way to change this pattern ?
    Actually, We want to change this to "Portal Title - Page Title" .
    Regards, Arnold.

    Hi Arnold
    do the following in portal
    system administration -> system configuration ->under detailed configuration choose service configuration
    under portal runtime -> central configuration double click to open it
    find out following portal.html.head.title
    change the value SAP Enterprise Portal 6.0 to ur value.
    save ur changes. ( save button is below at end of page)
    restart the J2EE server.
    regards,
    kaushal

  • We want to view header reference as column data wonu2019t appear in any Refaren

    Dear Experts,
    we want to view header reference as column data wonu2019t appear in any of the reference filed.
    Please tell me the soluation How can I give the soluation bilow issue.
    Currently user are facing one problem with respect of Line item report.
    In any of the line item report (i.e. FBL1N, FBL3N, FBL5N) we want to view header reference as column data wonu2019t appear in any of the reference filed.
    For Example in Bank G/L Cheque number was enter in reference field but same is not apear
    In Sales G/L or tax G/L invoice number is to be appear which is again invoice number as reference in document.
    Regards
    Devendra.
    Moderator: Please, search SDN before posting

    Hi,
    To add Reference field in line item report do below.
    From FBL1N output screen.
    Click change layout / (clr + F8)
    Now add Hidden field u2018Referenceu201D to column content and push copy button.
    Now you should be able to view reference field (BKPF- XBLNR) in line item report.
    Best Regards,
    Raju

  • Can you programmatically change the width of columns in a table control\indicator

    Is it possible to programmatically change the width of columns in a table control\indicator ie to fit to width of the data or in my case the header information.

    Create a property node (or reference) and use the 'Active Cell' property to select which column you want to change and then use the 'Cell size'--> 'Width' property to change the size.
    "There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
    Attachments:
    table.vi ‏33 KB

  • Changing header of an analysis grid in Excel

    Hello!
    I try to change the header of a query in Excel, but when I change from design mode to analysis mode the title of the header changed to the intial value "Table".
    Is there are a way to change the title of a query in Excel permanently?
    Thanks in advanced!
    Best Regards,
    Markus

    Hi,
    You need to Create a program and create normal screen no. 100 under this program. And in screen 100, please create custom control
    Look at the below link
    http://howforge.com/abap-4-example-code-alv-grid-control-by-applying-object-cl-gui-alv-grid
    Regards
    Sudheer

  • How to display header title for 0MATERIAL texts in the query output?

    Dear Bwers,
    I have a requirement where i need to display headers titles for 0MATERIAL texts in the query output. (example "Material description"). Any ideas on how to do this?
    Thanks
    Raj

    Kamal,
    Its is as below:
    <b>Vendor</b>    <b>Vendor Name</b>
    1001 ---            Bright Industries
    1002 ---            Glow Industries
    I want to display the header title "Vendor Name" as the  title in the column instead of displaying the text without any header title.
    Thanks
    Raj
    Message was edited by:
            Raj Singh
    Message was edited by:
            Raj Singh

  • How to change the title of a report by programmation at the run time?

    Hi,
    I would like to change the title of my report at the run time.
    Is it possible?
    If someone can help me...
    Thanks,
    Mbo

    hello,
    what do you mean with "title" ?
    a couple of approaches :
    - Runtime Customization
    - lexicals
    - before report escape HTML
    regards,
    the oracle reports team --pw

  • Sharepoint 2013 changing the width of columns in a list

    Hi, 
    I would like to know if it is possible to change the width of columns in a custom list in sharepoint 2013. I have tried to load it in Sharepoint Designer 2010, but it will not allow me. Therefore, I can only use SPD 2013.
    Thanks

    Hi Jemelia,
    According to your description, my understanding is that you want to change the width of a column in a custom list in SharePoint 2013.
    Per my test, if we edit the AllItem view of the list in SharePoint Designer 2013, we cannot get the design tab to customize the XSLT of the list and change the width of the column.
    I recommend to create a new page, and then add a data view web part of the corresponding list to the page. After that, we can get the design tab to customize the XSLT of the list.
    Here are the detailed steps:
    In the newly created page with the added data view web part of the list, select the data view web part  and then click on “Customize XSLT” > “Customize Entire View” on design tab in the menu.
    Search for the fieldname for example in my case “Column” then you will get template like “dvt_headerfield. Column”. In this template there is a attribute name like <xsl:attribute name="style">
    in this just add the width size like following.
    <xsl:attribute name="style">padding:0 !important;border:0 !important; width: 600px</xsl:attribute>
      3. Search for the template  “FieldRef_printTableCell_EcbAllowed.Column”. In this template you will see “<td>” and you can add style to change its width like following.
    <td style=" width:300px">
    We can also use jquery to change the width of the column in SharePoint 2013:
          1. Create a txt file containing the code below:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $("TH.ms-vh2:contains('Title')").css("width", "300px"); //You can change the column to be the column you want to change the width, Title in the code for example.
    </script>
           2. Upload the txt file to a library in SharePoint.
           3. Add a Content Editor in the page where the list exists, and then edit the web part.
           4. In Content Link, type in the URL of the txt file in SharePoint, like
    http://server/site/library/file.txt.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Change Page Title in Netweaver Portal

    I would like the Title of my Netweaver portal to say "Development Portal" all the time.  How to do I change this.  I have the runtime already changed for this, but if i go to different iviews/pages, the beginning of the title changes to the iview/page name.
    Thanks
    Lee

    Hello Lee,
    Please check the following thread, might be of some help for you.
    How to change Portal <title>
    Also the following thread talks about deleting the page title. /thread/87799 [original link is broken]
    May be if you can combine the above ideas it might work for you.
    This thread also might be of some help, Changing the text "SAP Enterprise Portal 6.0" in the browser window title
    Thanks and Good Luck,
    Firasath Riyaz.

  • Cannot change site title - help!

    Hi all,
    I try to change the title to no avail. Is there an explanation and solution?
    Here's the code I have in dreamweaver:
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Rainfunds | Welcome - Home</title>
    <LINK REL="SHORTCUT ICON" HREF="favicon.ico">
    I upload it to a server which is forwarded from the domain.
    When I load the page it does not show the title you can see above:
    I click the view source and this is what it shows. only when i click the link does it bring me to a page of code with the correct title:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
      <title>rainfunds </title>
    </head>
    <frameset rows="100%,*" border="0">
      <frame src="http://www.ledzep.biz/rtf" frameborder="0" />
      <frame frameborder="0" noresize />
    </frameset>
    <!-- pageok -->
    <!-- 04 -->
    <!-- -->
    </html>
    Thank you for your help,

    It's because you're using frames and framesets on your site.   Although frames were popular back in the 1990's they no longer fit modern web best practices. Here's why:
    http://apptools.com/rants/framesevil.php
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

Maybe you are looking for

  • Disk needs to be cleaned?

    I have tried about five times to update my BRAND NEW unibody aluminum MacBook Pro to Snow Leopard, and every single time it goes for about a minute or two and then presents me with the message: "There is a problem reading the Mac OS X Install DVD. Ca

  • ORA-13285 again

    Why would this query result in this error? Usually it occurs when the coordinate systems for the two tables are different, but in this case there is only one spatial table, which I'm looking for overlaps within where both features meet certain criter

  • Does linux/Arch benefit from a HOSTS file? to keep ads away..

    along with adblock plus for firefox? I got a huge host file, I remember the difference it made in windows years back..here's the site I got it from.. http://someonewhocares.org/hosts/ and wrote it to /etc/HOSTS i was wondering is there anything else

  • Tracing out an image

    hello forumers. im trying to live trace out this image here,and i like to know which of the settings is the one that doesnt brake the image,and keeps the lines intact im playing around with the various settings,but the results are a bit awkward. than

  • BW3.5 update rule

    Hi all         i create a report using direct master data update can anybody tell me is that nessory that i create update rule for this in the case when i assign data source using direct update method thx