Show TOC

Object documentationFault Messages Locate this document in the navigation structure

 

A fault message is a message that describes an application-specific error situation.

 

The proxy generation functions generate exception classes for fault messages. If an application triggers an exception using such an exception class, the ABAP proxy runtime automatically converts it to a fault message. Using the fault message, the application records an application error (for example, "Requested Customer Profile Unknown").

Structure

  • The structure of the fault message is described in the WSDL document and is not restricted.

  • Fault messages in PI are described by standardized fault message types in the Enterprise Services Repository, which are converted to the corresponding structure in the WSDL document (see below).

Standardized Structure for Fault Messages in PI

In PI, you can pass information about the error cause to the exception class generated from the fault message using the following structure:

This graphic is explained in the accompanying text.

The defined structure STANDARD contains fields essential for forwarding the error. The structure ADDITION can be used freely by the application.

Example

To send a fault message, complete the generated structure for the fault message and trigger the exception with the corresponding exception class:

data: l_standard_data type <Standard Fault Data Type>,

      l_detail_data type <Detailed Structure for Standard Fault Data Type>,

      l_additional_data   type <Application Error Data Type>.

l_standard_data-fault_text = <Error Text>.

l_standard_data-fault_url = <Error URL>.

l_detail_data-severity = <System Error Category>.

l_detail_data-text = <System Error Text>.

l_detail_data-id = <System Error ID>.

l_detail_data-url = <System Error URL>.

append l_detail_data to l_standard_data-fault_detail.

l_additional_data = <Application Error Information>

RAISE EXCEPTION TYPE <Name of Exception Class>.

   EXPORTING

      standard = l_standard_data

      addition = l_additional_data

If you use the application log, or have access to error information from a BAPI return table, you can also use these directly to complete the fault message. In this case, you only need to call the method CL_PROXY_FAULT=>RAISE of the proxy runtime to trigger the error:   

CALL METHOD cl_proxy_fault=>raise

EXPORTING

   exception_class_name = <Name of Exception Class>

   application_log_handle = <Application Log: Protocol Handle>

   bapireturn_tab = <Table witht BAPI Return Information>

If you transfer neither a handle of an application log nor a table with BAPI return information, the method completes the standard data of a fault message as follows:

faultText

Fault message text in the Enterprise Services Repository (shortened to 60 characters).

faultUrl

URL on the long text of this message in the Enterprise Services Repository.

The following additional fields are completed for the data from the application log or the BAPI return table:

faultDetail-severity

The ABAP message type is mapped to this field as follows:

ABAP field MSGTY

Fault Message Field faultDetail-severity

A (Abend)

error

E (Error)

error

W (Warning)

warning

S (Success)

information

I (Information)

information

faultDetail-text

Formatted T100 message text (in the language in which the service was executed).

faultDetail-url

URL to the T100 long text (if available).

faultDetail-id

Connection from work area and message number (for example, "XY(007)").

Representation of Data in SAP NetWeaver PI

In the asynchronous case, you can see a fault message in the PI monitoring. For example, in technical monitoring you can display the fault message in a more readable format by choosing Further Information on Error. In the synchronous case, you can integrate a format of this type into your application on the caller side by using the method CL_PROXY_FAULT=>SHOW.