Displaying error messages

In this recipe, we will see how we can display messages, such as error messages when a user input is found to be incorrect. We will create a view that will have a button that displays a message when the input is correct (for simplicity's sake, we will focus on the error generation coding in this recipe).

In addition, it is recommended that you use assistance class for storing language-dependent text that is to be displayed in the form of messages. For simplicity's sake, the assistance class has not been shown in this recipe.

How to do it...

  1. In the first step, we will create a Button element on our view and give it the caption Check Data. Within the events, we will select BUTTON (as the onAction property) from the listbox. ...

Get SAP ABAP Advanced Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.