Show TOC

Defining BSP ElementsLocate this document in the navigation structure

Use

You create individual elements for a BSP extension and these are inserted later on as tags in BSP pages. Each BSP element has a handler class assigned to it that implements its specific functions. Also, you can create and declare attributes for each BSP element.

Prerequisites

The BSP extension already exists.

Procedure

Creating BSP Elements

  1. Choose the required BSP extension from the object list.

  2. Choose the function Start of the navigation path Create Next navigation step BSP Element End of the navigation path from the context menu.

    The system displays the Create BSP Element dialog box.

  3. Enter the name of the BSP element, a valid name for the Element Handler Class , and a meaningful description for the BSP extension as a short text .

    Recommendation

    You can specify an existing, valid ABAP class as the element handler class. A valid class must support the interface IF_BSP_ELEMENT .

    We recommend that you derive this class from the automatically- generated basis class (Z)CLG_<name of BSP extension>_<name of BSP elements> . This basis class already contains a standard implementation of the interface methods and is automatically updated whenever changes are made to the element data.

    As a rule, you enter the name of a non-existing class as the element handler class into the respective input field. Then you have this generated, together with the corresponding basis class.

  4. Choose Continue to confirm your entries.

    The properties of the created BSP element are displayed in the editor.

Defining Attributes of the BSP Element

You can enhance the definition of a BSP element with a series of attributes. On the one hand, you can change the element content from the standard value. On the other hand, it is possible to access the element content through Further Options for the element and change it, thus influencing the flow logic.

For more details, refer to:

Furthermore, you have the following options available to you:

Declaring Attributes for a BSP Element

To create attributes for a BSP element, choose the Attributes tab in the element view and, if necessary, switch to change mode.

To create and declare an attribute, make the following specifications:

Specification

Mandatory?

Description

Attribute

Yes

In this column, enter a name that uniquely identifies the attribute.

After you have activated the BSP extension , the system generates a public attribute with the same name in the basis class ( CLG_* or ZCLG_* ).

Required

By setting this flag, you define that the attribute must be specified whenever the BSP element is used in a BSP page.

Dynamic value allowed

By setting this flag, you define that the value of the attribute in a BSP page may also be specified dynamically through a BSP expression (<%= ...%>). Otherwise, only static values are possible in the form of a string.

Pass by reference

By setting this flag, you define that the attribute is passed to the event handler class as a reference. Otherwise, a value is passed.

For further information, see: Pass by Reference for Attributes .

Kind of typing

Yes

You have at your disposal the two types TYPE and TYPE REF TO, depending on whether you have data or object references.

Note that the selection TYPE REF TO is only appropriate in combination with the active option Dynamic Value Allowed . The reason for this is that object references in BSP pages can only be passed with the help of BSP expressions, not statically in the form of a string.

Reference type

Yes

As reference type, you can use the elementary ABAP types (however, no generic types) or object types (classes and interfaces). Generic types such as C, N, X, P, and so on are not allowed because generically-typed attributes are not allowed in ABAP classes either. There is a 1:1 relationship between the attributes of the BSP element and the class attributes.

Default value

Here you always enter a value if the attribute is to be predefined with a value. This value is copied from the Tag Browser into the BSP page when you insert the attribute or the entire BSP element.

Description

Here you enter an explanatory attribute description.

Result

The new BSP element is assigned as a subobject to the BSP extension and copied inactive into the object list.

With the new BSP element, the basis class (Z)CLG_<name of BSP extension>_<name of BSP elements> is automatically created itself, and possibly also the specified element handler class, provided this does not yet exist.

Also, you have specified the BSP element behavior at runtime through further properties, and have also declared the corresponding attributes. In the next workstep, you can activate the BSP extension