Skip to content

Runtime

At runtime, recorded and published user interactions can be consumed via OData services.The OData services can be accessed

  1. Through a Mobile Services application or
  2. Directly, to allow integration into external software.

Mobile Services App Consumption

After a recording has been published, the corresponding OData service can be added to a mobile app. Therefore, a new mobile destination must be created for the mobile app, linking the SAP GUI for HTML system to the published recording. A recording can also be exposed to a single app multiple times, for example, for different SAP GUI for HTML systems or SAP Clients.

You can use

Assign Mobile Transaction Bridge Feature to Mobile App

  1. In Mobile Services cockpit, select Mobile Applications > Native/Hybrid
  2. Select the app you want use Mobile Transaction Bridge in or create a new one
  3. Click on the add button near Assigned Features to open a list of available features.
  4. Select Mobile Transaction Bridge OData from the list and confirm using the OK button.

    Note

    This will also assign the Mobile Connectivity feature to your app. Read more about managing application features

  5. You will be redirected to an overview page, which includes a list of published recordings. This page is also accessible by clicking on the Mobile Transaction Bridge OData link at the app overview page.

Create a Destination for the Back-End System

  1. In Mobile Services cockpit, navigate back to your app's overview page.
  2. Click on the Mobile Connectivity link in the Assigned Features area.
  3. Click on the Create button in the right section.
  4. Enter the basic information about the SAP GUI for HTML system:
    • Destination Name: the name of the corresponding Mobile Destination
    • URL: the root URL of the SAP GUI for HTML system, e.g. http(s)://<ADDRESS>:<PORT>.
    • Use Cloud Connector: establish connectivity directly or using a SAP Cloud Connector (for On-Premise systems)
      • If turned on, enter the Cloud Connector Location ID, which identifies the Cloud Connector.
  5. In addition enable the support for Mobile Transaction Bridge:
    • Enable "Use Mobile Transaction Bridge"
    • Mobile Transaction Bridge Recording: select the published recording you want to expose
    • SAP Client: the SAP Client which will be used to access the SAP GUI for HTML system. For example 001.
  6. Confirm using Next and optionally configure additional custom headers.
  7. Skip the Annotations section.
  8. On the last page, configure the correct SSO mechanism/authentication type:

    • Cloud Connector SSO: enable principle propagation for Cloud Connector

    Note

    Read more about configuring mobile destinations

  9. Confirm your configuration using the Finish button.

  10. The OData service is now available at the root of the created destination.

    Note

    If you want to test your configuration right away run the Preflight Check to find common issues.

Mobile Development Kit Template

Upon successful configuration of the Mobile Transaction Bridge OData service in the SAP Cloud Platform Mobile Services Cockpit, a native UI can be built with the SAP Cloud Platform Mobile Service, mobile development kit.

The Mobile Development Kit contains a template which will create a complete UI from the metadata of a Mobile Transaction Bridge OData service. For each recording (action) in the OData service, it will create:

  • One input page with all input parameters of the recording
  • One output page that displays the results of the execution of a recording
  • One button on the main page to show the input page

Furthermore, the template will put all the wiring in place, so that OData service can be called from the running UI. Also, the result UI will automatically login the user to the configured SAP GUI for HTML back-end system.

Steps to Create UI with the Mobile Transaction Bridge Template

  1. In SAP Web IDE, in the MDK perspective, select New - MDK Transaction Bridge Project.
    • If in the standard development perspective, select New - Project from Template, and then choose MDK Transaction Bridge Project
  2. Enter Basic Information and Aplication Creation details
  3. In the Service Configuration step, select first the destination to the Mobile Services Cockpit as Service URL, the ID of the Mobile Application configured with the Mobile Transaction Bridge OData feature and the Mobile Transaction Bridge OData destination.
  4. In the next step, select the exposed functions to include in the UI
    • The UI can be customized based on the OData result type
    • The simple properties in the output is shown as KeyValue controls
    • The collection properties in the output is shown as ObjectCollection controls
    • The individual output collection properties can then be matched to the display properties of the ObjectCollection control.
  5. Select Confirm to close the wizard and generate the MDK Project

For more details on the SAP Cloud Platform Mobile Service, mobile development kit see Official Documentation.

Direct Consumption

After a recording has been published, the corresponding OData service can be consumed from any application outside Mobile Services. In order to invoke transactions, you must define the SAP GUI for HTML system against which Mobile Transaction Bridge executes the recorded interaction flows. When setting up the SAP Work Zone Integration, recording can also be consumed from Work Zone.

All SAP GUI for HTML systems which should be available for execution of recorded interaction flows must be explicitly configured here. For On-Premise systems you have to setup a Cloud Connector and configure it to grant access to the back-end systems. When defining a SAP GUI for HTML system, principle propagation must be used. By using principle propagation (e.g. Cloud Connector SSO), all SAP GUI for HTML actions will be invoked on behalf of the user calling the OData service.

The OData service itself is protected using OAuth 2. Tokens have to be retrieved using the Authorization Code Grant flow.

Steps to Create a Destination for the SAP GUI for HTML System

  1. In Mobile Services cockpit, select Settings > Mobile Transaction Bridge
  2. Click on the Destinations tab in the top header.
  3. Click on the Create button in the right section.
  4. Enter the basic information about the SAP GUI for HTML system:
    • Destination Name: a name for the SAP GUI for HTML system.
    • URL: the root URL of the SAP GUI for HTML system, e.g. http(s)://<ADDRESS>:<PORT>.
    • Use Cloud Connector: establish connectivity directly or using a SAP Cloud Connector (for On-Premise systems)
      • If turned on, enter the Cloud Connector Location ID, which identifies the Cloud Connector.
  5. In addition configure the support for Mobile Transaction Bridge:
    • Mobile Transaction Bridge Recording: select the published recording you want to expose. If you do not select a specific recording, all recordings will be made available.
    • SAP Client: the SAP Client which will be used to access the SAP GUI for HTML system. For example 001.
  6. Confirm using Next and optionally configure additional custom headers.
  7. Skip the Annotations section.
  8. On the last page, configure the correct SSO mechanism/authentication type:

    • Cloud Connector SSO: enable principle propagation for Cloud Connector

    Note

    Read more about configuring mobile destinations

  9. Confirm your configuration using the Finish button.

    Note

    If you want to test your configuration right away run the Preflight Check to find common issues.

Steps to Get OData Service Endpoint

  1. In Mobile Services cockpit, select Settings > Mobile Transaction Bridge
  2. Under Recorder you find a list of published recordings.
  3. Select the recording you wish to consume.
  4. Under OData Endpoints, you find the base URLs of all exposed systems.

    Note

    You can find dedicated destinations particularly associated with the current recording as well as generic ones which can be used with any recording.

Steps to Configure OAuth Security

  1. In Mobile Services cockpit, select Settings > Mobile Transaction Bridge
  2. Click on the Security tab in the top header.
    • You will find a list of configured OAuth clients. You can create, edit and remove those.
    • The necessary OAuth authorization and token URLs are also listed.
  3. In order to register a new client application for the OData services, create a new OAuth Client using the + button.
    • Leave the generated Client ID or enter a custom one to identify your application
    • Enter the redirect URL of your application
    • If you want to update or delete an existing client use the edit or delete buttons

Steps to Fetch an OAuth Token

  1. In order to allow users of your application to authenticate, navigate the user to the OAuth Authorization URL with the following query parameters:

    • response_type = code
    • client_id = Client ID of your application, e.g. 171b958c-1c45-4529-ab0d-02fb133be693
    • redirect_uri = Redirect of your application, e.g. https://example.com/auth/redirect

    This will redirect to a login screen of Cloud Platform. After successfully authenticating the user will be redirected to the given redirect URL. e.g. https://example.com/auth/redirect?code=xxxx

  2. The server application then has to take the given authorization code and request an access token. For that send a POST request to the OAuth Token URL with the following query parameters:

  3. grant_type = authorization_code
  4. code = Authorization code provided to your redirect URL, e.g. UbYRXOWIyr
  5. client_id = Client ID of your application, e.g. 171b958c-1c45-4529-ab0d-02fb133be693

  6. The response is a JSON object that contains a access_token field. For calling the OData service add a HTTP authorization header to your requests:

Authorization: Bearer <your access token>


Last update: September 1, 2020