Timeout Property If The SAP Session Has Hung Or Disconnected

Resolution when pop-up message causing Robot to stop execution. Timeout property if the SAP session has hung or disconnected.

With UiAutomation Activity Pack 22.2 a new feature is released which is being called,

Enforcing the hard timeout for SAP WinGUI

This parameter / settings / variable will ensure, that SAP activities will be enforced to terminate after a predefined timeout.

Timeout can be set on activity level, here:



Use case 1: In SAP process, performing some activities in SAP and example pressing the button “show me report”. This activity is taking a long time, as SAP needs to collect the data and prepare a report, SAP is working.

If “Enforcing the hard timeout” is activated, the UiPath Robot will terminate the activity execution and will throw an error after the timeout specified in the activity target.

Catch and handle this error message in a Try & Catch activity.



Use case 2: In SAP process, while performing some activities in SAP, and SAP has a network issue and the robot will lose the connection to SAP.

If “Enforcing the hard timeout” is activated, the UiPath Robot will terminate the activity execution and will throw an error after the timeout specified in the activity target.

You can catch and handle this error message in a Try & Catch activity.

To be able to use Enforcing the hard timeout for SAP WinGUI in Studio

  1. Upgrade to UiAutomation Activity Pack 22.2
  2. Use Invoke Activity as the FIRST and the TOP activity in your workflow
  3. (THIS IS MUST-HAVE. IT MUST BE ACTIVITY NUMBER ONE in your workflow)
  4. Add the following code:
  5. System.Environment.SetEnvironmentVariable ("UIPATH_SAP_TIMEOUT_ENFORCED", "1")