cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically table width and Column width set

Former Member
0 Kudos

Hi Experts,

At design mode I have set the table column width but in runtime depending upon the volume of data the column width is being increased and decreased. I want to fix the column width so that whatever data volume is there the column width will always be fixed.

How to get the table and table column reference so that I can programatically set the fix column width.

Please help.

Regards,

Anindita

Accepted Solutions (1)

Accepted Solutions (1)

krishnendu_laha
Active Contributor
0 Kudos

Hello,

Please use below code to get configuration table...

DATA:
    lr_salv_wd_table         TYPE REF TO iwci_salv_wd_table.

* Get ALV component...*alv_items* is used to declare component SALV_WD_TABLE
  lr_salv_wd_table = wd_this->wd_cpifc_alv_items( ).

* Get ConfigurationModel from ALV Component...rf_table_items typed CL_SALV_WD_CONFIG_TABLE
  wd_this->rf_table_items = lr_salv_wd_table->get_model( ).

And after that you can get reference of column and field using down cast...

*  lrf_column_settings typed if_salv_wd_column_settings
  lrf_column_settings ?= wd_this->rf_table_items.
* li_coumns typed salv_wd_t_column_ref
  li_columns = lrf_column_settings->get_columns( ).

Hope it is going to help you.

Thanks.

Answers (2)

Answers (2)

Former Member
0 Kudos

answered

former_member199125
Active Contributor
0 Kudos

hi,,

Try this

data lo_cmp_usage type ref to if_wd_component_usage.

lo_cmp_usage = wd_this->wd_cpuse_alv1( ).

if lo_cmp_usage->has_active_component( ) is initial.

lo_cmp_usage->create_component( ).

endif.

data lo_interfacecontroller type ref to iwci_salv_wd_table .

lo_interfacecontroller = wd_this->wd_cpifc_alv1( ).

data lo_value type ref to cl_salv_wd_config_table.

lo_value = lo_interfacecontroller->get_model(

).

data: lo_column1 type ref to cl_salv_wd_column.

lo_column1 = lo_value->if_salv_wd_column_settings~get_column( 'ATTRIBUTE NAME' ).

LO_COLUMN1->SET_WIDTH( 150PX ).

Regards

Srinivas