Target system: SAP
This page describes what Save2ERP expects from an SAP system, and the information to pass on to the administrator of the Save2ERP server.
Identifying the system
Each SAP system is identified by its logical system, for example P01CLNT100. This name is:
- written by SAP in the
S2E_SystemKeyproperty of the documents it generates; - used by the administrator in the names of the server variables (
SAP_P01CLNT100_…, see Configuring the server).
Both must be identical.
OAuth2 server
Save2ERP uses SAP's OAuth2 server (transaction SOAUTH2), with these addresses, specific to each client:
| Service | Address |
|---|---|
| Authorization | /sap/bc/sec/oauth2/authorize?sap-client=<client> |
| Token | /sap/bc/sec/oauth2/token?sap-client=<client> |
| Revocation (sign-out) | /sap/bc/sec/oauth2/revoke?sap-client=<client> |
In SOAUTH2, register an OAuth2 client for Save2ERP:
- "authorization code" flow; Save2ERP also uses PKCE and the refresh token;
- redirect URI: the public address of the Save2ERP server followed by
/auth/callback, for examplehttps://save2erp.my-company.com/auth/callback, identical to theOAUTH_CALLBACK_URIvariable; - scope: the one of the attachments REST service;
- an ID and a secret, passed to the Save2ERP administrator through a secure channel.
At their first sign-in, the user sees SAP's authorization page and accepts that Word saves documents on their behalf. With single sign-on (SSO), they usually do not have to enter a password.
REST services
The three required services of the API contract must be exposed by SAP, under a common base address (APIBASE), for example https://sap.my-company.com:44300/rest. Save2ERP adds the sap-client parameter with the client number to each call.
To offer designer mode, SAP also exposes two optional services: the user permissions (/attachments/permissions) and the template XML (/attachments/readTemplateXml).
If your paths differ from the default ones (/attachments, /attachments/check, /attachments/healthcheck, /attachments/permissions, /attachments/readTemplateXml), tell the administrator.
If a gateway in front of SAP requires an API key, give the name of the HTTP header and its value: Save2ERP adds it to each call.
Information to pass on to the administrator
| Information | Save2ERP server variable |
|---|---|
| Logical system | variable names: SAP_<system>_… |
| Environment: SBX, DEV, QUAL or PROD | SAP_<system>_ENV |
| SID | SAP_<system>_SID |
| Client | SAP_<system>_MANDT |
| Base address of the REST services | SAP_<system>_APIBASE |
| Address of the OAuth2 server | SAP_<system>_OAUTH_SERVER |
| OAuth2 client ID and secret | SAP_<system>_OAUTH_CLIENT_ID, SAP_<system>_OAUTH_CLIENT_SECRET |
| Scope | SAP_OAUTH_SCOPE (or SAP_<system>_OAUTH_SCOPE) |
| Service paths, if different | SAP_<system>_ATTACHMENTS_PATH, _CHECK_PATH, _HEALTHCHECK_PATH, _PERMISSIONS_PATH, _TEMPLATE_PATH |
| Gateway API key, if needed | SAP_<system>_APIKEYNAME, SAP_<system>_APIKEY |
If SAP uses a certificate issued by an internal authority, also pass on that authority's certificate: the Save2ERP server must be able to verify it.
Messages
The messages returned by the services are shown as is in Word: write them in the user's SAP logon language.