Page 1 of 1

<New Line> character in Smartform

PostPosted: Thu Apr 26, 2012 3:11 am
by EvaLam
Hi,

Is it feasible to insert a <New Line> character in a cell of a table in SmartForm? Please find a sample as below.

Here is a Text Line. <New Line>
New Start of Line 2.

Please help and Thanks!

Re: <New Line> character in Smartform

PostPosted: Thu Apr 26, 2012 3:18 am
by Gothmog
Have you tried using CL_ABAP_CHAR_UTILITIES=>CR_LF ?

Re: <New Line> character in Smartform

PostPosted: Thu Apr 26, 2012 3:28 am
by EvaLam
The text already contains the <New Line> character, just it would not be breakdown in a new paragraph. (i.e. the text would be shown in one line.)

Re: <New Line> character in Smartform

PostPosted: Thu Apr 26, 2012 8:47 am
by SHS
It seems a bit strange to me. I have never encountered problems with this.
Is your cell large enough to contain two lines?

And if you check the text using the text editor (i.e. click the icon with the notepad), is the text also split into two lines there?

Re: <New Line> character in Smartform

PostPosted: Fri Apr 27, 2012 1:52 am
by EvaLam
The cell is large enough to contain two lines (word wrap is applied, and the text would be wrap to the second line if the text is too long.)

Checked. The text is also split into two lines in the text editor (both MS Word and SAP standard text editor).

Thanks.

Re: <New Line> character in Smartform

PostPosted: Fri Jul 27, 2012 3:25 am
by adhimas
If you get the text from long text (using the FM read_text,) then you can directly set the text type to Include Text and set the right parameters for it. It will retain all the formatting from the long text.