Skip to Content

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

line break in text edit

Hi,

I use a text edit to display comments on a business object.

the comments are stored in SAP systems own text reopository, where texts are stored as lines of a table

for example:

this is a comment

to business object XY

I want to display this in a text edit UI element. the text edit ui element needs a context attribute of type string (or char I guess). I need to bring the lines of the table into lines of the text edit.

when entering values with line break, the text looks like this in the context attribute: "this is a comment#to business object XY".

even when I concatenate it like this is a comment#to business object XYthis is a comment#to business object XY

in the text edit box it is displayed like

this is a comment

to business object XY

this is a comment

to business object XY

I assumed that the symbol hash # is the line break symbol but I cannot programmatically add the symbol for a line break.

If I set the context attribute with "this is #a test" it won't show as

this is

a test

it displays

this is#a test

how can I add a line break programmatically at runtime?

best regards

Stefan

replied

Hi Stefan,

In order to have a line break in between the text while you concatenate, you have to use the attributes from the character utility class instead of #

Eg.

 

CONCATENATE 'this is'
             CL_ABAP_CHAR_UTILITIES=>NEWLINE
             'a test'
             CL_ABAP_CHAR_UTILITIES=>NEWLINE
                                               to <your string name>.

This would show as you expected like:

this is

a test

Regards,

Trikanth

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