SAP Data API with Evolve

SAP Data API is exposed to upload and download data from SAP. API is available for both Evolve and Studio Manager. This solution is governed by Script workflow along with script workflow settings. API exposes JSON payload and other details(like SAP, Run Settings etc.) for posting data to the SAP.

To access SAP Data API from Evolve follow the below steps:

  1. Activate a valid SAP Data API License.
  2. Create SAP API Store Library.
  3. Create a script in Studio to be used in adding SAP API from Evolve. Refer to Create script for integration with SAP Data API in SAP Data API with Studio.
  4. Add SAP API from Solutions Tab.

SAP API Store Library

For saving solutions of SAP Data APIs on Evolve, user needs to create a new library from Evolve. Below are the steps to create new Library :

  1. Go to Evolve → Configuration → Manage Libraries, in the app where Library needs to be created.

  2. Click on Add.

  3. Type to be selected should be SAPAPIStore .

  4. Provide Name and Description for the Library. Both are mandatory fields.

  5. Turn on Enable Document History if you want to generate documents for SAP API solution on execution. Default value will be false.

  6. Click on Save.

  7. Navigate to Solutions page and new library should be visible along with all other libraries.

When SapIntegrationAPIEnable key is enabled the SAPAPIStore library type will also be enabled for all Evolve Apps. This library would not be available for Reference Data apps. The SAPAPIStore library type will be enabled under Add Library. Only the App Administrators and Global Administrators are allowed to add this library.

To manage “SAPAPIStore” type library permissions navigate to Configuration → Manage Libraries from Evolve and select SAP Data APIs by clicking on the checkbox present on table grid. Click on Manage Library Permissions. Like Form library, SAPAPIStore library also has two manage permission options, Processes Permission and Library Solution Permission for managing SAPAPIStore library permissions. Process Permission has default permission set to Originator; User can delete default permission and add any group of Originator permissions. Library Solution Permission has default permission set to Solution Developer and Solution Reviewer; User can delete default permissions and add any group of Solution Developer and Solution Reviewer permissions.

SAP API Approval Settings can be added on App → Preference → Design Preference page, with the following three options. The default value is false for all three options.

  1. Solution Approval: If Set to True, Solution submitted to Evolve will be under review until Reviewer approves it from tasks.

  2. Self Approval: If Set to True, User Submitting Solution can self approve the Solution and user's name will be visible under Reviewer's list while submitting or Updating SAP Data API.

  3. Reason for Solution Rejection : If Set to True, user must define a reason to reject solution.

Add SAP API from Solutions Tab

Once SAPAPIStore library is selected from Solutions, Add API becomes available. This option will only be visible if logged in user has Solution Developer role. Authorized user can click on Add API to generate web API schema using scripts to upload/download data from SAP to JSON schema.

Add API pops up a three step wizard containing API Information, Select Files and Select Reviewer as the three steps.

API Information has the following fields:

  1. Name: The Service/Solution name; it should be unique on library level.

  2. Category: Helps to categorize solutions in different categories that can be filtered out later using filters on solutions page. The category is not a mandatory field.

  3. Description: Can be used to by the user to explain what solution is all about. The description is not a mandatory field.

API Creation has two options Create from Transaction and Create from Query; default option is Create from Transaction. API Creation has the following fields:

  1. Select File: Only JSON mapped script will be supported to generate API schema. If script is of Query type, system usage levels (Low, Medium and High) will be shown.

  2. Viewers: There are two JSON viewers Text Area and JSON Viewer; the default selection is JSON Viewer. Both viewers have fixed width and height and enable scroll bar according to JSON text.

You need to create a script in Studio to be used in Evolve. Refer to Create script for integration with SAP Data API in SAP Data API with Studio.

After browsing a valid script file from Select file, the service method call generates API specifications and displays it on JSON Viewer. JSON has three tabs InputPayload, OutputPayload and ErrorPayload. API specifications for InputPayload and OutputPayload is according to the script file and ErrorPayload is a fixed array. Data type corresponding to script data type and API specifications will be available in generated payloads.

The InputPayload and OutputPayload have following sections:

  1. RunParameter: It has all input fields for Transaction. The Query script will show all user defined criteria fields and ignore fixed criteria fields.

  2. SolutionDetail: It has SolutionName, LibraryName and AppName fields.

  3. RequestParameter: It has all run time inputs i.e. Record Count, GetRecordCount etc.

  4. SAPDetails: It has ConnectionName and EvolveUser as mandatory fields. The other fields like SAPUser, SAPCredentials and Windows Credentials are optional fields.

Note: Please save SAP Credentials Or Windows Credentials on Evolve against Evolve User so that plain text password does not traverse on network call while executing API through third party client.

Select Reviewer will be visible if Solution Approval flag under SAP API Approval Settings is set to true. It has a Reviewer drop down which will show all users who have solution reviewer role in current app. If Self Approval setting is false, the current logged in user will not be visible in drop down even if the current user has solution reviewer role in app. The solution cannot be submitted without the selection of reviewer.

After submission of the solution, it will be visible on solution page Solution, Description, Status, Category, Reviewed By and Created By columns.

The URL for SAP Data APIs will be <RoutePrefix>/api/v1/SAPIS

Note: API schema details have been documented in SAP Data API Specification.

If Solution Approval flag under SAP API Approval Settings is true, solution must be submitted using reviewer. After the submission of solution, task is assigned to reviewer for review. If Reason for Solution Rejection preference is set to on, the solution reviewer must specify rejection comments. If solution workflow is applied, Update API will only work if solution is in Production state.

Update SAP API from Solutions Tab

User can use Update API for the solution which has Production status. In SAP API Approval Settings (App→ Preferences→ Design Preferences page), if solution approval is turned on, solution will be under review until approved by assigned Reviewer. Solutions under Review cannot be updated. After Approving solution and moving them to production, user can update SAP Data API solution. If Solution Review is off, solution will always be in Production and user can edit the SAP API Solution. Below are the details to Update API:

  1. Navigate to Solutions and select SAP Data API library.

  2. Select SAP API solution(in Production) you want to update by clicking on checbox present on solution grid.

  3. Click on Update API.

  4. Service/Solution name is read only. Category and Description is editable.

  5. The script type will be selected according to existing script type and other options would be disabled. The Select File will be allowed to add same type of script.

  6. Service URL and JSON views(Text Area and JSON Viewer) are read only.

  7. These steps will be visible if Solution Approval flag under SAP API Approval Settings is true. The Reviewer drop down will show all users who have solution reviewer role in current app. If current solution reviewer is available in reviewer list then same reviewer will be selected.

  8. If Self Approval setting is false, the current logged in user should not be visible in drop down even if the current user have solution reviewer role in app. The solution cannot be submitted without the selection of reviewer.

  9. This action will create new version of the solution.

View SAP API

To View SAP API, click on View API option after selecting a particular solution from SAP API Library. Complete data will show on single page, like reference schema view. JSON can be viewed in both JSON viewers i.e. Text Area and JSON Viewer.

The service URL will be visible as <BaseURL/GatewayURL>/api/v1/SAPIS.

Executing SAP Data API

To execute Integration API, User will fill authentication header and payload, and send it to valid exposed end point for execution. Follow the below steps for executing SAP Data API:

  1. Fill in all required input fields of payload like Authentication header, SolutionName, LibraryName, AppName, ConnectionName, EvolveUser etc before execution.

  2. Evolve user must have Originator role for the API execution.

  3. For Transaction - The SAP Data API solution in Production state is allowed to execute on Production server. Latest version of the solution will be applicable. The SAP Data API solution in Review or Rejected state is allowed to execute on non-production SAP system; Validate would be executed on both Production and non-production SAP system.

    For Query - The SAP API solution in Production state is allowed to execute on both Production and non-production servers. Latest version of the solution will be applicable. The SAP API solution in Review or Rejected state is allowed to execute on non-production SAP system.

  4. The EvolveUser will be used to verify role and policies and to check login credential against the specified ConnectionName, if SAP Credentials and Windows Credentials are not passed.

    The preference criteria to execute SAP API solution is:

    1. SAP Credentials.

    2. Windows Credentials.

    3. Evolve User.

    The default preference is to use EvolveUser to avoid using plain text password over network.

  5. After the execution, the run result(log and output fields) will be overwritten in JSON document.

  6. If Document History is enabled on the library then documents would be uniquely identified as ServiceName_TimeStamp(in numbers). The document will be a text file containing InputPayload and OutputPayload in JSON format. If user specifies password, then the password will not be stored in the document. The document does not have any workflow so status will always be Completed.

To view the API Usage select any solution from solutions Library and click on API Usage. The API Usage View has Title, Data File, Activity Date Time, SAP System, Records uploaded and Run Errors columns which show detailed information of API execution.

To Import/Export Integration API Solution, go to the Solution(i.e. test) and download the script; now you can add new Solution using downloaded script.