SAP Connector
Introduction
This page describes the usage and the configuration of the Synchronization SAP Connector aimed at provisioning SAP systems.
The SAP Connector is compatible with SAP R/3, SAP ECC, SAP S/4HANA. It uses BAPI functions to manage users or other objects in SAP.
The reader is supposed familiar with the structure of a SAP user account, namely attributes formatted such as ADDRESS.FIRSTNAME.
Configuring the SAP Connector
To configure the SAP Connector, just declare a ConnectorDefinition (see Application Connector) with the following characteristics:
Connector class:
com.evolveum.polygon.connector.sap.SapConnectorConnector properties: see table below:
Property Name | Type | Mandatory | Description | Values (default value in bold) |
|---|---|---|---|---|
loadBalancing |
| NO | If false (the default), connect to the SAP ABAP application server gateway, else connect via message server (less common) | false |
host |
| YES | SAP ABAP application server gateway, or message server host | - |
user |
| YES | Logon user TODO list required rights to provision accounts | - |
password |
| YES | Logon password | - |
logonGroup |
| NO | SAP Logon group, applicable only if | SPACE |
systemId |
| YES | System ID of the SAP system (r3Name) | - Example: S4H |
systemNumber |
| NO | System number of the SAP ABAP application server | 00 |
client |
| YES | SAP client (mandant), 3 digits | - Example: 100 |
messageServer |
| NO | Message Server, applicable only if If provided, then | - |
destinationName |
| NO if non-CUA env YES if CUA env | Destination name. For SAP CUA (see For non-CUA, it may be left empty, it then defaults to the concatenation of systemId+systemNumber+client+user | Non-CUA : concatenation of systemId+systemNumber+client+user CUA: Central CUA destination name, for example: S4HCLNT400 |
lang |
| NO | SAP language used by the logon user | EN |
poolCapacity |
| NO | Maximum number of idle RFC connections kept in the connection pool. 0 means no connection pooling | 1 |
peakLimit |
| NO | Maximum total number of active RFC connections allowed at the same time. Includes:
Once this limit is reached, new RFC requests wait until a connection is released. 0 means no limit, any number of concurrent RFC calls is allowed | 0 |
changePasswordAtNextLogon |
| NO | If true, at next SAP GUI logon the user must change their password | false |
alsoReadLoginInfo |
| NO | If true, for each user, run BAPI function | false |
includeIndirectActivityGroups |
| NO | When reading a SAP user, whether role assignments coming from a composite role are included in the user account properties. If set to | false |
preserveActivityGroupsMetadataOnUpdate |
| NO | Preserve role metadata when updating user roles, namely the “assigned from” and “assigned until” information | true |
tables |
(multi-valued) | NO | Describe the name and structure of generic SAP tables to read, aside users and profiles. User and profiles tables management is built-in in the SAP Connector. For example: In this example, we aim to import or provision activity groups (user roles):
Due to technical constraints, all columns of a SAP table must be enumerated in their native SAP order, even those who shall be ignored. Only the trailing columns which aren’t of interest can be omitted from the table description Note: the structure of SAP table names can be found online, see for example https://leanx.eu/sap/table/AGR_DEFINE/ | 2 values are configured by default: AGR_DEFINE as ACTIVITYGROUP=MANDT:3:IGNORE,AGR_NAME:30:KEY,PARENT_AGR:30 USGRP as GROUP=MANDT:3:IGNORE,USERGROUP:12:KEY |
nonFatalErrorCodes |
(multi-valued) | NO | Specify which SAP error codes are considered as non-fatal in user create/update response. For example, 025 (company address cannot be selected), 410 (maintenance of locked user) | Empty list |
baseAccountQuery |
| NO | Simple filter added to all user account queries to limit the accounts read by Example: | - |
considerGlobalLock |
| NO | Evaluate local and global lock for user account status, i.e. consider account | false |
cuaEnabled |
| NO | Whether SAP CUA is enabled. If Enabling CUA support has the following consequences:
CUA aspects are detailed in the next sections | false |
Note about the SAP connection port
The SAP connection port is not configured explicitly, it is derived from configuration parameters:
for a direct connection to the SAP application server gateway (the most common case), the port is constructed using
systemNumber, as follows: port = 33<systemNumber>. For example, if systemNumber=00, the port is 3300for a load-balanced connection via Message Server, the port may be directly specified with the
messageServerproperty. Otherwise, it is constructed usingsystemNumber, as follows: port = 36<systemNumber>
Managing SAP User Roles
Roles are referred to as “activity groups” in SAP parlance.
There are 2 kinds of SAP roles:
single roles, containing authorization objects, effectively used to perform access control
composite roles, which are containers that group together multiple single roles. Composite roles cannot be nested, i.e. a composite role cannot contain another composite role
Roles are assigned to SAP user accounts. A user role assignment has the following properties:
the role name, referred to as
AGR_NAMEin SAP parlancea “valid from” date, referred to as
FROM_DAT, indicating when the role assignment becomes effectivea “valid to” date, referred to as
TO_DAT, indicating when the role assignment stops being effectivehow the role was assigned, i.e directly or indirectly via a composite role
Roles assigned to a user are exposed by the SAP Connector in 3 multi-valued user properties:
User Property Name | Mode | Description | Values Example |
|---|---|---|---|
| Read Write | Contains the simple names of the roles assigned to the SAP user. Other role assignment properties, such as “valid from”, are omitted. By default, only direct role assignments are present in this property, unless the SAP Connector is configured with When provisioning SAP users, this property can be used to set (write) the user roles. It overrides then all the user’s roles. If this property is used when creating a user, then by default, If this property is used when updating a user, then the original For the SAP CUA case:
The simplicity of this property (list of simple strings) makes it a good candidate to drive a basic provisioning of user roles. However, it is not possible to specify the role assignment validity dates through this property. To achieve that, see next property | Non CUA case, 2 roles are represented:
CUA case, equivalent roles:
|
| Read Write | Lists the direct roles assigned to a user in XML format (indirect roles are also listed if Each role is represented by a single one-liner XML document, formatted as follows:
When creating or updating a SAP user, setting this attribute enables to define the role assignment validity dates. Due to a technical limitation of the current SAP Connector version, this format must be strictly respected if If both To avoid conflicts, only one of them should be configured as Attribute Mapping. | Non CUA case, 2 roles are represented:
CUA case, equivalent roles, note the presence of the
|
| Read Only | This property is set on the user when It is a read-only property, aimed at displaying in full XML format all the user’s roles, both direct and indirect. Indirect roles are assigned via composite roles, they can be identified by the presence of the Direct roles are characterized by the empty If a role description has been configured, it will be displayed in the When obtaining all a user’s role in the | Non CUA case. In this example:
2 of those roles are represented below (direct and indirect):
|
Additional SAP CUA Notes
In a SAP CUA landscape, users are created on target CUA systems, and roles are assigned on target CUA systems.
The CUA Central System must be referenced in the main SAP Connector properties, namely host and client.
Even if a user was not explicitly added to a CUA system via the SYSTEMS attribute, assigning a role on this system is enough to trigger the implicit creation of the user in the system.
For now, the SAP Connector only interacts with the Central CUA System. The Central CUA System distributes asynchronously users and roles on target subsystems. This means that if a distribution on a target subsystem ends up in error, because the remote subsystem is not available, the SAP Connector won’t be aware of it, and wrongly report the whole provisioning operation as successful. This limitation shall be alleviated in a future SAP Connector version, where each CUA subsystem will be polled in turn, to ensure that its distribution was correct. This may have an impact on performance, but data consistency is an essential aspect of IM operations.
By directly querying subsystems, it will also be possible to obtain the full list of roles for a target system, including those assigned indirectly via composite roles. The ALL_ACTIVITYGROUPS user attribute will thus contain the exhaustive list of user roles, and both ACTIVITYGROUPS.AGR_NAME and ACTIVITYGROUPS will reflect the real role assignations, not those supposed correct by the Central CUA System.