Definition of Methods for an Object Type
(BOR)
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.
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.
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.

You cannot
edit a method in the list of methods displayed, which was inherited from the
supertype or
an interface. But you can redefine an inherited method by selecting it and
choosing
. You can then edit
the method.
You normally change the implementation of inherited methods in the implementation program of the object type to adapt it to the object type. The ID of the method is not changed.
You cannot change or delete the inherited parameters and exceptions that define the interface of the method. You can, however, add further parameters and exceptions
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 the new method is based on a function module, you should answer the question with YES. You are then supported by a wizard in the definition of the method.
If you do not set the indicator Dialog on the tab page General, the method is executed in the background at runtime.

You cannot trigger any messages, error messages or warnings in the implementation of these methods, because they are not evaluated by the system and terminate the program.

If you implement a background method with a function module, you must return any exception and error situations using the interface of the function module and include them in the method exceptions.
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, refer to
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. 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.

Define the method in full to simplify the implementation of the method in the implementation program of the object type.
For
implementation examples, refer to
Implementation of
Method ExistenceCheck
and
Creating an "Execute
Together" Method.
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