Skip to Content
Technical Articles
Author's profile photo Matteo Palarchio

HOWTO – Import SFLIGHT sample data into SAP HANA from a local computer

Out of the box, SAP HANA does not include any sample data. When getting familiar with and learning the platform, it’s often useful to have some to play around with as you get a feel for HANA before beginning some real work with it.

 

SAP provides a free data model focused on flight data for anyone to use. You can download the data here: https://github.com/SAP/hana-xsa-opensap-hana7/raw/snippets_2.3.2/ex2/sflight_hana.tar.gz

Below, I’ll be walking you through the steps on how to import the data into HANA from your local machine.

 

  1. Make note of where your downloaded archive is. You’ll need to know this to find it later.

 

  1. On the SAP Web IDE for SAP HANA, open the Database Explorer view. If you haven’t already, connect to the database you wish to import the data into. Press the Add button to do so.

  1. Add a new database connection by filling out the required fields as appropriate for your database. The only difference for a tenant on a multi-tenant database is the need to specify which tenant you wish to connect to.

  1. After selecting your newly connected database, right-click on the Catalog folder and select Import Catalog Objects

  1. From your local machine, click Browse to navigate to where you downloaded the flight data. After a few moments, the file should be uploaded, and you can select all Catalog Objects within it to import by checking the box at the top of the table. Once you have, you can click.
  1. It will take another few moments for the data to be imported into HANA. After, you should be able to expand the database and click Tables to view all the newly imported table schema. Right-click on one of them like SFLIGHT and select Open Data to view it all.

 

Congrats! You’ve now added a wealth of data to your HANA instance and are ready to explore and learn with it. Once you have some substance to work with, it’ll be much easier to experiment with all the functionality that HANA has to offer — enjoy!

Assigned Tags

      18 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Nabheet Madan
      Nabheet Madan

      Much needed thanks for sharing

      Nabheet

      Author's profile photo Former Member
      Former Member

      Hi Matteo,

       

      I got stuck on step 2 as I don’t see the icon for adding database connections:

      What’s next? 

      Thanks, greg

      P.S. I'm all set as Thomas Jung has provided the next step here: https://blogs.sap.com/2018/09/13/build-database-objectsservices-in-hana-service-using-sap-webide-full-stack-part-1/

       

       

      Author's profile photo Marco Büscher
      Marco Büscher

      Hello Gregory,

       

      I think you had to set up a SAP HANA Instance like this https://developers.sap.com/topics/sap-hana-express.html#flowchart

      If you decide to set up HANA on Google drive you can use a google Voucher about 350 €.

      Elswere you can download the express edition or use Amazon Cloud.

      Author's profile photo Rahul Gupta
      Rahul Gupta

      I am getting this error "An error occurred while performing a catalog import (dberror) insufficient privilege: Not authorized"-

      Can you please help which roles/ authorization objects are required for this?

       

       

      Author's profile photo Jagadish Bojja
      Jagadish Bojja

      I am also getting same error when trying to import to HANA SPS02 system.

      Author's profile photo Ricardo Ferreira
      Ricardo Ferreira

      I was having the same issue until I found out that my connection with the database was set with the XSA_ADMIN user. I switched to the SYSTEM user, that for me had the same password as the XSA_ADMIN and it worked.

      Author's profile photo Jim Varrati
      Jim Varrati

      I added as the system user and it went fine

      Author's profile photo Ayoub Syed
      Ayoub Syed

      Jim Varrati can you please explain how you added as technical user? I am still facing the issue...It would be really appreciated if you can provide steps to add as technical user.

      Thanks in advance 🙂

      Author's profile photo Jim Varrati
      Jim Varrati

      This is what worked for me, the older courses they were using just the privileges now they are using a role so first make sure you install the SFLIGHT in the systemdb not the HXE then using Hana client open SQL console for the sflight schema ( you can use the hana cockpit sql tool as well just make sure you are connected to sflight) then create the user and role for the exercise by executing the following statements one at a time. change the password below with what you want to use and remember because you will need to enter this when you create the service it asks for user and password. if you are using hanaexpress I believe I used 39015.

      CREATE USER CUPS_SFLIGHT PASSWORD "<Password>" SET PARAMETER CLIENT = '001';
      ALTER USER CUPS_SFLIGHT DISABLE PASSWORD LIFETIME;
      GRANT SELECT ON SCHEMA SFLIGHT TO CUPS_SFLIGHT WITH GRANT OPTION;
      GRANT SELECT METADATA ON SCHEMA SFLIGHT to CUPS_SFLIGHT WITH GRANT OPTION;

      CREATE ROLE SFLIGHT_CONTAINER_ACCESS;
      GRANT SELECT, SELECT METADATA ON SCHEMA SFLIGHT TO SFLIGHT_CONTAINER_ACCESS WITH GRANT OPTION;
      GRANT SFLIGHT_CONTAINER_ACCESS TO CUPS_SFLIGHT WITH ADMIN OPTION;

      good luck let me know how you made out 😉

       

      Author's profile photo Henrik Damhøj Andersen
      Henrik Damhøj Andersen

      Hi Jim,

      I tried following your steps, but i not able to see any objects.

      I have executed all SQL statements one by one without any errors.

      is there something I have missed? I'm logged on as XSA_ADMIN in WebIDE.

      Regards,

      Henrik

      Author's profile photo Jim Varrati
      Jim Varrati

      When you say you don't see any objects is that when you are browsing for tables in the synonym? you have the service check box checked? if that is the case then either the port is wrong or SFLIGHT is installed in the other DB, HXE or SYSTEM HanaExpress has both. If your still stuck tonight when I go home I will look at the exact port.

      Author's profile photo Henrik Damhøj Andersen
      Henrik Damhøj Andersen

      Hi Jim,

      Sorry for the late reply!

      When i got home again problem has been solved 🙂

      Regards

      Henrik

      Author's profile photo Jim Varrati
      Jim Varrati

      Awesome! Code on!!

      Author's profile photo Ravi alter
      Ravi alter

      Hi All ,

      I am new on WEBIDE

      I got same screen as step 3 but unable to proper host name .

      help to get host name of web IDE .

       

      Thanks in  Ad.

      Ravi

      Author's profile photo Pankaj Kumar
      Pankaj Kumar

      Thanks for Sharing..

       

      Pankaj

      Author's profile photo Sagar Sheokand
      Sagar Sheokand

      I successfully added SFLIGHT using your blog and was able to see this addition in WebIDE. But I can’t see the new tables when I log into HANA using Eclipse. To add tables to Eclipse, I used this blog – https://blogs.sap.com/2013/05/16/howto-import-sflight-sample-data-into-hana-from-a-local-computer/

      How do I sync the Database Explorer with Eclipse or vice versa?

      Author's profile photo Sagar Sheokand
      Sagar Sheokand

      Got it. A trivial error. 

      I used the wrong database. In Eclipse I added the database as Multi Tenant and was using its System database. While in Database Explorer, I added it as Single Tenant.

      So, one should use the same databases (Multi Tenant (SYSTEM)) at both the places.

       

      Author's profile photo Sourav Bhaduri
      Sourav Bhaduri

      Thanks...