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

Doubt regarding Message statement

Former Member
0 Likes
682

Hi,

I want to pop up a message in which I want the valye of X tp be replaced by its value.

DATA: X(3) TYPE C VALUE 'FFF'.

MESSAGE ID 'ERROR MESSAGE' TYPE 'E' NUMBER '000' WITH 'COMPUTED' '&X&'.

But this does not work.

Can someone help me out ?

Tushar

4 REPLIES 4
Read only

krzysztof_konitz4
Contributor
0 Likes
595

Hi,

Try to use variable X directly:

MESSAGE ID 'ERROR MESSAGE' TYPE 'E' NUMBER '000' WITH 'COMPUTED' X.

then symbol "&1" in your message text will be replaced with "COMPUTED" and symbol "&2" will be replace with variable X content.

Krzys

Read only

Former Member
0 Likes
595

Hi,

MESSAGE ID id TYPE mtype NUMBER n.

If u want a Pop-up message then u have to give TYPE I message class.

<b>MESSAGE i001 WITH 'COMPUTED' text-001 .</b>

Text-001 should be FFF

Changes in ur messgae

<i>MESSAGE ID TYPE E000 WITH 'COMPUTED' text-001.</i>

Also see this link

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaae335c111d1829f0000e829fbfe/content.htm

Try this one.

Message was edited by: Judith Jessie Selvi

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
595

Hi,

Here is the sample code.Whatever value you type in p_matnr will be displayed if you press the button.

data : itab type standard table of mara.

PARAMETERS : p_matnr LIKE mara-matnr.

SELECTION-SCREEN PUSHBUTTON /10(20) TEXT-001 USER-COMMAND GO.

AT SELECTION-SCREEN .

CASE SY-UCOMM.

WHEN 'GO'.

message i005 with p_matnr.

ENDCASE.

If your message is static,you better can create a text-symbol[say.eg..005 - 'fff'] for it and use the following code.

message i005.

Hope it helps.If so,reward points.Otherwise,get back.

Read only

ramki_maley
Active Contributor
0 Likes
595

Tushar,

The ID part refers to a Message Class. Here you specified 'Error Message' which is an invalid name as well as being not in customer name space (does not start with Y or Z). You can examine existing Message Classes as well as create and maintain with Txn SE91.

A message with Number mentioned with the number part should exist in the specified Message Class. In your case the message should have at least two '&' symbols as place holders for two variable you are going to substitute from your ABAP.

Do not enclose a variable name with & and quotes in the ABAP code.

As already mentioned in one of the replies, Error Messages by default are not dispalyed in a popup. It is a user setting.

Also, please read the F1 help for the Message statement.

Cheers,

Ramki Maley.