Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAdI WORKORDER_UPDATE - Dump with Message E

former_member216168
Active Participant
0 Kudos

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!

4 REPLIES 4

former_member216168
Active Participant
0 Kudos

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

former_member216168
Active Participant
0 Kudos

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?

0 Kudos

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

0 Kudos

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