Jump to content

Waiting for Button appearing in SAP and than press


 Share

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

Link to comment
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

 

Link to comment
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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.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 (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

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

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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

 

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...