In this blog, we will explore the development workflow for building intelligent data applications using machine learning on SAP HANA and the SAP Cloud Application Programming Model (CAP). Along the way, we will share insights from our own experiences, examine the practical viability of this approach, and discuss challenges and potential improvements.
Development Approach
There are a few essential steps in a typical development workflow for building intelligent data applications. Generally, the work is divided between two different people: a data scientist and a software engineer (or CAP developer in this context).
- The data scientist takes the lead in analyzing available datasets, designing, and training machine learning models that provide valuable insights.
- Once the model is ready, the data scientist hands over the design-time machine learning artifacts to the developer, who will then be able to integrate and use the models in a CAP project.
This handshake marks the shift from data exploration and experimentation to building functional, user-facing applications. While conceptually straightforward, this transition can present several practical challenges, particularly when it comes to aligning the results of the data scientist’s work with the development requirements of a CAP project.

Data Scientist – Developer Handshake
What is the SAP Predictive Analysis Library?
The SAP Predictive Analysis Library (PAL) is a collection of SQLScript functions designed to enable predictive analytics directly within SAP HANA. By running machine learning algorithms natively in the HANA database, PAL eliminates the need to move large datasets to external environments, which improves both speed and efficiency.
PAL includes a wide range of algorithms across various data mining categories, such as clustering, classification, regression, time series analysis, and more. Its integration with HANA makes it particularly appealing to customers looking to incorporate machine learning into their existing SAP ecosystem. Our workflow involved setting up a development environment in SAP Business Application Studio (BAS) with Python extensions. Once our Python environment was set up, we were able to import the HANA ML Python Client API package to use PAL capabilities in our Python code. In our opinion, this works quite well. Comprehensive documentation is available for both PAL and the HANA ML package. We also found several SAP Learning Journeys online to help you get started.
Enabling PAL in SAP HANA Cloud
It is important to note that PAL must be explicitly enabled on your HANA Cloud instance before you can use any of its features. At first, we found this somewhat confusing, since PAL did not appear to be available in the trial version of HANA Cloud when we were setting up our own instance. However, it was available in the Free tier.
We were also not entirely sure what resources were needed to run PAL without any issues. Fortunately, the standard resources provided by the Free tier version of HANA Cloud turned out to be sufficient to allow about 10 different users to use PAL’s functionality simultaneously. Please make sure, however, that every user has the appropriate roles to actually use this functionality.
After some trial and error, we were able to successfully create an instance that we could use for an internal CodeJam we organized at our office. This hands-on session gave us plenty of insights into how PAL can be used for machine learning scenarios.

Machine Learning CodeJam at INNOV8iON
Integrating the model into SAP CAP
After building and training a machine learning model using PAL, the data scientist is ready to hand over the appropriate design-time artifacts to the CAP developer. The HANA ML package provides a HANAGeneratorForCAP module that can automatically generate the artifacts for you. These artifacts should then be importable into a CAP project. Unfortunately, in our case, these auto-generated artifacts did not seem to work out of the box.
We encountered some problems with the artifacts during the deployment step:
- Insufficient privilege errors caused by the contents of the .hdbgrants file.
- Missing keys in the auto-generated entities, requiring manual adjustments.
- There were also several issues with case-sensitive column names not being mapped and/or handled correctly.
The documentation for this step was limited and appeared outdated. We could only find two relevant SAP blogs from two years ago. As such, we suspect that this HANAGeneratorForCAP module may not be fully optimized for use in the latest version of SAP CAP. Due to these challenges, we decided to focus solely on the data science aspects during our CodeJam, leaving the CAP development workflow for future exploration.
Conclusion
Overall, we see significant potential in building custom machine learning models for SAP customers. There are many different use cases where AI can help streamline business processes. However, we believe that this specific development workflow may not be particularly intuitive or accessible for customers who are just beginning their journey into the world of AI. This is especially true when transitioning from data science to actual application development using these models. That step, in particular, requires more intuitive tools and updated documentation. We’re excited to see how these AI solutions evolve and will continue to keep a close eye on future developments in this space!






