ABAP Message Error Handling Standards - ABAP Development - SCN Wiki

ABAP Message Error Handling Standards - ABAP Development - SCN Wiki
ABAP Message/Error Handling StandardsPurposeThe message handling process varies depending on the type of programming, functional requirements, run time environment and modularization. ABAP errors occur for the same reasons that errors occur in other programming languages (e.g., record not found, type mismatch, record locked, etc.)The following sections detail the proper way to handle certain types of messages in certain situations. The list is not comprehensive and the programmer is responsible for using good professional judgment for the cases that are not covered below.MessagesABAP programs should use the MESSAGE statement to output messages to inform of necessary runtime activity.For executable program, the message-id should be defined in the REPORT statementCustom messages should be created and maintained as a message class in transaction SE91 by related applications (SD, FI, Interface, Report), or, specific to a program if it does not fit into a general custom application specific message class.The message text should be defined as a concise text describing the runtime message. Substrings (&) should be used to identify the variable that is specific for the message.ExampleREPORT z…. MESSAGE-ID z1.……IF sy-subrc EQ 0.    MESSAGE S001 WITH mara-matnr.    “Material & has been updatedENDIF.For large development projects a common message class “ZCA” (cross-application) should be created.  This message class should contain all common messages used by add-on programs.  Messages within this class can be used with the format: MESSAGE Ennn(ZCA)E          = Message Type (‘I’, ‘W’, ‘S’, ‘E’, ‘A’)nnn      = Message number within ZCOMMONThe long text option in the message should be used to define the action.SAP Message Types (format = a) Code Type Action Description I Informational Press ENTER to continue It contains information about operations already performed and can be safely ignored without any consequences. W Warning Correction possible It provides information about the consequences of certain actions. These messages cannot be ignored but the user can choose whether or not to make a correction or bypass the message. E Error Correction required It contains information about processing errors. The system interrupts the current processing so that the errors can be corrected. Only then can processing continue. A Abend Transaction terminated It provides information about processing errors but the processing cannot be resumed. X Exit Transaction terminated with short dump It provides no processing information, but rather, a stack dump for the state of the system. S Success Message on next screen It contains normal information which is show in screen. Return Co


desABAP System Field SY-SUBRCMessages in ABAP are handled, in most cases, by the system field SY-SUBRC which retains the value of the return cod

Word文档免费下载Word文档免费下载:ABAP Message Error Handling Standards - ABAP Development - SCN Wiki (共3页,当前第1页)

ABAP Message Error Handling Standards ABAP Development SCN Wiki相关文档

最新文档

返回顶部