cancel
Showing results for 
Search instead for 
Did you mean: 

How to continue executing batch job even after error

RaviSee
Explorer
0 Kudos
768

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
turkaj
Active Participant
0 Kudos

Hello,

There are various ways to implement the requirement.

Here are some questions regarding this:

  • Are these messages generated by you, i.e., is it Z-Coding?
  • A standard report is being executed:
    • Here, it depends on which report is being executed and to what extent you can intervene.

One possibility is to develop a process around the job:

  • You can run your own tracking job that tracks your job in the background and, for example, continues from where the other job left off. For instance, by restarting the job and continuing the processing from that point.
  • Another possibility is to copy the standard report and adjust it in the Z namespace according to your requirements.

It is crucial to know which job and which report are being executed in the background. Depending on this information, you can implement your solution.

RaviSee
Explorer
0 Kudos

Hello Turkaj,

It is a custom error message handled at IF_EX_LE_SHP_DELIVERY_PROC~DELIVERY_FINAL_CHECK, but the execution program is RVV50R10C. Please help me how to raise error_message for my issue.

Creating a custom function module with exception error_message and write error message statement inside that function module at IF_EX_LE_SHP_DELIVERY_PROC~DELIVERY_FINAL_CHECK will handle the issue?