Value doesnot fall in expected range - SAP Automation


I was using Automation in Windows Legacy Framework.Where my SAP activities worked properly.After a while i converted windows legacy to windows framework.
Post which when i am testing the robot.I am geting an error “Value doesnot fall in expected range”.For Some of the Select SAP Menu Item Activity across the Process.Tried validating the selectors they remain same.
Could Someone help with this please?


Did you try switching the activites also to the modern activities? can you please try it

Alternately try upgrading the packages as well from Manage packages


I am already using Modern Activites .No where classic activites were used.

Also I upgraded and downgraded packages and tried still same issue.


Can you run in debug mode and check the inner exception details from locals panel…that might give you more info on what exactly failed…and the error is not because of selector…but might be because of the value your are trying to pass or use


On trying in debug mode there is not much information available it says only "System.Argument Exception : Value doesnot fall in expected range ".I checked the arguments as well everything looks as expected.
Not sure where it went wrong.Any further ideas or inputs?


May I know at what activity it is failing…is it possible to attach a screnshot or project files here


It is failing at Select SAP Menu Activity(I tried continue on error to bypass :stuck_out_tongue: )
But there should be a way to get this fixed.
Attached the screenshot if you can find something.

I see that the SAP Select Menu Item activity is used on what seems to be a simple ComboBox element, for this use case a simple Select Item activity should be the correct approach.

The SAP Select Menu Item activity is designed to be used for SAP Menus and Toolbars such as these:

1 Like

I am using SAP Select Menu just for Tollbars items but the same error keeps on coming and I am using Window Legacy.

What about to use simple Click, if you need just to click the first button? Does it work?

Normal Click Activity is not able to recognize ToolBar buttons.

To be able to understand your automation challenge better, please share following information:

  • SAP WinGUI version
  • SAP WinGUI transaction
  • UiPath Studio version
  • UiPath UiAutomation Activity version

In addition share the following screenshots:

  • SAP WinGUI screenshot - Full screen (you can blurry the business information)
  • SAP UiPath Studio - selectors of SAP element

Best regards, Lev

Hi Lev,

Here are the information

  • SAP WinGUI version : File Version: 7700.1.7.1161 Build: 2133993 Patch Level: 7

  • SAP WinGUI transaction : SO01

  • UiPath version : 2021.10.5

  • UiPath -ui-automation-Activity version: 22.10.3 ( I have tested with 23.4.8 version but still same issue)

  • selectors of SAP element : I am using all SAP activities inside Attach window activity

  • SAP WinGUI screenshot

Thank you

this is the last key screenshot, How selector of SAP element looks like?

Sorry Lev, For late reply i was not around

Here is

  • SAP UiPath selectors

wnd app=‘saplogon.exe’ cls=‘SAP_FRONTEND_SESSION’ title=‘Business Workplace*’ />
sap id=‘usr/cntlSINWP_CONTAINER/shellcont/shell/shellcont[1]/shell/shellcont[0]/shell’ />

Thank you


check the video here. Looks good for me. Select the whole area of table, not just a button



1 Like

Yes it’s working but Not stable if I have 20 IDOC to process its mange to click maybe 5 then fail for the next 2 then again manage to click 2 or 3 then fail again with the same error.

Then I do not understand the issue.

You are saying above “I cannot click the Update button”, now you are saying “I can click the button” :thinking: what is the trouble?

Be clear :slight_smile:

Dear Lev,

Sorry If i have confused you.

I am using the Select SAP menu Activity. This activity is not Stable it has been working fine for last 8 months and now suddenly it has stopped working.

The Button is there
its very visible and active, but robot throws an error saying "Exception MSG: Value does not fall within the expected range. Source–Select Menu Item click > Replace IDC"

It’s not happening with all cases but if have 50 Cases then almost 10 cases fail because of this error. You can refer to the screenshots I have provided earlier.

Dear @daljit_parmar

Lets use a proper wording. “the activity is working for 8 months” - means it is stable and reliable. If you are not changing nothing on UiPath side and the automation starts breaking I would seach for the source of troubles on SAP side. Just to make super clear!

In the case above I may think about some kind of synchronisation issue, SAP is not responding in proper time, the data are not loaded. Think exactly about the time when it is happening. It his after 10 documents, or always after 20? what is the behaviour of SAP if the processing is super fast. Please investigate in this area.

Best regards, Lev

1 Like