Additional Window Attributes for SAP Windows

Hello UiPath Team,

via Get Attribute activity is it possible to get a selection of properties of the GuiSessionInfo object from the SAP GUI Scripting.

In Uipath Studio it called e.g. sapLanguage, sapProgram or sapScreen. A long time ago I posted in the SAP Community about this possibility to identify an SAP session via this properties.

So far so well. For the SAP GUI Scripting is the connection and session number very important. So is my suggestion to add this information as additional attributes to SAP windows. You can do it very easily, select from the session ID the numbers. The session ID looks like this: /app/con[0]/ses[1]. This means my selected session is in connection 0 and it is session 1. On this way it would be very easy to use existing SAP GUI Scripts with UiPath, like I described here. For the identification of a window, e.g. with the Attach Window Activity, this information is of minor importance. But for an integration scenario with an external SAP GUI script are they very important.

In my opinion it should be very easy to realize this. You work with the GuiSessionInfo object, so you know the GuiSession object and with the property ID you get all you need. All you have to do is to detect the numbers. Here my approach in VBScript:

pos = InStr(session.Id(), "con[") + 4
len = InStr(pos, session.Id(), "]") - pos
connectionNumber = CLng(Mid(session.Id(), pos, Len))
pos = InStr(session.Id(), "ses[") + 4
len = InStr(pos, session.Id(), "]") - pos
sessionNumber = CLng(Mid(session.Id(), pos, Len))

This possibility would be fantastic. Integration scenarios with SAP GUI Scripting are on this way a child’s play.

Thanks for all your efforts.
I wish the whole UiPath team a successful 2020.

Best regards
Stefan

HI @StefanSchnell

Thank you for your input and idea!

With UiPath Studio 19.7 (UiPath 2019 Preview (Community Edition v2019.7.0)) we implemented the extended support for SAP session information to allow unique identification of SAP windows.

From 19.7 and all versions above there are following attributes available for selectors:
sapClient, sapLanguage, sapProgram, sapScreen, sapSession, sapSysName, sapSysNumber, sapSysSessionId, sapTransaction, sapUser

See an example here:

Please try it out and let me know, if you have any more questions or ideas

Best regards, Lev

1 Like

@LevKushnir

Hello Lev,
thank you very much for your reply.

Yes, UiPath delivers a selection of attributes from the SAP GuiSessionInformation object.

Please look at your example ID, it starts at the user screen hierarchy
usr/subSUBSCREEN_HEADER:SAPMV45:4021...
but the full SAP GUI Scripting ID looks like this
/app/con[0]/ses[0]/wnd[0]/usr/subSUBSCREEN_HEADER:SAPMV45:4021...
It starts with application, connection, session and window and then follows the user screen (usr). Please take a look at slide 21 of this SAP presentation.

From the perspective of UiPath it is not necessary to know the full hierarchy, because you identify the window with other selectors. But if you want to start an external SAP GUI Script from UiPath are these information very helpful to do that easily. That is the target of my suggestion.

In my opinion is this a tiny extension for you, because all necessary information are in the context of UiPath available.

Thanks for your effort.
Best regards
Stefan