Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Enforce a line break in a TEXTVIEW

I have a textview that displays some text which is stored in the database.

For the textview, i have enabled the wrapping option.

Now, I would like to enforce a wrapping after the first sentence of the text.

Can I add a special character into the text on the database, that is interpreted as a line break in the TEXTVIEW (like <BR> in HTML or \n in Java)?


There are two ways:

1. You can bind the text view ui element to a context attribute of type string_table. Each row in the internal table corresponds to a new line in the text view. Since the split statement is able to place the result into an internal table, this might be the way of choice.

2. As an alternate solution you can use CL_ABAP_CHAR_UTILITIES=>LF. Simply concatenate this constant into your string at the places you would like to have a line break.

Raja T

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question