SAP -Element misaligned with actual when mapping fields

Hi I am trying to implement a routine in SAP to create a Sales Order. I can get it to work using basic keystroke recording. However when trying to identify the elements to use in a “type into” activity, I find that the identified anchor, is mis-aligned to the actual item on screen. In the screen shot attached I want to type into the RED box, for the order type. However the UiPath element that will actually populate this is shown in the green box! This makes for a slow and tedious process in trying to determine by trial and error the correct element for each field. I am using Studio 2021.2. I have tried changing the screen resolution on my monitor but that doesn’t seem to make a difference.

Any ideas how I can resolve this alignment issue.

image

@murray.trim

Welcome back to our UiPath community.

Did you enable SAP script ?

Hi Ganta.

Yes scripting is activated and working. I have had this checked. UiPath reads everything ok, and I can see the information in the UI Explorer etc being populated. Its just the visual alignment on screen that is the issue. I can spend the time working through all of the elements in UI Explorer to find the right ones to enter data into, but it is some much slower and cumbersome than using the point and click functionality as its designed to be used.

thanks

Murray

@murray.trim

Can you search Type Into activity in Activity panel and share screenshot of it. Need to check once which Type Into activity are you using here.

Hi

Here you go. here is the type into I am using. It is when I select the “Indicate Target on screen” then go to the indicate it on SAP, the green box’s don’t line up with the actual fields.

image

@murray.trim

Hello Murray,
interesting case.

Is it possible for you to “catch” the field with the UI Explorer?

If it is possible, as workaround, copy the wnd app attribute to window selector and sap app into the fuzzy an selector input fields manually. Choose the target and the targeting methods.

<wnd app='saplogon.exe' cls='SAP_FRONTEND_SESSION' title='Create Sales Order: Initial Screen' />
<sap id='usr/ctxtVBAK-AUART' />

image

Not elegant but at least you would get ahead.

If it is not possible try the attributes from here, just to know if it works.

Let us know your results.

Best regards
Stefan

1 Like

Hi Stefan.

Yes I have been starting to use the fields in the UI Explorer, (starting to get quicker at what I am looking for and getting the right fields.) Interestingly I found for a couple of fields I still had to offset the cursor even when naming the field!

thanks for the pointers

1 Like

@murray.trim

Hello Murray,
does the setting of the fields work with the SAP GUI scripting via VBScript?
Best regards
Stefan

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

session.findById("wnd[0]/tbar[0]/okcd").text = "/nVA01"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtVBAK-AUART").text = "CS"
session.findById("wnd[0]").sendVKey 0
1 Like

Hi Stefan

Yes the SAP Gui VBA script above works fine.

cheers

Murray

1 Like

@murray.trim

Hello Murray,
as far as I can say all looks good. Sadly I have no idea what could be the reasons for this behavior.
Best regards
Stefan

Hi Stefan

All good, thanks for your input.

kind regards

Murray

1 Like

Hi @murray.trim

Let me ask you two questions and with high probability I will know the EXACT answer to your issue.

  1. Are you using SAP WinGUI 7.70 ?
  2. Do you have more than 1 monitor?

Looking forward to hearing from you

Best regards, Lev

2 Likes

Hi Lev

Yes to both. (Laptop + 2 monitors)

cheers

Murray

1 Like

Hi @murray.trim

Then it is all super clear.

The root cause is that SAP has introduced Multi Monitor Scaling support :(( It has nothing to do with UiPath.

There are a plenty of issues with SAP WInGUI 7.70 und Multi scaling, feel free to check it our here: https://launchpad.support.sap.com/#/notes/2985351

In your case the solution would be

  1. Close all SAP windows incl. SAP Logon itself
  2. Set the DPI scaling of ALL your monitors to 100% (means, no scaling) in Windows display setting.
  3. Restart SAP WinGUI
  4. DONE

So, the monitor scaling would be set to 100%, then automation and identification will work 100%

Best regards, Lev

10 Likes

Hi @LevKushnir

Thanks. that’s solved it. Had my laptop at 150%, and my monitors at 100%.

So much easier now!
kind regards

Murray

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.