SAP Robot Template

This template is an example of a robot using the SAP module. The robot logs on to SAP with the configured connection, username, and password, and then opens an SAP transaction. In this example, the transaction to open is VA01.

For a more complex case of how to use SAP, see the SAP tutorial.

Workflow

SAP-robot-workflow.png

Robot configuration

The robot that is generated with this template contains some values that must be modified to work in your environment.

Location of the executable"saplogon.exe"

The robot assumes that the executable saplogon.exe is in the default path selected by the SAP GUI installer: "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe". If your local installation is on a different path, you will have to modify the SapConstants.App class.

1
2
3
4
5
6
7
8
9
  /**
     * The Class App.
     */
    public class App {
        
        public static final String SAP_EXECUTABLE_PATH = "C:\\Program Files (x86)\\SAP\\FrontEnd\\SAPgui";
        public static final String SAP_EXECUTABLE = "saplogon.exe";
        
    }

SAP logon name

To log on to SAP we need to select a system logon. In our environment this is "SAP Demo". The SAP_CONNECTION constant must be modified within the robot class RobotSapTemplate.java.

1
2
 /** The Constant SAP_CONNECTION. */
    public static final String SAP_CONNECTION = "SAP Demo";

2236285.png

Use credentials for accessing SAP

The robot utilizes a user and a password previously configured in the Credentials list. The robot asks the credentials module for a user/password with the application name SAP_IDES. The constant containing the application name for the credentials module is as follows:

RobotSapTemplate.java

1
2
 /** The Constant CREDENTIALS_SAP_APPLICATION. */
    private static final String CREDENTIALS_SAP_APPLICATION = "SAP_IDES";

It must match the one defined in the credentials module:

sap-credential.png

Open in Github

On This Page

FEEDBACK