Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
jgleichmann
Active Contributor

last updated: 2023-11-20 08:10 CET


licensing is a topic which I have some points of contact in my projects. Mostly the questions are similar:

  1. How the system measurement is working?

  2. What about memory leaks? Do we pay for this peak usage?

  3. Do new HANA technologies / techniques such as NSE or persistent storage (aka pmem) have to be licens...

  4. How we can reduce the license costs?

  5. Which license do we need?

  6. What about S/4 HANA - enterprise or standard edition?

  7. How will the costs increase in the future?

  8. Direct or indirect use?

  9. How are the license costs composed?

  10. What is indirect static read?


To avoid answering the same questions all weeks was the reason writing this blog. So, it is also my lazyness factor not to have to repeat myself over and over again 😉

As you may know I hate to repeat already published details. I just want to summarize them and go deeper into some of them.
At first licensing is not my favourite topic and I just want to shed some light into the technical part. For sales part I have my partners or direct contacts at SAP for the customer.

 




 

Sources to start with:

Important views:
M_LICENSE_USAGE_HISTORY
M_LICENSE_MEASUREMENTS
M_LICENSE
M_SERVICE_MEMORY
M_SERVICES

 




 

At first we have to know that in the old MDC days the system measurement was performaed on the system database. Since SAP HANA 2.0 SPS01, a MDC system performs measurements in the System database as well as in the individual tenant databases.

The named statement in 1704499 will show you the current license memory utilization of particular tenant database:
SELECT ROUND((SUM(SM.HEAP_MEMORY_USED_SIZE) + SUM(SM.SHARED_MEMORY_USED_SIZE)) / 1024 / 1024 / 1024, 0) +
ROUND(MAX(SM.CODE_SIZE) / 1024 / 1024 / 1024, 0) AS DATABASE_MEMORY_USED_IN_GIGABYTES
FROM SYS.M_SERVICE_MEMORY SM JOIN SYS.M_SERVICES S ON SM.HOST = S.HOST AND SM.PORT = S.PORT
WHERE S.COORDINATOR_TYPE != 'STANDBY'

But what is included there? At first we need to know what is heap and shared memory to answer this question.
Because I don't want to repeat myself

The short answer SAP counts the heap, shared memory + code and stack for the license measurement.
The measurement consists of the used memory not the maximal memory which CAN be loaded. It is the peak of this 3 components. The monthly peak of this sum will be written to M_LICENSE_USAGE_HISTORY. If you want to check all the measurements over time you can use view M_LICENSE_MEASUREMENTS. Every hour the current peak value will be written to it.
SELECT 
ROUND(
( SUM(SM.HEAP_MEMORY_USED_SIZE) + SUM(SM.SHARED_MEMORY_USED_SIZE) ) / 1024 / 1024 / 1024,
0
) + ROUND( MAX(SM.CODE_SIZE) / 1024 / 1024 / 1024, 0 ) AS DATABASE_MEMORY_USED_IN_GIGABYTES,
ROUND( SUM(SM.HEAP_MEMORY_USED_SIZE) / 1024 / 1024 / 1024, 0 ) AS heap,
ROUND( SUM(SM.SHARED_MEMORY_USED_SIZE) / 1024 / 1024 / 1024, 0 ) AS shared,
ROUND( MAX(SM.CODE_SIZE) / 1024 / 1024 / 1024, 0 ) AS code
FROM
SYS.M_SERVICE_MEMORY AS SM
INNER JOIN
SYS.M_SERVICES AS S
ON SM.HOST = S.HOST
AND SM.PORT = S.PORT
WHERE S.COORDINATOR_TYPE != 'STANDBY';

 


 

This means to lower the costs you should lower this memory areas.

1) Code - there is nothing you can do regarding code an stack
2) Shared memory = row store
3) Heap

 

Shared Memory


We can break down this by service:
SELECT 
s.service_name,
ROUND(sm.total_memory_used_size / 1024 / 1024 / 1024,0) as total_memory_used_size,
ROUND(SM.SHARED_MEMORY_USED_SIZE / 1024 / 1024 / 1024 ,0) AS Shared,
ROUND(SM.HEAP_MEMORY_USED_SIZE / 1024 / 1024 / 1024 ,0) AS Heap,
ROUND(SM.CODE_SIZE / 1024 / 1024 / 1024 , 0 ) AS code
FROM
SYS.M_SERVICE_MEMORY AS SM
INNER JOIN
SYS.M_SERVICES AS S
ON SM.HOST = S.HOST
AND SM.PORT = S.PORT
WHERE S.COORDINATOR_TYPE != 'STANDBY';


 

Don't be confused by the 'total_memory_used_size'. This is not the size of the measurement. It is just an indicator for the current memory usage.

The shared value of the M_Service_memory consists of (Details: SQL:HANA_RowStore_Overview / Views: M_RS_MEMORY / M_RS_TABLES 😞



 






Table_GB 81,3
+Catalog_GB 0,52
+EXTFRAG_GAR_GB 7,73
+INTFRAG_GB 6,48
=> 96GB (Shared Memory value)

Take care of your RS tables and check the reorg need from time to time. In the latest SPS there is a automatical reorg feature.

Shared_GB , INDEX_GB and Extfrag_GB is not counted into.

 


 

Heap


The Heap consists of the loaded CS tables, row store indexes, Intermediate results, temporary structures, caches.
Wait we talked about the row store and it is linked to shared memory segments which results in non swappable structures. Why is it listed as heap allocator?
Anwer: The Pool Allocator Pool/RowEngine/CpbTree is part of the heap which results in swappable structures. (Details: 2160391 - FAQ: SAP HANA Indexes 14. / 1999997 - FAQ: SAP HANA Memory : Pool/RowEngine/CpbTree) This means that the RS index structures are not organized as shared memory segments. They have another design as the source RS data.

HANA_Memory_TopConsumers => Aggregate_By 'SubArea'


 


 

However, the best way is to archive/delete data from CS and RS, but what about Intermediate results, temporary structures and caches?

In this example we see about 800GB of System Heap, 270GB of Intermediate results, 185GB fragmentation.

1) Intermediate results
Ok, the results can only be limited if you use the workload management, but in the most scenarios (SAP application/product based) this value is not avoidable.

2) Fragmentation
How heap fragmentation can be managed you can read in 1999997 - FAQ: SAP HANA Memory => What is memory garbage collection?
Solution:






hdbcons 'mm gc -f'
or
use the parameters gc_unused_memory_threshold_abs / gc_unused_memory_threshold_rel if you want to intervene.

3) System Heap
The greatest lever can be achieved if you analyze the system heap.
HANA_Memory_TopConsumers => Aggregate_By SUBAREA => in this case 'Heap (System)'


You can see that the Top 3 of the 800GB consists of default/LPA aka Page Cache. Nearly 600GB are working space which can be configured.

Ok, this was the long answer of 'How the system measurement is working?', but it answers also the question 'What about memory leaks? Do we pay for this peak usage?' 🙂
Yes, if you can't give a reason for it and the peak is over a longer time, you have to pay for it.
There are several areas which can be configured to lower the memory usage. Use them to reduce your costs!

 




Do new HANA technologies / techniques such as NSE or persistent storage (also known as pmem) have to be licensed and what are the effects of the license costs?


 

pmem reduces the TCO of hardware (RAM) but has nothing to do with the license costs of HANA.
Another topic is NSE. You only pay for the buffer cache and not for the warm store on disk. So, yes, you can reduce your license costs with NSE. You can also save hardware costs for the future growth of the DB.

Both features are included in the standard license of SAP HANA. You don't have additional license costs to use them.


 




How we can reduce the license costs?



  • Housekeeping

  • Archiving / deletion

  • configure your system correct

  • frequent HANA health checks to discover bugs

  • use NSE


 




Which license do we need?


This depends on how you use the HANA. Please check the licensing Guide.
First check if you use on prem / priv. cloud or public cloud.
Do you use sofware licensed from SAP (runtime database) or a non-SAP/native software (=Full-use database)?
The Full use is devided into Enterprise and Standard edition. This means it also depends on the engines you want to use.
Do you want to use HSR with active/active? Yes? This is also a functionality you have to pay on top.






Note: As of Q1 2022, SAP HANA, standard edition is no longer available.

 

 



Source: SAP licensing guide

 




 

What about S/4 HANA - enterprise or standard edition?











Note: As of Q1 2022, SAP HANA, standard edition is no longer available.

 
Information Management Option: SDI + SDQ

Database Services: Native Storage Extension (NSE)

Source: SAP HANA, Enterprise Edition for SAP S/4HANASAP HANA 2.0 Certification Guide: Technology Associate Exam (C_HANATEC_17) (SAP PRESS)


 

You can not use the standard edition for S/4HANA. Only the enterprise edition can be used for S4.
Source: SAP S/4HANA Licensing Model & Conversions

 




How will the costs increase in the future?


I have no glass sphere for you, but if you create frequent heath checks of your DB you will receive a linear growth of your database which is a good cost indicator. But there are so many factors you have to consider. It depends on the used revision, functionality, configuration, fragmentation and some more.

 




 

Direct or indirect use?







Indirect or digital access is when people or things use the digital core without logging into the system directly. It occurs when humans or any device or system indirectly use the digital core through non-SAP intermediary software, such as a front end, a custom solution, or any other third-party application. It also occurs when nonhuman devices, bots, automated systems, and so on use the digital core in any way.

Historically, any use of our digital core – either direct or indirect – was licensed through SAP Named User licenses and/or software on a user metric. The new pricing approach differentiates between direct human access (pricing continues to be user based) and indirect digital access (pricing is based on the number of transactions, called documents, processed within the digital core).





Source SAP licensing guide / SAP News / Indirect Usage Guide

 




 


 

 









In the first year you pay a one time license fee + annual recurring fee. In the following years you only pay the maintenance and support fee which is x% of the license fee.

 




 


 




 



Source: SAP licensing guide





 

In the end we know that all caches (if we need them or not) are taken into account. Housekeeping is not only nice to have, it can save a lot of money. Not only the data loaded into memory is important, also the caches and the rest of the working space will be considered. So, tuning your systems results in lower license costs.

 








What is indirect static read?


Indirect Static Read is a scenario in which information has been exported from an SAP system (excluding SAP Business Warehouse or any third-party runtime database) to a non-SAP system pursuant to a predefined query that meets the criteria listed below. SAP’s policy is that the use of such exported data in third-party non-SAP systems does not need to be licensed, as long as all of the criteria listed below for Indirect Static Read are met.

  • Was created by an individual licensed to use the SAP ERP system from which the information is being exported

  • Runs automatically on a scheduled basis, and

  • The use of such exported information by the non-SAP systems and/or their users does not result in any updates to and/or trigger any processing capabilities of the SAP ERP system













© 2018 SAP SE or an SAP affiliate company. All rights reserved. Source: Indirect_Access_Guide_for_SAP_Installed_Base







*Note: Scenario is Indirect Static Read as long as all of the conditions outlined above are met.














Do you have other questions which I should add? Just drop a comment with your question.
29 Comments
SriKrishna
Active Participant
0 Kudos
How will the usage of external connections to HANA using Python affect licensing. can we connect to a HANA DB with runtime license using PyHDB which is also SAP developed open source python connector.
michael_eaton3
Active Contributor
A HANA untime license only allows you to connect to HANA using the SAP Product that is licensed (typically S/4HANA). To connect directly to a HANA database using Python will require a full-use HANA license.
SriKrishna
Active Participant
0 Kudos
thank you.
seasonfan
Explorer
0 Kudos
Hi,

Am I allowed to create a database trigger in HANA runtime edition? Can it be created directly on HANA DB? Or should it be created from SAP application layer?

Many Thanks.
jgleichmann
Active Contributor
0 Kudos
Hi,

if you you want to use trigger in context of data replication using SAP Landscape Transformation Replication Server or SAP Data Integrator the answer is you need an enterprise license. Trigger will always be a handicap for updates/upgrades. May be you can describe you scenario on more detail. For what do you need the trigger in your ABAP system?

Regards,

Jens
seasonfan
Explorer
0 Kudos
Hi Jens,

 

Thanks for your reply.

In fact, I am wondering if we can access HANA monitoring views using PyHDB to setup our IT centralized monitoring system. And in this scenario we may use trigger.

Does this requirement need an enterprise license?

 

Thanks.
jgleichmann
Active Contributor
0 Kudos
Hi,

this should be no problem if the user can only access the monitoring views and no application data. But as always you have to state a reason for such accesses.

Regards,

Jens
former_member799447
Discoverer
0 Kudos
Very nice blog!

I have a question here: I have a CRM on HANA with runtime license, may I access the HANA DB directly using Microsoft POWER BI?

Many thanks.
jgleichmann
Active Contributor
0 Kudos
check the conditions for indirect static read and map them to your scenario.

Check out the indirect access guide by SAP

Regards,

Jens
TaraRogers
Advisor
Advisor
0 Kudos
Hello Jens and Ran,

I would like to add from an SAP HANA, runtime database licensing perspective, access to the database is through the SAP application and by certified third-party BI vendors. Always good practice to refer to the Software Use Rights agreement from the SAP Trust Center for the official language. I suggest working with your Account Executive directly for your specific license questions if needed.

Best Regards,

Tara

 
jgleichmann
Active Contributor
0 Kudos
Hi Tara,

thanks for the hint. I will add this information also to the blog. But the question was a direct connection from Power BI to SAP CRM on HANA. The licensed products are PBID (Desktop) and PBIG (Gateway) for the following scenarios:










































Solution Scenario Source experation date





Power BI Desktop 2.80








HANA-BI-SQL 2.0 ‒ THIRD-PARTY BI CLIENTS CONNECTION TO SAP HANA








native HANA



07.04.2023
Power BI Desktop 2.81 BW4-OBI 1.0 ‒ SAP BW/4HANA-OLAP BAPIS SAP BW/4HANA 2.0 08.06.2023
Power BI Gateway 3000.40.15 BW4-OBI 1.0 ‒ SAP BW/4HANA-OLAP BAPIS SAP BW/4HANA 2.0 08.06.2023
Power BI Desktop 2.79 BW-OBI 2.0 ‒ OLAP BAPI INTERFACE FOR SAP BW 2.0




SAP NetWeaver BW 7.50



23.03.2023
Power BI Gateway 3000.31.3 BW-OBI 2.0 ‒ OLAP BAPI INTERFACE FOR SAP BW 2.0




SAP NetWeaver BW 7.50



23.03.2023


tara.rogers : The named CRM system on HANA is not mentioned as source product. Is this handled by Power BI Desktop 2.80? The topic of indirect is still not 100% transparent and needs a lot of checks. There is still a gap of official information.

 


Regards,

Jens

claudiorossi_sap
Participant
0 Kudos
Hi

We acquired SAP S/4HANA foundation-promotion in 2015 license without install effectivelly S/4..we have a SAP ECC ( SAP Business suite )

Now we want to install S/4 hana 2022 but we don't know if we are elegible to do this with the license SAP S/4HANA foundation-promotion , because we know that now SAP require S/4 hana enterprise management licenses. Can you explain?

I'm not sure that SAP S/4HANA foundation - promotion include all feature that are needed for using SAP S/4 hana 2022... can you explain the differences ?

SAP S/4HANA foundation-promotion is S/4hana full or another product ?

 

best regards
0 Kudos
Hi !

We have currently Hana license:  "SAP HANA, Runtime edition for Applications & SAP BW"

We want to model calculation views in our separate BW system on Hana 2.0 and (further BW/4Hana).

Could you please confirm the following points ?




  1. Can we connect to Hana views for reporting with SAP BO tools ( Lumira, Webi, Analysis for Office) ?

  2. Can we model calculation views for reporting purposes with tool Hana Studio perspective Hana Modeler -  with BW objects generated Hana views and SAP ECC tables via SDI?

  3. Can we use install and use Web IDE for Hana to model calculation views  to replace Hana Studio?


Thank you very much,

Kind regards
jgleichmann
Active Contributor
0 Kudos
Hi Claudio,

 

I can only answer this from a technical point of view as you know this blog only covers the technical aspects of HANA licensing. The ASUG has already covered this question in an articel of 2015.




What is the pricing model for SAP S/4HANA?

For the on-premise version, SAP Business Suite customers need to purchase the SAP S/4HANA foundation- promotion license to run the new SAP S/4HANA code line.

SAP is offering the following promotion until the end of Q3/2015:

  • Existing SAP Business Suite customers have to procure the SAP HANA runtime license for SAP Business Suite (@15% HSAV = SAP HANA Software Application Value) and will get the SAP S/4HANA foundation-promotion license at no additional cost.

  • Existing SAP Business Suite powered by SAP HANA customers with a valid SAP HANA limited runtime license for SAP Business Suite (LREA) are eligible for the SAP S/4HANA foundation-promotion license without additional cost.


For the cloud, the pricing model will be subscription-based and communicated at a later stage.

Please contact your local sales representative for more information and the current state of this statements. In the end the official statements of SAP on the contract counts and therefore every detail of your scenario is important.

 


Regards,

Jens


sundeepc
Explorer
0 Kudos
Hi Jens,

Thanks for the information. With the S/4HANA runtime license, are we allowed to create custom HANA calculation views?

Thanks,

Sundeep Chalasani
hai-tao_zhou
Discoverer
0 Kudos
Hi Jens:

Questions from Customer:

Customer has one S/4 basing on Runtime HANA and a self-develop application basing on HANA EE, so:

1、could customer build a virtual table in HANA EE linking to the table in S/4 Runtime HANA?

2、If question 1 is Yes,could customer insert into the virtual table in HANA EE so creating records in remote Runtime HANA?

Thank you very much!

Best regards

Zhou Hai-tao
jgleichmann
Active Contributor
0 Kudos
At first you have to double check always you current license and the software use rights. This can always differ with special contracts. You questions are regarding indirect access and here it depends on with which users the data is accessed. I can not provide a solution for any scenario, please contact a SAP license specialist.

If you just talk about development and modeling for non-prod systems you can use the WebIDE without any doubt.

 
jgleichmann
Active Contributor
0 Kudos
hi hai-tao.zhou ,

 

please check the section What is indirect static read? It always depends on how and where data is linked and consumed. Please contact the customers SAP AE to validate the scenarios.

 

Regards,

Jens
Martina_Gállego
Active Participant
0 Kudos
Hi Jens,

 

With the Runtime edition of HANA, is it possible to make SQL queries with an external product to monitor (centreon for example)?

 

Thank you in advance.

Best regards,

Martina

 
jgleichmann
Active Contributor
0 Kudos
It always depends on the scenario who is consuming the data (SAP named user, functional user => SAP software or third party). Why should the creation of HANA calc views be limited? Your doubts based on what exactly? This would also apply to SQL script and AMDP or CDS views.

 
"Runtime databases licensed from SAP are solely to support software and SAP Named Users licensed from SAP."
jgleichmann
Active Contributor
0 Kudos
Hi Martina,

you mean you will query data outside of the SAP schema? You want to query only monitoring views? I don't heard of any case that this in the scope of interest in the context of licensing issues. There are several monitoring tools out there doing this.

Regards,

Jens
sundeepc
Explorer

It always depends on the scenario who is consuming the data (SAP named user, functional user => SAP software or third party)
- We can consider the consumer as a third-party reporting tool

Why should the creation of HANA calc views be limited? Your doubts based on what exactly?
The embedded BW on S/4HANA allows us to generate External HANA views (calculation views) from the application level with BW Modeling Tools which we know is covered by run-time license.

What we are not sure is whether a custom package and custom calculation views using HANA Studio directly at the database level without involving any S/4HANA application-level components are allowed with an S/4HANA runtime license.

seasonfan
Explorer
0 Kudos
Hi Jens,

I see all the listed solution for Power BI connect to SAP NetWeaver BW 7.50 are already expired. Is the Power BI connection to SAP NetWeaver BW 7.50 still supported with HANA runtime license nowadays?

Thanks and best regards.
jgleichmann
Active Contributor
0 Kudos
see indirect static read scenario 12 - 14. It depends on how the data is consumed. Is it read out by the third party tool and viewed by end users? Is it processed and written back? Check if indirect static read can be used and the extracting user is licensed. If you are not write data back and the extraction is a frequently schedule you may can use it in this way if all conditions outlined in the section above are met.
Martina_Gállego
Active Participant
0 Kudos
Hi Jens,

I have read that Runtime edition is a restricted license only for SAP Applications. Enterprise on the other hand is an unrestricted license which can be used for SAP, non-SAP, custom, hybrid and third-party applications. So a third-party monitoring aplication tool as Centreon, could make SQL requests to SAP HANA Runtime?

Thank you very much.
Best regards,
Martina
ClaudiaA
Explorer
0 Kudos
Hi Hai-tao Zhou,

please check which license modell the customer is using for indirect access, as there is a "Digital Access" license model for new SAP contracts or for customer which used the License Contract Conversion. https://news.sap.com/2020/05/daap-extension-enable-customer-digital-journey/

Please also check the Price and Condition List, which is relevant for your customer.
There are different versions of HANA Runtime. Here one example:

SAP HANA runtime edition for applications and SAP BW licensed by HANA SAP Application Value

19.16.2SAP HANA Platform includes the HANA Studio, Cockpit and Web IDE components.
All data modeling, distribution, creation and extension of data structures, including tables and virtual tables via Smart Data Access used in HANA REAB must be performed via the HANA REAB Supported Software.
Use of DI, SDI and SLT is limited solely to loading data into HANA REAB or HANA REAB Supported Software.
Data may be loaded from an appropriately licensed Data Source via DI, SDI or SLT or via HANA REAB Supported Software interfaces.
SDI may also be used with Smart Data Access in a data federation scenario.
Notwithstanding anything to the contrary, HANA REAB Supported Software is not allowed to distribute data from tables residing in HANA REAB licensed for other Software.
For example, SAP Data Services licensed with HANA REAB is not allowed to distribute data from HANA REAB licensed for SAP S/4HANA

19.16.3Customer may export data, using licensed SAP tools, solely to be used within 1 or more of the following:
a) SAP HANA, enterprise edition
b) SAP HANA, standard edition
c) SAP Cloud Platform, SAP HANA service
d) SAP HANA Cloud
e) SAP Datasphere

Source: SAP List of Prices and Conditions SAP Software and Support enDE.v.10-2023 / https://www.sap.com/trust-center/

HANA REAB Supported software should be S/4HANA in your case.

In case of any doubt, the customer should contact their SAP AE.
Because if the customer using function, which belong to SAP HANA EE, then they will have to buy HANA EE license. (this could be expensive)

Best regards
Claudia
hai-tao_zhou
Discoverer
0 Kudos
Thanks a lot,Jens!

Best regards

Zhou Hai-tao
hai-tao_zhou
Discoverer
0 Kudos
Hi Claudia:

Nice information and I will discuss with the customer,thanks!

Best regards

Zhou Hai-tao
jgleichmann
Active Contributor
0 Kudos
Hi Martina,

as far as you are not accessing a SAP schema or an user own schema - means only monitoring views and no productive data - I see no issue with it. The limitation is for productive usage of the data inside the SAP schema (context direct access) and running another application within an own schema for non-SAP usage (full use/ Enterprise license). You want only accessing the monitoring data. I never faced any issues in this context. But I think not 100% covered by the contract details, because the monitoring data is saved within a default SYS schema. It is not a schema created by yourself and not a SAP application schema.

 

Regards,

Jens
Labels in this area