cancel
Showing results for 
Search instead for 
Did you mean: 

How to continue executing batch job even after error

RaviSee
Explorer
0 Kudos
933

Hello,

I have a requirement where i have to continue batch job even after error and the job should not cancel and the message should appear as error not like information or warning in the job log.

Sandra_Rossi
Active Contributor
0 Kudos
See explanation and solution in the official ABAP documentation of MESSAGE (behavior in a background job): https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenabap_message_batc...
RaviSee
Explorer
0 Kudos
It seems there is no other way to handle error msg without stopping the job?
Sandra_Rossi
Active Contributor

Please read again the documentation. Isn't it clear how to solve?

Messages of type E and A are written to the log. A check is then performed to see whether the message is handled using error_message. If this is not the case, the message is also written to the log with message number 564 of the message class 00 and current background processing is terminated, whereby a message of type A executes a database rollback and a message of type E does not. Background processing is resumed when the message is handled.

It means that the "current background processing is terminated" only if you don't handle using error_message, which means "it is not terminated" if you handle using error_message. "error_message" is a hyperlink to another document.

RaviSee
Explorer
0 Kudos
Hello @Sandra_Rossi, Sorry for the late answers, i am new to this topic. Yes i have seen errors in V_SA (Collective log) but it is creating deliveries.
View Entire Topic
RaviSee
Explorer
0 Kudos

Hello,

I have resolved the issue by writing the below logic.

if delivery contains an errors and sy-batch = 'X'. "ct_finchdel (IF_EX_LE_SHP_DELIVERY_PROC~DELIVERY_FINAL_CHECK)

Note: Ct_finchdel contains custom errors which is populated at (IF_EX_LE_SHP_DELIVERY_PROC~DELIVERY_FINAL_CHECK)

            DELETE ct_vbuk WHERE vbeln <lfs_likp>-vbeln.  "$       1 entry
            DELETE ct_vbup WHERE vbeln <lfs_likp>-vbeln. "$       1 entry
*           clearing Update indicator so that delivery cannot be created and deleting the temp delivery no. so that delivery no. should not be assigned
            CLEAR<lfs_likp>-updkz<lfs_likp>-vbeln.
*           Deleting the entries from VBPA
            CLEARct_vbpact_vbuv.

* Set the UPDKZ as D for the entries with VBELN as "$    1" in the ct_lips and ct_vbfa

endif.