Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Column settings - CL_SALV_TABLE

Former Member
0 Likes
8,522

I'm using CL_SALV_TABLE to create a very simple report. The report only consists of one column. How do I set the column width and align the text to left? I tried set_optimized, but I do not see any difference to the ALV after adding it in. Please advise.

I'm using CL_SALV_TABLE to create a very simple report. The report only consists of one column. How do I set the column width and align the text to left? I tried set_optimized, but I do not see any difference to the ALV after adding it in. Please advise.

3 REPLIES 3
Read only

Former Member
0 Likes
3,077

Hi,

check the below

[http://help-abap.blogspot.com/search/label/SALV%20Tutorial]

Regards

Sunil

Read only

Former Member
0 Likes
3,077

Hi,

For setting column width

DATA :     gr_columns   TYPE REF TO cl_salv_columns,
                 gr_column    TYPE REF TO cl_salv_column.

  CALL METHOD gr_table->get_columns
    RECEIVING
      value = gr_columns.

  gr_column ?= gr_columns->get_column( c_bukrs ).
  gr_column->set_output_length( 12 ).

For alignment

gr_column->SET_ALIGNMENT( IF_SALV_C_ALIGNMENT=>LEFT ).

Regards

Read only

Former Member
0 Likes
3,077

Hi,

Thanks for the replies. The column width is solved by putting set_optimize before defining the column title.