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 display

Former Member
0 Likes
651

Hi,

We get message stored is some in table in " The Contract Account &1 is not valid". How can we display this message as " The Contract Account A1324 is not valid" dynamically.

thanks,

Arun

5 REPLIES 5
Read only

Former Member
0 Likes
603

message I001 with var1 var2..

Here 0001 is where ur message is stored...[The Contract Account &1 is not valid]

var1 var2 are variables to pass values..[A1324]

MESSAGE E001(ZHR) WITH 'ur msg'. -- this is correct way!

Read only

Former Member
0 Likes
603

hI,

You can simply write as,

If sy-subrc ne 0.

Message I000 (003) WITH 'CONTRACT ACCOUNT NO 1234 NOT VALID'.

ENDIF.

Regards,

Nikhil.

Read only

Former Member
0 Likes
603

Hi

The MESSAGE statemet has the syntax MESSAGE TNNN (Message_Class) WITH V1....V9.

Where T is the Message type,

NNN is the 3 digit message ID

V1....V9 are the variables we want to pass to the message to replace the & in the messages.

Now as per your requirment, The Contract Account &1 is not valid is already there and you just have to pass A1324 to this. So for this the syntax will be:

MESSAGE I000 ('YOUR MESSAGE_CLASS') WITH 'A1324'.

Hope this helps you.

Regards

Gaurav.

Edited by: Gaurav Gupta on Jun 2, 2009 9:14 AM

Read only

Former Member
0 Likes
603

Hi arunchandra,

use the below code.

MESSAGE e303(me) WITH 'The Contract Account A' var1 'is not valid'.

here var1 is 1234.

and it will print

The Contract Account A1324 is not valid.

regards,

ravibabu.a

Read only

former_member222860
Active Contributor
0 Likes
603

If your reading the text from itab. you can try with this:

data: begin of itab_mess occurs 0,
        mesg(100) type c,
      end of itab_mess.

itab_mess-mesg = 'The Contract Account &1 is not valid'.

REPLACE '&1' in itab_mess-mesg  WITH 'A1234' .
append itab_mess.

loop at itab_mess.
  write:/ itab_mess-mesg.
endloop.