Hi,
I hope this example helped you
READ TABLE i_return WITHKEYtype = 'E'.
IF sy-subrc = 0.
*If you want you can manage the message
CALLFUNCTION'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALLFUNCTION'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
Regards
Ivan