Questions about using SAP GUI Scripting and SAP RFC-Functions inside UIPath

sap
studio

#1

Hello to everyone :slight_smile:

I hope this is the right category to ask These kind of technical questions. If not, please move it to the right section, thanks :smile:

We actually start a PoC with UIPath.
Our Company works with SAP (Basic and programmed Addons).

For SAP Automation I normally use SAP GUI Scripting and SAP RFC Functions but now we want to do that inside the RPA Software.

Now I have a few technical Questions.

  1. Question:

The Identifer of SAP GUI Element in UIPath seems to be the ID.

But these IDs are changing with every new SAP Release.

Is it possible to use another Method instead of “FindById” or OCR?

For example in SAP GUI Scripting you can use the “findbyname” Method to find the Element with its technical Name and Fieldtype.

Example:

Findbyid:
session.findById(“wnd[0]/usr/subSCREEN_3000_RESIZING_AREA:SAPLBUS_LOCATOR:2036/subSCREEN_1010_RIGHT_AREA:SAPLBUPA_DIALOG_JOEL:1000/ssubSCREEN_1000_WORKAREA_AREA:SAPLBUPA_DIALOG_JOEL:1100/ssubSCREEN_1100_MAIN_AREA:SAPLBUPA_DIALOG_JOEL:1101/tabsGS_SCREEN_1100_TABSTRIP/tabpSCREEN_1100_TAB_01/ssubSCREEN_1100_TABSTRIP_AREA:SAPLBUSS:0028/ssubGENSUB:SAPLBUSS:7005/subA02P09:/GKV/SAPLBP02_U_XBP1:0200/ctxt/GKV/BP02_STR_U_PERS_SCR-BIRTHTITLE_TEXT”).setFocus

vs.

FindByName:
session.findById(“wnd[0]”).findByName("/GKV/BP02_STR_U_PERS_SCR-BIRTHTITLE_TEXT ",“GuiCTextField”). setFocus

With every SAP Release the SAPLBUSS Number are changing and the recorded ID is not valid anymore.

Sure, we could use directly a VBS but it would be better to have it inside UIPath.
OCR is also not the best way for us, cause we have few Elements (Images, Buttons etc.) which looks the same and also have the same text.

I was trying to use Invoke Code Method to execute SAP Scripts but no success (Late Binding is not allowed)

Is there Way to use SAP Gui Scripting directly inside UIpath?

  1. Question:

Is it possible to use SAP BAPI / RFC Functions Calls inside UIPath? (for example RFC_READ_TABLE) ?

We have a lot RFC Functions we can use (actually we use it inside VBA Makro) which we could use instead of using long SAP GUI Recordings.

For example we get live access (readonly) to SAP Database to compare different Data and do decisions on that instead of looping through the GUI to the desired fields.
This would make the Process very stable and supportable.

Thanks to anyone with Information on that stuff :slight_smile:

Greetz
Sebastian


#2

Nobody?

It would be nice to get some Information about this :slight_smile:

Greetz
Sebastian


#3

Hi Sebbi,
Sorry I am not here to answer your questions, but I have some doubts. Even I have to start POC on SAP automation. Can you please let me know the prerequisites for that?


#4

Hi to all,

I am looking for the same features!

@Sebbi ,

did you (or somebody) got it working?

If yes please share the solution here :slight_smile:

Greetz Bernhard


#5

I am looking for an approach to call vbs file with inout and outout paramteres in uipath


#6

I was trying the same, but never found a way to get an “outout” Argument back to UiPath.
The only thing that could work is to store the Output in another File and read it by UiPath.

Looking back to my Question in the beginning, I am now able to use SAP Gui Scripting and SAP RFC-Functions the way I want (Different Methods with SAP Gui Scripting and RFC-Calls)

The solution was to write a Custom Activity.

After reading some Tutorials I was able to make it visible and working inside UiPath.

For each SAP RFC/BAPI you have to write an own Custom Acitvity cause the way you call is always different.

Note:
By using SAP .Net Connector dll´s there was a Problem with the specific RFC-Connections/Sessions. It seems that UiPath doesnt Close the Connection, so it was impossible to use it 2 Times in a working Process.

I decided to use the normal SAPFEWSELib.dll with SAP.Function/BAPI.Control.

When I got time to speak with my Company about it, I will publish my Solution here later.

Greetz Sebbi


#7

Nice response Sebbi did you try an do anything on User Impersonation or are you running each BOT in the context and environment of a normal SAP user?