Hi Maren,
It is not a good practice to use commit statement in Order_save badi.
Solution is:
- Create a FM 'ZUPDATE_CUSTOM_TABLE' call this in to your custom implementation of Order_save badi.
- Create Subroutine 'CALL_ON_COMMIT' in above FM.
- Update your custom table in subroutine (Do not use Commit statement)
- Call the subroutine into FM like this
- PERFORM call_on_commit on commit.
- and pass the data according to your requirement.
FUNCTION ZUPDATE_CUSTOM_TABLE.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(GUID) TYPE CRMT_OBJECT_GUID
*"----------------------------------------------------------------------
PERFORM call_on_commit on commit.
ENDFUNCTION.
FORM call_on_commit.
Update your custom table here.
ENDFORM.
Regards,
Ankit