Show TOC

 Usage Types and Usage OperationsLocate this document in the navigation structure

A Usage Type determines the level of exposure of an object at a package interface or a client interface. Usage types are the user's perspective on ways of using an object.

Technically, such a "logical" way of using an object includes certain "technical" ways, i.e. Usage Operations. For example the usage type "derive a subclass" means using the name of the class, allowing references to the class, using public and protected section of the class and using the CLASS ... DEFINITION INHERITING FROM statement.

  • When exposing a development object at an interface, the set of permitted usage types can be specified for that object.
  • The potential set of permitted usage types is specific to the actual type of object.
  • One such usage type may optionally imply one other usage type. "Implies" means that the permissions granted by the "implied" usage type must also be granted by the implying usage type.
  • It is not necessary that all usage types imply another usage type or are implied by other usage types.
  • The total number of possible values of a usage type (that is, the sum of the value count in all dimensions) cannot be greater than 24 (twenty-four) per object type. An object type means the type of object that can be exposed at a package interface, client interface, etc. These object types do not need to match exactly a transport type (TADIR type) but can be subtypes of that (such as FORMs of a program).
  • Each usage type includes a set of usage operations. There must be at least one usage operation per usage type.
    Tip

    Actual package checking is done on the level of usage operations technically.

    Usage types for ABAP Objects Classes

This example shows the possible usage type for ABAP Objects classes:

  • "Access from Friend Classes", "Inheriting", and "Allow Event Handlers FOR ALL INSTANCES" can be set independently of each other
  • Each of them implies "Using the PUBLIC SECTION", implies "Referring" and so on.

The following are some examples for actual usage types:

  • For transparent tables:
    • Only the type of the table line can be used.
    • The table's contents can be read.
    • The table's content can be modified.
  • For classes (ABAP Objects), the above figure shows the implications of various Usage Types on ABAP Classes:
    • Naming: The client can use the name of the class (to declare friendship for example).
    • Referring: The client can only refer to the class, but cannot access it further. This still allows the client to declare reference variables, or to manage or pass around references to instances of the class.
    • Using: The client can only invoke public methods and access public attributes of the class being exposed.
    • Deriving: The client can also derive subclasses from the class being exposed.
  • For interfaces (ABAP Objects):
    • The client can only refer to the interface, but cannot access it further. This still allows the client to declare reference variables, or to manage or pass around references to instances of classes implementing the interface.
    • The client can invoke the interface's methods and access the interface's attributes on instances of classes implementing the interface being exposed.
    • The client additionally can create classes that implement the interface being exposed.