abaplovers.blogspot.com messages in abap ... a message needs to be displayed, instructing the user...
TRANSCRIPT
![Page 1: ABAPLOVERS.BLOGSPOT.COM Messages in ABAP ... a message needs to be displayed, instructing the user to rectify the error, or after a certain task is accomplished, you may need to display](https://reader034.vdocuments.mx/reader034/viewer/2022051800/5ad2aa0e7f8b9aff738cf954/html5/thumbnails/1.jpg)
Follow Me on Twitter Check Videos
This document discusses how to call messages in SAP ABAP.
At the end of the document you will find instructions on how to use the BLOG ABAPLOVERS.BLOGSPOT.COMso that you will not miss any updates. This BLOG is updated on a daily basis and all the Tutorials (Files/PDFs)associated with the BLOG are also updated from time to time.
(While you are free to distribute or share this article, please do acknowledge the author by not changing the title, content,links in the article and using it AS IS.)Feel free to upload this article on the following websites
http://www.esnips.com/http://www.slideshare.net/http://www.rapidshare.com/http://www.megaupload.com/
Get started register and stay tuned to ABAP.BLOGSPOT.COM
Enter Your Email Address
Delivered By FeedBurner
ABAPLOVERS.BLOGSPOT.COMMessages in ABAP
LOGON TO ABAPLOVERS.BLOGSPOT.COM
Subscribe
![Page 2: ABAPLOVERS.BLOGSPOT.COM Messages in ABAP ... a message needs to be displayed, instructing the user to rectify the error, or after a certain task is accomplished, you may need to display](https://reader034.vdocuments.mx/reader034/viewer/2022051800/5ad2aa0e7f8b9aff738cf954/html5/thumbnails/2.jpg)
Follow Me on Twitter Check Videos
Displaying Messages in ABAP
In ABAP you need to display a message on various occasions, for example if the user has input erroneous data then a message needs to be displayed, instructing the user to rectify the error, or after a certain task is accomplished, you may need to display a message.
A message class is used to display messages from the program and the transaction used for this purpose is SE91. The messages are stored in the table T100. Examples of calling a message are shown below.
You may need to create a message class for displaying your message. You need to check if a message class has already been created by other ABAP colleagues. Note that messages classes would already exist in your system, but you may have to create a new class for your programs.
To create a new message class type the name following the naming standards and type the name as shown in the figure below. Alternatively you can goto transaction SE91 to create a new message class.
ABAPLOVERS.BLOGSPOT.COMMessages in ABAP
LOGON TO ABAPLOVERS.BLOGSPOT.COM
![Page 3: ABAPLOVERS.BLOGSPOT.COM Messages in ABAP ... a message needs to be displayed, instructing the user to rectify the error, or after a certain task is accomplished, you may need to display](https://reader034.vdocuments.mx/reader034/viewer/2022051800/5ad2aa0e7f8b9aff738cf954/html5/thumbnails/3.jpg)
Follow Me on Twitter Check Videos
In this example we will type the Message class as shown below and double click on 'ZEXERCISE1'
ABAPLOVERS.BLOGSPOT.COMMessages in ABAP
LOGON TO ABAPLOVERS.BLOGSPOT.COM
![Page 4: ABAPLOVERS.BLOGSPOT.COM Messages in ABAP ... a message needs to be displayed, instructing the user to rectify the error, or after a certain task is accomplished, you may need to display](https://reader034.vdocuments.mx/reader034/viewer/2022051800/5ad2aa0e7f8b9aff738cf954/html5/thumbnails/4.jpg)
Follow Me on Twitter Check Videos
The following prompt will appear. Click on Yes.
ABAPLOVERS.BLOGSPOT.COMMessages in ABAP
LOGON TO ABAPLOVERS.BLOGSPOT.COM
![Page 5: ABAPLOVERS.BLOGSPOT.COM Messages in ABAP ... a message needs to be displayed, instructing the user to rectify the error, or after a certain task is accomplished, you may need to display](https://reader034.vdocuments.mx/reader034/viewer/2022051800/5ad2aa0e7f8b9aff738cf954/html5/thumbnails/5.jpg)
Follow Me on Twitter Check Videos
Click on Yes again.
ABAPLOVERS.BLOGSPOT.COMMessages in ABAP
LOGON TO ABAPLOVERS.BLOGSPOT.COM
![Page 6: ABAPLOVERS.BLOGSPOT.COM Messages in ABAP ... a message needs to be displayed, instructing the user to rectify the error, or after a certain task is accomplished, you may need to display](https://reader034.vdocuments.mx/reader034/viewer/2022051800/5ad2aa0e7f8b9aff738cf954/html5/thumbnails/6.jpg)
Follow Me on Twitter Check Videos
Type an appropriate short text.
ABAPLOVERS.BLOGSPOT.COMMessages in ABAP
LOGON TO ABAPLOVERS.BLOGSPOT.COM
![Page 7: ABAPLOVERS.BLOGSPOT.COM Messages in ABAP ... a message needs to be displayed, instructing the user to rectify the error, or after a certain task is accomplished, you may need to display](https://reader034.vdocuments.mx/reader034/viewer/2022051800/5ad2aa0e7f8b9aff738cf954/html5/thumbnails/7.jpg)
Follow Me on Twitter Check Videos
Create a $tmp object
ABAPLOVERS.BLOGSPOT.COMMessages in ABAP
LOGON TO ABAPLOVERS.BLOGSPOT.COM
![Page 8: ABAPLOVERS.BLOGSPOT.COM Messages in ABAP ... a message needs to be displayed, instructing the user to rectify the error, or after a certain task is accomplished, you may need to display](https://reader034.vdocuments.mx/reader034/viewer/2022051800/5ad2aa0e7f8b9aff738cf954/html5/thumbnails/8.jpg)
Follow Me on Twitter Check Videos
Type a message that you would like to display. Please note the number associated with the message. In this case the message is '000'.
ABAPLOVERS.BLOGSPOT.COMMessages in ABAP
LOGON TO ABAPLOVERS.BLOGSPOT.COM
![Page 9: ABAPLOVERS.BLOGSPOT.COM Messages in ABAP ... a message needs to be displayed, instructing the user to rectify the error, or after a certain task is accomplished, you may need to display](https://reader034.vdocuments.mx/reader034/viewer/2022051800/5ad2aa0e7f8b9aff738cf954/html5/thumbnails/9.jpg)
Follow Me on Twitter Check Videos
We have created 3 messages.
ABAPLOVERS.BLOGSPOT.COMMessages in ABAP
LOGON TO ABAPLOVERS.BLOGSPOT.COM
![Page 10: ABAPLOVERS.BLOGSPOT.COM Messages in ABAP ... a message needs to be displayed, instructing the user to rectify the error, or after a certain task is accomplished, you may need to display](https://reader034.vdocuments.mx/reader034/viewer/2022051800/5ad2aa0e7f8b9aff738cf954/html5/thumbnails/10.jpg)
Follow Me on Twitter Check Videos
We now need to display these messages in our program. We will make changes in the Create Sales order program as shown below.
Some examples of calling a message.
1. MESSAGE xnnn.2. MESSAGE ID id TYPE mtype NUMBER n.3. MESSAGE xnnn(mid).
There are six kinds of message type: A (Abend)
Termination
E (Error) Error
I (Info) Information
S (Status) Status message
W (Warning) Warning
X (Exit) Termination with short dump
See the syntax shown below for displaying a message in your programs.
MESSAGE ID id TYPE mtype NUMBER n.
ID message class in our case ZEXERCISE1 or ZEXERCISE2
ABAPLOVERS.BLOGSPOT.COMMessages in ABAP
LOGON TO ABAPLOVERS.BLOGSPOT.COM
![Page 11: ABAPLOVERS.BLOGSPOT.COM Messages in ABAP ... a message needs to be displayed, instructing the user to rectify the error, or after a certain task is accomplished, you may need to display](https://reader034.vdocuments.mx/reader034/viewer/2022051800/5ad2aa0e7f8b9aff738cf954/html5/thumbnails/11.jpg)
Follow Me on Twitter Check Videos
TYPE message type (A,E,I,S,W,X)
NUMBER
message number
Example
MESSAGE ID 'ZEXERCISE' TYPE 'S' NUMBER '000'.
ABAPLOVERS.BLOGSPOT.COMMessages in ABAP
LOGON TO ABAPLOVERS.BLOGSPOT.COM
![Page 12: ABAPLOVERS.BLOGSPOT.COM Messages in ABAP ... a message needs to be displayed, instructing the user to rectify the error, or after a certain task is accomplished, you may need to display](https://reader034.vdocuments.mx/reader034/viewer/2022051800/5ad2aa0e7f8b9aff738cf954/html5/thumbnails/12.jpg)
Follow Me on Twitter Check Videos
Once the program is run the messages will be displayed as follows. Choose the one that suits your requirement.
ABAPLOVERS.BLOGSPOT.COMMessages in ABAP
LOGON TO ABAPLOVERS.BLOGSPOT.COM
![Page 13: ABAPLOVERS.BLOGSPOT.COM Messages in ABAP ... a message needs to be displayed, instructing the user to rectify the error, or after a certain task is accomplished, you may need to display](https://reader034.vdocuments.mx/reader034/viewer/2022051800/5ad2aa0e7f8b9aff738cf954/html5/thumbnails/13.jpg)
Follow Me on Twitter Check Videos
The following message is displayed just to show as to how to explicitly call another message class.
ABAPLOVERS.BLOGSPOT.COMMessages in ABAP
LOGON TO ABAPLOVERS.BLOGSPOT.COM
![Page 14: ABAPLOVERS.BLOGSPOT.COM Messages in ABAP ... a message needs to be displayed, instructing the user to rectify the error, or after a certain task is accomplished, you may need to display](https://reader034.vdocuments.mx/reader034/viewer/2022051800/5ad2aa0e7f8b9aff738cf954/html5/thumbnails/14.jpg)
Follow Me on Twitter Check Videos
ABAPLOVERS.BLOGSPOT.COMMessages in ABAP
LOGON TO ABAPLOVERS.BLOGSPOT.COM