report zjso_transaction_events.
class lcl_oo_transaction definition.
public section.
class-data mo_transaction type ref to if_os_transaction.
class-methods on_finished for event finished of if_os_transaction.
class-methods on_save_prepared for event save_prepared of if_os_transaction.
class-methods on_save_requested for event save_requested of if_os_transaction.
class-methods init_transaction.
endclass.
start-of-selection.
lcl_oo_transaction=>init_transaction( ).
write / 'commit work'.
commit work. " all three events are raised
uline.
commit work. " new transaction, no initialialzation, no handling
lcl_oo_transaction=>init_transaction( ).
write / 'rollback work'.
rollback work. " only event finished is raised
uline.
class lcl_oo_transaction implementation.
method on_finished.
write / 'on_finished'.
endmethod.
method on_save_prepared.
write / 'on_save_prepared'.
endmethod.
method on_save_requested.
write / 'on_save_requested'.
endmethod.
method init_transaction.
mo_transaction = cl_os_system=>get_transaction_manager( )->get_current_transaction( ).
set handler on_finished for mo_transaction.
set handler on_save_prepared for mo_transaction.
set handler on_save_requested for mo_transaction.
endmethod.
endclass.
class lcl_oo_transaction definition.
public section.
class-data mo_transaction type ref to if_os_transaction.
class-methods on_finished for event finished of if_os_transaction.
class-methods on_save_prepared for event save_prepared of if_os_transaction.
class-methods on_save_requested for event save_requested of if_os_transaction.
class-methods init_transaction.
endclass.
start-of-selection.
lcl_oo_transaction=>init_transaction( ).
write / 'commit work'.
commit work. " all three events are raised
uline.
commit work. " new transaction, no initialialzation, no handling
lcl_oo_transaction=>init_transaction( ).
write / 'rollback work'.
rollback work. " only event finished is raised
uline.
class lcl_oo_transaction implementation.
method on_finished.
write / 'on_finished'.
endmethod.
method on_save_prepared.
write / 'on_save_prepared'.
endmethod.
method on_save_requested.
write / 'on_save_requested'.
endmethod.
method init_transaction.
mo_transaction = cl_os_system=>get_transaction_manager( )->get_current_transaction( ).
set handler on_finished for mo_transaction.
set handler on_save_prepared for mo_transaction.
set handler on_save_requested for mo_transaction.
endmethod.
endclass.
No comments:
Post a Comment