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

Text symbols: Split line

luis_rod
Participant
0 Likes
2,240

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
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,925

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'.

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

5 REPLIES 5
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,925

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.

Read only

0 Likes
1,925

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

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,926

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'.
Read only

1,925

Sandra,

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

Regards,

Luis

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
1,925

Or like that?

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