Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
thomas_jung
Developer Advocate
Developer Advocate
9,304
In this blog, we would like to point out some of the highlights of the new features for developers who use the SAP HANA native application development capabilities in HANA 2.0 SPS 03. It should be noted that most of the major architectural changes in the development topic area were recently introduced in SAP HANA 1.0 SPS 11.  This is when we first shipped the SAP HANA extended application services, advanced model (XSA), SAP HANA deployment infrastructure (HDI), and the SAP Web IDE for SAP HANA.  If you are new to these topics in general, you might first want to review the what’s new details from SPS 11, SPS 12, HANA 2.0 SPS 0 and the openSAP courses on this topic.

https://blogs.sap.com/2015/12/08/sap-hana-sps-11-new-developer-features/

https://blogs.sap.com/2016/05/20/sap-hana-sps-12-new-developer-features/

https://blogs.sap.com/2016/12/01/sap-hana-2.0-sps-0-new-developer-features/

https://blogs.sap.com/2017/04/18/sap-hana-2.0-sps-01-new-developer-features/

https://open.sap.com/courses/hana5/

https://open.sap.com/courses/hana6/

We have also updated the exercises from the latest openSAP course to include a version that showcases how to build the same using HANA 2.0 SPS 03:

https://github.com/SAP/com.sap.openSAP.hana5.example/tree/hana2_sps03

Its also important to keep in mind that many of the new developer features are contained in the XSA runtime and/or the SAP Web IDE for SAP HANA.  These two features of SAP HANA are updated and released with HANA 2.0 SPS 03, but actually are backwards compatible and can be updated independent of the HANA database. Therefore if want some or many of the features described in this blog, you can update the XSA Runtime and SAP Web IDE for SAP HANA to the latest version even if you don't also update the SAP HANA database backend version.

SAP HANA, express edition


On the subject of updating without disrupting your existing HANA database; we also have SAP HANA, express edition. This is can be a great way for an individual to get access to the latest HANA 2.0 SPS 03 without needing their business systems to be upgraded. SAP HANA, express edition is a free, personal copy of SAP HANA that runs on a local machine or in the cloud. For more details on the new features in SAP HANA, express edition 2.0 SPS 03, please refer to this blog by rudi.leibbrandt :

https://blogs.sap.com/2018/04/13/sap-hana-express-edition-sps-03-ready-to-download/

Database Development


In order to keep this blog from being too large, rich.heilman posted about the database development features in a separate blog here:

https://blogs.sap.com/2018/04/11/sap-hana-2.0-sps-03-new-developer-features-database-development/

SAP HANA Extended Application Services, Advanced Model


One of the biggest changes to the SAP HANA architecture was the introduction of XS advanced in HANA 1.0 SPS 11. SAP HANA extended application services in SPS 11 represents an evolution of the application server architecture building upon the previous strengths while expanding the technical scope. While I don’t want to repeat all the architectural features which came with XS advanced in SPS 11, you can review them in this blog: SAP HANA SPS 11: New Developer Features; XS Advanced

With HANA 2.0 SPS 03 we continue to round out the general feature set of XS Advanced; particularly focusing on supportability and every day operations of the environment.

A few of the various new and enhanced features are:

SAPUI5 Service Broker


The UI5 service provides resources to SAP UI5 applications which are needed to run their graphical user interfaces. In a typical XS advanced installation, one service is installed at any point in time and the service corresponds to an UI5 release. UI5 applications no longer need to refer to a particular UI5 service that they depend on; they can refer to the UI5 Service Broker, which serves the bootstrap URL of the service they require.


XSA Messaging Service (ActiveMQ)


The XSA Messaging Service is a new, central service broker based upon ActiveMQ which helps with the efficient communication between services and applications. For a general overview of this new service, I would point you to the online help description here: https://help.sap.com/viewer/4505d0bdaf4948449b7f7379d24d0f0d/2.0.03/en-US/03007855703e4ba79ca534696e...

The important thing to know about this new messaging service is that like the SAPUI5 Service Broker, it isn't installed automatically with the XSA Runtime. It has its own, separate MTAR that must be downloaded and installed. For instance you can find the XSA Messaging Service on the Support Launchpad, Software Downloads:


SAP HANA XS Advanced Cockpit


HANA 2.0 SPS 03 introduces a newly designed XSA Admin Cockpit which matches the interaction patterns and UI design of the SAP Cloud Platform Cockpit. The previous XSA Admin web-based tool is now deprecated and will be completed replaced by this new XSA Admin Cockpit moving forward. You will also find new features in this new tool like the ability to create and edit User Provided Services which are of particular interest to developers.


Node.js version 8.x


With HANA 2.0 SPS 03, we see the removal of Node.js 4.x as it is out of maintenance. However we also see the addition of Node.js 8.x. As with any major new release of Node.js, there are infrastructure and language improvements. For example Node.js 8.x comes with npm version 5 and the JavaScript engine (V8) version 6.1. In particular the new version of the JavaScript VM (known as TurboFan and Ignition) provides on average 20% faster performance when compared to typical Node.js version 6.x based applications. That's a pretty nice improvement that comes essentially "for free".

We also see a new utility function to promising existing functions or module exports. For example in the past if you wanted to add a promises interface you might write a small wrapper like this:
	function readFilePromisified(filename) {
return new Promise((resolve, reject) => {
require("fs").readFile(filename, "utf8", (error, data) => {
if (error) {
reject(error);
} else {
resolve(data);
}
});
});
}

But now in Node.js version 8.x, you could accomplish the same with one call to this new util.promisfy:
const readFilePromisified = util.promisify(require("fs").readFile);

On the subject of promises, Node.js version 8.x also introduces the concept of Async/Await. Basically this a next generation option to both callbacks and promsies. It builds upon the concept of promises and further simplifies the syntax and avoids the nested and hard to read code of deeply embedded callbacks.

For example, here is a simple database query using only callbacks:
	//Simple Database Select - In-line Callbacks
app.get("/example1", function(req, res) {
var client = req.db;
client.prepare(
"select SESSION_USER from \"DUMMY\" ",
function(err, statement) {
if (err) {
res.type("text/plain").status(500).send("ERROR: " + err.toString());
return;
}
statement.exec([],
function(err, results) {
if (err) {
res.type("text/plain").status(500).send("ERROR: " + err.toString());
return;
} else {
var result = JSON.stringify({
Objects: results
});
res.type("application/json").status(200).send(result);
}
});
});
});

Notice how all the embedded callbacks makes the code rather difficult for a human to both read and write.

In Node.js version 6.x, we had the option of using promises and avoid some of this nesting of callbacks:
//Simple Database Select Promises
app.get("/promisesDB1", function(req, res) {
let db = new promisedDB(req.db);
db.preparePromisified("select SESSION_USER from \"DUMMY\"")
.then(statement => {
db.statementExecPromisified(statement, [])
.then(results => {
let result = JSON.stringify({
Objects: results
});
res.type("application/json").status(200).send(result);
})
.catch(err => {
res.type("text/plain").status(500).send(`ERROR: ${err.toString()}`);
return;
});
})
.catch(err => {
res.type("text/plain").status(500).send(`ERROR: ${err.toString()}`);
return;
});
});

We still have a few layers of nesting, but now we can simplify the flow of error catching.  The then-based flow is more readable than embedded callbacks, but it could be even more readable. That's where async/await comes in.
	//Simple Database Select Await
app.get("/awaitDB1", async(req, res) => {
try {
let db = new promisedDB(req.db);
const statement = await db.preparePromisified("select SESSION_USER from \"DUMMY\"");
const results = await db.statementExecPromisified(statement, []);
let result = JSON.stringify({
Objects: results
});
return res.type("application/json").status(200).send(result);
} catch (e) {
return res.type("text/plain").status(500).send(`ERROR: ${e.toString()}`);
}
});

This streamlines the code and allows you to write/read the code in the manner a human would expect even if it is still executed via events. The await keyword simply tells the code to wait until the completion of his command before moving onto the next. You also notice that we have a single try catch block for all the events.  This avoids all the redundant error processing within each callback level we saw in the previous examples.

XSA and Python


With HANA 2.0 SPS 03 Python moves from BYOL/R (Bring Your Own Language/Runtime) to fully supported runtime in XSA.  However the situation with Python is still a little different than using Node.js or Java.

XS advanced now supports the Python run-time environment with a new build pack and supporting libraries.

This does NOT include the runtime. Customers must still download, compile and install a Python runtime at the server OS level. There is also no integration of Python within the SAP Web IDE for SAP HANA. The setup steps to compile and install your own Python runtime can be found here: https://help.sap.com/viewer/4505d0bdaf4948449b7f7379d24d0f0d/2.0.03/en-US/681f48593a1a46e595f8bfde1c.... Likewise information about the new Python libraries can be found here: https://help.sap.com/viewer/4505d0bdaf4948449b7f7379d24d0f0d/2.0.03/en-US/842824f04d654ceeaf5168da66...

XS Command Line Tool


The XS command line tool has long been the main tooling for administration and some developer task at the lower level. It predates the introduction of any web-based administration tooling. However its had a few gaps such as role collection maintenance and tenant mapping that could only be done via the web-based admin UI. With HANA 2.0 SPS 03, we remove that gap by adding a whole new set of xs commands:


XSA Command Tool


Although not techncially new in HANA 2.0 SPS 03, I think this is a good time to also talk about the XSA command.  This is not to be confused with the XS command line tool.  The XSA command is a command installed on the Linux OS of the XSA Runtime itself. It provides very low level and powerful operations on the XSA Runtime. Originally this command was primarily used to stop and start XSA independent of the HANA DB. However in HANA 2.0 SPS 03, we started expanding its features to also include some important troubleshooting capabilities.

From the Linux console as your HANA SID admin user, you can issue the XSA command (all caps - because of course Linux is case sensitive).



I really like the new XSA diagnose command. It runs configuration and performance testing on your XSA Runtime. It can help troubleshoot common problems such as slow performing file systems which greatly impact XSA operations.



In particular the details on the file system throughput is important to developers. This greatly impacts the time for builds/runs in the SAP Web IDE for SAP HANA while we are developing:


Sizing XSA


With HANA 2.0 SPS 03, we've also expanded the sizing options of XSA. In HANA 2.0 SPS 02 we first introduced the t-shirt based sizing configuration. Now in HANA 2.0 SPS 03, we allow separate sizing for platform vs. application usage.  This is detailed in this help article:

https://help.sap.com/viewer/6b94445c94ae495c83a19646e7c3fd56/2.0.03/en-US/7a49aa852c0c4ed089a58a840f...

And in this service note:

https://launchpad.support.sap.com/#/notes/2618752

We've also published a sizing note specific to the usage of the SAP Web IDE for SAP HANA: https://launchpad.support.sap.com/#/notes/2624901

SAP Web IDE for SAP HANA


SAP Web IDE for SAP HANA provides a comprehensive web-based end-to-end development experience for creating SAP HANA native applications:

  • Development of SAP HANA content and models

  • UI development with SAPUI5

  • Node.js, XSJS, or Java business code and service enablement

  • Git integration


Therefore it provides a complete workflow for all of your new HANA Deployment Infrastructure (HDI) and XS advanced model (XSA) based development.

SAP Web IDE for SAP HANA comprises capabilities of SAP HANA Studio and SAP HANA Web-based Development Workbench. It represents the long term replacement tool for both of these previous offerings. It consolidates technologies, follows industry trends, and leverages industry standards where possible, while retaining a competitive innovation focus of SAP’s current offering.

With SAP HANA 2.0 SPS 3, we continue to enhance and expand the capabilities of the SAP Web IDE for SAP HANA and close the few remain feature gaps compared to the old HANA studio. We are also focused on increased productivity in typical day to day activities.

Automatic Service Creation (a.k.a. Service Provisioning) in SAP Web IDE


This new feature of the SAP Web IDE for SAP HANA was already detailed here in another blog by uri.nizan:

https://blogs.sap.com/2018/05/16/automatic-service-creation-a.k.a.-service-provisioning-in-sap-web-i...

Improved Git Integration


The SAP Web IDE for SAP HANA in HANA 2.0 SPS 03 features Git file level comparison display and cherry picking, tagging, reverting and check out options.


Annotation Modeler


The Annotation Modeler is a new tool in the SAP Web IDE for SAP HANA to help building annotation XML files for use in Fiori Elements based applications. It is essentially the same tool which is already available in the SAP Web IDE on SAP Cloud Platform. It can be used within modules created via the List Report Module or SAP Fiori Master/Detail Module wizards.


External HANA Service Wizard


This is a new wizard that helps with the creation of development artifacts commonly needed for the use of HDI containers or schemas outside of our project. It supports both HDI and schema sources. It creates or updates the User Provided Services for us. It also adjusts the mta.yaml automatically.



 
17 Comments
JorgeWeiss
Participant
0 Kudos
Hi Thomas,

Great job!

Thanks a lot!

/Weiss
Former Member
0 Kudos
Hi Thomas,

Nice blog and good set of features sap added in SP3. But there is a problem with local npm registry. The packages which are present in local registry does not have all there dependencies present.

For example if I use "@sap/xssec": "latest" (2.1.11) building the module gives me error stating request@2.86.0 is not available as it is mention as dependency in xssec 2.1.11.

Moreover the upstream link also stopped working in SP3 as mention in this question , so we cannot get the required version from public registry too.

 

regards,

Himanshu
thomas_jung
Developer Advocate
Developer Advocate
0 Kudos
You should enter support tickets then.  The NPM error message seems to indicate a missing certificate.  However I can tell you my systems on SPS 03 connect fine. As far as the NPM modules in the local registry, they should be self contained - meaning their dependencies should be in the local registry as well.

I checked the local npm registry and @sap/xssec latest would be 2.1.10 not 2.1.11.  You seem to be pulling items from the upstream link and not the local registry. If then combined with an error that won't let you connect to http://registry.npmjs.org, this would explain the unfulfilled dependency.  If you only fetch from the local registry you would instead get @sap/xssec 2.1.10 which has a dependency to request 2.85.0, which in turn is also in the local registry. You can't use the upstream link to the external SAP registry if you can't also reach the public NPM registry. Otherwise you get such dependency errors. So either you need to correct your connection to registry.npmjs.org or only use the local registry. 
Former Member
0 Kudos

hi Thomas,

Thanks for the reply, even i thought that could be the problem. regarding npm error, I have installed signed certificate by SAP for XSA and has also set the upstream_certificate parameter in di-local-npm-registry. And it is working for me too in some other landscape where we require a proxy server to access internet. I believe that npm is not able to recognize the CA signing authority. Is there a way we can resolve this in XSA (if we are using npm directly we can to it by command

npm config set cafile /path/to/cert.pem

)

ericci
Active Contributor
0 Kudos
Love the support for await/async pattern. Lately, I'm really abusing it!

Now I only need a project that has XSA 😄

 

Nice blog post as usual 😉
shivam_bedwal
Explorer
0 Kudos
Hello Thomas,

I cannot find any information regarding HANA Workflow in XS Advanced using Web ide. Can you please provide some information about how can we implement workflow in XS Advanced.

Thanks,

Shivam
thomas_jung
Developer Advocate
Developer Advocate
0 Kudos
I don’t know what you mean by HANA Workflow. There is nothing by that name. Do you perhaps mean Flowgraphs?
shivam_bedwal
Explorer
0 Kudos
Hello Thomas,

I want to say that, like how we have business workflow in SAP Cloud Platform. Where we create events where notification goes to another user for approval.

I found this link for HANA Workflow modelling using HANA Studio -


https://help.sap.com/viewer/fa1a356f3f9f4ad49ea92b55ca2b00f1/1.0.12/en-US/6609e8432f4e4171801cf4dfc9...

 

I wanted to understand how can we achieve this in HANA XSA using SAP Web IDE.

 

Any help is much appreciated.

 

Thanks,

Shivam

 
thomas_jung
Developer Advocate
Developer Advocate
0 Kudos
There is no such thing in XSA.
shivam_bedwal
Explorer
0 Kudos
Thank you Thomas for your inputs.

 

Regards,

Shivam
shivam_bedwal
Explorer
0 Kudos
Hello Thomas,

I am following this link -

https://help.sap.com/viewer/4505d0bdaf4948449b7f7379d24d0f0d/2.0.02/en-US/f11324322ad445d596ec5650a6...

To add an SAPUI5 app to a Fiori Launchpad module in HANA XS Advanced. I am able to add a new tile on the FIori Launchpad module, but when I click on the tile the following error is thrown - "Failed to load Component.js from /1.00/resources/webapp/Component.js"

It is basically failing in the following step -

... "sap.platform.cf": { "uri": " " }

I have added the above attribute in the manifest.json file of the SAPUI5 app, which is placed inside the applications folder of 'MySite-content' folder. I have kept the resources of my SAPUI5 app inside the 'MySite' folder of the Fiori Launchpad module.

In the uri I am providing the following value -

"sap.platform.cf": { "uri": "/resources/webapp" }

Could you please provide your inputs as how can we achieve this.

Thanks & Regards,

Shivam
0 Kudos
Which version of "promised-db" does SP 03 supports?

"promised-db": "1.0.4"  or "promised-db": "latest" or "promised-db": "*" None of them seems to work..

How do we identify which versions of the packages are supported?

 

Thanks in advance.

Girish
thomas_jung
Developer Advocate
Developer Advocate
promised-db isn't a package which SAP redistributes. If you configure you system to allow access to the public NPM, you can of course access any node module available there. However if your system doesn't have such access you are restricted to the small sub-set of modules we deliver in the SAP Web IDE registry cache. This module is not one of those. My recommendation: it sounds like you need to configure the proxy settings and allow your system to connect the internet if you want to access such modules.
0 Kudos
Thanks Thomas, for the response,

I am not sure whether the proxy was enabled during installation, if not enabled, can we enable it now(post installation), if yes, then how to enable it?

 

Regards,

Girish
thomas_jung
Developer Advocate
Developer Advocate
former_member417044
Discoverer
0 Kudos
Hi Thomas,

Could you please help us to answer the following question?

Currently, we use SAP Web IDE in SAP Cloud Platform to develop and deploy extensions. We know that Web IDE Personal Edition does not support extension development. Does "SAP Web IDE For SAP HANA 2.0" (the on-premise Web IDE) support "extension development" in the same way as Web IDE in the Cloud platform?

Thank you!

Yun
thomas_jung
Developer Advocate
Developer Advocate
0 Kudos
No.