cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable a table column header

thomas_mueller8
Participant
0 Kudos

Hi Guys,

I have a table with a column for selection (it contains a checkbox). How can I get rid of the column header? Because it contains the name of the data element of the underlying checkbox field.

I didn't find a suitable attribute to do this? Any ideas?

Warm regards,

Thomas

Accepted Solutions (1)

Accepted Solutions (1)

ChandraMahajan
Active Contributor
0 Kudos

Hi,

I guess you do not want to display column header text for checkbox column. In that case, you need to set the blank text for the header.

Use below coding in the WD ALV config. code place,

  • get table of column settings - each line one column

lt_columns = lr_column_settings->get_columns( ).

LOOP AT lt_columns INTO ls_column. " get header of column

CASE ls_column-id.

WHEN 'CHECKBOX_COL.

lr_col_header = ls_column-r_column->create_header( ).

CLEAR l_string.

lr_col_header->set_text( EXPORTING value = l_string ). "Empty text

ENDLOOP.

Thanks,

Chandra

thomas_mueller8
Participant
0 Kudos

Hi Chandra,

this is correct, I don't want to have a header text for my checkbox.

However I'm working with a normal table not an ALV one. How would the coding look like ?

Warm regards,

Thomas

Former Member
0 Kudos

What you can do is to get the table UI from the view

data:

lo_table type ref to cl_wd_table,

lo_col type ref to CL_WD_TABLE_COLUMN,

lo_header type ref to CL_WD_CAPTION,

ls_text type WDY_MD_TRANSLATABLE_TEXT.

lo_table = view->get_element( "table id").

lo_col = lo_table->get_column( "column1d").

lo_header = lo_col->get_header( ).

lo_header->set_text( ls_text ).

ChandraMahajan
Active Contributor
0 Kudos

Hi,

if it is normal table then you need not to code. just double click on the header text. it will be a CAPTION UI element. There you will have text property. just clear that value.

Thanks,

Chandra

Answers (1)

Answers (1)

thomas_mueller8
Participant
0 Kudos

Thanks for your answers. They had been helpful.