Skip to Content

Line Break in Tableview Header?

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?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Feb 15, 2008 at 01:32 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 28, 2008 at 08:28 AM

    Hi,

    For grouping of columns in ALV refer this reply by me

    [column-grouping-in-webdynpro-alv]

    Regards,

    Ismail.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 27, 2008 at 03:36 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 27, 2008 at 07:30 PM

    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 ).

    Add comment
    10|10000 characters needed characters exceeded