SAP error freezing bot

  • 14 December 2022
  • 6 replies

Badge +1

Hello guys!

I have a problem in a production environment: one of the automations uses SAP, however when there is some instability in it (connection, SAP crash and others), the bot is stuck infinitely. Is there any solution for this?

Unfortunately it is disturbing the execution queue.

6 replies

Userlevel 3
Badge +6

Dear @Cesar.R1,


If your automation is getting stuck when there are issues with the SAP system, it's likely that you need to add some error handling to your automation to prevent it from getting stuck in this situation. In general, error handling is an important aspect of automation design, as it allows you to anticipate and recover from potential issues that may arise during the execution of your automation.

One approach you could try is to use the "Try-Catch" action to wrap the part of your automation that interacts with SAP. The "Try-Catch" action allows you to specify a block of actions that should be executed, and then provide a separate block of actions to be executed if an error occurs during the execution of the first block. This can allow your automation to recover from errors and continue running without getting stuck.

Alternatively, you could use the "Wait" action to add a delay between attempts to interact with SAP. This can allow your automation to wait for the SAP system to become available again before continuing, which can prevent it from getting stuck in an infinite loop.

Overall, there are a few different approaches you could try to solve this problem. The best solution will depend on your specific situation and the needs of your automation.



Badge +1

@Zaibi Thanks for the help! Unfortunately, there are already Try/Catch negotiations, but in any case the bot is frozen. For example, on December 2nd I received an SAP connection error. This caused the bot to be stuck until today in a line in which the command was a click on a table.

Userlevel 3
Badge +6

Dear @Cesar.R1,


If your bot is stuck despite the presence of try/catch negotiations, there may be an issue with the way the try/catch block is implemented. In general, the try/catch block should be placed around the specific actions that are likely to cause errors, such as commands that interact with SAP or other external systems. The catch block should include specific instructions for handling any errors that are encountered, such as using the "exit loop" or "exit thread" command to break out of the current loop or thread and move on to the next step in the automation.



Userlevel 7
Badge +13

Hi @Cesar.R1 ,


How had you automated the process? 

  • Through SAP Package 


  • Through Recorder package

If either the case, kindly check the package version and try to change it. 

Badge +1

Hi @Padmakumar 


With Recorder package. I will check the package version. Thanks.

Badge +1

I too face the same issue of the bot going into hang state for Infinite time. After running an action on SAP (either SAP command or Recorder), the command waits for the result. By the time SAP returns the result the connection was lost, and SAP GUI keeps on waiting to return the result.  In such scenario the next action is not executed in the bot and it goes into hang state.


I reproduced the scenario with an online call with AA support and had raised the concern. AA agreed that there is no existing capability in the AA software to deal with this scenario. The only way is to monitor automation manually and kill the bot. So, if you have the bot to run 24x7, you have to put extra manpower, which eventually impacts RPA achievements or come back to manual process and discard RPA.