SAPERP Platform

SAP HANA + AI

AI on SAP HANA Data: HANA Cloud Vector Engine, PAL, or a Private RAG Beside HANA

Short answer

There are three ways to put AI on SAP HANA data: use SAP HANA Cloud's vector engine for embeddings and similarity search inside HANA, use the Predictive Analysis Library for classical machine learning in the database, or run a private RAG system beside HANA that reads released views. Licence type, deployment and whether you need non-SAP data decide which fits.

ERP
SAP HANA, SAP HANA Cloud, SAP S/4HANA, SAP BW/4HANA
Industries
Manufacturing, Aerospace, Electronics, Defense
Written for
SAP Data Architect

SAP HANA sits under S/4HANA, BW/4HANA and many custom applications, so it holds a large share of the data that manufacturers want to ask questions about. Naturally, data teams ask whether they can build AI directly on HANA rather than copying data elsewhere.

SAP has added AI capabilities to HANA. SAP HANA Cloud includes a vector engine for storing embeddings and running similarity search, which is what retrieval-augmented generation needs, along with a knowledge graph engine. HANA has long included the Predictive Analysis Library and Automated Predictive Library for classical machine learning such as regression, classification, clustering and time series forecasting. These are real tools, well suited to teams already invested in HANA Cloud and BTP.

Two practical constraints shape the decision. First, licensing: many SAP customers run HANA under a runtime licence bundled with SAP applications, which typically restricts direct access by non-SAP applications and custom development. Reading data through released CDS views and APIs, or holding a full-use licence, is usually required. Second, scope: manufacturing questions often need MES, PLM and document data that does not live in HANA.

This page explains the options, where each fits, and how to design retrieval over HANA-based data without breaking licences or authorisations.

What usually gets in the way

The problems we hear most from sap data architect teams running SAP HANA.

Licence restrictions

Runtime HANA licences commonly prohibit direct access by third-party tools, so a quick SQL connection for an AI pilot can create a compliance problem.

Semantic complexity

Raw HANA tables under S/4HANA are hard to use directly; meaning lives in CDS views, calculation views and application logic.

On-prem versus cloud features

The vector engine is a HANA Cloud capability; on-prem HANA customers need to check what their release supports before planning around it.

Data outside HANA

Documents, PLM data and plant systems needed for many answers are not in HANA, so in-database AI covers only part of the question.

Authorisations

Analytic privileges and application authorisations must still apply when AI retrieves data; direct database users often bypass them.

Where AI earns its place in SAP HANA

Each use case names the ERP objects it reads or writes, so your ERP team can judge the integration effort before anyone commits budget.

Vector search in HANA Cloud

Store embeddings of product texts, documents or notifications in HANA Cloud and run similarity search for retrieval, near the business data.

Touches: HANA Cloud vector engine (REAL_VECTOR type, similarity functions), document tables

Outcome: Retrieval inside the SAP data platform with SAP-managed operations.

Classical ML with PAL

Run forecasting, classification or anomaly detection inside HANA using the Predictive Analysis Library.

Touches: PAL procedures, calculation views as input, result tables

Outcome: Numeric predictions computed where the data lives, without data movement.

Private RAG over released views

Extract data through CDS views or OData into a private retrieval index alongside documents, used by an on-prem model.

Touches: Released CDS views, OData APIs, BW/4HANA queries, document stores

Outcome: Answers combining SAP and non-SAP data with licence-safe access.

Text-to-query over curated views

The model generates queries only against a curated set of views with documented semantics, never raw tables.

Touches: Curated CDS or calculation views, view documentation

Outcome: More reliable answers because the model works with business-meaningful structures.

Similar notification search

Find similar past quality or maintenance notifications using embeddings of their text and attributes.

Touches: QM and PM notification texts, codes, equipment

Outcome: Faster investigations using prior resolutions.

BW/4HANA analytics questions

Ask questions over BW/4HANA models in plain language, with the model calling defined queries.

Touches: BW/4HANA CompositeProviders, queries

Outcome: Business users get answers from existing analytic models without building reports.

Anomaly detection on postings

Use PAL or external models to flag unusual postings or movements for review.

Touches: ACDOCA through CDS views, MATDOC through CDS views

Outcome: Early identification of errors and unusual activity for finance and inventory teams.

Reference architecture

Choose between in-HANA AI (HANA Cloud vector engine and PAL) and a private RAG layer beside HANA that reads released views. Many landscapes use both: PAL for numeric models and private RAG for language-based answers across systems.

  1. 1

    HANA data

    S/4HANA, BW/4HANA or custom schemas, accessed through CDS views, calculation views and APIs.

  2. 2

    In-database AI

    HANA Cloud vector engine and PAL for embeddings, similarity search and classical ML where licensed.

  3. 3

    Extraction layer

    For private RAG: scheduled extraction through released views or OData into an external index such as pgvector or Qdrant.

  4. 4

    Private model

    An open-weight model on your GPUs using retrieval from HANA-based data and other sources.

  5. 5

    Authorisation

    Analytic privileges and application roles enforced either by HANA or by retrieval filters in the private layer.

Integration notes for your ERP team

  • Confirm whether your HANA licence is runtime or full use before connecting any non-SAP tool directly.
  • Prefer released CDS views (I_ and C_ prefixes) or OData APIs for S/4HANA data extraction.
  • Vector engine availability differs between HANA Cloud and on-prem HANA releases; check your release.
  • Keep embeddings refreshed incrementally using change timestamps on source views.
  • Apply analytic privileges or equivalent retrieval filters so users only see authorised data.
  • Document the semantics of each curated view; the model's accuracy depends on it.

Deployment options

HANA Cloud native

Companies already using HANA Cloud and BTP.

Use the vector engine and SAP's generative AI hub; keep data inside SAP's platform.

Private RAG beside on-prem HANA

On-prem S/4HANA customers, runtime licence holders, restricted environments.

Read through released views, index externally, run models on-prem.

Hybrid

Companies with HANA Cloud for analytics and on-prem operational systems.

PAL or vector engine for SAP-centric models; private layer for cross-system language questions.

Compliance and data control

How the architecture supports your obligations. Certification and accountability stay with your organisation; the design keeps the evidence straightforward.

SAP licensing

Confirm HANA licence type before any direct access; use released views and APIs under runtime licences.

ITAR / EAR

Controlled data extracted for retrieval stays on-prem with the private model.

SOX

AI is read-only on financial data; anomaly flags feed existing review processes.

GDPR

Personal data in embeddings follows the same retention and deletion rules as source data.

How an engagement runs

Phase 1 . 1 week

Landscape and licence review

  • -HANA licence assessment
  • -Data source inventory
  • -Use case shortlist

Phase 2 . 2 weeks

Design

  • -In-HANA vs private RAG decision
  • -Curated view list
  • -Authorisation design

Phase 3 . 4-6 weeks

Pilot

  • -Retrieval pipeline
  • -Model endpoint
  • -Evaluation set

Phase 4 . 3-4 weeks

Production

  • -Incremental refresh
  • -Monitoring
  • -Governance

Questions to ask any vendor, including us

A short list that separates real SAP HANA AI work from a chatbot demo.

  1. Do we hold a runtime or full-use HANA licence, and what access does it permit?
  2. Does our HANA release support the vector engine?
  3. Which curated views will the AI use, and who maintains them?
  4. How are analytic privileges enforced in retrieval?
  5. What non-SAP data does the use case need?
  6. Where are embeddings stored and how are they refreshed?

Frequently asked questions

Does SAP HANA have a vector database?

SAP HANA Cloud includes a vector engine that stores embeddings in a vector data type and supports similarity search functions, which is the core of retrieval-augmented generation. Availability for on-prem HANA depends on release, so check SAP's documentation for your version. For many teams already on HANA Cloud, keeping vectors next to business data is attractive.

Can we connect an AI tool directly to HANA with SQL?

Technically yes, but licensing often says no. Many customers license HANA as a runtime database bundled with SAP applications, which typically restricts direct access by non-SAP applications. Check your contract. Under runtime licences, use released CDS views, OData APIs or SAP-approved extraction methods instead.

What is PAL in SAP HANA?

The Predictive Analysis Library is a set of machine learning algorithms that run inside HANA, covering regression, classification, clustering, time series and more. It suits numeric prediction tasks close to the data. It is not a language model and does not answer questions in plain language, but it pairs well with a language model layer.

Should we use HANA Cloud vector engine or an external vector store?

Use HANA Cloud if you are already on it, your data is mostly SAP, and SAP's platform meets your deployment needs. Use an external store such as pgvector or Qdrant with a private model when you need on-prem deployment, mix SAP with many non-SAP sources, or face licence restrictions on HANA access.

Why not let the model query raw S/4HANA tables?

Raw tables are large, technical and change between releases, and their meaning depends on application logic. Models produce far more reliable results against curated, documented CDS or calculation views. Released views are also the access path SAP supports, which matters for licensing and upgrades.

How do we enforce authorisations in a RAG system?

Either let HANA enforce analytic privileges by querying as the end user, or tag indexed content with organisational attributes and filter retrieval by the user's authorisations before the model sees anything. The second approach is common for private RAG and must be designed and tested explicitly.

Can BW/4HANA data be used for AI?

Yes. BW/4HANA models and queries already encode business meaning, so a model calling defined queries can answer analytic questions reliably. This often delivers value faster than building new views on S/4HANA, especially for historical analysis.

Talk it through with an engineer who knows SAP HANA

Bring one real question your team cannot answer from the ERP today. We will map the data path, the model, and where it runs, and tell you honestly if AI is the wrong tool for it.

Try it here, free

SAP HANA SQL Error Codes Reference

Open full tool

Searchable table of common SAP HANA 2.0 SQL error codes with the error text, typical cause, the view or trace to check first and the fix.

Get SAP HANA and Basis alerts

Support and maintenance deadlines, release changes that affect SAP HANA and Basis sites, and new free SAP HANA and Basis tools. A couple of emails a month at most.

Free. Unsubscribe with one click from any email.

ArchRay builder
Design the on-prem AI stack for SAP HANA and Basis: model, GPUs, RAG pipeline, guardrails
See memory, speed and cost as you swap parts, then export the diagram. Free, in your browser.
Open the builder

New to SAP HANA and Basis? Start with the SAP HANA and Basis guide and toolkit.

Keep exploring

Free tools

ERP fixes and how-tos

Guides

AI on your ERP

Integrations

Troubleshooting

Comparisons