Jump to content
Sign in to follow this  
Sascha_77

Waiting for Button appearing in SAP and than press

Recommended Posts

Hi Folx.

I´m new to AutoIt. I used since years "PowerPro" but AutoIt seems to be more flexible. Now I think it´s time to change to AutoIT. :)

Now my Problem. 

I press the red marked Button via Shortcut CTRL+F1 to get to a another Mask.

image.thumb.png.0b5fa06810719c37f2ffef434e1c7c75.png 

These is the Code:

Send("{CTRLDOWN}+{F1}")
WinWait("FIS/edc® Workflowanwendung ändern")

It changed to this:
image.thumb.png.a85b21302abe2b1a26aa2144669305bd.png

To press the Green Button I´m using

MouseClick($MOUSE_CLICK_LEFT, 240, 540)

After that the Iconbar looks like this and a "White Sheet" with Tooltip "Workflow anlegen" appears:

image.png.d7b5f5c90fcfa23aa1cf55f282cceba8.png

WinWait("FIS/edc® Workflowanwendung ändern")
MouseClick($MOUSE_CLICK_LEFT, 1070, 200)

Push it with the Code above.

Now my Question. Sometimes SAP is laggy and the White Sheet appeared with a delay. Is AutoIt able to detect if there is a pressable Button on the Screen or if there is nothing to press? The White Sheet has no shortcut. Only the Tool Tip.

 

image.png

Share this post


Link to post
Share on other sites

yes, you can wait for controls, but it may not be able to talk directly to that control with standard AutoIt script. Look at the help file for the ControlSend functions and related functions.

you need to be the one to wait for controls in your script

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites

Please check the wiki for the SAP UDF. It allows to automate the SAP GUI uisng SAPScript.
https://www.autoitscript.com/wiki/User_Defined_Functions#Other_Applications


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-09-05 - Version 1.5.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
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
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

The SAP Samples I found are not working here. SAP.au3 is throwing Errors.

But I found another way to check if the White Sheet Button is present. 

Before:

image.png.723b0c8f1896957acc3b9a8b2eebb03d.png

And after (when the Button appears):

image.thumb.png.6d179f20b66b3012201a1acbf821b647.png

How to trigger ClassnameNN "ToolbarWindow324"?

If ClassnameNN = "ToolbarWindow324" then Mouseclick x,y

 

image.png

image.png

Share this post


Link to post
Share on other sites

Ok I Found a sample and modified it. But it doesn´t work.

 

#include <Constants.au3>
#include <AutoItConstants.au3>
#include <MsgBoxConstants.au3>
#include <SAP.au3>
#include <SAPGUI.au3>

Global $hCtrl = 0, $Waiting = True
While (1)
    If $Waiting And WinExists("FIS/edc® Workflowanwendung ändern") Then
        $hCtrl = ControlGetHandle("FIS/edc® Workflowanwendung ändern", "", "ToolbarWindow324")
        If $hCtrl Then
            ; we got the handle, so the button is there
            ; now do whatever you need to do
            MsgBox($MB_SYSTEMMODAL, "", "Button is available")
            $Waiting = False
        EndIf
    EndIf
WEnd

 

Share this post


Link to post
Share on other sites

then you should post your solution here so others with the same issue can maybe get the help they seek as well.


My resources are limited. You must ask the right questions

 

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...