SAP CLASS FOR BEHAVIOR OF ABAP Statements



Get Example source ABAP code based on a different SAP table
  


• FOR BEHAVIOR OF CLASS

CLASS, FOR BEHAVIOR OF
Short Reference

ABAP_SYNTAX
CLASS class DEFINITION
PUBLIC $[ABSTRACT$] $[FINAL$]
FOR BEHAVIOR OF bdef.
...
ENDCLASS.

What does it do?
The addition FOR BEHAVIOR OF to the definition of a global class defines an ABAP behavior pool (ABP) for the RAP behavior definition (BDEF) specified in bdef. The name of the global class (class ) of an ABAP behavior pool usually starts with the prefix BP_. The global class is implicitly ABSTRACT and FINAL; hence, ABSTRACT and FINAL can but need not be specified. It can have static methods, CLASS-DATA, CONSTANTS and TYPES .
If a BDEF defines operations with user-defined logic, such as nonstandard operations, determinations or validations, an implementation of those operations is required in one or more behavior pools. Any number of behavior pools can be assigned to a BDEF allowing applications a structuring into multiple units (see the topic RAP BDL - implementation grouping).
The actual implementation of the transactional behavior of RAP BOs happens in the CCIMP include of a behavior pool. There, two types of special local classes can be defined: one or more handler classes to implement the RAP interaction phase and a saver class to implement the RAP save sequence of the business object behavior.



Latest notes:

Currently, global classes of behavior pools cannot be instantiated or inherited.
ABPs can be unit tested with class CL_ABAP_BEHV_TEST.
NON_V5_HINTS
ABAP_HINT_END