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
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.