Application Development 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: 

Text symbols: Split line

luis_rod
Participant
0 Kudos

Hi all,

If a message line is long, sometimes it looks better in two or more lines. I know how to do it when using literals in MESSAGE. Is there any way to do it using text symbols?

Thanks in advance,

Luis

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos

If I understand well your question. Currently, you do:

DATA: msg_text type string.
msg_text = 'a long first line' &
           ' a long second line'.
MESSAGE msg_text type 'I' DISPLAY LIKE 'W'.

You want to use text symbols instead of the text literals, so you cannot use the literal operator &, but you may use the string operator &&:

DATA: msg_text type string.
msg_text = 'a long first line'(001) &&
           ' a long second line'(002).
MESSAGE msg_text type 'I' DISPLAY LIKE 'W'.
5 REPLIES 5

Sandra_Rossi
Active Contributor
0 Kudos

Differently said, is your question "split line" similar to "word wrapping" ? If so, I don't understand why your solution for MESSAGE would be different with a text symbol.

Or is your question about replacing "placeholders" in a text symbol ? (not related to "split line" but maybe you used the wrong term) If so, using the ABAP statement REPLACE is very easy.

0 Kudos

Sandra,

First, my apologies if the question was not stated clearly, as english is not my first language.

Let me show you a small example. If I write:

DATA: msg_text type string.
msg_text = 'a long first line' &
           ' a long second line'.
MESSAGE msg_text type 'I' DISPLAY LIKE 'W'.

I get my message in two lines. How can I replicate that using text symbols?

Regards,

Luis

Sandra_Rossi
Active Contributor
0 Kudos

If I understand well your question. Currently, you do:

DATA: msg_text type string.
msg_text = 'a long first line' &
           ' a long second line'.
MESSAGE msg_text type 'I' DISPLAY LIKE 'W'.

You want to use text symbols instead of the text literals, so you cannot use the literal operator &, but you may use the string operator &&:

DATA: msg_text type string.
msg_text = 'a long first line'(001) &&
           ' a long second line'(002).
MESSAGE msg_text type 'I' DISPLAY LIKE 'W'.

Sandra,

Thanks for your answer. I think that's the way to do it.

Regards,

Luis

horst_keller
Product and Topic Expert
Product and Topic Expert

Or like that?

MESSAGE 'a long first line'(001) &&
        ' a long second line'(002) 
        type 'I' DISPLAY LIKE 'W'.