Business Application Studio Introduction

Business Application Studio Introduction

Access SAP Business Application Studio

SAP Business Application Studio is a new SAP Business Technology Platform (SAP BTP) service that offers a modern development environment tailored for efficient development of business applications for the SAP Intelligent Enterprise.

Based on Code-OSS, an open source used for building Visual Studio Code. Available as a cloud service, SAP Business Application Studio provides a desktop-like experience similar to leading IDEs, with command line and optimized editors.

  • Development (dev) Spaces Comparable to isolated virtual machines in the cloud containing tailored tools and preinstalled run-times per business scenario, such as SAP Fiori, SAP S/4HANA extensions, Workflow and Mobile.

  • Capabilities Unlike other desktop IDEs, SAP Business Application Studio is equipped with various tools specially built for developing business applications in the SAP ecosystem.

    These tools cover the end-to-end development cycle:

    • Clone an existing project with a Git client or create a new project using templates.
    • Use editors for SAP-specific technologies.
    • Easily test your application on your dev space while consuming services from remote sources.
    • Build and deploy the application as a multi-target application (MTA).

Try it out!

Note

If you have already completed the lesson on

Create Development Space in Business Application Studio

To realize database projects we mainly use the SAP Business Application Studio (BAS for short). It is recommended to use the incognito tab of one of the following three browsers with the latest version.

  • Google Chrome
  • Mozilla Firefox
  • Microsoft Edge
  • Click here to open the SAP Business Application Studio.

  • Log in with the Credentials provided to you in the workshop email.

    • Username:
    • Password: Provided via mail
    • Click Continue

Before you can start your project you must first create a Development Space within BAS. A dev space is a development environment with the tools, capabilities, and resources needed for developing your application. A dev space provides tailored tools and pre-installed runtimes for your business scenario. This simplifies and saves time in setting up your development environment and allows you to efficiently develop, test, build, and run your solution locally or in the cloud.

  1. Click on Create Dev Space to create a new development environment for your project.

    img
  2. Provide the following inputs to the wizard:

    • Give your Development Space the Name _HCGX.
    • Select SAP HANA Native Application as application kind. You do not need to add any Additional SAP Extension.
    • Click on Create Dev Space

    img

Your _HCGX Dev Space is being created right now.

img
  1. It takes roughly 1-2 minutes to switch from STARTING to RUNNING. Now that your space is running click on the Name _HCGX to open it. Your BAS Development Editor opens, in which you create your projects.

img

Customize the default BAS layout

For a better orientation in SAP BAS we adapt the default layout to our needs.

  1. Click on the icon to open the Explorer.

    img
  2. Right-click on the Outline tab and deselect Outline.

    img
  3. Repeat the process by right-clicking and deselecting the Timeline.

    img

Set Cloud Foundry Endpoint

Connect the development space in SAP BAS to Cloud Foundry, to later deploy the project to the SAP HANA Cloud running on the Cloud Foundry environment.

  1. Click on the Cloud Foundry Icon on the Activity Bar on the left side, expand Services and Click on the Login to Cloud Foundry Icon.

    img
  2. Provide the following inputs to the Cloud Foundry Sign In wizard:

    • Cloud Foundry Endpoint: https://api.cf.eu10-004.hana.ondemand.com
    • Authentication method: SSO Passcode
    • Click on Open a new browser page to generate your SSO passcode

    img
  3. Enter IDP and click on Sign in with alternative identity provider.

    img
  4. A new browser tab opens up, copy the generated Temporary Authentication Code and paste into the Enter your SSO Passcode field.

    img

    img
  5. Select the following options in the Cloud Foundry Target wizard:

    • Cloud Foundry Organization: SE Technical Academy - PROD Int_sap-build-hana-cloud
    • Cloud Foundry Space: AC_HANACLOUD
    • Then click on Apply

    img
  6. The Cloud Foundry target has been set successfully.

    img

Note

The next step is to create a project in which all development will be done.

Create SAP HANA Cloud project

  1. Click on New Project from template to build a new project.

  2. Choose SAP HANA Database Project and click Start.

  1. Provide a Project Name _Proj for the SAP HANA Cloud Database Project and click Next.

  2. Provide the module name _db for the SAP HANA Cloud Database Project and click Next.

  1. Provide a Namespace _NS and Schema Name for the SAP HANA Cloud Database Project and click Next.

  1. Now bind the project to the SAP HANA Cloud database. Use the system-provided options as shown in the following screenshot, and click on Finish.

  1. Wait while the Project is generated (This process could take several minutes)

The Bind process is now completed, and the project is available!

Database connections

Now create a database connection using a pre-defined user service named SDI_CONN. This connection will provide access to the Azure SQL Server.

  1. To add the database connection, navigate to the SAP HANA PROJECTS in the bottom left corner in Business Application Studio and expand the project. Then click on the + sign next to Database Connections as shown in the below screenshot.

  1. Add Database Connection dialog will open on the right pane. Select “Existing user-provided service instance” as the connection type. In the service instance name select SDI_CONN as the connection name. And click Add.

    SDI_CONN is a predefined user provided service which provides the credentials required to connect to SAP HANA Cloud with access to Azure remote source.

  2. Connection under connections with name SDI_CONN

  1. Create a user provided connection service to connect to SAP HANA Cloud using the login details provided for the lesson.

    • HANA Cloud Username:
    • HANA Cloud Password: provided by email

    Click on the + next to the Database Connections

    The Add Database Connection dialog will open on the right pane. Input the below information in the various fields

    Input Type Values
    Connection Type: Create user-provided service instance
    Service Instance Name: USER_CONN_
    Connect to database: Provide database information
    Host name:
    Host Port: 443
    User Name:
    Password: provided by instructor
    Security: Connect to the database securely

Keep all other values default and click on Add

  1. You will see another cross-container-service connection named USER_CONN_ created under Database connections

Note two database connections in our SAP HANA Project. SDI_CONN for connecting to AZURE remote source created in the SAP HANA Cloud instance and USER_CONN_ connection to connect to the HANA Cloud and get access to a user schema.

The .hdbgrants configuration files

  1. Create the grants file to provide necessary privileges to the user to access the remote source. This grants file will be named as RemoteSourceGrants.hdbgrants. To accomplish this, click on Menu, View and then Command Palette…

  2. Type HANA in the search dialog box and choose SAP HANA: Create SAP HANA Database Artifact option

  1. In the Create SAP HANA Database Artifact, choose Grants (hdbgrants) as the artifact type and provide the name RemoteSourceGrants as the Artifact name and click Create

  2. RemoteSourceGrants.hdbgrants will appear under Workspace -> src. This grants file provides the privileges to create subscription and create virtual table in the remote source RSSQLserver. The exact syntax is provided below.

In the text editor on the right, replace the contents of the file with the one provided below.

Code Snippet
123456789101112131415161718192021222324
{ "SDI_CONN":{ "object_owner":{ "global_object_privileges":[ { "name":"RSSQLserver", "type":"REMOTE SOURCE", "privileges":[ "CREATE VIRTUAL TABLE", "CREATE REMOTE SUBSCRIPTION" ] } ], "roles":[ "Academy_Users" ] }, "application_user":{ "roles":[ "Academy_Users" ] } } }
  1. Click on the deploy button to deploy the RemoteSourceGrants.hdbgrants file. You will see deployment related messages in the terminal window.

  1. Add another grants file to our project. This grants file will be named as SchemaGrants.hdbgrants and will provide privileges on the user schema. Open Command Palette…. Choose SAP HANA: Create SAP HANA Database Artifact option

  2. In the Create SAP HANA Database Artifact, choose Grants (hdbgrants) as the artifact type and provide the name SchemaGrants as the Artifact name and click Create

  1. In the text editor on the right, replace the contents of the file with the one provided below.

    Code Snippet
    12345678910111213141516171819202122
    { "USER_CONN_{placeholder|userid}": { "object_owner": { "schema_privileges":[ { "schema":"{placeholder|userid}", "type": "TABLE", "privileges_with_grant_option":["SELECT","EXECUTE","UPDATE","INSERT","DELETE"] }] }, "application_user": { "schema_privileges":[ { "schema":"{placeholder|userid}", "type": "TABLE", "privileges_with_grant_option":["SELECT","EXECUTE","UPDATE","INSERT","DELETE"] }] } } }
  2. Click on the deploy button to deploy the SchemaGrants.hdbgrants file. See deployment related messages on the console.

    Setting up required database connections are now complete!

Well done! The base Business Application Studio project is ready.