Skip to Content

Add a Database to Your Business Application

test
0 %
Add a Database to Your Business Application
Details
// Explore More Tutorials

Add a Database to Your Business Application

12/11/2018

Deploy the data model to the SAP HANA database that is associated with your enterprise or trial account.

You will learn

  • How to deploy the data model you created for your business application to the SAP HANA database using SAP Web IDE Full-Stack


Step 1: Add a database

Right-click the db module and choose Build.

Build the db module

Wait for the notification that says the build was successful.

If the build is unsuccessful, check the console log for errors. Errors similar to this one: Warning: Could not find a configured library that contains the "com.sap.hana.di.afllangprocedure" build plugin in a version compatible to version 2.0.30.0 at "src/.hdiconfig" can be addressed as follows:

  1. Ensure all files in the project are shown, with menu path View > Show Hidden Files.

  2. Expand the folder db/src/ to find the file .hdiconfig.
    finding the .hdiconfig file

  3. Open the file and check the value of the plugin_version property at the top of the file. It needs to be 2.0.2.0.

  4. Change the value to 2.0.2.0 if necessary, being careful to maintain the structure and integrity of the rest of the file (basically, just change the value inside the double quotes).
    like

  5. Save the file, and re-try the build.
Log on to answer question
Step 2: Enable SAP HANA Database Explorer

To view the generated deployment artifacts, SAP HANA database explorer must be enabled in SAP Web IDE. If you have already enabled the SAP HANA database explorer, go to step 3.

  1. Go to Tools | Preferences | Features.

  2. Search for the database explorer and enable it.

    Enable the database explorer
  3. Choose Save. You may be prompted to refresh SAP Web IDE. If you are, do so.

  4. While still in Preferences, choose Database Explorer and make sure the Cloud Foundry Region is set to the one you are using for this mission.

    database explorer preferences
Log on to answer question
Step 3: Open the SAP HANA Database Explorer
  1. Go to Tools | Database Explorer.

  2. If you haven’t added any database before, you’ll be prompted to do so - select Yes in the dialog box to continue (if you already have databases listed, you can add another one with the plus symbol at the top of the list).

    Add a Database
  3. Select the bookshop database.

    Add the database

    Once connected you can view the different database artifacts. For example, the books table that you have created.

Log on to answer question
Step 4: Fill in initial data
  1. Download the following files:

    Authors.csv

    Books.csv

    Orders.csv

    Data.hdbtabledata

  2. In your workspace, go to bookshop/db/src/, right-click on the src folder and choose Import | File or Project.

  3. Browse to the location where you have saved the Authors.csv file.

  4. In the Import to field, add /csv to the default location and choose OK.

    This creates a /csv folder under /bookshop/db/src and adds the Authors.csv file to that location.

  5. Repeat steps 2 and 3 to add the remaining 3 files to /csv folder.

What is the purpose of the Data.hdbtabledata file?
×
Step 5: Re-build the db module and run the app
  1. Go back to your workspace and right-click the db module and choose build.

    Wait for the notification that says the build was successful.

  2. Right-click the app module and choose Run | Run Configurations.

  3. Choose Run flpSandbox.html and deselect Run with mock data.

  4. Choose Save and Run.

  5. Open your app from the SAP Fiori Launchpad and choose Go.

You now have actual data served automatically.

Log on to answer question

Next Steps

Back to top