Ansicht
Dokumentation

ABENABP_SAVER_CLASS - ABP SAVER CLASS

ABENABP_SAVER_CLASS - ABP SAVER CLASS

ABAP Short Reference   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.
SAP E-Book

RAP Saver Class

Syntax for unmanaged scenarios. The adjust_numbers method is only available for late  numbering scenarios.

CLASS lsc_bdef DEFINITION
  INHERITING FROM CL_ABAP_BEHAVIOR_SAVER $[ ABSTRACT$] $[FINAL$].
  PRIVATE SECTION.
     $[METHODS finalize REDEFINITION.$]
     $[METHODS check_before_save REDEFINITION.$]
      METHODS adjust_numbers REDEFINITION.
      METHODS save REDEFINITION.
     $[ METHODS cleanup REDEFINITION.$]
     $[METHODS cleanup_finalize REDEFINITION.$]
ENDCLASS.

CLASS lsc_bdef IMPLEMENTATION
     $[METHOD finalize. ... ENDMETHOD.$]
     $[METHOD check_before_save. ... ENDMETHOD.$]
      METHOD adjust_numbers. ... ENDMETHOD.
      METHOD save. ... ENDMETHOD.
     $[METHOD cleanup. ... ENDMETHOD.$]
     $[METHOD cleanup_finalize. ... ENDMETHOD.$]
ENDCLASS.


Syntax for managed scenarios with additional or unmanaged save:

CLASS lsc_bdef DEFINITION
  INHERITING FROM CL_ABAP_BEHAVIOR_SAVER $[ ABSTRACT$] $[FINAL$].
  PRIVATE SECTION.
     METHODS save_modified REDEFINITION.
    $[ METHODS cleanup REDEFINITION.$]
ENDCLASS.

CLASS lsc_bdef IMPLEMENTATION
      METHOD save_modified. ... ENDMETHOD.
     $[METHOD cleanup. ... ENDMETHOD.$]
ENDCLASS.


Effect

A saver class can be defined in the CCIMP include of an ABAP behavior pool. It includes the definitions and implementations of RAP saver methods.

A saver class lsc_bdef inherits from class CL_ABAP_BEHAVIOR_SAVER. The RAP saver methods are declared by redefining predefined methods of the superclass. They implicitly have response parameters as outlined in the table further down.

Saver classes are implicitly ABSTRACT and FINAL since instantiating and calling only happens through the RAP runtime engine. All saver methods are called after at least one successful modification of data in the current RAP LUW using a COMMIT ENTITIES statement. In contrast to RAP handler methods, saver methods do not have data of RAP BO instances as import parameter. Therefore, instance data must be handled via the transactional buffer when self-implementing the saver methods.

The following predefined methods are part of the saver class. They are called in this order. The following table also shows whether they are mandatory and which response parameters the methods offer:

Method Mandatory failed mapped reported
finalize - X X X
check_before_save - X X X
adjust_numbers X ( Only available and mandatory in late numbering scenarios.) - X X
save X - - X
save_modified X ( Only available and mandatory in managed scenarios that include an additional or unmanaged save.) - - X
cleanup - - - -
cleanup_finalize - - - -

Development guide for the ABAP RESTful Application Programming Model, section Save Sequence Runtime.

Note

The use of CL_ABAP_BEHAVIOR_SAVER is restricted to redefining RAP saver methods in a behavior pool.






RFUMSV00 - Advance Return for Tax on Sales/Purchases   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 12454 Date: 20240329 Time: 133700     sap01-206 ( 95 ms )