Show TOC

Background documentationController Attributes Locate this document in the navigation structure

 

You can define local attributes for every type of controller. Like the private instance attributes of a class, these can be used locally in all methods of the view or the controller.

You can assign these attributes the characteristic Public and in this way are known beyond the limits of their own controllers within the surrounding component.

Two attributes are automatically created when a controller is created:

  • WD_CONTEXT

  • WD_THIS

Name

The attribute ID can consist of the alphanumeric characters and the special character underline (_). The ID must not begin with a figure, an underline or the letter combination WD.

Caution Caution

The IDs for attributes, events, actions and methods share the same namespace within the view/controller – that is, an attribute cannot have the same name as an event, an action or a method.

End of the caution.
Public

Use this checkbox to decide whether the attribute’s visibility remains restricted to the corresponding controller (default setting), or whether the attribute is visible and can be used within the entire surrounding component.

Reference Type

All types that are entered in the ABAP Dictionary are permitted as reference types for an attribute, as are all data types that are created. Furthermore, references to classes and interfaces can also be used as reference types. In this case you have to select the field belonging to the attribute in the RefTo column.

WD_CONTEXT

WD_CONTEXT always has the reference type IF_WD_CONTEXT_NODE and is a reference to the local controller context.

You can find more information about interface IF_WD_CONTEXT_NODE in the system in the relevant system documentation.

WD_THIS

This attribute is a self-reference to the local interface of the corresponding controller. Since each controller has a unique local interface, every WD_THIS attribute also has a unique reference type.

More information: Programming Controller Methods.