web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / SAP UI element capture...
Power Automate
Unanswered

SAP UI element capture error

(0) ShareShare
ReportReport
Posted on by 8

When I tired to add a UI element from SAP, the capture frame is not at correct position.

Do you have any solution for this?

 

KeyL_0-1652432941311.png

 

  • VJR Profile Picture
    7,635 on at

    For automating SAP applications in a better way you need to enable client side and server side scripting within the SAP GUI.

    https://docs.microsoft.com/en-us/power-automate/guidance/rpa-sap-playbook/prerequisites

    Follow the steps mentioned under "SAP GUI scripting configuration".

     

  • Riyaz_riz11 Profile Picture
    4,219 Super User 2026 Season 2 on at

    Hi @KeyL ,

    Better you can click on Material after u can pass send keys use tab so it will work no need UI in that case, whichever line u need, you can click using click element on window.

     

    Regards

    Ahammad Riyaz

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

  • KeyL Profile Picture
    8 on at

    Actually the function works well on my other computer, I wonder if reinstalling the PAD software will help...

  • Riyaz_riz11 Profile Picture
    4,219 Super User 2026 Season 2 on at

    Even if system is slow so also matters, so it was not able to capture ui element in that case.

  • SjaakS Profile Picture
    22 on at

    I can recommend the same solution that VJR posted about.

    The best way to get started is through the SAP options, as shown in the following screenshot:

     

    2022-05-25 12_54_30-SAPOptions.png

     

    Here I would go to 'Accessibility & Scripting' and edit both sections as shown in following two screenshots (I am pretty sure that these require the SAP Signature Theme - check the Help section using the button in the bottom of the SAP GUI Options screen):

     

    2022-05-25 12_54_59-SAPAccesspng.png2022-05-25 12_55_16-SAPScript.png

     

    As a final tip, I could really recommend using SAP GUI Scripting, this is way more effective than using the SAP front end.

    Check this link for more info on the Microsoft portal.

  • uia41300 Profile Picture
    4 on at

    I found same issue, still waiting for solution.

  • uia41300 Profile Picture
    4 on at

    The SAP version is 7700, there is no such issue in SAP pervious version.

  • KeyL Profile Picture
    8 on at

    Exactly, the problem occurred just after my SAP updated from 760 to 770.

  • KeyL Profile Picture
    8 on at

    I also don't have a solution yet, but here are my ways to overcome the difficulties:

    1. Record my actions by SAP GuiXT, then call the script in PAD by using the powershell script action;

    2. Use keystrokes such as {Tab}, {Next} or {Ctrl({Right})} to move to the area I want, or first capture an area which PAD can recognize and then use keystrokes.

  • SjaakS Profile Picture
    22 on at

    If the recording of UI elements really does not work, I can strongly recommend using VBScripts within PAD. VBScripts need no interaction with recorded UI elements, or the use of keystrokes.

     

    Let me give you a quick example using transaction FD03 - Customer Display.

    In the following screenshot, I entered "FD03" in the command field, then confirming this with Enter.

    SAP - Command fieldSAP - Command field

     

    In the next screen, we get a pop-up window where I enter a debtor number, as well as a company code, also confirming my input with Enter.

    SAP - Customer Display: Initial ScreenSAP - Customer Display: Initial Screen

     

    If I record these steps with Script Recording and Playback, as shown in the screenshot below, I get a result / script that is shown beneath the screenshot (Scripting needs to be enabled, check my previous message showing how to do this). The scripts should be saved as .vbs files for instant use - try editing with Notepad to see the result of your recording.

    SAP - Script recordingSAP - Script recording

     

    Result of my recorded script with explanation:

    --- This first part pretty much connects to a running instance of SAP ---
    If Not IsObject(application) Then
    Set SapGuiAuto = GetObject("SAPGUI")
    Set application = SapGuiAuto.GetScriptingEngine
    End If
    If Not IsObject(connection) Then
    Set connection = application.Children(0)
    End If
    If Not IsObject(session) Then
    Set session = connection.Children(0)
    End If
    If IsObject(WScript) Then
    WScript.ConnectObject session, "on"
    WScript.ConnectObject application, "on"
    End If

    --- This next part is where the magic happens ---
    --- Be aware that counting starts with a 0 instead of a 1 - window 0 is indeed the first window ---
    session.findById("wnd[0]").maximize <- the window is maximized / full screen
    session.findById("wnd[0]/tbar[0]/okcd").text = "FD03" <- okcd is command fiels - text FD03 is entered
    session.findById("wnd[0]").sendVKey 0 <- SAP Vkey 0 = Enter
    session.findById("wnd[1]/usr/ctxtRF02D-KUNNR").text = "123456" <- in the pop-uped window, cust. nr. is added
    session.findById("wnd[1]/usr/ctxtRF02D-BUKRS").text = "1234" <- the same goes for the company code
    session.findById("wnd[1]/usr/ctxtRF02D-BUKRS").setFocus <- unnecessary, can be deleted
    session.findById("wnd[1]/usr/ctxtRF02D-BUKRS").caretPosition = 4 <- also unnecessary, sets the current position in the text field
    session.findById("wnd[1]/tbar[0]/btn[0]").press <- presses the continue button

    These scripts can also used with variables in PAD. If you use a variable for a transaction, this can make your script look like

     

    session.findById("wnd[0]/tbar[0]/okcd").text = "%Transaction%"

    instead of

    session.findById("wnd[0]/tbar[0]/okcd").text = "FD03"

    Another great plus, as you might have seen in the script, is that no wait stages need to be added, since the script continues to run its script as soon as it is able.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 211 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 190

Last 30 days Overall leaderboard