Show TOC

Logging an ExceptionLocate this document in the navigation structure

Use the method LOG_STEP_COMPLETION_EXCEPTION of class /IWFND/CL_LOGGER to log an exception and to log the completion of the step which ended with this exception. The message type is not required as it is always an error.

Note

Note that for the backend system (where software component IW_BEP is deployed) a corresponding class exists called /IWBEP/CL_COS_LOGGER for OData Channel development.

This method creates the following log entries:

  • Completed step

  • The exception itself and corresponding description

The two entries are correlated, so the administrator can ascertain which exception log entry belongs to which step completion message.

Note

With regard to applications, don't forget to log each exception.

With regard to the framework, use this method to log the exceptions you have created or exceptions originating from an external system (backend, SAP Gateway).

Use the method LOG_STEP_COMPLETION for exceptions received from another SAP Gateway component and/or application. In this case, you only need to log the fact that the step ended with an exception.

  • External exceptions:

    For exceptions not of type /IWFND/CX_BASE, use the parameter IO_EXCEPTION_EXTERN. In this case, you must provide the parameters IV_MSG_ID, IV_MSG_NUMBER and IV_MSG_V1-4.

  • SAP Gateway exceptions:

    For SAP Gateway exceptions (of type /IWFND/CX_BASE), the message parameters can be maintained in the exception itself and do not need to be explicitly provided to the logger.

Parameter Name

Parameter Type

Optional

Data Type

Def. Value

IO_EXCEPTION

importing

X

/IWFND/CX_BASE

IWFND base exception

IO_EXCEPTION_EXTERN

importing

X

CX_ROOT

Abstract superclass for all global exceptions

IV_MSG_ID

importing

X

SYMSGID

Message class

IV_MSG_NUMBER

importing

X

SYMSGNO

Message number

IV_MSG_V1

importing

X

SYMSGV

Message variable

IV_MSG_V2

importing

X

SYMSGV

Message variable

IV_MSG_V3

importing

X

SYMSGV

Message variable

IV_MSG_V4

importing

X

SYMSGV

Message variable

IV_SYSTEM_ALIAS

importing

X

/IWFND/DEFI_SYSTEM_ALIAS

System alias

IS_OBJECT_KEY

importing

X

/IWFND/S_COR_ID

ID of the object whose processing caused the errors

IV_AGENT

importing

 

/IWFND/SUP_IW_AGENT

IW agent

IV_MSG_HANDLE

importing

X

BALMSGHNDL

Application Log: Message handle

IV_LOG_TO_CCMS

importing

X

/IWFND/SUP_LOG_CCMS

Flag for logging the message to CCMS