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: 

Pass a varaible (Place holder) in the Long text of message class

Former Member
0 Kudos
2,085

Hi Gurus,

My requirement is to display an error messages using message class for better understanding I am using Long text will it possible to pass a variable (place holder) in the long text if possible means suggest how to pass the variable (we need to put any &1 like this similar we do in message class) or only we can display only text in long text.

Confirm the same

Regards

Dhanoo

1 ACCEPTED SOLUTION

ThomasZloch
Active Contributor
344

you can insert place holders also into the long text, e.g. &V1& for the first place holder (via Edit -> Command -> Insert Command, then under "Symbols")

Thomas

9 REPLIES 9

Former Member
0 Kudos
344

hiii

Create new message in message class with text like material number & is not valid

Here .

& symbol is the place holder. you can dynamically pass some thing to this message. In your validation do like this.

MESSAGE e001 WITH wa_matnr.

Here wa_matnr is the input field value.Display this message under appropriate events.

eg: AT SELECTION-SCREEN ON wa_matnr in case of reports.

reward if useful

thx

twinkal

0 Kudos
344

Hi,

But I neeed to pass the similar value in the long text for that what will be place holder in the long text .

Regards

Paul

0 Kudos
344

Hi Paul,

Amongst all the noise of these relies Thomas has given you the correct answer.

Regards,

Nick

0 Kudos
344

I owe you five

krishnendu_laha
Active Contributor
0 Kudos
344

Hi Friend,

Suppose in message class ZTS you have message no 001 which has & & for taking dynamic values.

In Program you will pass variable like:

Message I001(ZTS) with 'Test variable value ' ws_var.

It will show variable value dynamically.

Hope it will solve your problem.

Regards

Krishnendu

Former Member
0 Kudos
344

Hi;

In the message long text, Insert the variables.....

Regadrs,

Prabhu Rajesh

ThomasZloch
Active Contributor
345

you can insert place holders also into the long text, e.g. &V1& for the first place holder (via Edit -> Command -> Insert Command, then under "Symbols")

Thomas

Former Member
0 Kudos
344

What does long text mean? Are you passing the message by means of a Text Element??

If so you have to concatenate the message with the value.

like text-001 = Material number

text-002 = is not valid

Concatenate text-001 lv_matnr text-002 into lv_ms separated by space.

Former Member
0 Kudos
344

Hi,

keep a place holder '&' in your message class. for ex: keep place holder for 000 message number.

message class is : z50871.

now declare one variable.

data : v_msg type string value 'your long text'.

now display msg ;

message e000(z50871) with v_msg.

Regards

Sandeep REddy