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

How to change the column length in the ALV Grid.

Hai All,

I am developing a ALV application.

in the table it have five columns, I want to set the column width to only 5 character length.

how can i make this.

Thanks,

Sreevathsava.G.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2009 at 12:21 PM

    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' ).
    Regards, Radhika.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Check in ST22 where the Null reference error is pointed to.

      DATA lr_cmdl type ref to cl_salv_wd_config_table.

      DATA LR_COL TYPE REF TO CL_SALV_WD_COLUMN.

      if lr_cmdl is not initial.

      LR_COL = LR_CMDL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'STATUS' ). "Is this column name correct

      endif.

      if lr_col is not intiial.

      LR_COL->SET_WIDTH( '10' ).

      endif.

      Where have you written this piece of code.

      If you have written in any method of view, then check wether this ALV is under the component usages tab of PROPERTIES tab of that view.

      Now instantiate the ALV then try touse the above code of RADHIKA's.

      Regards,

      Lekha.

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.