SAP Logon

Estimated reading: 4 minutes

The SAP Logon activity connects to an SAP system using the configured connection details or attaches to an existing SAP session. It makes the session available to child SAP activities within its Body.

Prerequisites

Before using the activity, ensure that:

1. SAP GUI for Windows, including the SAP GUI Scripting component, is installed on the execution machine.
2. The required SAP system connection is configured in SAP Logon.
3. SAP GUI scripting is enabled on the client and server.
4. The SAP system is accessible and the user has the required permissions.
5. Valid authentication, such as SAP credentials or Single Sign-On (SSO), is available.

SAP Logon and Authentication

Configure SAP GUI before using the SAP Logon activity. The activity connects to an existing SAP session or opens a new connection using the configured Application Path and Connection Name.

When a new connection is opened, SAP may require login unless Single Sign-On (SSO) or Secure Network Communications (SNC) handles authentication automatically.

Activity Canvas

Application Path:Specifies the path to the SAP Logon executable (saplogon.exe).
Example:
C:\Program Files\SAP\FrontEnd\SAPGUI\saplogon.exe

Connection Name: Specifies the name of the SAP system connection configured in SAP Logon. The value must be a String and must match the connection name on the execution machine.
Example:
SV4 GCP

Attach Session: Allows you to select an existing SAP session through the Designer and associate it with the activity.

Session Status: Displays the current session attachment status. If no session is attached, No session attached is displayed.

Activity Menu

The three-line menu provides the following options.

Attach Session: Attaches the activity to an existing SAP session through the Designer.

If no SAP session is open, the Designer displays a message indicating that a session is unavailable. Log on to SAP and select Attach Session again or configure a valid Application Path and Connection Name to allow the activity to establish a session at runtime.

Refresh Screenshot: Captures the latest screenshot of the SAP window and updates the image displayed on the activity canvas.

Remove Screenshot: Removes the displayed screenshot from the activity canvas without changing the SAP connection configuration.

Properties

INPUT

Wait Time: Specifies the maximum time, in milliseconds, that the activity waits for SAP Logon to launch and establish a connection. The default value is 30000 milliseconds.

The session resolver may wait at least 60 seconds when opening a new session.

MISC

DisplayName: Specifies the activity’s display name. Customize it to identify the activity in the workflow.

SkipOnError: Specifies whether workflow execution continues when the activity encounters an error.
True: Continues workflow execution when an error occurs.
False: Stops workflow execution when an error occurs.
None: Uses the default value, False.

Version: Displays the current version of the activity.

OUTPUT

Result: Returns a Boolean value indicating the activity’s execution status.
True: The activity executed successfully.
False: The activity failed due to an unexpected error.

SAP

Body: Provides a container for SAP automation activities that use the SAP session established or accessed by SAP Logon.

Connection Name: Specifies the SAP system connection used to establish or attach to an SAP session. The value is a String and corresponds to the connection configured in SAP Logon.

Session ID: Identifies the SAP session associated with the activity. It is retrieved automatically during execution and is not a user-configurable input.

Runtime Behavior

At runtime, the activity resolves the SAP session as follows:

1. Checks whether the saved Session ID is still open and belongs to the expected SAP system.
2. Reattaches to the existing session if it is valid. A session associated with a different SAP system is rejected.
3. If the saved session is unavailable or invalid, attempts to establish a new connection using the configured Application Path and Connection Name. SAP GUI is launched if required.
4. Retrieves the Session ID automatically and makes the session available to child SAP activities within the Body.

Session Timeout and Recovery

An SAP session may become invalid due to inactivity, manual logoff, network issues, authentication failures, SAP GUI crashes, or session limits.

If the session becomes invalid, subsequent SAP activities may fail with errors such as SAP GUI session is not attached or Element not found.

a. Use Try-Catch or SkipOnError to handle execution failures.
b. Rerun the SAP Logon activity, such as within a Retry Scope, to attempt to attach to an existing session or establish a new connection.

Session timeouts and limits depend on the SAP environment. Contact your SAP Basis team for configuration details.

Example

To automate purchase order creation in SAP:

1. Set Application Path to
    C:\Program Files\SAP\FrontEnd\SAPGUI\saplogon.exe.
2. Set Connection Name to SV4 GCP.
3. If required, attach to an existing SAP session through the Designer.
4. Add the required SAP automation activities inside Body to navigate to the relevant transaction and enter the required details.
5. If a new connection requires authentication, handle the login and verify that SAP Easy Access appears before continuing.

The Session ID is retrieved automatically.

Share this Doc

SAP Logon

Or copy link

CONTENTS
Robility Chatbot
Robility Assistant
Online