cancel
Showing results for 
Search instead for 
Did you mean: 

How to fix the size of the column in a table of ALV table type?

Former Member
0 Kudos

Hi all,

I want o fix the size of the ALV column.

Can any one help me out regarding this.

Regards,

Yugesh

Accepted Solutions (1)

Accepted Solutions (1)

saket_abhyankar
Active Participant
0 Kudos

try following code:

DATA z_column TYPE REF TO cl_salv_wd_column.

DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .

l_ref_interfacecontroller = wd_this->wd_cpifc_alv_table( ). " Value from the prop tab of the view

DATA: l_value TYPE REF TO cl_salv_wd_config_table.

l_value = l_ref_interfacecontroller->get_model( ).

z_column = l_value->if_salv_wd_column_settings~get_column( 'MATNR' ). " Name of column

z_column->set_width( '100' ). " Width of column

Regards,

Saket.

Former Member
0 Kudos

Hello Saket,

I am getting the following error..

Method "WD_CPIFC_ALV_TABLE" is unknown or PROTECTED or PRIVATE.

Former Member
0 Kudos
data:  lr_table_settings1  TYPE REF TO if_salv_wd_table_settings ,
lr_table1 type  TYPE REF TO if_salv_wd_column_settings,          .


  lr_table_settings1 ?= l_value    
  lr_table1  ?= l_value

.

saket_abhyankar
Active Participant
0 Kudos

1) Goto properties tab of view/comp controller

2) There will component usage declared for SALV_ED_TABLE

3) Replace ALV_TABLE from 'WD_CPIFC_ALV_TABLE' by the 'Component Use' name i.e. name of your component usage

Regards,

Saket.

Edited by: Saket Abhyankar on Jan 18, 2010 4:40 PM

Edited by: Saket Abhyankar on Jan 18, 2010 4:53 PM

Former Member
0 Kudos

Hello radhika,

What is the type of l_value??

Former Member
0 Kudos
* Data declarations for instantiation
  DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table   ,
        l_ref_cmp_usage   TYPE REF TO if_wd_component_usage,
        l_value   TYPE REF TO cl_salv_wd_config_table   ,

* Instantiate the ALV
  l_ref_cmp_usage =   wd_this->wd_cpuse_usg_alv_feclm( ) ."usg_alv_feclm is the name of your usage
  IF l_ref_cmp_usage->has_active_component( ) IS INITIAL .
    l_ref_cmp_usage->create_component( )                 .
  ENDIF                                                  .

* Get model
  l_ref_interfacecontroller = wd_this->wd_cpifc_usg_alv_feclm( ).
  l_value = l_ref_interfacecontroller->get_model( )             .

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

refer :

regards,

amit

Former Member
0 Kudos
DATA: lr_col TYPE REF TO cl_salv_wd_column.
DATA: LV_RESIZE TYPE FLAG.
*Get ref to column whose width is to be set .
lr_col = lr_table1->get_column( 'NAME1' ).
*Set width.
LR_COL->GET_RESIZABLE( ).
LV_RESIZE = 'X'.
LR_COL->SET_RESIZABLE( LV_RESIZE ).
lr_col->SET_WIDTH( '15' ) 

Sset the fixed table layout in the code
lr_table_settings1->SET_FIXED_TABLE_LAYOUT( 'X' ).
Former Member
0 Kudos

Hello Radhika,

What are the data types of lt_table1 and lr_table_settings1?