RPA.SAP related issue that the keyword is not working

I am a beginner here in Robocorp and facing the issues like :-

(RPA.SAP) Open Connection and Connect To Existing Connection is not working while trying to connect with SAP GUI. It is not mentioned that what are the arguments to be passed under this keyword.

connect session is working but unable to open a connection because there are not any proper syntax is available so not getting what are the arguments to be passed.

we have already created the session but when running the script to connect existing session it is throwing error that unable to connect session.

Also, it is not properly explained that what are the parameters to be passed under all the commands. could you please provide the good docs where example is available for all the keyword.

could you please tell us that why this keyword is not working.

thank you,

Hi and welcome to the forum :smiley: !

We indeed have to improve our SAP library documentation that is for sure.

The SAP Gui Login is my custom keyword which I have used to login into SAP.

Keyword steps explained:

  • Open Connection takes as argument the connection name you have entered when you created connection entry into SAP Gui
  • Then Input Text and Input Password keywords are used to enter in arguments which connection open requires - the clientID, user name and password
  • Send Vkey 0 presses enter to complete login

Variables explained:

  • ${EXE_PAD} is absolute filepath to saplgpad.exe
  • ${TITLE_PAD} is the window title of the saplgpad.exe application once it has started
  • ${FIELD_CLIENT} is the locator for Client input field, wnd[0]/usr/txtRSYST-MANDT
  • ${FIELD_USER} is the locator for User input field, wnd[0]/usr/txtRSYST-BNAME
  • ${FIELD_PASSWORD} is the locator for Password input field, wnd[0]/usr/pwdRSYST-BCODE

The custom keyword steps:

*** Keywords ***
SAP Gui Login
    Disable Screenshots On Error
    Windows.Open Executable    ${EXE_PAD}    ${TITLE_PAD}
    Connect To Session
    ${secrets}=    Get Secret    sap
    SAP.Open Connection    ${secrets}[connection]
    SAP.Input Text    ${FIELD_CLIENT}    ${secrets}[client]
    SAP.Input Text    ${FIELD_USER}    ${secrets}[user]
    SAP.Input Password    ${FIELD_PASSWORD}    ${secrets}[password]
    SAP.Send Vkey    0

I hope this was helpful for you ?

Mika / Robocorp


Hi and welcome @b.k.bhardwaj23

in addition to @mika 's great explanation I also did a short video about this topic:



Hi @mika and @RoboHeart

Thanks a lot. It helps me to run the code.

Few things i am not understanding, could you please help there also :-
1). can we create a new connection also by writing code? (Open connection keyword is not creating the new connection, if we have already the connection created manually then it is opening that connection)
2). How you people are finding the locator like wnd[0]/usr/txtRSYST-MANDT, wnd[0]/usr/txtRSYST-BNAME and wnd[0]/usr/pwdRSYST-BCODE…
could you please guide me also to find the locator… currently i am using the Accessibility Insights for windows to find the locator but not getting anything like this you have given…

Is there any video for this? Please share the link if it is available.