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 SAP mobile service 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

    If you plan to use Mobile Development Kit, please also assign the App Update feature.

  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 SAP mobile service 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 SAP Cloud Connector: establish connectivity directly or using a SAP Cloud Connector (for On-Premise systems)
      • If turned on, enter the SAP Cloud Connector Location ID, which identifies the SAP 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:

    • SAP Cloud Connector SSO: enable principle propagation for SAP 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 mobile service cockpit, a native UI can be built with the 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.

Note

In order to use Mobile Development Kit, the app requires the App Update feature.
Read more about how to create apps for Mobile Development Kit.

Steps to Create UI with the Mobile Transaction Bridge Template

  1. Enter your SAP Business Application Studio Mobile Development Kit space or create a new one.
  2. In SAP Business Application Studio select File > New Project from Template.
  3. In the template overview select MTB Project and click Next.
  4. Enter a Project Name and click Next
  5. In the next step, enter the service connection details:
    • Enter a Service File Name (for example, MTB_Service).
    • For the OData Source select mobile services.
    • Select the target Application Id and Destination.
    • Click Next.
  6. In the Collection step, you can select which sequences you want to integrate into the app. Select at least one sequence and click Next.
  7. The app is generated. In order to open it click on the Open in New Workspace button in the bottom-right corner.
  8. Deploy the app using the MDK: Deploy command.

For more details on the SAP Business Technology 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 SAP 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. SAP 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 SAP mobile service 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 SAP Cloud Connector: establish connectivity directly or using a SAP Cloud Connector (for On-Premise systems)
      • If turned on, enter the SAP Cloud Connector Location ID, which identifies the SAP 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:

    • SAP Cloud Connector SSO: enable principle propagation for SAP 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 SAP mobile service 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 SAP mobile service 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 SAP Business Technology 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: April 14, 2021