SAP S/4HANA
16 min
let’s learn how to connect engini to sap s/4hana this integration allows you to connect engini workflows to sap s/4hana and work with your sap business data and odata services directly from engini to get started, create an account at sap s/4hana https //www sap com/mena/products/erp/s4hana/trial html getting started with sap s/4hana prerequisites before creating an sap s/4hana connection in engini, make sure you have access to an sap s/4hana environment with odata services enabled the sap s/4hana / sap gateway base url valid authentication credentials for the sap environment permission to access the required odata services and business objects at least one available sap odata service that can be selected as the service name during the connection setup depending on your sap environment, authentication may require a username and password or another supported authentication method configured by your sap administrator note if you do not know the sap gateway url, authentication details, or which odata service to use, contact your sap administrator add a connection to sap s/4hana in engini enter your engini account at https //app engini io https //app engini io/ navigate to connections page by clicking on the connections on the left sidebar or by clicking here https //app engini io/connections click on the "new integration" option located at the top bar choose sap s/4hana option from the available applications enter the following details in the “new integration” form and press save note there are two different authentication methods available, and the required fields differ depending on the option you choose please follow the relevant instructions based on your selected method oauth2 uses an authorization flow and access tokens instead of directly using the user’s password it is generally more suitable for secure, controlled access and token based authorization connection name enter a clear and recognizable name for the sap s/4hana connection so it can be easily identified later in engini authentication method select oauth2 sap host enter the base url of your sap s/4hana or sap gateway environment use the host only, without adding a specific service path sap odata service select the sap odata service that engini should use for this connection the available services are loaded based on the connection details entered above oauth client id enter the sap communication user id or oauth client id used to authenticate the connection oauth client secret enter the sap communication user password or oauth client secret associated with the selected authentication credentials sap client (mandant) enter the 3 digit sap client number, such as 100, when connecting to an on premise or private cloud sap environment leave this field empty for cloud tenants when it is not required communication channel select the communication channel that matches your sap environment, such as cloud or the relevant on premise/private cloud option use csrf token enable this option if your sap environment requires a csrf token for write operations when enabled, engini retrieves a fresh token before the request save click save to create the sap s/4hana connection using the configured settings basic uses a username and password to authenticate directly with the sap system it is simple to configure but relies on storing and sending user credentials with the connection connection name enter a clear name to identify this sap s/4hana connection in engini this helps distinguish it from other sap connections configured in the same account authentication method select basic sap gateway host enter the sap gateway host url that engini should connect to use the base host only, without adding a specific odata service path, for example https //s4host 44300 username enter the sap gateway username used for authentication this user must have the required permissions to access the selected sap odata service password enter the password associated with the sap gateway user it is used together with the username when basic authentication is selected sap odata service select the sap odata service that should be used by this connection the available actions and data will be loaded according to the selected service, for example api purchaseorder process srv communication channel select how engini should communicate with the sap environment choose the appropriate channel according to how the sap system is exposed and connected use csrf token enable this option if the sap host requires a csrf token for write operations when enabled, engini fetches a fresh token for each request instead of storing it save click save to store the sap s/4hana connection after all required connection details have been configured actions get records retrieves multiple records from the selected sap s/4hana object, with optional filtering, sorting, and pagination object type select from the drop down the type of record you want to retrieve top n you can set the maximum number of records engini will return for the object you chose (default = all records) offset specifies the number of records to skip before retrieving results the default value is 0 add filter click add filter to define conditions that narrow down the data list and return only the relevant items to learn more about using filters, click here https //help engini ai/workflow editor#add filters add sort click add sort to organize the data list by a selected field in ascending or descending order to learn more about sorting data, click here https //help engini ai/workflow editor#add sorts get record retrieves a single record from the selected sap s/4hana object using its identifying value or key object type select the sap s/4hana object you want to work with once an object is selected, the relevant record identifier field is loaded dynamically based on that object create record creates a new record in the selected sap s/4hana object using the field values provided in the workflow object type select the sap s/4hana object in which you want to create the new record once an object is selected, the relevant fields required to create that object are loaded dynamically update record updates an existing record in the selected sap s/4hana object using the new field values provided in the workflow object type select the sap s/4hana object that contains the record you want to update once an object is selected, the relevant record identifier and editable fields are loaded dynamically based on that object delete record deletes an existing record from the selected sap s/4hana object based on its identifying key or record information object type select the sap s/4hana object that contains the record you want to delete once an object is selected, the relevant record identifier field is loaded dynamically based on that object get metadata retrieves the odata metadata exposed by the selected sap s/4hana service, including its available entities and structure list services retrieves the available odata services exposed by the connected sap s/4hana environment so a service can be selected initialize object array creates a new empty object array that can be populated with records or values during later workflow steps variable name enter a name for the object array variable so it can be referenced and reused in later workflow steps object element type select the object type that defines the structure of the items stored in the array the available values are loaded dynamically append to object array adds one or more objects to an existing object array, allowing additional items to be collected and processed later in the workflow variable select the object array variable you want to append to once a valid array is selected, the relevant fields for that array’s object type are loaded dynamically so you can provide the values to add map object array transforms an object array by mapping selected source fields into a new output structure for use in later workflow steps data list select or map the source object array that you want to transform this should contain the records or objects that will be processed by the mapping object name select the target object type for the mapping once selected, the relevant fields for that object are loaded dynamically so you can map values from the source array into the desired structure send api request sends a custom api request to the connected sap s/4hana service, allowing access to endpoints not covered by the predefined actions base url the main endpoint of the api you want to call (e g , the server or service url) relative url the specific path or resource you want to access, appended to the base url method defines the http method used for the request (e g , get, post, put, delete) body type specifies the format of the request body (e g , json, form data) application/json – sends the request body in json format commonly used by rest apis application/json – sends the request body in json format commonly used by rest apis custom (use content type header) – allows you to define a custom body format by manually setting the content type header application/x www form urlencoded – sends the body as url encoded key value pairs, commonly used in form submissions file – sends a file as the request body multipart/form data – sends form data that may include both text fields and files text/html – sends the request body as html content text/plain – sends the request body as plain text text/xml – sends the request body in xml format body the payload sent with the request, usually required for methods like post or put add headers allows you to include additional headers (e g , authorization, content type) required by the api add queries allows you to add query parameters to the request url (e g , filters, pagination)