You will learn
- How to use the SAP HANA Web-based Development Workbench.
- How to develop a simple server-side application.
- How to publish and run an application.
In this tutorial you will make your very first SAP HANA XSC application using the SAP HANA Web-based Development Workbench.
Each Trial HANA MDC instance comes with the HANA Web-based Development Workbench. The workbench allows you to develop on HANA without the need to set up a local development environment.
Login to the HANA Cloud Cockpit with your free developer edition account.
Choose Persistence in the left column menu and then Database & Schemas. You will need to create your new instance. To do this simply give it a name, enable web access and of course give a password. This password you will need to remember as it is the password for your SYSTEM user and how you will be able to access the server.
Once you begin the creation process, you will be redirected to an events tab.
Remember the instance runs for a limited time, so if you have to come back later you may need to restart it.
Just click start to restart it. Also note it’s only valid for 30 days.
Couple of more steps before we hit the editor
You’ll need to click on the “Admin Cockpit” first to trigger the authorizations you will need going forward.
Once your authorizations have applied, you should then select the “Manage Roles and Users”.
Here you can create a new user. This is recommended so you do not risk the “SYSTEM” user.
Now simply apply new roles to the user to give this user the appropriate authorizations to begin developing.
With that completed we can now log into the “SAP HANA Web Based Development Workbench”
You are now in the Editor and can immediately start developing in HANA.
For HXE enter the address
http://hxehost:8090/sap/hana/ide/ in to the address bar of your browser. This works provided you have the
Server + Applications version or if you followed these steps to add the XSC tooling to your
Server Only instance.
The first step to start developing a SAP HANA application with SAP HANA Web-based Development Workbench is to create a new package for the application.
Here we will create a package called
codejam, Right-Click on the content folder on the left, and enter the package details.
Now you have a package that is waiting for your code, now we will Right-Click on the
codejam package and choose
This step will generate 3 files, the
.xsaccess and an
.xsjs files. Now such a file will be created.
Open the context menu of the
codejam package by right-clicking on the name and choose Create File. Enter
mylibrary.xsjs as file name and save with Enter:
The new empty file is now open in the Editor:
Copy and paste this code to the just created
$.response.contentType = "text/html"; $.response.setBody("My Personal Library");
Save the file using the Save button or by pressing
ctrl+s. Again, the successful save is confirmed in the console.
Now the application is ready to be tested. As you are developing with the SAP HANA Web-based Development Workbench the application is already deployed and activated to your SAP HANA Trial Instance. So you can immediately continue to test it:
mylibrary.xsjs file to enable the Run on Server in the toolbar. Then click the Run on Server button:
The application will open in your browser and greet you with the beginning of your personal library:
Congratulations: You just have your first own native SAP HANA application running on SAP Cloud Platform!
Beginners might take 10-15 minutes to execute this tutorial.