cancel
Showing results for 
Search instead for 
Did you mean: 

line break in text edit

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

very well thank you both

Answers (1)

Answers (1)

Former Member
0 Kudos

try concatenating the CR_LF attribute of the class CL_ABAP_CHAR_UTILITIES

concatenate str cl_abap_char_utilities=>cr_lf into str.

it should work