EDUCAÇÃO E TECNOLOGIA

Connect to External Data Sources with SAP Business Application Studio


Overview

Connecting your application to an external data source is important, but often seems to be a complex task.

The external data source can be public on the internet or on-premise. It can require different authentication methods. The external data source can reflect a specific service or serve as an entry point for multiple services.

In this blog post, we take a look at a new panel called the Service Center in SAP Business Application Studio. The Service Center simplifies the connectivity to external data sources, enables data source exploration from different providers, and integrates the data source into application development.

The formal documentation can be found here.

Log in to SAP Business Application Studio

  • In your SAP BTP account, ensure that SAP Business Application Studio is available.

  • If you are using a trial account, you can skip this step.
  • If you are using a non-trial account, assign yourself to a developer role:
    1. Navigate to Security > Trust Configuration.
    2. Click the sap.default link.
    3. Enter your email address.
    4. Click Assign Role Collection.
    5. Select both “Business_Application_Studio_Developer” and “Business_Application_Studio_Administator” from the dialog box.
    6. Click Assign Role Collection to save the changes.

Trust

Role

  • Open SAP Business Application Studio:
    1. Click Go to Application from the SAP Business Application Studio tile.
      The SAP Business Application Studio landing page or Dev Space Manager opens.
    2. Click Create Dev Space.
    3. Enter a name for the dev space.
    4. Select the following extensions to create an HTML5 application:
      1. MTA Tools
      2. HTML5 Runner
      3. HTML5 Application Template
    5. Open the dev space by clicking on the dev space name.

Create a Data Source (Destination) 

  • Click (Service Center) from the left side menu, expand the SAP SYSTEM, and press “+” (Add System).


  • Enter the system name, URL, and system type in the form.
    There are 3 system types that you can choose from:
    • ABAP Service Catalog
    • Service Host
    • Service URL

  • There are 2 authentication options:
    • No Authentication
    • Basic authentication using user name and password

  • If you require different authentication Navigate to BTP cockpit and complete the missing fields.

Service URL

  • The Service URL option refers to an absolute OData based service.
    For example:
  • After the system is added, you can explore the service entities and fields.

Service Host

  • The Service Host option can be used in case there are multiple services in one host which can be accessed using the same credentials.
  • Fill in the mandatory system name field.
  • Enter the URL with this value: https://services.odata.org
  • Select Service Host for the system type.
  • Select the authentication method No Authentication.
  • Click Add.

  • After the system is added, login with different service paths, such as /V2/Northwind/Northwind.svc or /V4/(S(1ul4kptxaye3o5zsudk01oun))/TripPinServiceRW/
    and
    click CONNECT.

  • To set up a service host based on SAP S/4HANA Cloud or SAP SuccessFactors using client certificate or SAML Bearer Assertion, follow the formal documentation.
  • Go to BTP destination and add the following attributes:
    • WebIDEUsage = odata_gen
    • WebIDEEnabled = true
    • HTML5.DynamicDestination = true
  • After the service host is added, login with different service paths and click CONNECT.

Service Catalog

  • The Service Catalog option can be used if the data source refers to an ABAP stack and if the catalog service exposing OData V2 or OData V4 services is available.
  • Before you create a data source from the Service Center, perform the following steps:
    • Find the secured port of your ABAP on-premise system. To find the right port, enter to transaction /NSMICM, then from the menu press More->Goto->Services.

    • Verify that the following services are active in the /NSICF transaction:
      • sap-bc-adt
      • sap-opu-iwfnd-catalogservice

    • Make sure your SAP BTP account is connected to ABAP using the Cloud Connector.
    • For the account created in the Cloud Connector, ensure that under Access Control, the paths to the following resources exist, and include Sub-Paths:
      • /sap/opu/
      • sap/bc/adt

  • Now you can create the Service Catalog in SAP Business Application Studio.
    Fill the the following  mandatory fields:
    • Name
    • URL to ABAP with the following pattern <http://<host:<secured port>
    • Client
    • Proxy Type as on-premise
  • Press Add button

  • The system is added to the SAP BTP account, and you can click connect in the Service Center to see the list of available services.

  • Choose a sample service and explore its entities and fields

Services from SAP API Business Hub

  • You can explore the products, packages, and OData services exposed in the SAP API Business Hub. You must log in to the SAP API Business Hub one time per session to see the service entities.

Integrate a Service into an Application

  • You can integrate your service into your application. This applies for any origin used to explore a service, including the SAP API Business Hub, an SAP System service URL, a service host, or a service catalog.
  • Click Service Actions-> Create Project from Service
  • Create a SAP Fiori or HTML5 applications based on the selected service
  • You can also add the service as a data model in your CAP application in a Full Stack Cloud Application dev space

Conclusion

You have connected to the following external data sources from the Service Center panel in SAP Business Application Studio:

  1. Service URL
  2. Service Host
  3. Service Catalog
  4. SAP API Business Hub

You integrated your service into a new application:

  1. SAP Fiori or HTML5 application
  2. Data model in a CAP application

I will be happy to hear your feedback personally or here in the comments.

You can take your first steps using the Trial environment and take a look at all of the SAP Business Application Studio tutorials.