on 05-20-2009 10:14 AM
Hi there,
can anyone help me? I want to set the column width to a fix value e.g. 50px.
How can i do this in SAP List Viewer for ABAP Web Dynpro? At the moment i use this code:
lo_value->if_salv_wd_table_settings~set_scrollable_col_count( 6 ).
lo_value->if_salv_wd_table_settings~set_width( '100%' ).
lo_value->if_salv_wd_table_settings~set_fixed_table_layout( 'X' ).
The effect is that there are 6 columns all the same width. Is it possible to fix width for one specific column??
best regards...
David Wallner
wow thanks a lot. working fine!!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
You need to change Table setting Layout. Please check this code:
* create an instance of ALV component
DATA: LR_IF_CONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE,
LR_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE,
LR_CMDL TYPE REF TO CL_SALV_WD_CONFIG_TABLE,
LR_TABLE_SETTING TYPE REF TO IF_SALV_WD_TABLE_SETTINGS.
LR_CMP_USAGE = WD_THIS->WD_CPUSE_ALV( ).
IF LR_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
LR_CMP_USAGE->CREATE_COMPONENT( ).
ENDIF.
** get reference to the ALV model
LR_IF_CONTROLLER = WD_THIS->WD_CPIFC_ALV( ).
LR_CMDL = LR_IF_CONTROLLER->GET_MODEL( ).
LR_TABLE_SETTING ?= LR_CMDL.
** Set column width
DATA LR_COL TYPE REF TO CL_SALV_WD_COLUMN.
LR_COL = LR_CMDL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'PERNR' ).
LR_COL->SET_WIDTH( '70' ) .
LR_COL = LR_CMDL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'ENAME' ).
LR_COL->SET_WIDTH( '100' ) .
LR_TABLE_SETTING->SET_FIXED_TABLE_LAYOUT( ABAP_TRUE ).
This is the important thing:
LR_TABLE_SETTING->SET_FIXED_TABLE_LAYOUT( ABAP_TRUE ).
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.