Jump to content
rundak

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.  

Share this post


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 (2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-03-02 - Version 1.3.5.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (2019-01-22 - Version 0.1.0.0) - Download - General Help & Support
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


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 (2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-03-02 - Version 1.3.5.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (2019-01-22 - Version 0.1.0.0) - Download - General Help & Support
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

@rundak

Did you check the AutoItWindowsInfoTool? :)


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


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. 

Share this post


Link to post
Share on other sites

@rundak

Happy to have helped :)


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


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

×
×
  • Create New...