on 09-24-2013 9:40 AM
Hello experts!
I have 2 questions
1) How can I make a table column resizable , so user can play with its size?
2) How to make an ALV column optimized in web dynpro as the same as in dynpro?
thnaks for your help!!
Hi,
Can use below logic to resize the ALV table column.
For increasing Display layout width to 100 use below code
DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
DATA l_table TYPE REF TO cl_salv_wd_config_table.
l_ref_cmp_usage = wd_this->wd_cpuse_it_alv( ).
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
l_salv_wd_table = wd_this->wd_cpifc_it_alv( ).
l_table = l_salv_wd_table->get_model( ).
l_table->if_salv_wd_table_settings~set_width( '100%' ).
And please refer standard WD component where column setting scenario is handled
WD componant name: SALV_WD_TEST_TABLE_PROPS.
2)
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 ).
Check above code, may be usefull.
Regards,
Shaik Farooq
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check this link:
http://help.sap.com/saphelp_nw70ehp2/helpdata/en/4b/5d4d645f30584ae10000000a42189c/content.htm
Its supported in 7.0 EHP 2.
Regards,
Sharath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
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.