ABAP Objects Syntax Summary
ABAP Objects Syntax Summary
CLASS-POOL.
ENDCLASS
CLASS pc DEFINITION PUBLIC. " the public class of the class pool
ENDCLASS.
CLASS pc IMPLEMENTATION.
ENDCLASS.
Class definition:
CLASS c DEFINITION
[PUBLIC]
[ABSTRACT]
[FINAL]
[PUBLIC SECTION.
[PROTECTED SECTION.
[PRIVATE SECTION.
ENDCLASS.
CLASS c IMPLEMENTATION.
ENDCLASS.
*--- forward definition of class for mutual recursive references
Class components:
CLASS c DEFINITION.
{PUBLIC|PROTECTED|PRIVATE} SECTION.
TYPES … .
CONSTANTS … .
METHODS m REDEFINITION.
[CLASS-]EVENTS e [EXPORTING … ].
ENDCLASS.
Availability:
as of 4.5A: all components, except
as of 4.6A: METHODS : REDEFINITION , ABSTRACT ,
FINAL
Implementation of classes/methods:
CLASS c IMPLEMENTATION.
METHOD m1.
ENDMETHOD.
ENDCLASS.
Interface definition :
INTERFACE i.
ENDINTERFACE.
INTERFACE i DEFERRED.
*---
Availability:
as of 4.5A: all components, except
as of 4.6A: compound interfaces
Using OO:
Create objects:
Availability:
as of 4.5A: CREATE OBJECT … [ EXPORTING … ]
as of 4.6A: TYPE …
Call methods:
Availability:
as of 4.5A: CALL METHOD …
as of 4.6A: functional method call
Trigger event:
Availability:
as of 4.5A: all components
Widening Cast:
"--- CAST
INTERFACE LOAD.
Component selection:
Symbol Example Meaning