on 01-18-2010 9:39 AM
Hi all,
I want o fix the size of the ALV column.
Can any one help me out regarding this.
Regards,
Yugesh
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
* 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( ) .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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' ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.