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

warnnig messege

Former Member
0 Likes
1,677

hi experts

how do i show a warnnig messege with red color

thanks

amit

hi experts

how do i show a warnnig messege with red color

thanks

amit

9 REPLIES 9
Read only

Former Member
0 Likes
1,377

You ca't display warning message in red clor.It will be dislpayed in orange color.Other alternative is give 'Information' message.It will be a pop-up message.

Read only

Former Member
0 Likes
1,377

hi,

Warning message comes in Yellow color and can be issued in the below way ...


message w001(zfi).

Read only

Former Member
0 Likes
1,377

hi check this report..

report message-id zmsg.

if sy-subrc eq 0.

message i000 DISPLAY LIKE 'E' with ' this is test'.

endif.

Read only

Former Member
0 Likes
1,377

Hi,

When you want to give a warning message, in some cases (Within the Events) it behaves like error message. then your warning message comes in red color as an error message only.

Read only

Former Member
0 Likes
1,377

hi amit walden

MESSAGE 'Donot allow' TYPE 'E'.

Reward if useful,

S.Suresh.

Read only

Former Member
0 Likes
1,377

Error messages will be displayed in red. To specify the error type you will need to put a distinct character when raising the error.

If sy-subrc NE 0.

Message e000(00) with text-001.

endif.

The 'e' denotes and error message that will display the message in text field 001 and terminate the program.

See the link below for more information on messages.

Link: [http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbaae335c111d1829f0000e829fbfe/content.htm]

Read only

Former Member
0 Likes
1,377

Hi Amit,

Warning message cannot be displayed in red color.

&***********Reward point if helpful**************&

Read only

Former Member
0 Likes
1,377

Hello amit,

Different messages behave differently in different events,

A message of type 'W' behaves as a message of type 'E' in start-of-selection..

So if you want a warning message to be displayed as an error message give the message command in start-of-selection event.and start-of-selection is the default event .So,check this out...

Example

REPORT z_demo .

DATA:
fs_pernr LIKE p0000.

SELECT pernr FROM pa0001
         INTO fs_pernr
         WHERE
         pernr EQ 78324.
ENDSELECT.

IF sy-subrc NE 0.
  MESSAGE 'hello' TYPE 'W'.
ENDIF.

WRITE 'hello'.

However if you just want to change the colour of a warning message without changing its type then that is not possible as it is pre-defined by sap standards.

*Hope this is useful..

Regards,

Bhumika

Read only

Former Member
0 Likes
1,377

I can´t test this in 4.6C but I understand this was introduced later.


message W001(00) display like 'E'.

This will make a Warning message display in red like an error message.