Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Line Break in the Method SET_TEXTSTREAM

Former Member
0 Likes
1,297

I'm trying to fill a textedit control with a string using the method SET_TEXTSTREAM. How can i produce a line break in my string?

could be, but it does not work:

text = 'this should be a "\n" linebreak!'.

CALL METHOD me->set_textstream

EXPORTING

text = text

EXCEPTIONS

error_cntl_call_method = 1

not_supported_by_gui = 2

OTHERS = 3.

I'm trying to fill a textedit control with a string using the method SET_TEXTSTREAM. How can i produce a line break in my string?

could be, but it does not work:

text = 'this should be a "\n" linebreak!'.

CALL METHOD me->set_textstream

EXPORTING

text = text

EXCEPTIONS

error_cntl_call_method = 1

not_supported_by_gui = 2

OTHERS = 3.

2 REPLIES 2
Read only

0 Likes
779

Hi,

please check out the following:

Break your lines where you want and fill every line in a new table which has only one field ( e.g. types: git_text_tab_t type standard table of tline-tdline ).

Then use the method get_text_as_r3table:

..call method g_editor->get_text_as_r3table

.....importing

..........table = git_text_tab

.....exceptions

..........others = 1.

I hope, it will work.

Best regards

Thomas

Read only

thomasalexander_ritter
Product and Topic Expert
Product and Topic Expert
0 Likes
779

Hi Robert.

try:

concatenate 'this should be a' CL_ABAP_CHAR_UTILITIES=>NEWLINE 'linebreak!' into text.

or

concatenate 'this should be a' CL_ABAP_CHAR_UTILITIES=>CR_LF 'linebreak!' into text.

cheers

Thomas