cancel
Showing results for 
Search instead for 
Did you mean: 

How to split header text in table view to 2 lines?

Former Member
0 Kudos

Hello,

I have a table view that has many fields. There are fields with long header text.

Is it possible to split the text and have it on 2 lines?

Foe exsamle: instead of 'ORDER NUMBER' ---> ORDER

NUMBER

Thanks,

Sara

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member193352
Active Contributor
0 Kudos

Hello Sara,

You can do that using line feed.

Implement the following code.

data: lv_constant type string value 'CRM ORDER'.

data: lv_constant1 type string.

data: lv_constant1 type string.

split lv_constant at ' ' into lv_constant1 lv_constant2.

CLASS cl_abap_char_utilities DEFINITION LOAD.

lv_linefeed = CL_ABAP_CHAR_UTILITIES=>CR_LF.

clear lv_constant.

concatenate lv_constant1 lv_linefeed lv_constant2 into lv_constant.

I hope this works.

Thanks

Vishal

Former Member
0 Kudos

Hi,

Thanks for answering. Where do I have to write it?

Where is the place the headers of a tableview are handled?

Thanks,

Sara

former_member193352
Active Contributor
0 Kudos

Hello Sara,

You can write this code in DO_PREPARE_OUTPUT method of your view controller class.

Regards

Vishal

walt_b
Participant
0 Kudos

Hi Sara,

I think the behaviour you are referring to is called text wrapping.

To my knowledge, you cannot force text wrapping in tableview columns via customizing.

However you may force this with some programming, after having enhanced the component view containing that tableview.

Either by setting the property of the column's GET_P_ method, But I am not sure this property can be set via GET_P_ method.

Or by enhancing the iterator class of the tableview. I have not done that yet, but the fact that tableview columns managed by class CL_THTMLB_TABLE_VIEW refer to structure TABLEVIEWCOLUMN is promising, because it does well contain an attribute WRAPPING.

Hope this helps

Kind regards

Walter