04-19-2006 3:20 PM - edited 02-04-2024 4:08 AM
Hi All!
Sorry, my English is very poor...
I have a variable with a text line. I´m going to show this text in the SapScript, but the text is very long...
How can I write de variable in 2 lines, without cut any word?
Thanks!
04-19-2006 3:28 PM
Hello,
DO like
&T001-BUTXT+0(15)& IN FIRST LINE
&T001-BUTXT+15(10)& IN SECOND LINE.
You can use FM : RKD_WORD_WRAP
Regards,
Naimesh
04-19-2006 3:25 PM
Hi,
Do not bother about your Language buddy...
If it is a standard text(Constant all the time). then define it as a std text in so10 transaction.
Because you are defining it , you make sure you enter the text in two lines without any break in words.
REgards,
Ravi
04-19-2006 3:26 PM
04-19-2006 3:28 PM
Hello,
DO like
&T001-BUTXT+0(15)& IN FIRST LINE
&T001-BUTXT+15(10)& IN SECOND LINE.
You can use FM : RKD_WORD_WRAP
Regards,
Naimesh
04-19-2006 3:32 PM
&T001-BUTXT+0(15)& IN FIRST LINE
&T001-BUTXT+15(10)& IN SECOND LINE.
With this the words are cut...
04-19-2006 3:30 PM
Hi all again! Thanks for your quickly request!
CALL FUNCTION 'FORMAT_TEXTLINES'
EXPORTING
CURSOR_COLUMN = 0
CURSOR_LINE = 0
ENDLINE = 99999
FORMATWIDTH = 72
LINEWIDTH = 132
STARTLINE = 1
LANGUAGE = SY-LANGU
IMPORTING
NEW_CURSOR_COLUMN =
NEW_CURSOR_LINE =
TABLES
lines =
EXCEPTIONS
BOUND_ERROR = 1
OTHERS = 2
.
Where I have to put the variable in this function?? How is the result?
04-19-2006 3:36 PM
Please see the following example program.
report zrich_0001 .
data: lines type table of tline with header line.
lines-tdline
= 'This is the first line of the text and we need to format it'.
append lines.
lines-tdline
= 'This is the second line of the text and we need to format it'.
append lines.
loop at lines.
write:/ lines-tdline.
endloop.
call function 'FORMAT_TEXTLINES'
EXPORTING
* CURSOR_COLUMN = 0
* CURSOR_LINE = 0
* ENDLINE = 99999
formatwidth = 30
* LINEWIDTH = 132
* STARTLINE = 1
* LANGUAGE = SY-LANGU
* IMPORTING
* NEW_CURSOR_COLUMN =
* NEW_CURSOR_LINE =
tables
lines = lines.
* EXCEPTIONS
* BOUND_ERROR = 1
* OTHERS = 2
.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
skip 5.
loop at lines.
write:/ lines-tdline.
endloop.
Regards,
Rich Heilman
04-19-2006 3:33 PM
Hi,
try with FM <b>RKD_WORD_WRAP</b>.
Regards
vijay
04-19-2006 3:34 PM
04-19-2006 3:48 PM
04-19-2006 3:48 PM
Why are you concerned by this? Just ensure your output windown in SAP Script is at least 2 lines in height and SAP Script will handle the wrapping for you without cutting words.