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

Message variables in message longtext

Former Member
0 Likes
3,104

Hi,

I'm trying to dipslay the mesage variables (sy-msgv1 etc.) in the longtext of a message. In the longtext i put for example:

"varibale1: &V1&"

But i does not work, when raisimg the message, it does not resolve the variables.

Any suggestions?

Regards

Jan

6 REPLIES 6
Read only

Laxmana_Appana_
Active Contributor
0 Likes
1,137

Hi,

define the message text element like : varibale1: &

then raise message like

message e001(xxx) with <variable>.

(or)

do like this :

data : x_message(100) type c.

concatenate 'Testvariable1:' V1 'Testvariable2:' V2

into x_message.

message e001(zsd) with x_message.

it will work.

Regards

Appana

Read only

0 Likes
1,137

Hi Appana,

thanks, but this does not work, it still doesn't resolve the variable. I raise the message like this:

message e001(zsd) with 'Test'.

In the Longtext I get with Your suggestion:

"varibale1: &"

instead of:

"variable1: Test"

Regards

Jan

Read only

Former Member
0 Likes
1,137

Hi,

I think you should pass this in the short text itself.

For eg.

Message e01 with sy-msgv1.

where 01 would be &.

Best regards,

Prashant

Read only

0 Likes
1,137

Hi Prashant,

it seems like Your are almost right, now I'm having:

h_var1 = 'test1'.
h_var2 = 'test2'.

sy-msgv1 = h_var1.
sy-msgv2 = h_var2.

message e001(zsd) with h_var1 h_var2.

My message-longtext is:

<b>

Testvariable1: &V1&, Testvariable2: &V2&</b>

This now resolves only ONE variable (the first one), so I get this longtext-output:

<b>Testvariable1: test1, Testvariable2: &V2&</b>

I think this is very strange... Any more suggestions?

Thanks

Jan

Read only

0 Likes
1,137

hi

in the message class <b>ZSD</b> and message no <b>001</b> you should give like

&1& &2& &3& &4&.

then you can use

<b>message e001(zsd) with h_var1 h_var2 H_VAR3 H_vAR4</b>.

Regards

Srikanth

Read only

Former Member
1,137

Although this message is old. The answer is relevant today. The message variables are different in the short text and long text.

- In the short text you use the typical & as the placeholder. Multiple variables in the short text are the same.

- In the long text you use the &V1& as the placeholder. Multiple variables in the long text are sequential, i.e. &V1& &V2&