Jump to content

Waiting for ERP cell activation


Recommended Posts

Hello, 

I am a rookie with AutoIt and need some help from you. My problem is:

My program creates an array from values in excel spreadsheet. Then copies each value from array (cell by cell) to ERP program in loop.

It works quite good but from time to time our ERP system slows down and loop doesn't work correctly. When system slows down the AutoIt program runs with constant speed and omits some cells in ERP program.  Therefore the program tries to paste value (next value from array) to a field where is different data type becasue execution was to fast.

What I need is a way to force the AutoIt program to wait for a ERP program cell activation and after that send value from array. Sleep() is not a solution. It should work quite fast bacause I have to enter 500 rows x 7 columns. Loop (created based on other topic forum):

For $i = 0 To UBound($aResult) - 1
    For $j = 0 To UBound($aResult, 2) - 1
        Send($aResult[$i][$j])
        Sleep (50)
        Send ("{TAB}")
        Sleep(50)
    Next
Next

Please notice that ERP window is activated only once then only ERP cells change by TAB key and this is to fast.

Hope my problem is clear. 

Thank you in advance for clue.  

Link to post
Share on other sites

Welcome to AutoIt and the forum!

We need more information to help you! Which ERP are we talking about?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to post
Share on other sites

I hoped to get "SAP" as a reply, because there is an UDF available to automate the SAP GUI.
Do you know if iScala provides an automation interface?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to post
Share on other sites

@FrancescoDiMuro I was not aware that exist such tool :) Thanks for letting me know. It seems to be very useful but I think I found a solution for my problem without sleep() function, using ControlGetText() and ControlGetFocus() functions. Full speed of entering data. 

For $i = 0 To UBound($aResult) - 1
   For $j = 0 To UBound($aResult, 2) - 1
      Send("{DELETE}")
      Send($aResult[$i][$j])
      Local $sText = StringReplace(ControlGetText("[ACTIVE]", "", ControlGetFocus("[ACTIVE]")),".","","","") ; Variable which contains current value of cell
         If $sText <> $aResult[$i][$j]  Then ; Checks if data was enterd from array to a cell in ERP system
            Do
               $sText = StringReplace(ControlGetText("[ACTIVE]", "", ControlGetFocus("[ACTIVE]")),".","","","") ; In this loop AutoIt Program "waits" for value appearing in ERP system
            Until $sText = $aResult[$i][$j]
         EndIf
      Send ("{TAB}")
    Next
Next

FYI: Before AutoIt automation this work took 4 hours. . Now it takes 5 minutes. 

Thank you for your help. 

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...