‎2009 Jun 02 7:58 AM
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
‎2009 Jun 02 8:00 AM
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!
‎2009 Jun 02 8:07 AM
hI,
You can simply write as,
If sy-subrc ne 0.
Message I000 (003) WITH 'CONTRACT ACCOUNT NO 1234 NOT VALID'.
ENDIF.Regards,
Nikhil.
‎2009 Jun 02 8:13 AM
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
‎2009 Jun 02 8:15 AM
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
‎2009 Jun 02 8:17 AM
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.