Jump to content

How to make AutoIt wait for the end of the action in SAP?


Recommended Posts

For example, I start downloading a report from SAP to Excel by clicking on the button:

$ Sap_sess.findById ("WND [0] / TBAR [1] / BTN [22]"). Click

In AutoIt 3.3.8.1, everything worked fine, the button is pressed, SAP executed the download, an Excel window with data appeared, and the script went on.

But updating on the next versions, starting from 3.3.10.0 and higher, the script continues working without waiting for the end of the download. What has changed? How do I get it to work as an 3.3.8.1 version?

Sorry for my english, I am using google translator. I will try to explain in more detail if something is not clear.

Link to comment
Share on other sites

what library or AU3 files are you using for the SAP session? Can you post your whole script for clarity?

I believe you can still get hold of older versions. Would staying wtih 3.3.8.1 be acceptable? If not, there are things we can do I am sure to wait. One way I can think of is to monitor the CPU usage of Excel to see when it's done it's stuff using the below UDF. Holler back if you want to post your script and need some help to do this using the new AutoIT version

 

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

I'm using:

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3>
#include <Array.au3>
#include <File.au3>
#include <String.au3>
#include <Excel.au3>

The problem appears in the 327 line.

I've updated AutoIt because there appeared new functions. For example, the function of recursively listing of files is very useful.

I will be happy with your help. I'm interested in what basically changed in the new versions, which led to this effect. Previously, I did not have to catch the end of the SAP tasks, AutoIt always waited it.

OC-3_test.au3

Link to comment
Share on other sites

CPU usage of excel is not a good idea. You could try to check .Redystate or .Ready properties of excel. SAP could also have some properties that can do the trick, but i am not familiar with SAP.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...