Click Tabs in SAP /cockpit/1

Hi All,

I have a question about SAP, which is to click tabs inside SAP /cockpit/1.
image

I’ve found that the ID of element keep changing, causing the Robot unable to identify the element correctly.


I’ve tried to replace the highlighted part with wildcard to counter the issue, but the selector become not validate and Robot unable to find it.

Do you guys have any solutions on this?

Thank you.

Hi

Is this appearing as invalid after including wildcard even if that page of Sap is opened in background

If the page is not open then it will show as invalid
Only

Give a run once after replacing it with wildcard
It should work

@Gwen

@Gwen

Hello Gwen,
as @Palaniyappan wrote, the wildcards works with SAP Screen numbers. SAP Screen numbers, in your case 0389, are very often a problem in the automation. Your approach to replace it with a wildcard is correct. But you should “wildcard” your title too. “Display Invoice 2334352 (28 / 75)” as title applies only to a single case. Use instead “Display Invoice *”. It should work with that.
Best regards
Stefan

Alter the selectors see the possibilities and can you check Uipath explorer that selector exactly defined for tabs. That can avoid confusion changing. and also it may be the issue with SAP was defined in background as well . Activate the exact window that you required

Hi @Palaniyappan,

Yes, it is invalid after including wildcard and even the same page of SAP is opened the in background.

It runs into exception.
image

Hi

I can see few more places being dynamic apart from what we have now replaced with wildcard

If you see in the selector
038* is done
Another one is there which looks dynamic
SAPDISPLAY46:0405

Change that number with wildcard as well
And give a try

@Gwen

Hi @Vijay_RPA,

I have checked the possibilities in UiPath Explorer, there’s only ID available.

Hi @StefanSchnell,

Yes, I do change the title to wildcard, but the main issue is on the ID. The Robot not able to identify the selector after replace the ‘0389’ or ‘0385’ with wildcard ‘038*’.

Hi @Palaniyappan,

Still no luck. :frowning:

Use title like this “Display Invoice *”.

And did we try using Sap Wingui activities

Cheers @Gwen

Hi @Palaniyappan,

Because the title could be Display/Change Invoice (xx/xx) or Display/Change Credit Note (xx/xx) depending on the business requirement process. So, I set the title as * to be safe.

I tried to use Select SAP Menu Item and replace the ID selector with wildcard, still getting invalid selector.

Probably there’s something to do with the code in SAP.

Hi @Gwen,

Did you try changing the default framework and check if there are any parameters which can be included as part of selector apart From ID.
Hope this helps… Let me know if you need more details.

@shivagowdavarad please NEVER change the default identification framework in SAP WinGUI!

“Default” ensuring the identification of all elements with help of SAP WinGUI API Scripting

3 Likes

Hi @LevKushnir,

Noted, thanks for the Input.

I recommend that here since it was just a standard click activity used in the context.

@Gwen

Hello Gwen,
I tried it and in my case with my example it works without any problems.

We discussed the same problem a few month ago here, but unfortunately without any result.

Here you can find another post, which describes the same behavior.

Could it be possible that the id changes on different positions?

Best regards
Stefan

Hi @Gwen,

Seems that you hit a known problem with SAP id scheme. The problem here is that the control in the id that you are trying to use wildcards has slashes in its name and we cannot identify the hierarchy properly.

You have 2 solutions:

  1. You can use regex matching (RegEx Search), but I don’t recommend this since it’s slower
  2. Replace all slashes(’/’) in the control name with ‘?’ (simplest and recommended solution)

In your case you should use:
<sap id='usr/subSUB_MAIN:?COCKPIT?SAPLDISPLAY46:038*/subSUB_HDR:/COCKPIT/SAPLDISPLAY46:04051/tabsG_STRIP_HDR/tabpTAB4' />

I am assuming the name of your container is subSUB_MAIN:/COCKPIT/SAPLDISPLAY46:0389. Please check this in UiExplorer for confirmation.

Please let me know if this solves it for you.

3 Likes

@raduc

Helle Radu,

very interesting. I tried this with the field name /SAPDMC/LSSCREEN-PROJECT from the report /SAPDMC/SAPMLSMW …

… and without wildcards all works well. With a wildcard and replacing all slashes, as you described, all works well too.

I assume that @Gwen have to set a few question marks more in his id:
<sap id='usr/subSUB_MAIN:?COCKPIT?SAPLDISPLAY46:038*/subSUB_HDR:?COCKPIT?SAPLDISPLAY46:04051/tabsG_STRIP_HDR/tabpTAB4' />

You should definitely document this.

Thank you very much for this important information.

Best regards
Stefan

Hi @StefanSchnell,

Yes, I already talked to @LevKushnir and we will document this.
Regarding the extra '?'s you added, they are not needed as that is another container/control. To be more clear, the replacement of '/'s to '?'s is only needed in the leaf id of the container control that requires wildcards.
subSUB_HDR:/COCKPIT/SAPLDISPLAY46:04051 would need this replacement only if you needed to use wildcards within it (for example: subSUB_HDR:?COCKPIT?SAPLDISPLAY??:*)

This is a picture (hopefully) explaining it better:
image

If you need to use wildcards inbetween hierarchy separators, then all (and only) the slashes between those separators/slashes need to be replaced by ‘?’.
The element will be found no problems with the extra ‘?’ you added (in subSUB_HDR:/COCKPIT/SAPLDISPLAY46:04051), but those are not needed and might potentially make the search slower (as we have to look through all the children at that hierarchy level for matches).

3 Likes

@raduc

Hello Radu,

thank you very much again for this clarification and important information.

Best regards
Stefan

2 Likes

@raduc
Hi Radu,

Yes, the container is subSUB_MAIN:/COCKPIT/SAPLDISPLAY46:0389.
Also, the solution works well for me!

This is interesting! I never thought that the hierarchy could be the issue for this.

Greatly appreciate and thanks for the useful information!

3 Likes