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

How to display error message with some variable

Former Member
0 Likes
32,900

Hi

I want to display errror message along with material number which is thr in d LOOP .

Basically i want some variable to display along with error message .

Can anybody suggest me how can i go about it?

Edited by: sonal musale on Apr 14, 2009 12:06 PM

11 REPLIES 11
Read only

Former Member
0 Likes
11,496

Hi

use SE91 create message class, then create one message with 4 &

Amitava

Read only

0 Likes
11,496

Hi ,

As you will create the message with 4 '&'. It means that you can put 4 text elements or wf to be displayed with the message.

And you should display the message as

message e(Message number)(Message class) with (Variable) (Text)

Regards,

N.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
11,496

Hi,

Use the MESSAGE keyword along with 'WITH'.

Check documentation for MESSAGE keyword for more details.

Regards,

Sesh

Read only

0 Likes
11,496

HI

Thanks for ur reply

i have already written this code .

the message is getting displayed but not variable ..

Can u suggest something ?

message e000(zrfq) with wa_ekpo-matnr .

Read only

0 Likes
11,496

Hi Sonal,

I think the message '000' of your message class ZRFQ does not consist of a place holder.

Please use the transaction SE91 and check for the message 000 for message class ZRFQ. If that message doesn't consist of a place holder; do create one more message with the available number in there.

the message should be like this ... '<whatever message you would like> &1'.

Note down the message number that u've created.

let's assume that is 230.

Then your statement should go like this...


MESSAGE E230(ZFGQ) with wa_ekpo-matnr.

Then you should get the message with the variable value in it.

Regards,

Kiran

Read only

Former Member
0 Likes
11,496

Hi,

Use as below.

message e001(00) with <material variable> <message Text>.

Regards,

Raju

Read only

0 Likes
11,496

Issue Resolved

Thanks

Read only

Former Member
0 Likes
11,496

dear ,

If u need it globally

message class for that or you can directly write the

Message statement in the code with type :

Message msg type 'E' .

regds ankit

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
11,496

Hi,

In the message class, suppose you use 001 for invalid material message.

So keep it like:-

Invalid Material : &1

in the message class for 001.

Now in loop use as:-


loop at itab into wa.
  "perform validations
  "if validation fails for current material
  MESSAGE e001 WITH wa-matnr.
endloop.

Similary you can use more variables:-

Invalid Material : &1 &2 &3

MESSAGE e001 WITH <variable1> <variable2> <variable3>.

Hope this helps you.

Regards,

Tarun

Read only

Former Member
0 Likes
11,496

Hi sonal,

try below

data: lv_message type string.

concatenate 'Material Number'
                   wa_mat-matnr
                   'does not exist'
                   into lv_message.

message e000(oo) with lv_message.

Read only

Former Member
0 Likes
11,496

Solved