on 08-28-2009 3:12 PM
Hi All,
we have a WD4A. Ther is an ALV and the Header from some Columns are very long.
Itis possible to set this Header in 2 lines?
Have anybody an idea?
Thanks
Best ragards,
Markus
Hi,
You can use WRAP_TEXT functionality.
Check out cl_salv_wd_column_header->ALV column header where you can find the method for warpping.
DATA: lr_alv_header type ref to cl_salv_column.
Get the column reference for that column.
lr_alv_header = lr_column->get_header( ).
Regards,
Lekha.
Edited by: Lekha on Aug 30, 2009 7:14 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
set the width of the column,
get the header reference and use the method SET_HEADER_TEXT_WRAPPING by passing abap_true.
CALL METHOD lr_column->get_header
RECEIVING
value = lr_alv_header. "cl_salv_wd_column_header
lr_alv_header->set_ddic_binding_field(
if_salv_wd_c_ddic_binding=>ddic_bind_none ).
lr_alv_header->set_text( 'Desc' ). "Your text header
lr_column->set_resizable( abap_true ).
lr_alv_header->set_header_text_wrapping( abap_true ).
Regards,
Lekha.
Hi,
i have do this but it doenst work.
lr_column_settings ?= wd_this->r_table.
lr_column = lr_column_settings->get_column( column_z ).
lr_column->r_header->set_text( value = value_z_h ).
lr_column->r_header->set_tooltip( value = value_z_t ).
* lr_column->set_width( '150' ).
lr_column->SET_RESIZABLE( abap_true ).
lr_column->r_header->set_header_text_wrapping( abap_true ).
What do i wrong?
Best regards,
Markus
Hi,
i have changed to:
lr_column_settings ?= wd_this->r_table.
lr_column = lr_column_settings->get_column( column_z ).
lr_column->r_header->set_ddic_binding_field( if_salv_wd_c_ddic_binding=>ddic_bind_none ).
lr_column->r_header->set_text( value = value_z_h ).
lr_column->r_header->set_tooltip( value = value_z_t ).
lr_column->set_width( '80' ).
lr_column->SET_RESIZABLE( abap_true ).
lr_column->r_header->set_header_text_wrapping( abap_true ).
but it doesn´t work. I have only one line.
Best ragards,
Markus
Hi,
Where have you written the code.
One more thing, also set the FIXEDLAYOUT for the ALV table as abap_true.
data:
lr_tabset type ref to if_salv_wd_table_settings.
lr_tabset ?= lo_value.
lr_tabset->set_fixed_layout as abaptrue.
Then set the column header as per your code.
I think this should work.
Regards,
Lekha.
Hi,
I have applied the text wrapping functionality for both the column and also the cell content.
Also set the column width.
I have checked the SET_FIXED_TBALE_LAYOUT as abap_true/ abap_false both the cases.
I observed that, the wrapping holds good when the set_fixed_table_layout is abap_false.
When it is set to true, wrapping has no effect.
Regards,
Lekha.
Hi,
There could be some problems with the service pack levels also.
Please check wether some where you code is overwritten.
Try to reduce the wdith of colum. If it is a textview for that column, try to set wrapping for that textview also.
Check this out -
Yes, Im checking that behavior when fixed layout is set.
Regards,
Lekha.
Hi,
the text wrapping for the textview works. Only the Header didn´t do a text wrapping.
This is my code and i think the code is ok:
lr_column_settings ?= wd_this->r_table.
lr_column = lr_column_settings->get_column( column_z ).
lr_column->r_header->set_prop_ddic_binding_field( value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
lr_column->r_header->set_text( value = value_z_h ).
lr_column->r_header->set_tooltip( value = value_z_t ).
CREATE OBJECT textview.
textview->set_text_fieldname( column_z ).
textview->set_wrapping( abap_true ).
lr_column->set_cell_editor( textview ).
lr_column->r_header->set_header_text_wrapping( abap_true ).
i don´t know what is wrong
Best regards,
Maarkus
Hi,
This is what I coded. I didnot set any table widht or fixed layout
data: lr_col type ref to cl_salv_wd_column,
lr_colH type ref to cl_salv_wd_column_header.
CALL METHOD lv_value->if_salv_wd_column_settings~get_column
EXPORTING
id = 'WOSTD'
receiving
value = lr_col.
lr_col->set_width( '30' ).
lr_col->SET_RESIZABLE( abap_true ).
CALL METHOD lr_col->get_header
receiving
value = lr_colh.
lr_colh->set_prop_ddic_binding_field( value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
lr_colh->set_text( value = 'This is long text for demo' ).
lr_colh->set_header_text_wrapping( abap_true ).
I can see the header getting wrapped.
I also set the width as 80 now also i could see the wrapping.
Regards,
Lekha.
Edited by: Lekha on Sep 2, 2009 8:24 PM
Hi,
I want to update the OSS note for anyone who has the same problem:
Note [1383088|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1383088]
Regards,
Khanh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had open an OSS Call and get a note from SAP. Now its works.
Thanks for the help.
Best regards,
Markus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
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.