Sometimes Message goes into error at outbound side in BPM and hence further steps in BPM go into error. And in this case we go to sxmb_moni_bpe > continue process following error to restart / resend them. But this is manual process.
Many times if we don’t resend these error message then business process stops there which is very critical situation. So one person need to keep track of error messages and resend them on regular basis to keep business flow work properly and successfully.
I had IDoc to SOAP sycn scenario, in which if web service is unreachable then system error is thrown and BPM used to go into error state and need to resend message manually L
So why not to make this process automatic, so that these error messages will be resend after some interval / period.
Whenever any step in BPM goes into error and message stuck at outbound side, then all these messages are stored into table SWWWIHEAD and function module SWW_WI_ADMIN_ERROR_RESTART is used to resend these messages.
Messages failed into BPM has following values in table SWWWIHEAD:WI_STAT = ERROR WI_TYPE = F WI_CD = date when message went into error PROCCAT = CCBPM WFD_EXETYP = E WI_ID = unique id given to each error message
Using above all properties we can select error messages and resend them.
So for this we will write on report eg. Z_RESTART_ERROR_MESSAGEREPORT z_restart_error. TABLES : swwwihead. TYPES : BEGIN OF allwiid, wi_id TYPE sww_wiid, END OF allwiid. DATA : i_allwiid TYPE STANDARD TABLE OF allwiid WITH HEADER LINE. SELECT wi_id FROM swwwihead INTO CORRESPONDING FIELDS OF TABLE i_allwiid WHERE wi_stat = ‘ERROR’ AND wi_type = ‘F’ AND proccat = ‘CCBPM’ AND wfd_exetyp = ‘E’ AND wi_cd = sy-datum. IF sy-subrc EQ 0. LOOP AT i_allwiid. CALL FUNCTION ‘SWW_WI_ADMIN_ERROR_RESTART’ EXPORTING wi_id = i_allwiid-wi_id EXCEPTIONS update_failed = 1 no_authorization = 2 invalid_status = 3 OTHERS = 4 ENDLOOP. ENDIF.
In this report, program selects all error messages with its WI_IDs and calls function module SWW_WI_ADMIN_ERROR_RESTART to resend them one by one.
Now we need to schedule this report as per project requirement using tcode SM36.
That’s it !!! 🙂