SAP Messages

Advertisements

A SAP message is an essential part of any ABAP program and are used to display information to the user to let them know what's happening. This could be in a number of ways such as an error message, warning message or information message. 

The following ABAP code is the simplest way to implement a message into your report. 

    MESSAGE 'Display this message' TYPE 'E'. 

Advertisements

SAP Message Classes 

A better way to implement your messages would be to create and maintain them via a message class using transactions SE91 or SE80. This way you have a central store for all messages, which makes it easier to maintain. This is especially true if your messages need to be translated into multiple languages. Enter your text here...

To do this you first need to create a message class which is a kind of container/wrapper where you store related messages together. Once this is done you can add as many message as you require into it. You also get the option to create additional long text, which offers the user additional information about the particular issue. See the following link for more information and details of how to create a message class

Once you have created your message you can use them within your ABAP code using the following syntax: 

Advertisements

  MESSAGE E001(MCLASS). 

MESSAGE = ABAP statement 
E = Type of message (can also be I,W,S,A,X) 
001 = Message number 
MCLASS = Message Class 

Advertisements

Pass message Parameters

You can also add parameters to your messages using the "&" character. So for example you could create the following message 'Purchase order & has been deleted'. You can then pass a purchase order number to the message when using it and it will replace the "&" with the purchase order you pass for example 

    MESSAGE E001(MCLASS) with ekko-ebeln. 

The result would display 
"Purchase order 1234 has been deleted" 

Advertisements

Further information about message types 


I - Information messages 
Information message are displayed in a popup window and only pause processing until you have clicked through the message. 

E - Error message 
An error message will be displayed in red along the footer of the SAP screen and stops processing going any further. 

W - Warning message 
A warning message behaves similar to and error message and is displayed along the footer of the SAP screen and stops processing going any further. 

S - Success/Status message 
A Success message is also displayed along the footer of the SAP screen but does not stop processing going any further and is simply displayed at the end in green. 

A - Termination/Abend 
A termination message stops processing and causes a runtime error and short dump which is also viewable in tcode ST22. 

X - Exit 
An exit message stops processing and displays and exit button which exits session processing. Similar to typing /n into the SAP command box. 

SAP Standard Messages classes

SAP message 010 ICF_SYSTEM_LOGIN – log on again
Messsage Text for 010(ICF_SYSTEM_LOGIN) Client, name, or password is not correct; log on again  CAUSE This message is self-explanatory and is[...]
SAP Message class within ABAP reports
As you may already know using the ABAP "MESSAGE" statement allows you to display various types of message to the[...]
Error message Special character “_” in generic key
I got this error when entering a value into a key field of a custom SAP table. I am still[...]
FL389 – Only tables with flat line structure are allowed in RFC – SAP error message
The SAP message FL 389 can also appear if you are assigning a structure which contains a string field to a[...]
Table Maintenance dump – Negative value
If you get the following DYNPRO_FIELD_CONVERSION error when you access your table maintenance via transaction SM30 it is probably due to[...]
Advertisements