Definition of Methods for an Object Type (BOR)

Use

With a method you define a function with which you can edit, create, search for, or delete an object of this object type. The methods refer to ABAP functions (transactions, function modules, dialog modules, and so on) and make them available to the workflow system.

Prerequisites

Before you create a new method for an object type, check whether the desired function has already been defined as a method of an interface. If so, include this interface in the definition of your object type.

Features

You can also define the following data for each method:

  • Import parameters (for synchronous and asynchronous methods)

  • A result (only for synchronous methods)

  • Export parameters (only for synchronous methods)

  • Exceptions (only for synchronous methods)

You can declare one object type method as default method. For more information, see Editing the Basic Data of an Object Type.

To edit an existing method, you open it by double-clicking on the method ID.

Activities

To create methods for an object type, position the cursor on the name Methods (blue background), and select . Keep in mind the rules for naming object type components.

If you do not set the indicator Dialog on the tab page General, the method is executed in the background at runtime.

If you set the indicator Synchronous on the tab page General, you define a synchronous method. If you do not set it, you define an asynchronous method. For more information on implementation, see Programming Synchronous Methods and Programming Asynchronous Methods. These two types of method differ in their feedback properties. For more information, see Definition as Synchronous or Asynchronous Method.

If you set the indicator Result parameter on the tab page General, you must specify the data type reference of the result parameter on the tab page Result type.

If you set the indicator Instance-independent on the tab page General, no object reference is passed to the method when it is called. However, this method can create or establish an object (methods Create and Find). To inform the method caller of the reference to the generated object, the key field structure or key field established in the method must be passed on to the relevant variables OBJECT-KEY-... of the program. For more information on implementation, see Programming Instance-Independent Methods.

You enter the function to be executed when the method is called on the tab page ABAP/4. If a transaction is to be called, refer to the information in Method Implementation with CALL TRANSACTION.

If you want to define parameters or exceptions for the method, refer to the information in Definition of Method Parameters and Definition of Exceptions.

The system uses all the specifications you make when defining an object method with its method parameters and exceptions in the automatic generation of the source text of the implementation program.

For implementation examples, see Implementation of Method ExistenceCheck and Creating an "Execute Together" Method.

Further Procedure

Before the method is used, you must change its release status. To check the method you must generate the object type, after which you can test it. For more information, see Processing Object Types.

You can use macros to access the method. For more information, see Macro Instructions for Accessing Objects, Attributes, and Methods.