How to fix the width of the column when using alv table

Hi ,
I am displaying the contents in a table. Of course using alv component i displayed the content. Now the problem is the column width is not fixed with value of the table entries( based on the domain length level). As  length  of field increases or decreses as the length of the content increases or decreases. I wanted to fix the column width whatever be the length of the contents.
Can any one help in this regard ?
Thanks Pons.

Hi,
Please find the code related to your problem.
METHOD configure_alv .
data declaration for column settings
  DATA  : lr_column_settings   TYPE REF TO if_salv_wd_column_settings,
          lr_col_header        TYPE REF TO cl_salv_wd_column_header,
          lt_columns           TYPE salv_wd_t_column_ref,
          ls_column            TYPE salv_wd_s_column_ref.
data declaration for table settings
  DATA : lr_salv_wd_table_ctr  TYPE REF TO iwci_salv_wd_table,
         lr_table_settings_ctr TYPE REF TO if_salv_wd_table_settings,
         lr_header_ctr         TYPE REF TO cl_salv_wd_header.
Variables for drop-down and inpufield reference
  DATA : lr_drdn_by_key        TYPE REF TO cl_salv_wd_uie_dropdown_by_key,
         lr_input_field        TYPE REF TO cl_salv_wd_uie_input_field,
         l_header              TYPE string.
get ALV Component <CONTRACT_DETAILS>
  lr_salv_wd_table_ctr = wd_this->wd_cpifc_payment_detail( ).
  wd_this->alv_config_table = lr_salv_wd_table_ctr->get_model( ).
set visible row count
  lr_table_settings_ctr ?= wd_this->alv_config_table.
  lr_table_settings_ctr->set_visible_row_count( '5' ).
  lr_table_settings_ctr->set_read_only( abap_false ).
  lr_table_settings_ctr->set_grid_mode( ).
  lr_table_settings_ctr->set_width(
    EXPORTING
      value = '980PX' ).
  wd_this->alv_config_table->if_salv_wd_table_settings~set_data_check( if_salv_wd_c_table_settings=>data_check_on_cell_event ).
  wd_this->alv_config_table->if_salv_wd_std_functions~set_pdf_allowed( abap_false ).
  wd_this->alv_config_table->if_salv_wd_std_functions~set_view_list_allowed( abap_false ).
  wd_this->alv_config_table->if_salv_wd_std_functions~set_edit_insert_row_allowed( abap_false ).
  wd_this->alv_config_table->if_salv_wd_std_functions~set_edit_delete_row_allowed( abap_true ).
  wd_this->alv_config_table->if_salv_wd_std_functions~set_export_allowed( abap_false ).
  wd_this->alv_config_table->if_salv_wd_std_functions~set_edit_check_available( abap_false ).
  CLEAR: l_header.
  l_header = wd_assist->if_wd_component_assistance~get_text( '030' ).
  lr_header_ctr = lr_table_settings_ctr->get_header( ).
  lr_header_ctr->set_text( l_header ).
set text header for Columns.
  CLEAR: l_header,lt_columns.
  lr_column_settings ?= wd_this->alv_config_table.
  lt_columns = lr_column_settings->get_columns( ).
  LOOP AT lt_columns INTO ls_column.
    CASE ls_column-id.
      WHEN 'PAYMENT_METHOD'.
get header details
        lr_col_header = ls_column-r_column->get_header( ).
disable DDIC field label
        CALL METHOD lr_col_header->set_prop_ddic_binding_field
          EXPORTING
            property = if_salv_wd_c_ddic_binding=>bind_prop_text
            value    = if_salv_wd_c_ddic_binding=>ddic_bind_none.
set user defined column header
        l_header = wd_assist->if_wd_component_assistance~get_text( key = '020' ).
        lr_col_header->set_text( l_header ).
        CREATE OBJECT lr_drdn_by_key
          EXPORTING
            selected_key_fieldname = ls_column-id.
        ls_column-r_column->set_cell_editor( lr_drdn_by_key ).
        ls_column-r_column->se_width( '100PX' ).
        lr_drdn_by_key->set_key_visible(
          EXPORTING
            value = abap_true ).
      WHEN OTHERS.
    ENDCASE.
    CLEAR: l_header,ls_column.
  ENDLOOP.
ENDMETHOD.
Regards
Manoj Kumar

Similar Messages

  • Fixing the width of a column in a pivot table.

    Hi,
    I have a report with a pivot table view.
    In that pivot table i have a column called category and a measure called Amount.
    My issue is, i need to fix the length of the the measured column to particular extent like $111,111,111,111.11 (Bold) for all the columns.
    I went to Format Values for that column and add width=50 in the additional charting options.
    But it's not reflecting for all the columns.
    Is there any other way to resolve this one.
    Thanks,
    chinna.

    Hi,
    Thanks for the quick response.
    I tried to fix the width of a column by putting 20% ,30% ....suggested by you.But it's not reflecting in the report.
    is there any other way?
    thanks,
    chinna

  • How to fix the width of sorting column about adf table ?

    I develop project with ADF in jdeveloper.
    When click on the sorting column header in adf table,it will adjust the width of the sorting column header.It will make page shifting.
    How can I do to avoid the adjusting ?
    How can I do to fix the width of soting table header?
    Any hint will be appreciated.
    Thank you!
    Message was edited by:
    user618145

    I have set the column width like this:
    in style.css:
    /** Column Settings **/
    af|column::header-text
    background-color:#F0EDE1;
    color:#000000;
    font-family:Arial,Helvetica,sans-serif;
    font-size:12px;
    font-weight:bold;
    padding-left: 2px;
    padding-right: 2px;
    padding-top: 3px;
    padding-bottom:3px;
    border-color: #B5B5B5;
    WIDTH: 120px;
    af|column::sortable-header-text
    background-color:#F0EDE1;
    color:#000000;
    font-family:Arial,Helvetica,sans-serif;
    font-size:12px;
    font-weight:bold;
    padding-left: 2px;
    padding-right: 2px;
    padding-top: 3px;
    padding-bottom:3px;
    border-color: #B5B5B5;
    WIDTH: 120px;
    and in jsp page,write like this:
    <af:panelBox text="test" width="1000" background="dark" >
    <af:table emptyText="" value="#{ftOverview.listOfTransefersVect}" var="transfers" width="100%" banding="row" bandingInterval="1">
    <af:column sortable="true" sortProperty="transactionId" headerText="#{resources['ft_overview.ref']}" formatType="text" width="39"
    noWrap="true">
    <af:outputText value="#{transfers.transactionId}" escape="false"/>
    </af:column>
    </af:table>
    </af:panelBox>
    but it seems doesn't work well.

  • Need to fix the width of a column in interactive report

    Hi,
    I have a column named 'Comment'. Its have a huge data due to which the lenght of that column in interactive report get increased. I need to fix the length to a desired value.
    I used following code in Region Footer:
    <style>
    table.apexir_WORKSHEET_DATA td[headers=COMMENTS] {
      _width: 300px;
      min-width: 50px;
      max-width: 300px }
    </style>
    Its solved the problem by fixing the width of the column but the column is not showing the full data now. It is hiding most of its part to fit it in that column.
    Please give some idea.
    Thanks,
    Chandru

    Hi,
    I believe you will want to add a height specification to allow for multiple lines.  And you may want/need to specifiy how you want lines to wrap.
    Add (for example):
      height: 60px; 
      white-space: nowrap; 
      word-wrap: break-word;
    There are defaults and several options for white-space and word-wrap.  You may want to look them up and give them a try for comparison.
    Howard

  • How can I change the width of a column in a list of sharepoint 2010 ?

    How do I change the column width in sharepoint 2010 so the data displays properly in standard view?
    I open the list View in sharepoint designer,and change the width of the <td> ,but ,when I preview ,the column width don't change. what should I do?

    While they may auto adjust to what it thinks is a correct width, far too often it allocates way too much room and that causes lists with 4 columns to be much longer than they need to be and without the ability to adjust them, lists look strange.
    http://twitpic.com/23ro09/full is an example of the first column having been allocated too much room.
    Denzel

  • How do I increase the width of the first column in the Terminal ls -l command?

    I am now running 10.9.x, but I've experienced the problem described in the question over the last several iterations of OS X.
    I use bash as my interactive shell. When I display the "ls -l" command in Terminal the output is often very difficult for me to scan, because the columns in which are displayed the several fields of the records for the listed files are misaligned (different left-hand first-letter starting points for left-aligned text-valued fields; different right-hand low-digit alignment of numerical fields).
    When I look more closely at the mess displayed in my Terminal window, it appears that the cause of the problem may be that no minimum width, or an inadequate minimum width, has somewhere been set or defined for the first column of each record, containing the file's "mode" string (permissions, etc.); for all records in which this string is of equal length, the succeeding columns for all fields in those records are themselves aligned.
    It has not always been thus for me in the Terminal with OS X, or else I might not dream that the world could be a better place in this one respect. But if I launch an interactive csh-shell instead of bash in Mavericks today, the columns of the ls -l command there align no better.
    I've found no help in the Unix man pages for the ls command. There is a COLUMNS environment  variable whose value is supposed to be used by the ls command to set the width of every column displayed, but this is not what I want to do, and in my shell "ls -l" seems to ignore the exported variable anyway.
    There is also an LS_COLWIDTHS environment variable that is described as setting column widths on a field-by-field basis, at least for some fields, but the the mode column is not included among those whose width is supposed to be adjustable, and my shell seems to ignore the value of this variable as well.
    I've looked in my rather simple ~/.profile and ~/.bashrc files for anything that I might plausibly suspect of producing or perpetuating this behavior, but there is nothing there. Any suggestions about how to remedy this problem?
    Randy Miller

    John,
    I would like you to perform a safe boot. On reboot, press and hold the shift key at the chime, until the grey horizontal bar appears. After you type in your password, press and hold the shift key again, then click the right arrow to login, and release the shift key when your desktop appears. Move the contents of your local ~/Library/Caches into the Trash. Reboot normally. Empty your Trash.
    Re-evaluate your Terminal behavior. If it now works ok, great. Otherwise, here are a sequence of screen shots of my Terminal preferences for comparison. I can use both Courier fonts without formatting issues. Click to enlarge. I use the free IR Black Terminal theme as a personal choice in OS X 10.9.4. In my ~/.bashrc file (triggered from ~/.bash_profile), I export TERM=xterm-256color, and invoke /usr/bin/tput init. Click on the following images to enlarge.

  • How to change the width of a column in the web templete

    hai
       can anyone pl help me to solve the issue
    here is the issue
        " how to change the width of the column in web templete?" is there any chance  to change
    thanx in advance
    syam

    First use the Active Cell property and set the row value to -2 to change an entire column. The attached image shows how to set the background color of column 3 to green. I don't understand your comment about column size. It doesn't matter how wide or narrow a column is. Using the Cell Background Color property, the entire cell is colored. If you are having difficulty keeping track of the number of columns, thats a different issue.
    Attachments:
    Background_Color_of_Table.jpg ‏5 KB

  • How to increase the width of the column in Tableview

    Hi ALL,
    How to increase the width of the column in tableview?I have name column where big name is displaying in rows.Does any one have any idea how to increase the width of the column dynamically in tableview.Please respond its little urgent.
    Thanks in advance

    Hi Peter,
    Here is my Dynpage
    package com.ust.jcatotable;     
    import java.awt.Event;
    import javax.resource.cci.MappedRecord;
    import javax.resource.cci.RecordFactory;
    import com.sapportals.connector.connection.IConnection;
    import com.sapportals.connector.execution.functions.IInteraction;
    import com.sapportals.connector.execution.functions.IInteractionSpec;
    import com.sapportals.connector.execution.structures.IRecordSet;
    import com.sapportals.htmlb.DropdownListBox;
    import com.sapportals.htmlb.event.TableNavigationEvent;
    import com.sapportals.htmlb.page.DynPage;
    import com.sapportals.htmlb.page.PageException;
    import com.sapportals.portal.htmlb.page.JSPDynPage;
    import com.sapportals.portal.htmlb.page.PageProcessorComponent;
    import com.sapportals.portal.ivs.cg.ConnectionProperties;
    import com.sapportals.portal.ivs.cg.IConnectorGatewayService;
    import com.sapportals.portal.ivs.cg.IConnectorService;
    import com.sapportals.portal.prt.component.IPortalComponentContext;
    import com.sapportals.portal.prt.component.IPortalComponentProfile;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    import com.sapportals.portal.prt.component.IPortalComponentResponse;
    import com.sapportals.portal.prt.runtime.PortalRuntime;
    public class Display extends PageProcessorComponent {
      public DynPage getPage(){
         return new DisplayDynPage();
    public static class DisplayDynPage extends JSPDynPage{
         private Object formatFlag;
         public static IConnection connection ;
         private IPortalComponentRequest request;
         private IPortalComponentContext context;
         private IPortalComponentProfile profile;
         private IPortalComponentResponse  response;
         private int visibleRow=1;
         TableBean myBean;
         public void doInitialization(){
                   response = (IPortalComponentResponse) this.getResponse();
                   request = (IPortalComponentRequest) this.getRequest();
                    context = request.getComponentContext();
                    profile = context.getProfile();
                    IPortalComponentProfile profile = context.getProfile();
                    Object o = context.getValue("myBean");
                    if(o==null || !(o instanceof TableBean)){
                       myBean = new TableBean();
                       setBeanFromProfile(profile, myBean);
                       context.putValue("myBean",myBean);
                     }else {
                       setBeanFromProfile(profile, myBean);
                        myBean = (TableBean) o;
                    this.getData();
         public void myOnNavigate(Event event) throws PageException{
              TableNavigationEvent tne = (TableNavigationEvent) event;
              this.visibleRow = tne.getFirstVisibleRowAfter();
              if(myBean!=null)
              myBean.setVisibleRow(new Integer(this.visibleRow).toString());

  • How to modify the width of a column?

    Hi,
    I would like to specify different values in the width for the columns in a custom report, because from Microsoft Excel I would like to print all information in an only page.
    I have tried to modify the values from "Additional formatting options" specifying different values, but when I donwload the report in Excel format, the columns doesn't modify (they have the same with as default).
    How can I do it?
    Thanks and regards.

    Hi Monica
    Craete Narrative report and then throght HTML tags set the width. Hope it helps

  • How to set the width of a Column

    Hi friends
    I have problem with setting up the Width for each column. Let us i want to set different column width for each Column.
    That is for first column the Width may be Different and the other column the width may be different.
    So please help me out on this Issue
    Cheers
    Jofin

    How to set the width of a ColumnWhat component are you talking about? Are you talking about the width of a column in a JTextPane?
    Have you read the API for the component in question?
    Have you followed the link titled "How to Use...." to the Swing tutorial?
    Learn to read the API and ask a proper question with all the relevant information.

  • With OS X10.9 the Mail window (after hitting reply or forward) grows ridiculously long, sometimes 4 times the width of the screen and would not allow me to readjust the window size. Any one has the same problem? How shall I go about fixing it? (Thanks)

    With OS X10.9 the Mail window (after hitting reply or forward) grows ridiculously long, sometimes 4 times the width of the screen and would not allow me to readjust the window size. Any one has the same problem? How shall I go about fixing it? (Thanks)

    I'm having the same problem.  I've tried going into the Library and deleting the mail plist file(s), which fixes the problem, but only temporarily.  Would appreciate any help here too!

  • I can no longer adjust the width of the Bookmarks Sidebar, how do I fix this issue?

    In the past I could hover my mouse arrow over the slider vertical bar to the right of the sidebar and get a 2 headed arrow that I could use to adjust the width of the Bookmarks Sidebar but that stopped working. I need to fix this issue. What do I need to do?

    Maybe something you installed to Firefox messed up that feature.
    Do you have that problem when running in the Firefox SafeMode? <br />
    [http://support.mozilla.com/en-US/kb/Safe+Mode] <br />
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this: <br />
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • How can i fix the tab overlapping when i change the width of the url bar with #urlbar-container [focused]?

    I want to create for myself the most minimalistic browser experience as possible and i've put the most used features in the title bar. For purposes of space i had to fix the width of the url bar to a minimum and my intention is to increase it to a fixed width only when #urlbar-container [focused]. The problem is that #urlbar-container will overlap the existing tabs instead of shrinking their space, making it look really bad. It looks wonderful with #urlbar-container:hover, but i can't use that since whenever i want to refresh the wesbite using the button the width of the container will increase moving the button from the place i had the mouse in the first place to click it.
    Fixed width of the url bar when #urlbar-container is not focused:
    http://imagizer.imageshack.us/v2/800x600q90/829/xo4o.png
    Fixed width of the url bar when #urlbar-container [focused]:
    http://imagizer.imageshack.us/v2/800x600q90/34/8o36.png
    This is the css i have for the url bar at the moment:
    <pre><nowiki>#urlbar-container {max-width:225px!important;}
    #urlbar-container {min-width:225px!important;}
    #urlbar-container {transition:0.7s!important;}
    #urlbar-container [focused] {max-width:500px!important;}
    #urlbar-container [focused] {min-width:500px!important;}
    #urlbar-container {transition:0.7s!important;}
    #urlbar {border-top-right-radius:10px!important}
    #urlbar {border-bottom-right-radius:10px!important}</nowiki></pre>

    What method (code) did you use to get the Tab bar displaying in the space used for the Navigation Toolbar (location bar)?
    The Tab bar should be displayed above the Navigation Toolbar.
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • How to control the width of the columns in a table in the oaf page?

    hi,
    We have a requirement to adjust the width of the columns of the table so that they are in line with the width of the page.
    Please do share any feasible solution.
    thanks,
    Danish

    try to personalize and set the width property of item.
    else use below code in Controlller.
    1) public class wyseQotLinesCOEx extends QotLinesCO
    public CSSStyle cellUpperCase;
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    2)
    get handle of inputitem as inputbean;
    cellUpperCase = new CSSStyle();
    cellUpperCase.setProperty("width","50");
    if (inputbean != null)
    {        inputbean.setInlineStyle(cellUpperCase);
    }

  • Adjust the width of a column in a report.

    Hi,
    How can we adjust the width of a column in a report.
    We have a report with around 10 columns.
    out of the 10 columns 1 column has a width of 500 char..
    we want to display only the first 150 chars of that column with 50 char on first line,next 50 on second line and last 50 on third line.
    i have tried using the the substr and <br> in the region source but it takes 3 lines by default even if it is not of 150 chars .I want to display it in 3 columns if it of 100+ chars.
    Thanks in advance.

    Hi,
    Using the col tag is the more proper way of fixing the width of a column.
    If you don't want to use the col tag, you should change your expression to:
    &lt;table style="width:500px"&gt;
    Firstly, you should use the unit of length (ie, "px") for any non-zero value and secondly because we are being encouraged to use the style attribute whenever possible as, as I understand it, this will become the standard.
    Regards
    Andy

Maybe you are looking for

  • Lenovo U510 Intel Rapid Storage Installation

    I got my new U510 and wanted a clean installation of Windows 8. So (as I am a Studen and can order it for free) i bought a Windows 8 Licence and reinstalled Windows 8. At first i thought it would be the best to use the SSD as System Partition but i n

  • CASE statement in Oracle 8i PL/SQL

    I'm in the process of doing an upgrade from 8i to 10g and have the necessary instructions in performing it. however, after running the pre upgrade tasks (run utlu102i.sql) to show the preupgrade information, i found out that there are some INVALID ob

  • I am new to networked databases. Kindly help me with a basic implementation of a database system.

    Until now, I have only worked with local database files. My forte is designing custom database solutions tailored to client needs in VB.NET. I have however, never worked on a "database shared over a network". My client has 3 - 4 PC's that need to be

  • Use iPhone 4 while charging

    Can I use the iPhone 4 while charging for Internet, games, etc. or it hits the device?

  • PR from MRP

    Dear MM consulatnts, Request all of ur help. I have a customised PR say ZNB. Whenever MRP is run system should craete PR for this ZNB doc type for procured materials Where to configue this correct answers will be rewarded with points Thanks A.Gururaj