cancel
Showing results for 
Search instead for 
Did you mean: 

Line Break in Tableview Header?

daniel_humberg
Contributor
0 Kudos

It is possible to have a line break in a table view column header (in a web dynpro abap tableview element)?

In other words, can I have a table view column header which is several lines high?

Accepted Solutions (0)

Answers (4)

Answers (4)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

In 7.01 WDA table columns have a new boolean property called headerTextWrapping. If you set this, the column header will wrap automatically based upon the width of the column. This is especially nice when used with the resizable property (which lets the user drag and drop the column boards to resize the column).

This same property is exposed for the ALV as well.

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 ).
  l_column->set_resizable( abap_true ).

Former Member
0 Kudos

Other Workaround:

I've done that in WDJ because customer needed wrapping in column header.

it's a bit dirty but the user can't see the cheat:

- instead of using one table with a header line which has n wrapping, you need to use two tables

- first table is the header, second is the data table

- both tables col width must be equal and hard coded, in px or somehting like that, no content padding!

- both tables do not have a column header

- fist table has text views with wrapping on and text bound to context.

looks quite nice, I even used it for column groups fake, but sometimes it can be a pain in the arse when it comes to inconsistent col widths

regards

Stefan

Former Member
0 Kudos

Have a look on this thread, explanation by Thomas.

[Thomas Explaination|]

former_member182190
Active Participant
0 Kudos

Hi,

For grouping of columns in ALV refer this reply by me

[]

Regards,

Ismail.

Former Member
0 Kudos

Hi Daniel,

interesting question. I don't think that this is possible as the table header is only allowed to contain an element of type caption (CL_WD_CAPTION) which

can only display unformatted text and icons.

As workaround you could use group columns (CL_WD_TABLE_COLUMN_GROUP), where each group column contains one column.

~Silke

daniel_humberg
Contributor
0 Kudos

Is there any example WD application to see how the group columns look like?

daniel_humberg
Contributor
0 Kudos

Hi Silke,

i created an example for me myself. It was pretty easy in the layout of my view.

However, I wonder if I can use column groups in ALV tables as well? How do I add a column group to an ALV?

Regards,

Daniel