Skip to content

Latest commit

 

History

History
489 lines (303 loc) · 5.78 KB

cl-bali-exception-setter-interface-if-bali-exception-setter-f6be5a9.md

File metadata and controls

489 lines (303 loc) · 5.78 KB

CL_BALI_EXCEPTION_SETTER (Interface IF_BALI_EXCEPTION_SETTER)

To add a new exception to an application log, an object of class CL_BALI_EXCEPTION_SETTER is used. The public interface of the instance methods is IF_BALI_EXCEPTION_SETTER. It contains the interface IF_BALI_ITEM_SETTER.

Public Attributes

Name

Description

CATEGORY

(from IF_BALI_ITEM_SETTER)

Category of the item

Contains fixed value: IF_BALI_CONSTANTS=>C_CATEGORY_EXCEPTION

Public Methods

Create an instance of the exception class. Set the reference of the ABAP exception which is stored in the exception item and its severity:

CREATE (static)

Name

Description

Importing parameters

SEVERITY

(Optional): Severity of the message ('Error', 'Warning', etc)

Default: IF_BALI_CONSTANTS=>C_SEVERITY_STATUS

EXCEPTION

Reference to ABAP exception class instance

Returning parameter

EXCEPTION_OBJ

Exception object: A reference to interface IF_BALI_EXCEPTION_SETTER

Set the ABAP exception class instance and severity:

SET_EXCEPTION

Name

Description

Importing parameters

SEVERITY

(Optional): Severity of the message ('Error', 'Warning', etc)

Default: IF_BALI_CONSTANTS=>C_SEVERITY_STATUS

EXCEPTION

Reference to ABAP exception class instance

Returning parameter

NEW_EXCEPTION_OBJ

Reference to current application log exception object

Set the level of detail of the exception:

SET_DETAIL_LEVEL

Name

Description

Importing parameter

DETAIL_LEVEL

Detail level of the exception

Allowed values: Number between '1' and '9' or ' '

Returning parameter

NEW_EXCEPTION_OBJ

Reference to current application log exception object

Set the exception context using a data dictionary structure:

SET_CONTEXT

Name

Description

Importing parameter

CONTEXT

Structure with the context data

Returning parameter

NEW_EXCEPTION_OBJ

Reference to the current application log exception object

Exceptions (inherit from CX_BALI_RUNTIME)

CX_BALI_INVALID_PARAMETER

  • Field CONTEXT is not based on a database table or structure that is defined in the data dictionary

  • The total size of field CONTEXT is longer than 256 characters

Get all exception values:

GET_ALL_VALUES

Name

Description

Exporting parameters

DETAIL_LEVEL

Detail level of the exception (number between '1' and '9' or ' ')

SEVERITY

Severity of the exception ('Error', 'Warning', etc)

EXCEPTION

Reference to ABAP exception class instance

CONTEXT_DATA

Structure and content of the context. CONTEXT_DATA has the following fields:

  • STRUCTURE_NAME: Name of the data dictionary structure which was used for the context data

  • CONTENT: The content of the context data. The content is stored in a character field with a length of 256 characters

Check whether the exception can pass an item filter:

CHECK_PASSING_ITEM_FILTER (from IF_BALI_ITEM_SETTER)

Name

Description

Importing parameter

ITEM_FILTER

Reference to the item filter that is being checked

Returning parameter

FILTER_PASSED

If set, the exception can pass the item filter

Note:

If the severity of the exception contains a value which is not allowed, it is changed to IF_BALI_CONSTANTS=>C_SEVERITY_DEFAULT. Allowed values of the severity can be found in interface IF_BALI_CONSTANTS.

If the detail level of the exception contains a value which is not allowed, it is changed to IF_BALI_CONSTANTS=>C_DETAIL_LEVEL_DEFAULT. Allowed values of the detail level are a number between '1' and '9' and ' '.