[ABAP] Zustand einer SAP-Transaktion prüfen

* Transaktions-ID (LUW-Key)
WRITE: / cl_system_transaction_state=>get_sap_luw_key( ).

* Programm ist im Verbucher (1 = wahr, 0 = falsch)
CASE cl_system_transaction_state=>get_in_update_task( ).
  WHEN 1.
    WRITE: / 'Update task is active.'.
  WHEN 0.
    WRITE: / 'Not in update task.'.
ENDCASE.

* lokale Verbuchung ist eingeschaltet (1 = wahr, 0 = falsch)
CASE cl_system_transaction_state=>get_update_task_local( ).
  WHEN 1.
    WRITE: / 'Local update task is switched on.'.
  WHEN 0.
    WRITE: / 'Local update task is switched off.'.
ENDCASE.

* in ON-COMMIT/ON-ROLLBACK (1 = wahr, 0 = falsch)
CASE cl_system_transaction_state=>get_on_end_of_transaction( ).
  WHEN 1.
    WRITE: / 'In ON-COMMIT/ON-ROLLBACK.'.
  WHEN 0.
    WRITE: / 'Nicht in ON-COMMIT/ON-ROLLBACK.'.
ENDCASE.

* in ON-COMMIT (1 = wahr, 0 = falsch)
CASE cl_system_transaction_state=>get_on_commit( ).
  WHEN 1.
    WRITE: / 'In ON-COMMIT.'.
  WHEN 0.
    WRITE: / 'Nicht in ON-COMMIT.'.
ENDCASE.

* in ON-ROLLBACK (1 = wahr, 0 = falsch)
CASE cl_system_transaction_state=>get_on_rollback( ).
  WHEN 1.
    WRITE: / 'In ON-ROLLBACK.'.
  WHEN 0.
    WRITE: / 'Nicht in ON-ROLLBACK.'.
ENDCASE.