Fix ALV column width independent of content

Hi All,
I need to fix ALV column width independent of content. If I set the width of column as 10 and when the content is 20 characters long, the column expands to 20. I want the width of column to be fixed irrespective of content. I tried all properties available for ALV column and table but couldn't figure it out. We are on ECC 6.0 ENHP4. Any ideas how to achieve this.
Thanks,
Tom

I believe that I have done this setting fixed layout to true, and then manually setting the column widths in the code.
lo_model->if_salv_wd_table_settings~set_fixed_table_layout( abap_true )
lt_alv_column_table = lo_alv_model->if_salv_wd_column_settings~get_columns( ).
LOOP AT lt_alv_column_table INTO ls_alv_one_column.
ls_alv_one_column-r_column->set_width( '90' ).

Similar Messages

  • Setting ALV Column width

    Hi experts,
    I'm trying to set fixed width in my ALV report.
    I using set_width to set the fixed width.
    But I could not get the fixed width.
    data salv_column      type ref to cl_salv_wd_column.
    salv_column->set_width( '4' ).
    When I try this i'm getting like belwo.
    if my Header text is 'Test Column', and width = 4.
    I could able to see the header text fully (Test column).
    But I should see only Test and in the 2nd row it should show Column
    Any idea of doing it???
    Thankx...

    Hi,
    You need to change Table setting Layout. Please check this code:
    * create an instance of ALV component
    DATA: LR_IF_CONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE,
    LR_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE,
    LR_CMDL TYPE REF TO CL_SALV_WD_CONFIG_TABLE,
    LR_TABLE_SETTING TYPE REF TO IF_SALV_WD_TABLE_SETTINGS.
    LR_CMP_USAGE = WD_THIS->WD_CPUSE_ALV( ).
    IF LR_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
      LR_CMP_USAGE->CREATE_COMPONENT( ).
    ENDIF.
    ** get reference to the ALV model
    LR_IF_CONTROLLER = WD_THIS->WD_CPIFC_ALV( ).
    LR_CMDL = LR_IF_CONTROLLER->GET_MODEL( ).
    LR_TABLE_SETTING ?= LR_CMDL.
    ** Set column width
    DATA LR_COL TYPE REF TO CL_SALV_WD_COLUMN.
    LR_COL = LR_CMDL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'PERNR' ).
    LR_COL->SET_WIDTH( '70' ) .
    LR_COL = LR_CMDL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'ENAME' ).
    LR_COL->SET_WIDTH( '100' ) .
    LR_TABLE_SETTING->SET_FIXED_TABLE_LAYOUT( ABAP_TRUE ).
    LR_TABLE_SETTING->SET_FIXED_TABLE_LAYOUT( ABAP_TRUE ).
    Regards,

  • Can fix the column width in af:table

    I am using af:table, i need to fix the static column width, it can be able to do it?
    plz help,.....

    The width attribute of af:column element specifies column width.
    The setWidth(java.lang.String width) method of oracle.adf.view.faces.component.core.data.CoreColumn
    also specifies column width.

  • Fix the Column Width in WAD 7.0

    Hi Guys,
                 I have two Queries in a Web Template and when I execute the Web Template in Web, both the Query results are are populated one below the other. The column width for both the Query output from a Web Template when executed in Web needs to be the same.
    Any ideas and suggestions will be really appreciated. Thanks again Guys.
    Thanks,
    Harsha.

    The width attribute of af:column element specifies column width.
    The setWidth(java.lang.String width) method of oracle.adf.view.faces.component.core.data.CoreColumn
    also specifies column width.

  • Column width collapsing on content within it

    Hi I have a 3 column page, and I don't know why the right column called "rightcolumn" collapses on the size of its contents which is table called "news", no matter the size i make the rightcolumn width it always previews to news width.
      it appears correct in dreamweaever but when i preview it in any browser its not correct.
    posted page at: http://www.connectedelements.com/gmcfl/index3.html
    made rightcolumn background organge color and news table has a green border to help distinguish.
    any comments appreciated.
    thanks mike

    I'm not an expert on tables,but this looks wrong
    <td id="rightcolumn"><table border="0" cellpadding="0" cellspacing="0" id="news">
    Gary

  • Adjust JTable column width according to content

    'morning all,
    How can I resize each column's width according with the content ? I mean, i'd like to show all the content of my cells, neither clipped nor with leading space.
    Can something help me, please ?
    Bye bye by Dhavide - we will, forever -

    If you don't set specific font for individual cells, your JTable inherited a default font from the Component class. You can try something like this (untested):
    FontMetrics FM=getFontMetrics(myTable.getFont());
    int j=0;
    int col=1;  // or whatever column you want to change width
    String out;
    for (int row=0;row<maxRow;row++) {
       out=myTable.getValueAt(row,col);
       if (FM.stringWidth(out)>j) j=FM.stringWidth(out);
    myTable.setColWidth(col,col+1,j);          // width plus a fudge factorwhere myTable is a reference to your own table and out is the label in each row in the column that you want to change the width.
    ;o)
    V.V.

  • Freeze ALV Column width

    Hi All,
    In my application, I have set the width of the dynamic columns for ALV.
    Once the application loads, the user doesn't want to expand the columns by dragging the column.
    Is it possible to freeze this using ALV?
    Regards,
    Rekha

    Hi Rekha,
    You can try this code
      data: l_salv_wd_table type ref to iwci_salv_wd_table.
      l_salv_wd_table = wd_this->wd_cpifc_alv( ).
      data: l_table type ref to cl_salv_wd_config_table.
      l_table = l_salv_wd_table->get_model( ).
      l_table->if_salv_wd_table_settings~set_width( '100%' ).
      l_table->if_salv_wd_table_settings~set_fixed_table_layout( abap_true ).
    I hope it helps.
    Regards
    Arjun

  • How to fix the column width in a table in htmlb tableview control

    HI Experts,
    I have an issue with my htmlb table view controller. I have created a custom iView with a htmlb table view control and placed it in quick navigation window.
    When data in columns exceeds, I am getting horizontal scroll bar and column,table are getting extened. I don't want  column size increases when text length increses. Instead when lenght of the text incrases in a column, I want the text displyed in multiple columns.
    I have tried for this as below.
    <hbj:tableView
        id="statTable"
        model="bean.stattableModel"
        design="ALTERNATING"
        headerVisible="false"
        footerVisible="false"
        fillUpEmptyRows="false"
        navigationMode="BYPAGE"
        selectionMode="NONE"
        headerText="Report List"
        visibleFirstRow="1"
        visibleRowCount="10"
    width="100%">
    <%
         stattableModel.getColumn("D").setWidth("5px");
         stattableModel.getColumn("D").setWrapping(false);//tried true aswell
         stattableModel.getColumn("H").setWidth("px");
         stattableModel.getColumn("H").setWrapping(false);
    %>
    No change happen ever after I used the above code.
    Any one has the idea, how make it work.
    Thanks in Advance,
    Chinna.

    Hi Babu,
    Please go through this links.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80a7eef2-9a2c-2a10-12bb-abad552f3302
    http://www.sapfans.com/forums/viewtopic.php?f=20&t=300326
    Kind regards
    Prabhakaran.P

  • Prob with fixed column widths and word wrapping in viewer

    i have a report where each record has a very long paragraph of text in it.
    In desktop and plus, the text column is at a fixed width and the text just wraps nicely according to the column width.
    But in Viewer, the column widths do not stay fixed, the text does not wrap, and the long text is displayed in a single line that completely stretches the column width off the page and requires a horizontal scroll bar.
    is there anyway to fix the column width in viewer, have the text naturally wrap, and prevent the column stretching. All word wrapping settings are on, but seem to have no effect. I can't seem to find any solution to this.
    Thanks...

    Hi Pritam,
    Per my understanding that you can't see the vertical scrollbar of the ReportViewer controls 2012 to scroll for the grid rows, but can see the vertical scrollbar of the web application, you also can't fix the headers while scrolling, right?
    I have tested on my local environment and can't reproduce your issue, but you have an alternative way to add some css  to the web form's source code to display the vertical scrollbar.
    Details information below for your reference:
    Please check below properties setting of the reportviewer which control the visibility of the scrollbar:
    AsyncRendering="true"
    SizeToReportContent="false"
    Please check if this problem also occur on other version of IE and other type of browser.
    Please check if you have done correct setting of the Fix data to freeze the table header as the step of below:
    http://technet.microsoft.com/en-us/library/bb934257(v=sql.100).aspx
    If step1 doesn't work, please click the source of webform.aspx and add below CSS to add the vertical scrollbar manually:
    #ReportViewer1 {
              overflow-y: scroll;
    Run the application you will see it display as below:
    Similar thread for your reference:
    https://social.msdn.microsoft.com/forums/sqlserver/en-US/f96b3b56-e920-411b-82ea-40467c922e66/reportviewer-control-vertical-scroll-bars
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu

  • Fixed Column Width in F-32

    Hello Experts,
    We have 'Assignment' column in the clearing screen.  We want to have this column fixed.  The problem is that by default it displays 7 to 8 characters.  If we have more than 8 characters, we have to manually expand the column.  Is there a way to fix the column width to 17 characters?

    Dear Narayan
    Hello Experts,
    We have 'Assignment' column in the clearing screen. We want to have this column fixed. The problem is that by default it displays 7 to 8 characters. If we have more than 8 characters, we have to manually expand the column. Is there a way to fix the column width to 17 characters?
    Go To F-32
    Choose From Menu
    Setting --> Change line Layout
    Double click the layout that appears
    Double click the Assignment Field
    Change the display length to 17 as per your requirement
    and save
    Hope it Solves your query
    Cheers
    IMK

  • Autosize column width to contents

    Hello,
    I'm using WAD 7 and trying to set up the 0ANALYSIS_PATTERN template to automatically adjust the column width to the contents of the cells. Is there such functionality? I tried using the ColumnWidth mod to set up the default width, but all that does is adjusting all columns to a set width which doesn't look good.
    Any suggestions would be greatly appreciated.
    Thanks!
    Milu

    There is a checkbox in the table inspector to auto-resize to fit content. Unfortunately, that only seems to work with rows, not columns.

  • Fixed column width in Excel output

    Hi,
    Can we fix a column width when we are viewing the report output in excel? Can we do that in RTF template?
    If the column name is too long, it is automatically inreasing width of the column...But I need the column to be of a fixed width.

    You should try Excel templates instead of RTF templates. This is the best method to control Excel output formatting like column width.did you try excel template ?
    for example for 3 nested group?
    from Re: Can XDODTEXE produce BI Publisher output?
    i tested true excel template on ebs r12.1.2 and it works only for one group and for two group the result awful it duplicate and mix data
    IMHO true excel template very limited yet

  • Column Widths of existing Report

    Hi, I'm wondering how you can modify the width of a particular column in a report. One of the columns has a lot of information, and I want this column to take up about half the page. I look in the Application Builder to see the properties of that column, but don't see anywhere to set the width.
    Also is there a way to get a record to display over 2 rows, so that it doesn't scroll off the screen?
    Thanks in advance, Sarah

    as i explained briefly in How to change column width and other attributes , report templates are the best way to control the look/feel of our outputted result sets. more specifically, that's probably the best place to specify attributes such as wrapping and column widths. when doing this type of html formatting, though, you also need to be aware of the rest of the html that's on your page. so if a column in your report is set to be 500px wide but the region template for your report region stores its content in a table with a fixed width of 200px, i'm pretty sure the second setting overrides the first. i'd approach it this way: set up your report template to do what you want (wrap some rows and maybe fix some column widths). then see if your page renders correctly. if it doesn't do what you want, check the region template to see if that's interfering. if that's not it, then check the page template. there's a pretty good chance that just changing your report template will do the trick, but it helps to be aware of the html around it.
    hope this helps,
    raj

  • Business Graphics UI element Column Width

    Hi Experts,
    I am using business graphics UI element in my Web Dynpro application to display the chart in columns .
    I am able to display the chart properly based on the node data.
    But the issue that I am facing is that when the node data is less, the column in the chart is getting expanded(column width is increased) as I am not able to set the width of the column dynamically based on the node size.
    The column width keeps on changing based on the node size.
    Is there any possible way to set the column width dynamically or fix the column width irrespective of the node size?
    Best Regards,
    Anurag

    Hi Guys,
    Is there any update on this?
    Best Regards,
    Anurag

  • Fix Column width in tables

    Hi,
    Anyone of you please update the script for the below requirement.
    var doc = app.activeDocument, 
        w = doc.documentPreferences.pageWidth; 
        sel = doc.selection[0];
        if(sel instanceof Table) 
                var col = sel.columns; 
                    _left = sel.parent.parentPage.marginPreferences.left; 
                    _right = sel.parent.parentPage.marginPreferences.right, allcolwidth = 0; 
                for(var i=1;i<col.length;i++) 
                        var cell = col[i].cells, cont = ""; 
                        for(var j=0;j<cell.length;j++) 
                                cont += cell[j].contents; 
                        if(cont == "") 
                                col[i].width = "1p"; 
                                allcolwidth += col[i].width; 
                        else if(cont.indexOf("$") !=-1) 
                                col[i].width = "1p"; 
                                allcolwidth += col[i].width; 
                        else if(cont.indexOf("*") !=-1) 
                                col[i].width = "1p"; 
                                allcolwidth += col[i].width; 
                        else if(cont.indexOf("%") !=-1) 
                                col[i].width = "1p"; 
                                allcolwidth += col[i].width; 
                       else if(cont.indexOf(")") !=-1) 
                                col[i].width = "1p"; 
                                allcolwidth += col[i].width; 
                        else 
                                col[i].width = "5p"; 
                                allcolwidth += col[i].width; 
                                for(var k=0;k<col[i].cells.length;k++) 
                                        if(col[i].cells[k].contents !="") 
                                                var paras = col[i].cells[k].paragraphs; 
                                                for(var l=0;l<paras.length;l++) 
                                                        paras[l].justification = Justification.RIGHT_ALIGN; 
                col[0].width = w - _left - _right - allcolwidth; 
        else 
                alert("Select a table...") 
    All tables in a document:
    1) All $, %, ), columns should be fixed width “1p”
    2) All empty column should be “1p”
    3) All superscript content column like [1, (1), *] should be “1p”
    4) Remaining all columns (except first column) should be “6p” width and values are right aligned
    5) First column always variable width
    6) All underlines values should be 0.5 bottom border, border only need ‘$’ column and ‘value’ column (not in ‘)’ ‘%’ 1, (1), *) columns.
    7) Also table should be fit within text area (100%)
    The below script is working fine but it missed the requirements for (point no 3 and 6).
    Sometimes empty columns are not converted into "1p" because of spanning (see the below table), Can you please ignore the spanned columns while running the script or put any input dialogue box for "number of rows to ignore".

    Please do not post drive-by follow-ups to random ancient threads. The Column Width property referred to was introduced in APEX 4.0 in June 2010, 2 months after this thread originated. Whilst the new information might be useful for someone using APEX 4.0 who finds this thread in a search, this question occurs in hundreds of other threads: are you going to update all of them?
    And the Column Width property is in the Column Definition section of the column attributes...

Maybe you are looking for

  • Rtmpte not responding (on the first request)

    I am running adobe media server 4.5 on windows 2008 and for testing purposes I have no firewall enabled. Clients and servers on the same v-lan I created .swf on Adobe Flash Pro CS 5.5 with Action Script 3 and support for Adobe Flash 10 and 10.1 I am

  • Online Bill Pay Is Not Working

    I am trying to pay my bill online, and the service is not working.  I do not have any more time to waste on your website.

  • Handling oracle commit erros at Appilcaton level in case of AWT

    Hi All, Incase AWT, All transactions committed successfully in the TimesTen database will be successfully propagated to and committed in the Oracle database. Execution errors on Oracle cause the transaction in the Oracle database to be rolled back BU

  • AJAX - JavaScript - HTML

    Hi all, I am currently trying to find editors or IDEs for AJAX,HTML,Java. I am currently using Eclipse for my JAVA projects. Can you please suggest me which editor do you prefer to write html,javascript, or AJAX. I am not really interested in visual

  • Widget is missing it's scroll bar

    After publishing my project and viewing the project in Chrome, the tabs within a widget that have more content then the widget frame can hold are not accessible because the scroll bar has dissapeared.  Please advise on how to fix this. Thank you in a