cancel
Showing results for 
Search instead for 
Did you mean: 

How to show long text in TextView control in formatted form?

ChandraMahajan
Active Contributor
0 Kudos

Hi,

I have requirement to show long text from backend text edit control to WD application. I am using READ_TEXT Fm to read the long text and passing it to text view UI element.

The text is shown in simply one long line but I want it to show in the same format as stored in backend textedit control.

If I take textedit UI control then it shows the text in formatted form.

Could you please let me know how to achieve these for TextView control? My requirement is that I have to use only TextView control.

Thanks,

Chandra

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Chandrasekhar,

use cl_abap_char_utitilities=>newline to fill the attribute which is attached to the text view UI element.

Also check this forum thread for more information.

https://forums.sdn.sap.com/click.jspa?searchID=17650463&messageID=6260706

ChandraMahajan
Active Contributor
0 Kudos

Hi,

Yes i took String attribute and concatenating it using cl_abap_char_utilities=>cr_lf. but still it is not working.

Thanks,

Chandra

Former Member
0 Kudos

Hi Chandra,

Use cl_abap_char_utilities=>new_line you will get the solution.

check the forum thread link which i posted in previous post.

or else the othe option you have is Text Edit.

use new_line to populate the string then bind the string to Text Edit element but check the Read only property of text edit to make display only.

ChandraMahajan
Active Contributor
0 Kudos

Hi,

The Problem solved to some extend but still the exact formatting is not happening though i am using cl_abap_char_utilities=>newline.

for eg. if the long text is as below.

"To display the external component, you can now embed an interface view of any window of this component in a window of your current embedding a view of oneu2019s own component. By setting up navigation from one outbound plug of a view of your inbound plug of the inter external component, you enable the external component to be displayed. New line ."

and if in backend the Last line " New line ." is on next line, on WD it is not displayed on next line.

Thanks,

Chandra

Former Member
0 Kudos

if your requirement is ONLY to show the formatted text, you can very well use FORMATTED_TEXT_VIEW ui element.

-Haresh

ChandraMahajan
Active Contributor
0 Kudos

Hi,

i have already tried with FORMATTED_TEXT_VIEW. but still i am getting same output. that is One single long line.

Thanks,

Chandra