Skip to Content
Product Information
Author's profile photo Lea BENVENISTE

SAP Intelligent RPA 2.0: How to Launch SAP Logon in unattended mode

In this blog post you will learn how to launch the SAP Logon application with an unattended bot using the custom script activity, environment variables and trigger.


Create an automation


Set up environment variables in the project


First we need to create environment variables in a new project. Click on the parameter’s icon to open the project properties and click on the Environment Variables tab

Here you can create four variables: system, client, user and password. For the password put the type as Password instead of string like the other three.

Create the workflow


Now you can create an automation and put the Custom Script activity in your workflow.

Click on Edit script.

Add the variables that we will use in the script so when you write the script, the binding between the variable and the input will be made. As input, you will need the system, the client, the user and the password. For the password input specify the type as password and not string so your password is protected.


Then write this line in the script:

irpa_core.core.shellexec(‘sapshcut.exe’, ‘-system=’ + system +  ‘ -client=’ + client + ‘ -user=’ + user + ‘ -pw=’ + password);


This line makes the sap Logon start and log with the system, the client, the user and the password you specified. That is what the ‘+ client’ for example means. We concatenate our variables to the line that will be executed on a shell by the automation.



Now we need to give those variables to the Custom script activity. Click on the close cross to close the edit tab.

For every input parameter write the name of the variables then click on the variable that is suggest with the blue E before. Now the automation to log on is complete and we can setup the environment to launch this automation in unattended mode.


Create your project package


To be able to add your project in your environment you need to create a package first. To do that go to the overview page of your project and click on the Generate Package button, and again on Generate Package.

Set up the environment


In your environment, in the package page, click on Add Package, then search for the name of your package (it’s the same name as your project if you didn’t modify it in the generation of the package step).

Click on it and click on the Next button.

You can choose to setup your variables at this step, or latter at the trigger creation step. The difference is you can create multiple triggers to have different user for example is you setup the variables at the trigger level.


Create a trigger


On the trigger tab of your environment, click on the Add Trigger button.

Select your package, there should be a green deployed next to it. Click on the Next button. You can now setup your variables and click on Next.

You can choose the trigger type, for this automation we want it in unattended mode so click on Scheduled and Next.

Then you can setup the trigger to be executed when you want. In this example we put the trigger to go once a day at 9 am.

Then click on Create to finalize the setup of your trigger.

To test it, click on the three dots of the trigger and click on run now. Don’t forget to have your agent in unattended mode. The first time you launch the bot this popup might appear.

You can click on Remember My Decision then Allow to not have this popup show again.




In this blog post we learn how to create an automation with a custom script that logon automatically in SAP Logon. We also learn how to manage variables from the environment to the concatenation in the custom script. And finally how to setup and scheduled a job in the environment with a trigger.


Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Sven Diedrich
      Sven Diedrich

      Hi Lea,

      most customers are using SSO with SAPGUI, hence the command should be like this described:

      Author's profile photo Umut Yazici
      Umut Yazici

      Thanks Lea...

      Author's profile photo Miguel Mavo
      Miguel Mavo

      Thnks Lea. do you know if can I do the same with windows session ?  because I have an issue for send keystrokes with locked session , in this case send F2 and Enter to generate a result by a Excel formula in an specific cell. Doing that I mention in attended mode being logged in the server  works just fine but in locked mode when go out keystrokes fails because it can't unlock the screen. So, do you suddenly knows what could I do to make it works in unnaetended?  thanks a lot in advance. regards!.

      Author's profile photo Indrajit Shah
      Indrajit Shah

      That's a good read.

      I need one help that's upon running the above script the SAP Logon is opening in normal screen where as I want it to be in maximize screen, help me how can I do that?

      Author's profile photo Jaroslav Liska
      Jaroslav Liska

      Hi, thank you, its working nicely. Is there a way how to enhance this with running sap gui maximized? I have found commands like -wsz=maximized or simply -maxgui etc, but nothing seems to be working.