Warning to error message sap

How to create SAP ABAP Error Message Class SAP ABAP Error Messages are very important for each ABAP program to know what is happening...

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

How to create SAP ABAP Error Message Class

In the Messages Tab, choose id and enter Message Description.

How to create SAP ABAP Error Message Class

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.

message class in sap abap
how to create message class in sap abap
message class tcode
message class
how to use message class in sap abap
create message class in sap abap
sap message class
message class in sap
sap message class tcode
tcode for message class
message class tcode in sap
tcode for message class in sap
message class tcode in sap abap
sap tcode message class
abap message class tcode
abap message class
sap create message class
message class in abap
tcode message class
how to create a message class in sap abap
message class in sap abap tcode
tcode for message class in sap abap
sap transaction message class
message class abap
abap create message class
abap message
sap tcode for message class
standard message class in sap abap
transaction for message class in sap
message class sap
sap abap message class
message class transaction sap
message class tcode sap
message class sap tcode
sap message class table
message abap
abap error message
abap message example
sap message class transaction
message class table in sap
how to write error message in sap abap
abap message id
se91 in sap
error message in sap abap
error message abap
sap abap message
message to class
sap message id tcode
se91 tcode in sap
sap abap error message
display error message in sap abap
sap change error message to warning
abap message types
sap abap message types
how to check message class in sap
how to display error message in sap abap
types of messages in sap abap
se91 sap
message types in sap abap
sap display message class
sap standard message class with
error message syntax in sap abap
sap abap message example
how to display multiple error messages in sap abap
message in sap abap
warning message in sap abap
abap text-001
messages in abap
abap class tcode
message with abap
se91
how to find message class in sap
sap se91

Popular posts from this blog

BADI Interview Questions in SAP ABAP

BADI Interview Questions in SAP ABAP A BAdI is an object-oriented enhancement option, which makes it the most sophisticated enhancement type. The main characteristic of a BAdI is that it provides a mechanism to change the functionality of a well-defined business function without making changes to the delivered source code. Future upgrades of the original business function can be applied without losing the customer-specific enhancements or the need to merge the changes.  If you want to become a professional and technical blogger practically, read these real-world practical SAP ABAP books . These books will help you to become a more flexible coding developer in future SAP technology. What is a BADI in SAP? BADI (Business Add-In) is a new SAP Object Oriented enhancement technique that is used to add our own business functionality to the existing SAP standard functionality.  BADI follows the Object-Oriented approach to make them reusable. A BADI can be used any number of times

Sample SAP ABAP Programming Examples for Practice

Sample SAP ABAP Programming Examples for Practice Are you a beginner at ABAP Language, you’re looking for example programs for practice. Here I collected some sample programs from various objects in ABAP that are useful for beginners to improve their Technical skills. To familiar with coding and ABAP applications, you must be practice all applications. As per my experience, practice makes you perfect, as a technical consultant, should be ready to develop any object based on the need of the client, then only, we will get appreciation from the client and from our team side and it helps us to develop complex objects in SAP. ABAP Syntax ABAP Statements ABAP Program Types SAP ABAP Workbench Tools SAP Modules SAP Transaction Codes SAP Tables SAP ABAP Hello world Program Example ABAP- Simple ALV report Example ABAP- Interactive ALV Report Example ABAP- BDC Call Transaction Method Programming ABAP- BDC Session Method Programming Example ABAP- Smartforms

Module Pool Programming Interview Questions and Answers in SAP ABAP

Module Pool Programming(Dialog Programming)  Interview Questions and Answers in SAP ABAP As an ABAP Consultant, you should be strong in Module pool programming techniques as well as when you face the real-time or fresher interview, Questions, and answers to test your talent to select for the interview. For that purpose, I am sharing my interview experiences in which I faced the most of the times on these topics that are at exit command, events difference between set screen and call screen difference between call screen and set screen in module pool,chain-end chain in module pool. What is the transaction code for the screen painter? SE51. What is the transaction code for Menu painter? SE41. What is the transaction code for the screen painter? SE93. What are the main components of dialog programs? Screens Module pools Subroutines Menus Transactions What is Screen flow Logic? The screen flow logic is like an ABAP program in that it serves as a

Step by Step tutorial on BDC Session Method Program in SAP ABAP

Image

Step by Step tutorial on BDC Session Method Program in SAP ABAP BDC Session Method is used to upload data from Non-SAP to SAP System. Using Session method, we can transfer data through more than one Transaction, Unlike BDC Call Transaction Method Program . We are Processing Batch input Session From SM35 Transaction Code. Session method. 1) synchronous processing. 2) can transfer a large amount of data. 3) processing is slower. 4) error log is created 5) data is not updated until the session is processed. Call transaction Method. 1) asynchronous processing 2) can transfer a small amount of data 3) processing is faster. 4) errors need to be handled explicitly 5) data is updated automatically Go to SHDB and Press Enter Click on New Recording Button and Give the zrecord1 name and enter transaction code MM01 and click on the Start recording button. The system goes to the Create material screen, there give the industry sector and material type and selects ba

SAP ABAP Interview Questions and Answers for 10 Years Experienced

SAP ABAP Interview Questions and Answers for 10 Years Experienced This post will helpful for SAP ABAP experienced candidates who may have 3,4 5, 6,7, and 10 years of experience, all of them can be follow this interview pattern for their successful interview.  SAP Data Dictionary Realtime Interview Questions SAP BDC Realtime Interview Questions SAP ALV Reports  Real-time Interview Questions Module Pool Interview Questions SAP Smartforms Realtime Interview Questions SAP BADI Realtime Interview Questions SAP BAPI Realtime Interview Questions SAP  IDOC Realtime Interview Questions ABAP Check and Value Table Questions SAP SD MM FICO Flow Interview Questions SAP OOPs Realtime Interview Questions SAP OOPs Part One  Real-time Interview Questions SAP OOPs Part two Real time Interview Questions SAP OOPs Part three Realtime Interview Questions SAP OOPs Part four Realtime Interview Questions ABAP  Realtime Interview Questio

Содержание

  1. Message Types and Error Groups
  2. Message Types
  3. S Message (Success)
  4. I Message (Information)
  5. W Message (Warning)
  6. E Message (Error)
  7. A Message (Abend)
  8. Icons in Messages
  9. Error Groups
  10. Errors in Tables
  11. Input Values are not within the Valid Value Range
  12. Nonsensical Entries
  13. System Error, System Limits are Exceeded
  14. No Entry Made in a Certain Field
  15. Control Error
  16. Resource Conflicts Due to System Conditions
  17. Invalid Result of an Action
  18. Success Messages
  19. Plausibility Error
  20. Technical Notes
  21. Messages and Message Classes
  22. SAP Messages
  23. SAP Message Classes
  24. MESSAGE E001(MCLASS).
  25. Pass message Parameters
  26. Further information about message types
  27. ABAP Blog
  28. Все о разработке в решениях от SAP
  29. ABAP Blog
  30. Все о разработке в решениях от SAP
  31. Ссылки
  32. Цитаты
  33. Новое
  34. Последние комментарии
  35. Обработка особых ситуаций в ABAP
  36. Классический способ обработки исключений
  37. Обработка исключений, основанная на классах
  38. Категории исключений

Message Types and Error Groups

The messages in the R/3 System can be classified according to different types. The message type determines where the message is issued and how the system responds.

Messages which refer to errors, so-called error messages, can be grouped in terms of their contents on the basis of the events triggering them or the objects affected. Error messages are to state the problem and, if space permits, should offer suggestions for removing the error. In this way the user can proceed without outside help. Examples illustrate the individual error groups.

Message Types

Note: The message types have been defined by the programmers, not the Ergonomics Group.

S Message (Success)

S-type messages are displayed in the Status Bar on the same or next screen. The message has no influence on the user’s work. It only confirms the successful execution of system functions.

I Message (Information)

This message has a modal character — that is, the user must acknowledge the message. I messages are therefore displayed in a modal dialog box. The processing can be continued by pressing the ENTER key.

W Message (Warning)

So-called W messages interrupt the processing and allow the user to make corrections. For this reason, fields are enabled for input. W messages are displayed in the Status Bar if the messages have been issued by a primary window. If a dialog box issues the message, the system displays the message in a separate dialog box.

With regard to the system response, warnings are similar to E messages. E messages, however, force the user to change the entry.

E Message (Error)

When the system detects an error, E messages should be used. Incorrectly completed fields must be ready for input. If consequential errors occur, we recommend to make not only the incorrectly filled field ready for input but also those fields whose entries have contributed to the error.

Depending on whether the E message was issued by a primary window or a dialog box, it is either displayed in the Status Bar of the primary window or in a separate dialog box.

A Message (Abend)

A messages are intrinsically of a modal character, that is, a separate dialog is inserted into the current task. Therefore, they are displayed in modal dialog boxes

A messages do not allow the user to make any further entries. The user can only acknowledge the message. The task is abruptly terminated and the system returns to a higher-level menu.

A messages should only be issued in extraordinary circumstances, for example, when a system-related error occurs or if the error can no longer be handled by the task. In all error situations handled by the task, however, it should be possible for the user to remain in his work environment. A messages should therefore be avoided, if possible.

Icons in Messages

If standard error messages from the Basis system are displayed in a dilaog box, the system auotmatically displays the appropriate icon for the particluar message type (E, W, I, or A). Since S messages always appear in the status bar, there is no icon for S messages.

Information

Error

Warning

Critical

Figure 1: Icons to be used in messages

Note: In general, application developers do not have to take action in this respect.

Error Groups

Errors in Tables

Generally, the user is not authorized to make changes in a table. Therefore, the short text of the error messages which refer to tables should not contain a reference to a table. This information is contained in the long text, possibly together with the recommendation to contact the system administrator.

If the display of the message was initiated because a system table does not include an entry which it was expected to contain, the short text should not contain a reference to the table but at most a note on the entry:

  • Good : E: Order type & is not valid (Please check entry)

If the error is related to tables, which are only of importance for the SAP System itself or if the cause for the error cannot explicitly be assigned to a particular entry, the message should refer the user to the system administrator:

  • Good : A: No further processing possible (Please contact your system administrator)

The long text should always contain a detailed error diagnosis which can also be of a more technical nature (which, however, is indicated as such).

If special reference is made to lines which are not contained in a table and if the table is important for the user, that is, if he has maintenance authorization for the table, use the following message pattern:

  • Good : A: Please enter country in country table & first

Input Values are not within the Valid Value Range

The user has entered an entry which was not within the valid, usually numeric value range.

  • Good : E: Please enter posting period in allowed value range

If the value range is known or predefined, the error message should ask the user to enter a value within a specified range:

  • Good : E: Please enter a posting period between 1 and 12

Nonsensical Entries

In some situations, the user attempts to carry out an action which is meaningless from a business point of view (the system should be able to prevented these actions).

  • Good : E: Please create bill of material first
  • Good : E: Order type of outline agreement cannot be selected for &
  • Good : E: Balance & is in the revaluation document of company code &

System Error, System Limits are Exceeded

If a non-user error occurs in the system, the message should explain that a system-related problem has caused the error. It should also point out how the user can respond. Technical descriptions should be avoided.

For temporary problems, the following «good» example can be used:

  • Bad : I: Global lock table is full. Locking is currently notpossible
  • Good : I: At present, the function cannot be carried out

A detailed explanation of this message must be given in the long text.

If a more severe system error interrupts the user’s interaction with the system, the following message can be displayed:

  • Good : A: No further processing is possible (Please contact your system administrator)

A detailed explanation of this message must be given in the long text.

No Entry Made in a Certain Field

If particular entries are required to continue processing, the required specifications are, however, missing or incorrect:

  • Good : E: Please enter material or reservation in case of a single entry
  • Good : E: Please enter the batch number for material &
  • Good : E: Please enter required-entry field material

Control Error

If an operating error occurs, for example, the user chooses a function which requires a previous selection to have been made, the message should specify the initiated action and the error diagnosis, if possible:

  • Good : W: You have chosen Copy (Please select an order first)
  • Good : W: You have chosen Delete (Please delete all items individually)

Resource Conflicts Due to System Conditions

If records are locked, the user is missing the required authorization, etc.:

  • Good : I: You are not authorized for printer & (printer destination)
  • Good : I: Vendor master record & is currently locked

Invalid Result of an Action

If a calculation would lead to a meaningless or invalid result, not only the diagnosis should be given but also help in eliminating the error.

  • Good : E: The specified quantity is smaller than the delivered quantity (Please enter again)
  • Good : W: Today’s purchase order & cannot be printed

Success Messages

The system sends success messages to the user when it has performed certain tasks (e.g. particular important tasks).

  • Good : S: Differences to physical inventory document & have been posted with document &
  • Good : S: New record with field & was added to list X
  • Good : S: Physical inventory document with the generated number & has been posted

Plausibility Error

The system, for early recognition of substantive errors, should check entries for their plausibility, if possible.

Technical Notes

In the flow logic of the screen, the required fields for E messages must be enabled for input by the FIELD statement in front of the module in question. After the user has corrected the entry, the module is processed again automatically from the beginning.

Messages within modules are generally triggered at the event PROCESS AFTER INPUT. Only I messages and S messages are useful at the event PROCESS BEFORE OUTPUT.

If several fields/modules are chained on the screen (CHAIN), the entire chain and therefore all modules are processed again.

If a field is contained in several chains and an error occurs, all chains which are in front of the module reporting the error are checked for this field and processed again, if found.

Источник

Messages and Message Classes

You can create and group messages in message classes in order to inform the user about an error or a status, or to issue a warning.

Messages notify a user about unexpected behavior, an error, a status, or a result of an action. An application will display the message at runtime – for example, in a dialog box or in the status bar.

A message is specified by a unique 3-digit message number, a single-digit language key, text information, and a message class.

Messages are stored in the database table T100 .

Messages with a long text display additional information as to the cause and the potential solution of a problem.

Message classes are created within an ABAP project at the ABAP package level. They are used to group messages within a development object. So, you can combine related messages and reuse them in other programs. After creating a message class, you add the individual message(s).

The message with the number 045 contains the placeholder for a parameter. The placeholder «&» stands for the value of the parameter «carrid». In ABAP programs, messages are called using the MESSAGE statement.

This example of MESSAGE statement MESSAGE i045(SABAP_DOCU) WITH carrid contains the following elements:

  • Message type: «i»
  • Message number: «045»
  • Message class: «SABAP_DOCU»
  • Short text: «No authorization for airline carrier &»
  • Placeholder «&» which is defined for the parameter «carrid»

Источник

SAP Messages

A SAP message is an essential part of any ABAP program and are used to display information to the user to let them know what’s happening. This could be in a number of ways such as an error message, warning message or information message.

The following ABAP code is the simplest way to implement a message into your report.

MESSAGE ‘Display this message’ TYPE ‘E’.

SAP Message Classes

A better way to implement your messages would be to create and maintain them via a message class using transactions SE91 or SE80. This way you have a central store for all messages, which makes it easier to maintain. This is especially true if your messages need to be translated into multiple languages. Enter your text here.

To do this you first need to create a message class which is a kind of container/wrapper where you store related messages together. Once this is done you can add as many message as you require into it. You also get the option to create additional long text, which offers the user additional information about the particular issue. See the following link for more information and details of how to create a message class.

Once you have created your message you can use them within your ABAP code using the following syntax:

MESSAGE E001(MCLASS).

MESSAGE = ABAP statement
E = Type of message (can also be I,W,S,A,X)
001 = Message number
MCLASS = Message Class

Pass message Parameters

You can also add parameters to your messages using the «&» character. So for example you could create the following message ‘Purchase order & has been deleted’. You can then pass a purchase order number to the message when using it and it will replace the «&» with the purchase order you pass for example

MESSAGE E001(MCLASS) with ekko-ebeln.

The result would display
«Purchase order 1234 has been deleted»

Further information about message types

I — Information messages
Information message 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 and error message and is displayed along the footer of the SAP screen and stops processing going any further.

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 runtime error and short dump which is also viewable in tcode ST22.

X — Exit
An exit message stops processing and displays and exit button which exits session processing. Similar to typing /n into the SAP command box.

Источник

ABAP Blog

Все о разработке в решениях от SAP

ABAP Blog

Все о разработке в решениях от SAP

Ссылки

Цитаты

Самое важное правило объектно-ориентированного программирования на C++ таково: открытое наследование означает «является». Запомните это.

Скотт Мейерс

Новое

  • Получение инстанции cl_gui_alv_grid для SALV 11.09.2021
  • Introduction to ABAP in the Cloud 18.08.2021
  • Getting Started with FPM BOPF Integration 01.06.2021
  • 30. How to Use Authority Checks in Business Object Processing Framework 29.05.2021
  • 29. BOPF Extensibility 29.05.2021
  • 28. BOPF Enterprise Procurement Model (EPM) 29.05.2021
  • 27. BOPF Integration 29.05.2021
  • 26. BOPF Business Configuration Objects 29.05.2021
  • 25. BOPF Performance 29.05.2021
  • 24. BOPF Supportability 29.05.2021

Последние комментарии

Обработка особых ситуаций в ABAP

Когда мы создаем какой-либо многократно используемый компонент, например функциональный модуль или метод в классе, мы сталкиваемся с необходимостью обработки непредвиденных ситуаций (какой-либо входной параметр, оказался не заполненным или доступ к файлу не был получен и т.п.), т.е. тех ситуаций, после которых программа не может выполняться далее стандартным образом, либо требуется дополнительная обработка.

В приведенной статье рассматриваются способы вызова и обработки данных ситуаций, называемых исключениями.

В ABAP есть два основных способа работы с исключениями, классический способ заключается в вызове особых ситуаций описанных в ФМ или методе на отдельной закладке:

Классический способ может использоваться и в классах:

Новый способ основывается на ООП, где в качестве исключений используются классы (обратите внимание, что установлена галочка – классы исключений):

Хочется отметить, что новый способ был введен с версии SAP Web AS 6.10 и при создании новых функциональных модулей или методов рекомендуется использовать именно его. В данной статье не рассматриваются системные исключения и их обработка до введения классов исключений.

В RFC модулях в настоящее время используется классический способ обработки исключений. Не допускается одновременно использовать классический и основанный на классах, способы обработки исключений (в интерфейсе методов, процедур, функций).

Классический способ обработки исключений

При вызове исключения, системное поле sy-subrc будет заполнено номером, под которым исключение было обозначено при вызове ФМ, метода или процедуры:

Как правило, исключения вызываются с текстом сообщения, данный текст может быть описан статически – при вызове исключения оператором MESSAGE, либо динамически – путём получения текста из описания ФМ.

Так же исключение может быть вызвано без какого-либо текста (оператором RAISE ИмяИсключения), но данный способ лучше не использовать, т.к. вызов исключения должен как-то себя расшифровывать и говорить о том, что собственно произошло.

Напишем небольшой ФМ, рассчитывающий сумму двух чисел, оба параметра помечены как необязательные, если первый параметр не будет задан при вызове ФМ, система выдаст исключение – no_num_1.

И программа для его вызова:

При запуске программы произойдет вызов исключения, т.к. был использован тип сообщения «Е», программа завершит свое выполнение после показа сообщения:

Замечу, что это вовсе не означает, что при вызове ФМ или метода и обработке исключения необходимо завершать работу программы, вы можете свободно продолжить её выполнение и далее, добавив например, сообщение об ошибке в лог программы, а не на вывод как в примере.

Ключевое слово OTHERS используется для того чтобы поймать исключения не описанные в ФМ или явно неуказанные, при вызове ФМ.

Пример вызова неописанного исключения:

В данном примере вызывается неописанное в интерфейсе ФМ исключение – no_num_2, которое будет благополучно поймано с помощью ключевого слова OTHERS (системное поле sy-subrc примет значение равное 2).

Кроме того, можно не обрабатывать большой список всех возможных исключений описанных в ФМ, тогда в случае если такое исключение будет вызвано поле sy-subrc примет значение, указанное в OTHERS.

В ФМ, могут быть добавлены новые исключения и в случае, когда при вызове ФМ они не обработаны и не указано слово OTHERS программа упадет в дамп с ошибкой времени выполнения — RAISE_EXCEPTION. Отсюда вывод, ключевое слово OTHERS подставляем всегда, при вызове ФМ (метода или процедуры), когда мы точно не уверены в неизменности компонента.

При вызове исключения в процедурах (perform…) из ФМ, система пытается найти и вызвать исключение в первом ФМ из стека вызовов, если исключение не найдено, вызывается так же, как и неопределенное исключение в ФМ.

Как уже было упомянуто выше, есть возможность получать текст непосредственно из описания особой ситуации:

ФМ будет выглядеть следующим образом:

Результат:

Иногда особые ситуации используются не как исключения, а как параметры показывающие обработку ФМ и его результат, возвращаемый в поле sy-subrc, хотя лучше бы пренебречь подобным стилем:

Сообщения, вызываемые в ФМ или методах, оператором MESSAGE, без дополнения RAISING, либо сообщения вызываемые системой (например, при обработке экранов), могут быть обработаны программой с использованием дополнения: error_message = n_error, указываемого так же после ключевого слова EXCEPTIONS.

При обработке сообщений:

  • Сообщения с типом I, W, S не обрабатываются, но записываются в журнал обработки фонового выполнения, если происходит обработка в фоне.
  • Сообщения с типом E или A могут быть обработаны, при этом в поле sy-subrc будет записано значение n_error. При вызове сообщения с типом А, происходит вызов ROLLBACK WORK (см. описание оператора MESSAGE).
  • Сообщение с типом X не обрабатывается, программа завершается с дампом.

Обработка исключения классическим способом может быть выполнена динамически, с помощью ключевого слова EXCEPTION-TABLE. Пример:

Обработка исключений, основанная на классах

Как понятно из названия, под исключениями в данном случае понимаются объекты специальных классов исключений. Вызов такого исключения может быть выполнен либо в программе с помощью оператора RAISE EXCEPTION, либо системой (например, при делении на ноль будет вызвано предопределённое исключение CX_SY_ZERODIVIDE, список таких исключений), либо через дополнение THROW в условных выражениях (с версии ABAP 7.4).

Во всех случаях инициируется создание объекта указанного класса (если указано дополнение INTO в CATCH), в атрибутах которого содержится информация о возникшей исключительной ситуации, доступ к ним, как правило, осуществляется через методы этого класса.

Классы особых ситуаций могут быть определены как локально, так и глобально через построитель классов – транзакция SE24, диалог создания:

В данном случае галочка «с классом сообщений» означает использование в качестве текста сообщения из класса сообщений транзакция SE91 (будет рассмотрено ниже). По умолчанию текст сообщения создается в текстах класса:

Категории исключений

Все классы особых ситуаций являются производными одного из классов: CX_NO_CHECK, CX_DYNAMIC_CHECK или CX_STATIC_CHECK, которые сами являются производными общего суперкласса CX_ROOT.

  • CX_STATIC_CHECK – как правило, исключения которые вызываются в процедуре (ФМ или методе), должны быть либо обработаны в ней, либо процедура должна иметь соответствующий интерфейс, чтобы вызывающий её код мог обработать эту ситуацию. Если исключение определено как потомок этого класса, оно должно быть явно указано в интерфейсе метода (ФМ или формы) в котором происходит его вызов. Данная категория используется тогда, когда в коде явно ожидается передача обработки особой ситуации на уровень выше того места где оно было вызвано. Если при статической проверке, система не увидит обработки в блоке TRY..CATCH..ENDTRY подобного исключения система выдаст предупреждение:
  • CX_DYNAMIC_CHECK – при проверке кода, компилятор не будет делать предупреждений об отсутствии обработки исключений их этой категории, в случае вызова исключения его обработка будет проверена динамически и если обработчик не будет найден программа упадет в дамп. Обычно данная категория используется тогда, когда исключение может быть обработано внутри самого метода, без передачи обработки выше по стеку. Примером такой категории может являться исключение вызываемое при делении на ноль, передавать его выше по стеку и указывать в интерфейсе метода вовсе не обязательно, т.к. мы можем его обработать внутри самого метода. Однако, если мы хотим передать обработку данного исключения, необходимо указать его в интерфейсе метода.
  • CX_NO_CHECK – аналогичны предыдущему типу, но данную категорию нельзя объявлять в интерфейсах, при этом классы исключений наследуемые от этого класса, неявно все же передаются в интерфейс и выше по стеку вызовов. Данную категорию следует использовать для исключительных ситуаций, которые могут произойти в любое время и не могут быть обработаны непосредственно в коде метода. Кроме того, можно использовать в случаях когда одна и та же исключительная ситуация может возникнуть во множествах методов, а объявлять её в интерфейсах каждого из методов не имеет смысла, т.к. это усложнит код. В итоге подобные исключения могут пройти всю цепочку вызовов методов (т.к. неявно передаются в интерфейс) и быть обработаны на уровне программы.

На исключения накладываются следующие ограничения:

  • Исключение не может быть объявлено в интерфейсе статического конструктора:

  • Исключение не может быть объявлено в интерфейсе обработчика событий. При этом если в коде обработчика произошел вызов исключения, и он не был обработан, система вызовет исключение — CX_SY_NO_HANDLER, которое может быть обработано в вызывающем его коде.
  • При вызове программ через SUMBIT или CALL TRANSACTION, исключение, возникающее в вызываемой программе, не может быть передано в вызывающую программу.

Небольшой пример с локальным классом исключения:

Источник

What is Message?

Messages are used to describe what is happening in the program execution to the programmer or user. Messages represents with a three-digit number. Messages range starts from 000 to 999.

Message Types —

Messages are basically six types. Those are —

A Abend The message appears in a separate dialog box and the program execution get terminated.
When the user has confirmed the message, control returns to the next-highest area menu.
E Error An error dialog appears or the program terminates depending on the program condition.
I Information The message appears in a separate dialog box.
Once the user has confirmed the message, the program execution continues from the next statement coded immediately after the MESSAGE statement.
S Success The total program execution continues normally and the message is displayed in the status bar of the screen.
W Warning An error message is displayed in the status bar of the screen and the program execution terminates.
X Exit or Abort No message is displayed.
The program terminates with a short dump.
Program terminations with a short dump normally only occur when a runtime error occurs.

Message Usage —

Messages can be added to the program mostly in two ways. Those are —

  • Coding directly in the program
  • By using the message class.

Coding directly in the program —

Coding the message directly in the program is a very simple process. No definition was required before coding the message in the program.

Syntax —

MESSAGE {message-name} TYPE {message-type}.

  • Message — 80 characters user defined message.
  • Message-type — Specifies the message type.

Now, let us see how different message types coded one by one with seperate examples.

Example —

Display abend message.

Code —

*&---------------------------------------------------------------------*
*& Report  Z_MESSAGE
*&---------------------------------------------------------------------*
*& Written by TutorialsCampus
*&---------------------------------------------------------------------*

REPORT  Z_MESSAGE.

* Displaying Abend Message of type A
MESSAGE 'This is a Abend message' TYPE 'A'.

Output —

Abend message example display

Explaining Example —

In the above example, each and every statement is preceeded with a comment to explain about the statement. Go through them to get clear understanding of example code.

MESSAGE ‘This is a Abend message’ TYPE ‘A’. — Opens a popup and displays ‘This is a Abend message’ on the popup.

Example —

Display error message.

Code —

*&---------------------------------------------------------------------*
*& Report  Z_MESSAGE
*&---------------------------------------------------------------------*
*& Written by TutorialsCampus
*&---------------------------------------------------------------------*

REPORT  Z_MESSAGE.

* Displaying error Message of type E
MESSAGE 'This is a Error message' TYPE 'E'.

Output —

Error message example display

Explaining Example —

In the above example, each and every statement is preceeded with a comment to explain about the statement. Go through them to get clear understanding of example code.

MESSAGE ‘This is a Error message’ TYPE ‘E’. — Displays ‘This is a Error message’ on the output page status bar.

Example —

Display Informational message.

Code —

*&---------------------------------------------------------------------*
*& Report  Z_MESSAGE
*&---------------------------------------------------------------------*
*& Written by TutorialsCampus
*&---------------------------------------------------------------------*

REPORT  Z_MESSAGE.

* Displaying Informational Message of type I
MESSAGE 'This is a Informational message' TYPE 'I'.

Output —

informational message example display

Explaining Example —

In the above example, each and every statement is preceeded with a comment to explain about the statement. Go through them to get clear understanding of example code.

MESSAGE ‘This is a Informational message’ TYPE ‘I’. — Opens a popup and displays ‘This is a Informatonal message’ on the popup.

Example —

Display success message.

Code —

*&---------------------------------------------------------------------*
*& Report  Z_MESSAGE
*&---------------------------------------------------------------------*
*& Written by TutorialsCampus
*&---------------------------------------------------------------------*

REPORT  Z_MESSAGE.

* Displaying Success Message of type S
MESSAGE 'This is a Success message' TYPE 'S'.

Output —

Success message example display

Explaining Example —

In the above example, each and every statement is preceeded with a comment to explain about the statement. Go through them to get clear understanding of example code.

MESSAGE ‘This is a Success message’ TYPE ‘S’. — Displays ‘This is a Success message’ on the output page status bar.

Example —

Display warning message.

Code —

*&---------------------------------------------------------------------*
*& Report  Z_MESSAGE
*&---------------------------------------------------------------------*
*& Written by TutorialsCampus
*&---------------------------------------------------------------------*

REPORT  Z_MESSAGE.

* Displaying Warning Message of type W
MESSAGE 'This is a Warning message' TYPE 'W'.

Output —

Warning message example display

Explaining Example —

In the above example, each and every statement is preceeded with a comment to explain about the statement. Go through them to get clear understanding of example code.

MESSAGE ‘This is a Warning message’ TYPE ‘W’. — Displays ‘This is a Warning message’ on the output page status bar.

Example —

Display exit message.

Code —

*&---------------------------------------------------------------------*
*& Report  Z_MESSAGE
*&---------------------------------------------------------------------*
*& Written by TutorialsCampus
*&---------------------------------------------------------------------*

REPORT  Z_MESSAGE.

* Displaying Exit Message of type X
MESSAGE 'This is a Exit message' TYPE 'X'.

Output —

Exit message example display

Explaining Example —

In the above example, each and every statement is preceeded with a comment to explain about the statement. Go through them to get clear understanding of example code.

MESSAGE ‘This is a Exit message’ TYPE ‘X’. — Displays ‘This is a Exit message’ on the output exit page.

Using the message class —

In this scenario, messages gets displayed from the message class that is defined by using MESSAGE-ID along with the REPORT command. Message number is a three-character code that can define a set of 1000 messages and those are accessed when MESSAGE command executed in the program.

Messages number ranges from 000 to 999 (i.e. 1000 messages). Each message associated with message number and the message length can be upto 80 characters.
When a message number used in the program, the corresponding message retrived from the message class and gets displayed.

Syntax —

MESSAGE {message-name} WITH field1 ... field4.

This addition replaces the placeholders «&1» to «&4» and «&» of the short text or «&V1&» to «&V4&» of the long text of of the operands field1, …, field4. Up to four operands field1 through field4 can be specified.

Messages are not always static and some part of the message can be filled with a dynamic or runtime text.
While creating a custom message, Amber sign (&) symbol used in the place of dynamic or runtime text.
The MESSAGE…WITH statement used to pass the dynamic or runtime text during the program execution.

Example —

Create a message class with a template message and pass the runtime text to complete the message.

First we need to create the message class with MESSAGE-ID by coding in the program.

Step-1: Code MESSAGE-ID along with REPORT shown like below. ZMG_CUSTMESG is the new message class.

create custom message1

Step-2: Double click on the message class name (ZMG_CUSTMESG) to create it. The Create Object diaglog gets opened.

create custom message2

Step-3: Click on «YES» to create new. It directs to Message Maintenance screen.

create custom message3

Step-4: Once the required information updated, move to «Messages» tab or Save button. Below screen gets appear.

create custom message4

Step-5: Select the desired package and click on «Local Object» button or «Save«. The Messages tab gets opened like below.

create custom message5

Step-6: Create the messages that required and click on «Save» button to save. Now newly created message class gets saved and it routes to ABAP Editor to continue the program coding.

Note! The message added with &. ‘&‘ used to pass custom information from the MESSAGE…WITH statement to the message text.
The text in the MESSAGE statement replaces ‘&‘ and displays the message.

Step-7: Open ABAP editor and complete the coding in the program.

create custom message6

The message defined for the message number 000 is ‘This is a & Message’. We are passing custom text(‘Informational’) in MESSAGE….WITH statement. So the ‘&’ replaces with ‘Informational’ and displays the message as ‘This is a Informational message’. As it is an message type ‘I’, it displays in separate dialog box.

Step-8: Execute the program to display the output.

Finally, the custom message displayed with dynamic or runtime text ‘Informational’. The output ‘This is Informational Message’ gets displayed on the seperate informational dialog box.

A SAP message is an essential part of any ABAP program and are used to display information to the user to let them know what’s happening. This could be in a number of ways such as an error message, warning message or information message. 

The following ABAP code is the simplest way to implement a message into your report. 

    MESSAGE ‘Display this message’ TYPE ‘E’.

SAP Message Classes 

A better way to implement your messages would be to create and maintain them via a message class using transactions SE91 or SE80. This way you have a central store for all messages, which makes it easier to maintain. This is especially true if your messages need to be translated into multiple languages. Enter your text here…

To do this you first need to create a message class which is a kind of container/wrapper where you store related messages together. Once this is done you can add as many message as you require into it. You also get the option to create additional long text, which offers the user additional information about the particular issue. See the following link for more information and details of how to create a message class. 

Once you have created your message you can use them within your ABAP code using the following syntax: 

  MESSAGE E001(MCLASS). 

MESSAGE = ABAP statement 
E = Type of message (can also be I,W,S,A,X) 
001 = Message number 
MCLASS = Message Class 

Pass message Parameters

You can also add parameters to your messages using the «&» character. So for example you could create the following message ‘Purchase order & has been deleted’. You can then pass a purchase order number to the message when using it and it will replace the «&» with the purchase order you pass for example 

    MESSAGE E001(MCLASS) with ekko-ebeln. 

The result would display 
«Purchase order 1234 has been deleted» 

Further information about message types 

I — Information messages 
Information message 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 and error message and is displayed along the footer of the SAP screen and stops processing going any further. 

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 runtime error and short dump which is also viewable in tcode ST22. 

X — Exit 
An exit message stops processing and displays and exit button which exits session processing. Similar to typing /n into the SAP command box. 

SAP Standard Messages classes

Messages are usually used to tell the user what is going on. The following types of messages are available in ABAP.

A Termination The message appears in a dialog box, and the program terminates. When the user has confirmed the message, control returns to the next-highest area menu.
E Error Depending on the program context, an error dialog appears or the program terminates.
I Status The message appears in a dialog box. Once the user has confirmed the message, the program continues immediately after the MESSAGE statement.
S Error The program continues normally after the MESSAGE statement, and the message is displayed in the status bar of the next screen.
W Warning Depending on the program context, an error dialog appears or the program terminates.
X Exit No message is displayed, and the program terminates with a short dump. Program terminations with a short dump normally only occur when a runtime error occurs.

The syntax for issuing a message is as follows.

MESSAGE <message> TYPE <message type>.

We can issue a status message as follows. Status message will be displayed in the status bar. After the message is displayed the program continues after the MESSAGE statement.

MESSAGE 'This is a status message' TYPE 'S'.

status-message

Information message will be displayed in a dialog box. Once the user has confirmed the message, the program continues immediately after the MESSAGE statement.

MESSAGE 'This is an information message' TYPE 'I'.

info-message

Error message in report programs will be displayed in the status bar and when the user press enter, the program terminates.

MESSAGE 'This is an error message' TYPE 'E'.

error-message

Warning message behaves similar to error message in report programs.

Exit Message – No message is displayed, and the program terminates with a short dump. Short dumps can be viewed in t-code ST22.

MESSAGE 'This produces short dump' TYPE 'X'.

short-dump-message

Termination Message appears in a dialog box, and the program terminates. When the user has confirmed the message, control returns to the next-highest area menu.

MESSAGE 'This is termination message' TYPE 'A'.

termination-message

Instead of hardcode the message text in the program we can maintain the message text in text symbols. In order to maintain text symbols use the menu path Goto->Text Elements->Text Symbols in ABAP editor.

text-symbols-messages-1

In the text symbols screen we can maintain the messages with a 3 character identifier.

text-symbols-messages-2

Then use the following message statement.

MESSAGE text-001 TYPE 'I'.

text-symbols-messages-3


Оператор MESSAGE служит для диалогового взаимодействия с пользователем. Существует шесть типов сообщения.

Тип Описание
S Status (Success). Сообщение отображается в статусной строке и не влияет на работу программы. Данный вид сообщения применяется для информирования об успешной выполнении операции.
status-message
W Warning. Предупредительные сообщения отображаются в статусной строке. При возникновении сообщения работа программы прерывается, а пользователю предоставляется возможность вносить исправления в полях для ввода. При нажатии на Enter в диалоговом режиме, работа программы будет восстановлена.
warning-message
E Error. Сообщение отображается в статусной строке. При возникновении данного вида сообщения обработка программы останавливается.
error-message
I Information. Информационное сообщение отображается в отдельном модальном окне. При возникновении сообщения работа программы прерывается. После закрытия диалога работа программы восстанавливается.
imformation-message
A Abend (Abort). Сообщение отображается в модальном окне. При возникновении сообщения программа завершается, а система возвращается в меню более высокого уровня. Сообщения стоит применять только в крайних ситуациях.
abend-message
X Exception. Сообщение инициирует дамп MESSAGE_TYPE_X. Данный вид сообщения стоит применять в ситуациях, когда нужно проанализировать что именно привело к ошибке во время выполнения.
x-message

Синтаксис

MESSAGE { msg | text | exception }
{ { [DISPLAY LIKE dtype] [WITH dobj1 … dobj4] }
| { [DISPLAY LIKE dtype] [WITH dobj1 … dobj4] RAISING exception }
| { [WITH dobj1 … dobj4] INTO text } }.

После вызова оператора MESSAGE заполняются системные поля

Поле Значение
sy-msgid Содержит класс сообщения
sy-msgno Содержит номер сообщения
sy-msgty Содержит тип сообщения (S,I,W,E,A,X)
sy-msgv1 .. sy-msgv4 Содержит данные сообщения, указанные после добавления WITH

Для вывода сообщений используются классы сообщений, которые создаются в тр. SE91
se91

MESSAGE — msg

При выводе сообщений нужно указать: класс, номер и тип сообщения

MESSAGE tn(id)
MESSAGE tn
MESSAGE ID mid TYPE mtype NUMBER num.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

*&———————————————————————*

*& Report  Z_MESSAGE

*& Возможности оператора MESSAGE

*&———————————————————————*

*& Примеры использования оператора MESSAGE

*& http://abap4.ru/?p=360

*&———————————————————————*

REPORT z_message MESSAGE-ID 00.

START-OF-SELECTION.

  PERFORM main.

FORM main.

  » Краткая запись

  MESSAGE s002(00).

  » Краткая запись. Класс сообщения указывается в MESSAGE-ID программы

  MESSAGE s002.

  » Полная запись с указанием класса, типа и номера в отдельных полях

  MESSAGE ID ’00’ TYPE ‘S’ NUMBER ‘002’.

ENDFORM.

Результат работы программы
Класс сообщения 00, номер сообщения 002

MESSAGE — text

MESSAGE text TYPE mtype.

В также MESSAGE можно передать свободный текст. В этом случае класс сообщения будет 00, номер сообщения 001. Данный вариант обычно используют когда нет возможности определить сообщения в SAP, например когда текст сообщения формируется во внешних системах.

*&———————————————————————*

*& Пример вывода текста

*& http://abap4.ru/?p=360

*&———————————————————————*

REPORT z_message.

START-OF-SELECTION.

  PERFORM main.

FORM main.

  MESSAGE ‘Текст сообщения’ TYPE ‘I’.

ENDFORM.

Результат работы программы
free-text
В системных полях будет сообщение базисного класса 001(00)
free-text-sy

MESSAGE — exception

MESSAGE oref TYPE mtype.

В также MESSAGE можно передать исключение. Результат будет аналогичен выводу исключения.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

*&———————————————————————*

*& Пример вывода исключения

*& http://abap4.ru/?p=360

*&———————————————————————*

REPORT z_message.

START-OF-SELECTION.

  PERFORM main.

FORM main.

  DATA lr_root TYPE REF TO cx_root.

  DATA lv_value TYPE i.

  TRY .

    lv_value = 1 / 0.

  CATCH cx_root INTO lr_root.

    MESSAGE lr_root TYPE ‘I’.

  ENDTRY.

ENDFORM.

Результат работы программы
devide-by-zero
Значения системных полей
devide-by-zero-sy

MESSAGE — WITH

MESSAGEWITH dobj1 … dobj4.

Сообщения могут содержать параметры, которые передаются через дополнение WITH. Пример вывода сообщения 076(va) с двумя параметрами.
076(va)

*&———————————————————————*

*& Вывод сообщения с параметрами

*& http://abap4.ru/?p=360

*&———————————————————————*

REPORT z_message.

START-OF-SELECTION.

  PERFORM main.

FORM main.

  MESSAGE i076(va) WITH ‘TESTVAR’ syrepid.

ENDFORM.

Результат работы программы
message-with

MESSAGE — DISPLAY LIKE

MESSAGEDISPLAY LIKE dtype.

При использовании дополнения DISPLAY LIKE, происходит замена иконки на специфичную для типа, указанного в dtype. В dtype можно передать одно из следующих значений: A, E, I, S или W. Данное дополнение нельзя использовать для сообщения типа X, оно всегда вызывает дамп. DISPLAY LIKE обычно используется в ситуациях, когда нужно отобразить ошибку, но не прерывать выполнение программы.

*&———————————————————————*

*& Пример использования DISPLAY LIKE

*& http://abap4.ru/?p=360

*&———————————————————————*

REPORT z_message.

START-OF-SELECTION.

  PERFORM main.

FORM main.

  MESSAGE ‘Ошибка в модальном окне’ TYPE ‘I’ DISPLAY LIKE ‘E’.

ENDFORM.

Результат работы программы
i-as-e

MESSAGE — INTO

MESSAGEINTO text.

При использовании дополнения INTO, в переменную text записывается короткий текст сообщения. Само сообщение при этом, не отображается. Данное дополнение обычно применяют в двух случаях: когда нужно получить текст сообщения; когда нужно заполнить системные переменные для дальнейшего использования, например, для журнала приложений.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

*&———————————————————————*

*& Пример использования MESSAGE INTO

*& http://abap4.ru/?p=360

*&———————————————————————*

REPORT z_message.

START-OF-SELECTION.

  PERFORM main.

FORM main.

  DATA lv_text TYPE text120.

  MESSAGE e036(60) WITH ‘2100’ INTO lv_text. » Балансовая единица «&» неизвестна (ввести существующую БЕ).

  WRITE: / ‘TEXT: ‘, lv_text.

  WRITE: / ‘SY-MSGID: ‘, symsgid.

  WRITE: / ‘SY-MSGTY: ‘, symsgty.

  WRITE: / ‘SY-MSGNO: ‘, symsgno.

  WRITE: / ‘SY-MSGV1: ‘, symsgv1.

  WRITE: / ‘SY-MSGV2: ‘, symsgv2.

  WRITE: / ‘SY-MSGV3: ‘, symsgv3.

  WRITE: / ‘SY-MSGV4: ‘, symsgv4.

ENDFORM.

message-into

MESSAGE — RAISING

MESSAGERAISING exception.

Оператор MESSAGE вместе с дополнением RAISING представляет собой комбинацию операторов MESSAGE и RAISE. Данное дополнение имеет смысл только во время обработки методов и функциональных модулей, в которых определено исключение старого типа (основанного не на классах). Если вызывающий метод или функциональный модуль обрабатывает данное исключение в EXCEPTIONS, то MESSAGE .. RAISING работает аналогично оператору RAISE. Если же вызывающей стороне исключение не обрабатывается, то RAISING игнорируется.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

*&———————————————————————*

*& Пример использования MESSAGE RAISING

*& http://abap4.ru/?p=360

*&———————————————————————*

REPORT z_message.

CLASS c1 DEFINITION.

  PUBLIC SECTION.

    CLASS-METHODS m1 EXCEPTIONS exc1.

ENDCLASS.

CLASS c1 IMPLEMENTATION.

  METHOD m1.

    MESSAGE ‘Сообщение с RAISING’ TYPE ‘I’ RAISING exc1.

  ENDMETHOD.

ENDCLASS.

START-OF-SELECTION.

  PERFORM main.

FORM main.

  c1=>m1( ).                      » Отработает MESSAGE

  c1=>m1( EXCEPTIONS exc1 = 4 ).  » Отработает RAISING

  IF sysubrc = 4.

  ENDIF.

ENDFORM.

abap

Message types in ABAP as in every programming language are used to give information to the user or programmer about the status of the programming code execution. In ABAP there are 6 types of messages, which are available:

Type A (abend – abnormal end of task)

Type A (abend – abnormal end of task) means termination of the program. The message appears in a dialog box and the program terminates. The user is not able to make any further entries. The task is terminated and the system returns to a high-level menu. Messages of type A should be issued only in extraordinary circumstances, such as serious system errors. A-messages should be avoided, if possible.

Type E (error)

Type E is for error messages. An error message appears and the program stops. These messages are wide used. They can prevent the user from creating inconsistent records. They can point to a prerequisite to be fulfilled.

Type I (information)

Messages from type I are information only. The program is executed and information is displayed. After the user confirms the message, the program continues.

Type S (success, status)

Type S (success, status) messages only give information about the execution of the program. The only display the status of the program.

Type W (warning)

Waring messages are with type W. They are used to display information for the user, which warns the user for possible problems, but they don’t stop the program. The user can than perform corrections.

Type X (exit)

Messages from type X (exit) are the popular ABAP short dumps. The program terminates and the detailed information can be found in transaction ST22, searching by the user and the time of the error.

Syntax

The syntax for message is MESSAGE <message> TYPE <message type>.

For example if we want to display a warning message:

MESSAGE ‘This is a warning message.’ TYPE ‘W’.

The usage of messages can vary in the different programs and functional requirements. The programmer should carry for the proper and good professional usage of messaging.

Check also the meaning of SY-SUBRC here.

REPORT zdemomessages.

*&———————————————————————&*

*& Program Description:                                               &*

*& ————————                                            &*

*& This demo program will demonstrate the different types of SAP ABAP &*

*& messages.                                                          &*

*&                                                                    &*

*& Author:  ABAPCOOKBOOK                                              &*

*& Website: www.abapcookbook.com                                      &*

************************************************************************

************************************************************************

* SELECTION SCREEN                                                     *

************************************************************************

PARAMETERS:

  rb_msg01 RADIOBUTTON GROUP msg DEFAULT ‘X’,   » Success Message

  rb_msg02 RADIOBUTTON GROUP msg,               » Error Message

  rb_msg03 RADIOBUTTON GROUP msg,               » Warning Message

  rb_msg04 RADIOBUTTON GROUP msg,               » Information Message

  rb_msg05 RADIOBUTTON GROUP msg,               » Abend/Termination Message

  rb_msg06 RADIOBUTTON GROUP msg.               » Exit Message

************************************************************************

* SAMPLE CODE LOGIC FOR DEMONSTRACTION PURPOSES                        *

************************************************************************

START-OF-SELECTION.

  CASE ‘X’.

*   Success Message.

*   A success message appears along the SAP Logon footer (in green)

*   and processing is not stop.

    WHEN rb_msg01.

        MESSAGE ‘This is an example of a SUCCESS message.’ TYPE ‘S’.

*   Error Message.

*   Error message appears along the SAP Logon footer (in red) and

*   processing is stopped.

    WHEN rb_msg02.

      MESSAGE ‘This is an example of an ERROR message.’ TYPE ‘E’.

*   Warning Message.

*   Warning message is similar to error message, however depending

*   on the context, error message may appear or program terminated.

    WHEN rb_msg03.

      MESSAGE ‘This is an example of a WARNING message.’ TYPE ‘W’.

*   Information Message.

*   An information message appears in a popup window, processing halt.

*   When the user close the information message, processing resume.

    WHEN rb_msg04.

      MESSAGE ‘This is an example of an INFORMATION message.’ TYPE ‘I’.

*   Abend/Termination Message.

*   A termination message will stop processing and an exit button will

*   appears which will exit the session.

    WHEN rb_msg05.

      MESSAGE ‘This is an example of a TERMINATION message.’ TYPE ‘A’.

*   Exit Message.

*   An exit message will normally terminated the program. Usually, a

*   stack dump for the state of the system is raised (can be viewed in ST22).

    WHEN rb_msg06.

      MESSAGE ‘This is an example of an EXIT message.’ TYPE ‘X’.

  ENDCASE.

Понравилась статья? Поделить с друзьями:
  • Warning to avoid system error please do not press and hold the power button перевод
  • Warning there was an error checking the latest version of pip
  • Warning system boot fail как исправить
  • Warning smart self test log structure error invalid smart checksum
  • Warning ribbon in zebra ошибка на принтере