bind transaction code to an OO class

71 阅读1分钟

this is a subroutine pool:

*&---------------------------------------------------------------------*
*& Subroutine pool  DEMO_OO_TRANSACTION                                *
*&                                                                     *
*&---------------------------------------------------------------------*

PROGRAM  zdemo_oo_transaction.

*

CLASS demo_class DEFINITION create private.

  PUBLIC SECTION.
    METHODS instance_method.
     private SECTION.
  methods constructor.
ENDCLASS.

*

CLASS demo_class IMPLEMENTATION.
  METHOD instance_method.
    cl_demo_output=>display( 'Instance method in local class' ).
  ENDMETHOD.

  method constructor.
    BREAK-POINT.
  endmethod.
ENDCLASS.

image
In the runtime the constructor is called by SYSTEM-EXIT:
image