on 02-25-2010 9:54 PM
Hello. Did anybody encounter how to set up a property of salv to wrap text in some column? I look through the interfaces methods available for customising salv, but didn't find any useful.
Do you want to wrap the column header (possible as of NetWeaver 7.01) or the content within the rows of data?
For the column header you would use the following code:
First get access to the ALV Model Object:
data: l_ref_cmp_usage type ref to if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.
data l_salv_wd_table type ref to iwci_salv_wd_table.
l_salv_wd_table = wd_this->wd_cpifc_alv( ).
data l_table type ref to cl_salv_wd_config_table.
l_table = l_salv_wd_table->get_model( ).
Per Column you can control the header text wrapping:
data l_column type ref to cl_salv_wd_column.
l_column = l_table->if_salv_wd_column_settings~get_column( 'POSTING_DATE' ).
data l_header type ref to cl_salv_wd_column_header.
l_header = l_column->get_header( ).
l_header->set_header_text_wrapping( abap_true ).
If you want to have wrapping within the context of the rows of data, you will need to set propertest of the cell editor for the column:
l_column = l_table->if_salv_wd_column_settings~get_column( 'COMMENTS' ).
data textview type ref to cl_salv_wd_uie_text_view.
create object textview.
textview->set_text_fieldname( 'COMMENTS' ).
textview->set_wrapping( abap_true ).
l_column->set_cell_editor( textview ).
Edited by: Thomas Jung on Feb 25, 2010 6:52 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it possible to wrap the column header text using the CL_SALV grid outside of Web Dynpro?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
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.