‎2009 Aug 05 9:36 PM
I am building a SALV and my layout is Type ref to CL_SALV_LAYOUT.
I dont find any option there to optimize my column widths unlike we pass cwidth_opt = 'X' in regular ALV.
How do I optimize my columns width.
Thanks
Kiran
‎2009 Aug 05 9:42 PM
‎2009 Aug 05 9:42 PM
Check this
data: gr_columns type ref to cl_salv_columns_table.
data: gr_column type ref to cl_salv_column_table.
gr_columns = gr_table->get_columns( ).
gr_column ?= gr_columns->get_column( text-102 ). " MATNR
gr_column->set_visible( abap_false ).
gr_columns->set_optimize( abap_true ).
a®
‎2009 Aug 05 10:05 PM
Thaks ars.
Can you tell me how to align the values in each column also.
Thanks
Kiran
‎2019 Jul 26 11:19 AM
You may set the length by column as follow:
data gc_alv type ref to cl_salv_table.
gc_alv->get_columns( )->get_column( 'CHARG_MOSTO' )->set_output_length( value = 10 ).
Regards
‎2023 Oct 03 3:55 PM