How to create SAP ABAP Error Message Class
How to create SAP ABAP Error Message Class
SAP ABAP Error Messages are very important for each ABAP program to know what is happening in that Program. Creating an error message class is very easy and we can create message classes using SE91 and SE38 Transaction codes.
Every Message has the message class and its ID and its Type.
Message Class in SAP ABAP
MESSAGE E001(MCLASS).
MESSAGE-Keyword
E-Message Type
001-Message Id
Mclass-Message class Name
Message Class TCode
SE91 and SE38 are message classTransaction codes.
Creating Message Class in SAP ABAP
First of all, Go to SE91 Tcode and Give the Message Class Name ZDEMO_MESSAGE and click on create
In the Messages Tab, choose id and enter Message Description.
Message Class has been created successfully. Now how to use created message class in the ABAP program.
MESSAGE I000(ZDEMO_MESSAGE).
Types of Messages in SAP ABAP
I - Information messages
Information messages 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 an error message and is displayed along the footer of the SAP screen.
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 run time error and short dump.
X - Exit
An exit message stops processing and displays an exit button which exits session processing.
How many ways can we display the messages in the SAP ABAP Program
a). MESSAGE 'abs' type 'I'.
b). MESSAGE I003 (<Message Class>)
c). REPORT <Program Name> MESSAGE-ID <Message Class>.
MESSAGE I006.
d). MESSAGE text-001 type 'I'.
e). MESSAGE i009 WITH 'create the correct sales order number'(003).
f). MESSAGE ID '<Message Class>' type 'I' NUMBER 002.
g). MESSAGE i007 (<Message Class>) WITH '<Some text message> '.
h). MESSAGE i004 WITH text-003.
i). MESSAGE i002 (<Message Class>) WITH text-003.
j). MESSAGE i002 (<Message Class>) with p_user.
Comments
Post a Comment