cancel
Showing results for 
Search instead for 
Did you mean: 

Horizontal Scroll on ALV last column

former_member189690
Participant
0 Kudos

Hi gurus,

Let see I can explain my issue.

I have an ALV with 20 fields, I have put scrolling for 5 columns, to first two ones are frozen. I have set 150px as width for each column. Scrolling is working fine but when I reach the final scroll I can't see the LAST COLUMN (FIELD20), I mean, the column doesn't have the proper width (150px), for the rest columns the width is appearing properly.

I copy my source code and a image link to more details:


  DATA lo_column TYPE REF TO cl_salv_wd_column.
  lo_column = lo_value->if_salv_wd_column_settings~get_column( 'FIELD' ).
  lo_column->set_fixed_position( cl_wd_abstr_table_column=>e_fixed_position-left ).
*
  lo_column = lo_value->if_salv_wd_column_settings~get_column( 'FIELD_OCULTO' ).
  lo_column->set_fixed_position( cl_wd_abstr_table_column=>e_fixed_position-left ).


  DATA: lt_columns TYPE salv_wd_t_column_ref,
        ls_column  TYPE salv_wd_s_column_ref.

  CALL METHOD lo_value->if_salv_wd_column_settings~get_columns
    RECEIVING
      value = lt_columns.

  LOOP AT lt_columns INTO ls_column.

    lo_column = lo_value->if_salv_wd_column_settings~get_column( ls_column-id ).
    lo_column->set_width( '150PX' ).

  ENDLOOP.

  lo_value->if_salv_wd_table_settings~set_fixed_table_layout( abap_true ).

* Cantidad de columnas que ocupan el scroll.
  CALL METHOD lo_value->if_salv_wd_table_settings~set_first_visible_scroll_col
    EXPORTING
      value  = 'FIELD'.

  lo_value->if_salv_wd_table_settings~set_scrollable_col_count( 5 ).

[http://imageshack.us/photo/my-images/836/abap.jpg/]

Any idea?

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Lukas_Weigelt
Active Contributor
0 Kudos

Hi,

Try adding this:

DATA l_table TYPE REF TO cl_salv_wd_config_table.

l_table->if_salv_wd_table_settings~set_fixed_table_layout( abap_true ).

In case this doesn't help, does the problem remain when you try changing the column width to, let's say, 75PX?

Cheers, Lukas

former_member189690
Participant
0 Kudos

Thank you!

I have to fix a fixed witdth to the entire table and then use SET_FIXED_TABLE_LAYOUT!!

That's solves my problem!

Answers (0)