Skip to Content
Author's profile photo Soham Shah

SAP MII connection to External HANA database

SAP MII (Manufacturing Integration and Intelligence) is a very powerful tool provided by SAP to connect shop floor systems (PLC / SCADA / Historians) to ERP (SAP ECC / SAP S/4 HANA). By such seamless integration between shop floor and ERP systems, it provides customers better visibility in terms of manufacturing production and it helps in reducing operational costs by providing various dashboards, KPI monitoring and visual representation of machine data. In today’s world where everyone is talking and researching about IoT and the massive amount of data that any manufacturing company is going to deal with, the expectation from the SAP MII customers is to handle huge volume of time-series and tabular data collected from operations/PLCs at the manufacturing plants to perform long-term trend and regression analysis on it near real time. Moreover, customers also want to predict and prevent operational issues such as machine downtimes, material quality and performance bottlenecks in production lines.


MII in its traditional architecture usually has its own Netweaver database and an external database (commonly known as Application Database) where most of transaction data and certain master data is stored. In this blog, we are solely going to concentrate on external application database that MII connects to. Before the birth of HANA database, MII generally had MS SQL or Oracle as its application database. But looking at the computing power of HANA database and its massively fast i/o operations, customers are demanding HANA as their external database that should connect to MII for all the transaction data and analytics.


There are many ways MII can connect to external HANA database but we are going to learn how to connect to HANA database using JDBC API.


SAP HANA provides a driver that enables Java applications to connect to the SAP HANA database with the JDBC application programming interface (API). To install JDBC driver for HANA, please follow these two very detailed and informative blogs:


Now once we have a confirmation that HANA database has JDBC driver installed and configured,we can perform belowsteps in MII to connect to HANA database.


  1. Go to Data Sevices  / Data Servers :


2. Click on Create and below screen will be shown:


  • Provide Server Name – Any meaningful name
  • Connector Type: IDBC (As we are going to use JDBC connection, connector type would be IDBC)
  • Description: Meaningful Description
  • Click on Finish


3. Provide Server Details and other information (Critical Step) :

a. Check “Enabled” & “Allow Dynamic Query” Checkboxes in Settings tab:


b.Open Connection Tab:


  • JDBC Driver:
  • Server URL:

jdbc:sap://<server>:<port>[/?<options>] where <port> should be 3<instance number>15

Lets say Server name in & HANA Database instance is 01.Then Server URL would be: jdbc:sap://

  • User Name: User Name of the HANA Database
  • Password: Password of the HANA Databse
  • Validation Query: Select ‘Hello World’ from Dummy


If we have provided all the correct information then if we go to Status tab, we can see ‘Running’ Status:


4. Open MII Workbench, select New SQL Query and newly created data server External-HANA-DB will appear in Available Servers:


5. We can see all the tables and can query them:


Please note that by directly querying HANA database tables via MII SQL Query will not give us any benefits that HANA’s in-memory database management provides. Hence optimal way to perform this activity is to create tables in HANA as columnar tables and then define the Attribute views (fact tables), Analytic views (measure and dimensions) and Calculation views (complex calculations and data processing). Then MII SQL Query can directly query these views and can enjoy all of the HANA benefits.

I hope information provided in this blog proves useful to you.


Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Mantri Shekar
      Mantri Shekar

      Hi Soham,

      Apart from Pulling data from MII and Pushing to HANA DB is there any other way where in we can directly get the events from machine and Push into HANA DB directly.

      If yes please let me know the alternative. Looking forward for your reply.





      Author's profile photo Andrea Ferramosca
      Andrea Ferramosca

      Hi Shekar, take a look at this document, I think is what you are looking for.



      Author's profile photo Mantri Shekar
      Mantri Shekar

      Hi Andrea,

      In this document they are retrieving Data from SAP MII and Pushing into HANA DB.

      But my scenario is I need to collect the machine events directly from the machines with help of sensors attached to the machines.






      Author's profile photo Soham Shah
      Soham Shah
      Blog Post Author

      Hi Shekar,

      If you need to collect the machine events then you may ave to use SAP PCo (Plant Connectivity) which comes bundled with SAP MII license. SAP PCo has many source systems which PCo can connect to and can send notifications to MII BLS.


      SAP PCo:





      Author's profile photo Beyhan MEYRALI
      Beyhan MEYRALI


      I have just seen your question.

      First of all, you can only pull data from PCO. As far as i know, there is no push mechanism. PCO is like a web service to read data, that you read with a scheduled task. On MII workbench, you tie your pco call to a rfc and trigger events on SAP via RFC + you can save/process data as you like.

      or :), dont use MII and create your own opc that calls web api, rfc or a web service whenever data changes. But then you will have some licensing problems with SAP. SAP wants you to use MII even if it does not fit to your needs ?

      I hope that helps.



      Author's profile photo Chandrakanth Angannagari
      Chandrakanth Angannagari

      Hi, could this 'external app database' requirement of MII (whether its HANA or anything else) be met by using the same NW Database in a seperate schema? I cannot get a clear answer on this or a support statement from MII / ORA colleagues. We use an oracle database (dont think it matters which database product though)