on 06-02-2008 9:03 PM
Hi experts,
I'm trying to set fixed width in my ALV report.
I using set_width to set the fixed width.
But I could not get the fixed width.
data salv_column type ref to cl_salv_wd_column.
salv_column->set_width( '4' ).
When I try this i'm getting like belwo.
if my Header text is 'Test Column', and width = 4.
I could able to see the header text fully (Test column).
But I should see only Test and in the 2nd row it should show Column
Any idea of doing it???
Thankx...
Hi,
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 ).
LR_TABLE_SETTING->SET_FIXED_TABLE_LAYOUT( ABAP_TRUE ).
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
refer to this example
webdynpro component SALV_WD_TEST_TABLE_PROPs
Go for view TABLE and method SET_COLUMN_SETTINGS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.