Working with Program Messages 

You can assign a message class to any ABAP program. A message class has an ID nn where nn can be any two alphanumeric characters. A message class contains one or more messages.

You can display the messages for your program in the Editor. Choose Goto ® Messages from the Editor to display the Maintain Messages screen. By default, the system displays the messages for the current program:

If you choose Goto ® Messages and your program does not have a defined message class, the system assumes you want to browse an existing class and prompts you for a message class ID. You can also reach the Maintain Message Class screen by choosing Development ® Programming environ. ® Messages from the Workbench's initial screen.

Create a Message Class for Your Program

The following statement declares message class 89 for program ZACCTSP.

PROGRAM ZACCTSP MESSAGE-ID 89.

To create a new message class from within the Editor:

  1. Specify a message ID in a PROGRAM or REPORT statement.
  2. Messages are stored system-wide. The message ID you choose must be unique.

  3. Double-click the message ID
  4. If you defined an ID that is not unique, the system simply opens the Maintain Messages dialog. In this case, enter a different ID. Once you have done this, the system asks you whether you want to create a new message class.

  5. Choose Yes.
  6. The system opens the Display Message Class screen.

  7. Enter a Short text describing the class.
  8. Choose Save.

You can add messages to your class by choosing Messages. You can always return to the Display Message Class screen by double-clicking on a message ID or a message number where it appears in your code.

Adding Messages

  1. Open the Maintain Messages screen.
  2. You can open this screen by choosing Goto ® Messages from the Editor or by choosing Messages from the Display Message Class screen. The Maintain Messages screen lists all the messages in the class.

  3. Choose Maintain All.
  4. The system places all the messages in change mode. You can edit an individual message by placing your cursor on a message and choosing Individual maint.

  5. Enter the message text next to a Message number.
  6. Choose Save.