SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Declarations → Declaration Statements → Classes and Interfaces → Components in Classes and Interfaces → Methods →Syntax Forms
General Instance Methods
1. METHODS meth [ABSTRACT|FINAL]
[IMPORTING parameters [PREFERRED PARAMETER p]]
[EXPORTING parameters]
[CHANGING parameters]
[{RAISING exc1|RESUMABLE(exc1) exc2|RESUMABLE(exc2) ...}
|{EXCEPTIONS exc1 exc2 ...}].
Functional Instance Methods
2. METHODS meth [ABSTRACT|FINAL]
[IMPORTING
parameters [PREFERRED PARAMETER p]]
[EXPORTING parameters]
[CHANGING parameters]
RETURNING VALUE(r) typing
[{RAISING exc1|RESUMABLE(exc1) exc2|RESUMABLE(exc2) ...}
|{EXCEPTIONS exc1 exc2 ...}].
Instance Constructors
3. METHODS constructor [FINAL]
[IMPORTING
parameters [PREFERRED PARAMETER p]]
[{RAISING exc1|RESUMABLE(exc1) exc2|RESUMABLE(exc2) ...}
|{EXCEPTIONS exc1 exc2 ...}].
Event Handlers
4. METHODS meth [ABSTRACT|FINAL]
FOR EVENT evt OF {class|intf}
[IMPORTING p1 p2 ... [sender]].
Redefinition of Instance Methods
5. METHODS meth [FINAL] REDEFINITION.
Test Methods
6. METHODS meth [ABSTRACT|FINAL]
FOR TESTING
[{RAISING exc1|RESUMABLE(exc1) exc2|RESUMABLE(exc2) ...}].
Effect
The statement METHODS declares or redefines an instance method meth. For the name meth, the naming conventions apply.
Instance methods are bound to objects. To use instance methods, an object of the class must first be created. In instance methods, all components of the same class can be accessed without a component selector.
Use the variants of statement METHODS to distinguish between the following kinds of method declarations: