08-05-2015 1:23 PM
Hi there,
Does anyone could suggest me some tip to avoid runtime error SYSTEM_ON_COMMIT_INTERRUPTED when I use a message type E in BAdI WORKORDER_UPDATE?
METHOD if_ex_workorder_update~before_update.
MESSAGE 'test' type 'E'.
ENDMETHOD.
Thanks!
08-05-2015 1:36 PM
Almost there...
METHOD if_ex_workorder_update~at_save.
MESSAGE e006(ymr) RAISING error_with_message.
ENDMETHOD.
This return a message information when I try to save in COR1 transaction
08-05-2015 2:06 PM
I really don't konw if this is the better way, but...
1 - I declared a private attribute called erro_teste (type c).
2 - I setted this attribute in before_update method
3 - Called at_save method in before_update_method and call raise this message
*-----------------------------------------------------------------------------------------------------------------*
METHOD if_ex_workorder_update~before_update.
me->erro_teste = 'X'.
DATA: w_header TYPE caufvd.
READ TABLE it_header
INTO w_header
INDEX 1.
IF w_header IS NOT INITIAL.
me->if_ex_workorder_update~at_save( w_header ).
ENDIF.
ENDMETHOD.
*-----------------------------------------------------------------------------------------------------------------*
METHOD if_ex_workorder_update~at_save.
IF me->erro_teste IS NOT INITIAL.
* Message Type E = dump SYSTEM_ON_COMMIT_INTERRUPTED
MESSAGE i006(ymr) RAISING error_with_message.
ENDIF.
ENDMETHOD.
*-----------------------------------------------------------------------------------------------------------------*
Any better solution?
08-05-2015 2:59 PM
Hi ,
Not sure what you are trying to achieve here? If you want to raise any custom error message AT_SAVE is the correct method.
R
07-05-2022 10:43 AM
Hello,
it's working fine for me, follow steps above as tca85 suggested but you need change something:
1 - I declared a private attribute called erro_teste (type c). AS TYPE 'Static Attribute' NOT as 'Constant'
2 - I setted this attribute in before_update method
3 - Called at_save method in before_update_method and call raise this message
IF me->error_bp IS NOT INITIAL.
MESSAGE i001(Z_CH15_MSG00) RAISING error_with_message.
LEAVE TO TRANSACTION sy-tcode AND SKIP FIRST SCREEN.
ENDIF.
with 'LEAVE TO TRANSACTION sy-tcode AND SKIP FIRST SCREEN.' it will return back until the user will correct the informationsexample.jpg