大家好,
求助!我有一个SAP界面需要按回车键才能继续后面的操作,但是每次按回车的次数不固定,最少的时候不需要按回车,最多时需要按三次回车,请问这个怎么解决呢?谢谢!
Hi @yt.yutao
You can use the Retry scope activity to check the enter works or not.
If when you hit on enter it will show any reference element then it will help for us to click the next enter.
The retry scope has two blocks one is Action and another is Condition.
In the Action block give the Keyboard shortcuts to hit on Enter.
In the Condition block give the Element exist activity and indicate the Reference element.
Open the Retry scope activity properties, give the Number of retries as 3. we take 3 for at most hitting enters.
Hope it helps!!
Hi @yt.yutao
Assign MaxEnterCount=3
Assign CurrentEnterCount=0
While CurrentEnterCount < MaxEnterCount
SendHotkey Key="[k(enter)]"
Assign CurrentEnterCount=CurrentEnterCount + 1
While
Hope it helps!!
Hi @mkankatala
I used the Retry scope activity earlier, but it didn’t work properly. Pressing Enter for the first time worked fine, but when the conditions changed after pressing Enter for the second and third time, I added a Retry scope activity, which didn’t work. If you do not need to press Enter, an error will be reported when judging the Retry scope activity that is pressed enter for the first time.
Yes but the variables are of integer data type
The operation of pressing enter is normal, but it does not continue the following action, and stays in While. May I ask what is the problem? Thank you!

SAP启用了脚本后,每个输入组件都有特定的ID
另外不建议使用 enter 回车来完成输入,是不是可以根据下一步 所加载页面 的特定元素是否存在,来建立子流程?
下一步还是同一个界面里,按回车只是消除状态栏上的SAP警告提示,这一步除了按回车确实没有其他操作可以替代
这个就简单了,直接在SAP logon的选项里,把 脚本告警的两个 选项去掉,
这是输入了不符合要求的数据了,这种个人建议从源头解决,把输入的信息做个预处理,如果不合规的,直接跳过,是不是更好。