Using ABAP Exception classes with Message classes (Part 1 of 2)
We’ve talked about Exception Classes, and we’ve talked about Message Classes. Now let’s see how we can combine these two together.
Let’s take a scenario, in which you have an exception that is thrown whenever a database error occurs in your program. Let’s call this exception class CX_DB_ERROR. We want our exception to display various messages that can also be translated later on to different languages. For example, “Error when writing to database” or “Error when reading from database”. So let’s combine ABAP Exception and Message classes.
1. First, create a message class through SE91. For this example’s sake, let’s call it CM_DATABASE_MESSAGES
2. Add a few messages to the message class. For our example, let’s add the message: “An error occurred when writing to table &1”. &1 indicates that a parameter would be inserted to the message. This parameter would be the name of the table that caused the error. We’ll get back to this in a few minutes.
3. Now open SE80 and create the exception class CX_DB_ERROR .
4. Remember that our message from step 2 states which table caused the error? Now’s the time to add this parameter. So click on the “Attributes” tab, and add an attribute for the table name. Let’s call it TABLE_NAME, and give it the type STRING.
5. Next, click on the “Texts” tab.
6. Enter a key to the message you would like to display on your exception class. In our example, let’s add the key WRITE_ERROR, indicating an error occurred when writing to the database.
7. Click on the “Message Text” button.
8. A new dialog opens, titled “Assign Attributes of an Exception Class to a Message”.
9. In the field “Message Class”, insert the name of the Message Class associated with your exception class. Let’s insert the class CM_DATABASE_MESSAGES, which we created earlier.
10. Now we need to choose the message number. Click on the choice button and choose the message “An error occurred when writing to table &1”. The number of the message should now appear in the field (as we created only one message in our example, it should be 000).
11. Now, you have to choose attributes that would be associated with the parameter &1. Click on the drop down list button, and choose the TABLE_NAME attribute we created earlier.
12. Save everything and activate.
You’ve just finished creating an exception class that uses a message class. In the next post, I’ll show you how to use the exception class with the message.
16 comments:
Download SAP Material from
wwww.way2sap.com
Learn SAP on your own from the following SAP Forum website
www.way2sap.com
Your given most of the use full information..The Sales and Distribution (SAP SD) consists of all master data, system configuration, and
transactions to complete the Order to Cash process.
It includes the following information and processes.SAP SD TRAINING IN A SIMPLE WAY.
sap sd online training
thanks for sharing from Sankar
After reading this post I got an idea about on this note.Really something grate in this article ,Thanks for sharing this. We are providing SAP courses training online. After reading this slightly am changed my way of introduction about my training to people. To know more Visit Us SAP PM Online Training Course
This information which you provided is very much useful for us.It was very interesting and useful for sap online training.We also providing catminds online training institute in USA.
Pretty good post. I just came across your site and wanted to say that I’ve really enjoyed reading your posts. In any case I’ll be subscribing to your feed and I hope you will keep a good work!Cheer!
Regards
sap sd and crm online training
sap online tutorials
sap sd tutorial
sap sd training in ameerpet
sap crm training tutorial
I appreciate you sharing this article. Really thank you! Much obliged.
This is one awesome blog article. Much thanks again.
oracle online training
sap fico online training
dotnet online training
qa-qtp-software-testing-training-tutorial
very nice article.thanks for sharing the post..!
SAP Success Factors Real Time Support
SAP WebDynpro Real Time Support
SCCM 2012 Real Time Support
Selenium Real Time Support
Solaris Real Time Support
SQL and Plsql Real Time Support
SQL Server 2012 DBA Real Time Support
SQL Server 2012 Real Time Support
Tableau Real Time Support
Teradata Real Time Support
Tibco Real Time Support
Amazon Web Server Real Time Support
Microsoft Azure Real Time Support
SCOM 2012 Real Time Support
Oracle ADF Real Time Support
Oracle Golden Gate Real Time Support
Ruby Real Time Support
SAP XI Real Time Support
OBIEE Real Time Support
Talend Real Time Support
very nice best deals for paytm
best deals for pepperfry
best deals for prettysecrets
best deals for printland
best deals for printvenue
best deals for purplle
best deals for redbus
best deals for rediff-shopping
best deals for shopcj
best deals for shopclues
best deals for shoppersstop
best deals for slimthread
best deals for snapdeal
best deals for stalkbuylove
best deals for themobilestore
best deals for thomascook
best deals for ticketgoose
best deals for travelkhana
best deals for trendin
best deals for vistaprint
best deals for wonderchef
best deals for yebhi
best deals for yepme
best deals for zivame
best deals for zovi
best deals for abhibus
best deals for bookmyshow
best deals for yatragenie
best deals for alibaba
best deals for aliexpress
best deals for puma
Oracle DBA Online Training
http://onlineitguru.com/oracle-dba-online-training-placement.html
Oracle DBA Online Training at online it guru with 9+ years of hands on expert trainer, we provide Job oriented and certification level online training with placement assistance.
Very good articles for online trainings,thanks for sharing
Best SAP MM Online Training By Real Time Faculties
Best SAP SD Online Training By Real Time Faculties
Best SAP Success Factors Online Training By Real Time Faculties
Best SAP WebDynpro Online Training By Real Time Faculties
Best SCCM 2012 Online Training By Real Time Faculties
Best Selenium Online Training By Real Time Faculties
Best Solaris Online Training By Real Time Faculties
Best SQL and Plsql Online Training By Real Time Faculties
Best SQL Server 2012 DBA Online Training By Real Time Faculties
Best SQL Server 2012 Online Training By Real Time Faculties
Best Tableau Online Training By Real Time Faculties
Best Teradata Online Training By Real Time Faculties
Packers and Movers Hyderabad are blasting these days at huge scale. Resettlement is a pitiable errand for which individuals take bunches of stress. In any case, with the assistance of our organization this errand of moving can be get less demanding and smoother
http://packersmovershyderabadcity.in/
http://blog.packersmovershyderabadcity.in/
Thanks for nice post. I like it. We are Providing online training smartmindonlinetraining
interesting information. This is just the kind of information that i had been looking for, i'm already your rss reader now and i would regularly watch out for the new posts,Thanks a million once again, Regardsoracle Goldengate training in hyderabad,
Thanks for sharing these information. It’s a very nice topic. We are providing online training classesSAPWebDynproonlinetraining
Post a Comment