cancel
Showing results for 
Search instead for 
Did you mean: 

ALV GRID FIXED COLUMN....

Former Member
0 Kudos

I do have a web dynpro alv grid, I want some column to be fixed, and therefor add some horizontal scrolling to all others... (like in fronted Key columns, always displayed!

I can i do that ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

In the Application object include this -

WDTABLENAVIGATION SCROLLBAR WDR_APP_PROP_TABLE_NAV

In the CL_SALV_WD-CONFIG_TABLE(lo_value), get the columns using GET_COLUMNS

  • Get the column ref

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

For each column reference use the method - cl_salv_wd_column.

loop at lt_columns into ls_column.
    lr_column = ls_columns-r_column.
case ls_column-id.
when col1
        CALL METHOD lr_column->set_fixed_position
          EXPORTING
            value = cl_wd_abstr_table_column=>e_fixed_position-left.
when col2.

endcase.

endloop.

For Scrolling -

lr_tabset ?= lo_value.
      CALL METHOD lr_tabset->set_scrollable_col_count
        EXPORTING
          value = 15  "depends on the columns in your table .

Check out this link -

Regards,

Lekha.

Former Member
0 Kudos

Doesn't work !

Now i set scrol col should be total column minus fixed column am i right ???

Fixed column are not fixed!

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I can confirm as well that these settings work in applications I have built as well.

Here is another example:

data l_salv_wd_table type ref to iwci_salv_wd_table.
  l_salv_wd_table = wd_this->wd_cpifc_alv( ).
  data l_table type ref to cl_salv_wd_config_table.
  l_table = l_salv_wd_table->get_model( ).
  l_table->if_salv_wd_table_settings~set_width( '100%' ).
  l_table->if_salv_wd_table_settings~set_scrollable_col_count( 8 ).
  l_table->if_salv_wd_table_settings~set_fixed_table_layout( abap_true ).
  data l_column type ref to cl_salv_wd_column.
 l_column = l_table->if_salv_wd_column_settings~get_column( 'SO_ID' ).
  l_column->set_fixed_position(
    exporting
       value = cl_wd_abstr_table_column=>e_fixed_position-left ).

This code produces output like this:

http://www.flickr.com/photos/tjung/3657629904/

Answers (1)

Answers (1)

uday_gubbala2
Active Contributor
0 Kudos

Hi Stephan,

This functionality is very much achievable even in WDA. Try go through this [code snippet|https://wiki.sdn.sap.com/wiki/display/Snippets/WebDynproABAP-FixingaColumninan+ALV] in Wiki which explains in detail about the same.

Regards,

Uday