Skip to Content
author's profile photo Former Member
Former Member

How to increase the column size of Alv tbale

Hi All,

I created an Alv table to display the content of my database table. In one of the column the entire data from my database are not displayed the last few characters are missing. The data type for that column in the database is char. Can any one help me how to increase the column size in my Alv table or any suggestions to resolve this issue.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 18, 2011 at 06:21 AM

    HI ,

    Please try somthing similar ..

    DATA lv_value TYPE REF TO cl_salv_wd_config_table.
    DATA lo_coloum TYPE ref to CL_SALV_WD_COLUMN.
    
    
      lv_value = lo_interfacecontroller->get_model( ).
    
    lv_value->if_salv_wd_table_settings~set_fixed_table_layout( abap_true ).
    lo_coloum = lv_value->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( ID = 'EMLID').
    lo_coloum->set_width( '1000' ).

    Thanks,

    Aditya.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 18, 2011 at 06:22 AM

    Hi Vadiv,

    Try with this..

    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 ).

    You can refer to webdynpro component SALV_WD_TEST_TABLE_PROPS. Go to the view TABLE and look inside the method SET_COLUMN_SETTINGS. I hope this will help you.

    Cheers,

    Kris.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.