Show TOC

Basis Class CL_BSP_ELEMENTLocate this document in the navigation structure

Definition

The CL_BSP_ELEMENT class supplies a standard implementation of the interface IF_BSP_ELEMENT. This basis interface basically provides a series of methods and attributes that are used as a framework for the implementation of individual elements in BSP extensions.

Use

The standard implementation of the class CL_BSP_ELEMENT provides the common basic functions for all element handler classes. To implement specific functions of a BSP element, you must overwrite certain interface methods in the element handler class and possibly also create new ones there.

See also: Implementing Element Handler Classes

Methods

Interface Methods for Validation

COMPILE_TIME_IS_VALID

Determines at compile time whether correct values have been assigned to element attributes. The validation result is written to the return parameter valid.

The possible values for valid are: 'X' or ' ' (blank).

For information on how you can overwrite this method in the element handler class, refer to the example given for user-defined validation.

RUNTIME_IS_VALID

Determines at runtime whether correct values have been assigned to element attributes. For more information, refer also to the example for user-defined validation.

Recommendation

By calling the runtime method <Elementname>->RUNTIME_IS_VALID with the special argument '/*/', you can prevent termination from happening at activation if the string with runtime attributes (arg_1/arg_2/...) becomes too long (maximum length is 200 characters) and thus overflows.

Interface Methods to Influence Element Flow and Element Content

DO_AT_BEGINNING

This method is always accessed at the beginning of the element call when the BSP page is processed.

Using the return parameter RC, you can control whether the content of the current BSP element is to be evaluated or not. The possible values of the return parameter RC are therefore:

CO_ELEMENT_CONTINUE and CO_ELEMENT_DONE.

For an example of the implementation, refer to the section Iteration Through Element Content.

DO_AT_END

This method is accessed, whatever the case, at the end of the element call. Since the entire element content is available at this point, this method can be used for Manipulation of the Element Content.

Using the return parameter RC, you can control whether the entire BSP page is to be evaluated further or not. The possible values are therefore:

CO_PAGE_CONTINUE and CO_PAGE_DONE.

Interface Methods for Accessing Parent Nodes

GET_CLASS_NAMED_PARENT

Returns an arbitrary parent element that is identified by the element handler class.

GET_ELEMENT_NAMED_PARENT

Returns an arbitrary parent element that is identified by the name of the extension and the name of the element.

GET_DIRECT_PARENT

Returns the direct parent element.

Interface Method for Error Handling

RAISE_ERROR

Triggers an exception of the class CX_BSP_ELEMENT_EXCEPTION.

Interface Method for Accessing the Content of the BodyWriter

GET_PREVIOUS_OUT

Returns the reference to the BodyWriter of the surrounding element.

Attributes

General Interface Attributes

ID

BSP element ID

M_NAME

BSP element name

M_EXTENSION

BSP extension name

M_CLASS_NAME

Name of the element handler class

M_PARENT

Reference to a parent element

M_PAGE_CONTEXT

Reference to the page context ( IF_BSP_PAGE_CONTEXT)

Predefined Interface Constants

CO_PAGE_DONE

This constant defines that the BSP page is not to be evaluated further.

CO_PAGE_CONTINUE

This constant defines that the BSP page is to be evaluated further.

CO_ELEMENT_DONE

This constant defines that the BSP element is not to be evaluated further.

CO_ELEMENT_CONTINUE

This constant defines that the BSP element is to be evaluated further (once more).

Interface Attribute for the BodyWriter

M_OUT

Reference to the BodyWriter that manages the element content.

Interface Attributes for Validation

M_VALIDATOR

Static validator (for all class instances) that is used for runtime validation. Instances of this object are created only if the option Iteration Through Element Content has been explicitly set for the element.